D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7618 - delegate/function pointer call bypass parameter storage class
Summary: delegate/function pointer call bypass parameter storage class
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull
Depends on:
Blocks:
 
Reported: 2012-03-01 03:51 UTC by Kenji Hara
Modified: 2012-03-02 12:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-03-01 03:51:02 UTC
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!
}
Comment 2 github-bugzilla 2012-03-02 11:39:30 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/40b290c66756bce69369b188cad2cda1f3794777
fix Issue 7618 - delegate/function pointer call bypass parameter storage class

https://github.com/D-Programming-Language/dmd/commit/f2eff281cbb950cf85b47dda943afcbde22964d4
Merge pull request #776 from 9rnsr/fix7618

Issue 7618 - delegate/function pointer call bypass parameter storage class