http://d.puremagic.com/issues/show_bug.cgi?id=7618
Summary: delegate/function pointer call bypass parameter
storage class
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Kenji Hara <[email protected]> 2012-03-01 03:51:02 PST ---
Test case:
----
void foo(const int x)
{
int func(ref int) { return 1; }
func(x);
// Error: function test.foo.func (ref int x) is not callable
// using argument types (const(int))
/ --> OK
int delegate(ref int) dg = (ref int x) => 1;
dg(x);
// --> compiles without error, bad!
int function(ref int) fp = (ref int x) => 1;
fp(x);
// --> compiles without error, bad!
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------