[Issue 3642] New: Poor error message when using shared: function ___ not callable with argument types ___
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 23 17:41:41 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3642
Summary: Poor error message when using shared: function ___ not
callable with argument types ___
Product: D
Version: 2.036
Platform: x86
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: jason.james.house at gmail.com
--- Comment #0 from Jason House <jason.james.house at gmail.com> 2009-12-23 17:41:40 PST ---
Sample code
==================
struct foo{
void unsharedfunc(){}
void sharedfunc() shared {}
}
void main(){
foo unsharedvar;
shared(foo) sharedvar;
unsharedvar.sharedfunc();
sharedvar.unsharedfunc();
}
==================
Output with dmd 2.037
(Bug report lists dmd 2.036 because 2.037 was not an option at the time)
$ dmd test.d
test.d(8): Error: function test.foo.sharedfunc () shared is not callable using
argument types ()
test.d(9): Error: function test.foo.unsharedfunc () is not callable using
argument types () shared
Here's the kind of error message I would expect to see
test.d(8): Error: Only shared types can call shared functions
test.d(9): Error: Shared types can only call shared functions
Maybe the function or variable name could be worked into the message, but
that's the essence of what should be displayed.
--
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