Issue 13536 - Union of delegates breaks @safety
Summary: Union of delegates breaks @safety
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull, safe
Depends on:
Blocks:
 
Reported: 2014-09-27 01:41 UTC by hsteoh
Modified: 2016-10-01 11:47 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 hsteoh 2014-09-27 01:41:47 UTC
------
struct S {
        void sysMethod() @system {}
}
void fun() @safe {
        union U {
                void delegate() @system sysDg;
                void delegate() @safe safeDg;
        }
        U u;
        S s;
        u.sysDg = &s.sysMethod;
        // s.sysMethod(); // the compiler catches this
        u.safeDg(); // but not this
}
------
Comment 1 Walter Bright 2016-06-12 08:08:46 UTC
https://github.com/dlang/dmd/pull/5859
Comment 2 github-bugzilla 2016-06-16 21:04:53 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8e480a56f514284d919e894c103288dda67ea243
fix Issue 13536 - Union of delegates breaks @safety

https://github.com/dlang/dmd/commit/82fa43ff6cdea746aa626af1f8bc1ac52b228e90
Merge pull request #5859 from WalterBright/fix13536

fix Issue 13536 - Union of delegates breaks @safety
Comment 3 github-bugzilla 2016-10-01 11:47:48 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8e480a56f514284d919e894c103288dda67ea243
fix Issue 13536 - Union of delegates breaks @safety

https://github.com/dlang/dmd/commit/82fa43ff6cdea746aa626af1f8bc1ac52b228e90
Merge pull request #5859 from WalterBright/fix13536