Bug 769 – Property not properly compiled - (error on valid code)
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
All
Creation time
2006-12-29T18:21:57Z
Last change time
2019-05-16T09:01:00Z
Keywords
rejects-valid
Assigned to
Walter Bright
Creator
Marcin Kuszczak
Comments
Comment #0 by aarti — 2006-12-29T18:21:57Z
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.