[Issue 8492] New: can't infer type in static assert

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 1 19:27:40 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8492

           Summary: can't infer type in static assert
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ellery-newcomer at utulsa.edu


--- Comment #0 from Ellery Newcomer <ellery-newcomer at utulsa.edu> 2012-08-01 19:27:38 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list