Bug 6264 – ICE on testing opSlice in static if

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-07-07T06:17:00Z
Last change time
2011-07-10T07:39:18Z
Keywords
ice-on-valid-code, patch
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2011-07-07T06:17:40Z
void main() { double[] x; auto y = Result(0, x.length); static if(is(typeof(x[] = y[]))) {} // This line needs to be there. } static struct Result { this(size_t current, size_t pastLast) {} auto opSlice() { return this; } } Error message: Assertion failure: 't1n && t2n' on line 9612 in file 'expression.c'
Comment #1 by yebblies — 2011-07-09T21:32:18Z
https://github.com/D-Programming-Language/dmd/pull/224 The static if(is(typeof( is unnecessary. The compiler will assert rather than give an error. This was caused by the fix to bug 5284.
Comment #2 by yebblies — 2011-07-10T07:39:18Z