http://d.puremagic.com/issues/show_bug.cgi?id=10511
Summary: Unhelpful error messages with a const opDispatch
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2013-06-30 07:52:37 PDT ---
Modified from code by David in D.learn. This is wrong code:
struct Foo {
static Foo opDispatch(string s)() const {
return Foo();
}
}
void main() {
Foo f = Foo.bar();
}
DMD 2.064alpha gives:
test.d(7): Error: no property 'bar' for type 'Foo'
test.d(7): Error: Foo is not an expression
The error messages don't help much because they don't explain what's the
problem. The code able to compile is without "const":
struct Foo {
static Foo opDispatch(string s)() {
return Foo();
}
}
void main() {
Foo f = Foo.bar();
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------