[Issue 769] New: Property not properly compiled - (error on valid code)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 29 16:21:58 PST 2006


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

           Summary: Property not properly compiled - (error on valid code)
           Product: D
           Version: 0.178
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: aarti at interia.pl


class DataManager {
public:
    static DataManager instance() {
        if (dataManager is null) {
            dataManager=new DataManager;
        }
        return dataManager;
    }

    T get(T)(long row) {
        return T.init;
    }
}

----
Following makes problem:
1. (DataManager.instance).get!(T)(row);
   Error: found '!' when expecting ';' following 'statement'
   Error: C style cast illegal, use cast(T)(row)

2. DataManager.instance.get!(T)(row);
   Error: template setField!(T) is not a member of instance
   Error: function expected before (), not 0 of type int

When written as:
   DataManager.instance().get!(T)(row);

everything is OK.


-- 



More information about the Digitalmars-d-bugs mailing list