http://d.puremagic.com/issues/show_bug.cgi?id=8387
Summary: Semantic errors in opDispatch body are not reported Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: jus...@economicmodeling.com --- Comment #0 from Justin Whear <jus...@economicmodeling.com> 2012-07-13 15:16:11 PDT --- If an opDispatch function has a semantic error inside the body a misleading error will be reported at the call site. Example: --------------------test.d---------------------- struct Foo { int opDispatch(string prop)() @property { pragma(msg, prop); thisFunctionDoesntExist(); return 1; } } void main() { import std.stdio; Foo bar; writeln(bar.baz); } ------------------------------------------------- Run: dmd test.d && ./test baz test.d(15): Error: undefined identifier 'baz' The pragma clearly shows that opDispatch template is being instantiated, but it seems to bail when an error is encountered, leading to the "undefined identifier" error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------