Bug 13536 – Union of delegates breaks @safety

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-27T01:41:00Z
Last change time
2016-10-01T11:47:48Z
Keywords
accepts-invalid, pull, safe
Assigned to
nobody
Creator
hsteoh

Comments

Comment #0 by hsteoh — 2014-09-27T01:41:47Z
------ 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 by bugzilla — 2016-06-12T08:08:46Z
Comment #2 by github-bugzilla — 2016-06-16T21:04:53Z
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 by github-bugzilla — 2016-10-01T11:47:48Z
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