[Issue 5101] New: Poorly formed error against non-const template on const object
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 22 09:18:54 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5101
Summary: Poorly formed error against non-const template on
const object
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: Jesse.K.Phillips+D at gmail.com
CC: Jesse.K.Phillips+D at gmail.com
--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2010-10-22 09:18:10 PDT ---
The program below fails to compile because the MyClass.get template method is
not const. But this report is on the error message returned:
.\templateconst.d(10): Error: function
std.variant.VariantN!(maxSize).VariantN.g
et!(double).get () is not callable using argument types ()
I would expect it to complain that the call was not to a const method on a
const object.
void main() {
MyClass a;
test(a);
}
void test(const MyClass c) {
auto b = c.get!double;
}
class MyClass {
real pi = 3.14;
T get(T)() {
return cast(T) pi;
}
}
--
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