Bug 8492 – can't infer type in static assert

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-08-01T19:27:00Z
Last change time
2013-11-18T04:33:33Z
Assigned to
nobody
Creator
ellery-newcomer

Attachments

IDFilenameSummaryContent-TypeSize
1132multi_index.dtest casetext/x-dsrc1289

Comments

Comment #0 by ellery-newcomer — 2012-08-01T19:27:38Z
with the attached file, dmd multi_index.d compiles, but dmd multi_index.d -version=A fails, giving multi_index.d(13): Error: static assert (is(typeof(delegate pure nothrow @safe void() { assert(this,"null this"); RARange r = void; _error_ = __error; } ))) is false multi_index.d(41): instantiated from here: MultiIndexContainer!(A,IndexedBy!(__T12RandomAccessZ)) The difference is the following: version(A) { static assert(is(typeof( { RARange r = void; auto h = r.front; }))); }else { void flurby() { RARange r = void; auto h = r.front; } } both should compile.
Comment #1 by ellery-newcomer — 2012-08-01T19:28:55Z
Created attachment 1132 test case
Comment #2 by k.hara.pg — 2013-11-18T04:33:33Z
Fixed in 2.063, by fixing issue 9919.