Thread overview | ||||||
---|---|---|---|---|---|---|
|
December 10, 2012 [Issue 9132] New: Unhelpful error message when calling non-const property from const method. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=9132 Summary: Unhelpful error message when calling non-const property from const method. Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: diagnostic Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bugzilla@kyllingen.net --- Comment #0 from Lars T. Kyllingstad <bugzilla@kyllingen.net> 2012-12-10 01:14:45 PST --- Test case: struct S { @property int foo() { return 123; } void bar() const { foo; } } DMD produces the following error message, which is not very useful: bug.d(4): Error: function a.S.foo () is not callable using argument types () Note that if parentheses are added to the foo() call, the error changes to: bug.d(4): Error: function bug.S.foo () is not callable using argument types () const which is much better. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 10, 2012 [Issue 9132] Unhelpful error message when calling non-const property from const method. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars T. Kyllingstad | http://d.puremagic.com/issues/show_bug.cgi?id=9132 --- Comment #1 from Lars T. Kyllingstad <bugzilla@kyllingen.net> 2012-12-10 01:18:12 PST --- Please disregard the "a.S.foo" in the first error message, which is not part of the problem. It is simply a result of me renaming the source file and only copy-pasting part of the message anew. :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 10, 2012 [Issue 9132] Unhelpful error message when calling non-const property from const method. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars T. Kyllingstad | http://d.puremagic.com/issues/show_bug.cgi?id=9132 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich@gmail.com Resolution| |DUPLICATE --- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-10 08:57:38 PST --- *** This issue has been marked as a duplicate of issue 6707 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 10, 2012 [Issue 9132] Unhelpful error message when calling non-const property from const method. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars T. Kyllingstad | http://d.puremagic.com/issues/show_bug.cgi?id=9132 --- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-10 08:58:41 PST --- Note that in upcoming 2.061 this error is now shown for calls with or without parens, so it's slightly more descriptive: Error: function test.S.foo () is not callable using argument types () const -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation