www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8492] New: can't infer type in static assert

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: ellery-newcomer utulsa.edu



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: -------
Aug 01 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8492




19:28:55 PDT ---
Created an attachment (id=1132)
test case

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