[Issue 5865] New: __dollar cannot be read at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 19 18:10:22 PDT 2011


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

           Summary: __dollar cannot be read at compile time
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: changlon at gmail.com


--- Comment #0 from changlon <changlon at gmail.com> 2011-04-19 18:06:47 PDT ---
this working on dmd 2.052 release,  throw error on dmd git master .
------------------------------------------
class Test1(string name, string file = __FILE__){
    static const _file    = file ;
    void test1(){
        static const string file2 = _file[0..$]  ;
    }
}

void main(){
    auto obj    = new Test1!"Test1" ;
    obj.test1();
}
-----------------------------------------
test.d(5): Error: variable __dollar cannot be read at compile time
test.d(5): Error: variable __dollar cannot be read at compile time
test.d(10): Error: template instance test.Test1!("Test1") error instantiating

-- 
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