September 27, 2014 [Issue 13536] New: Union of delegates breaks @safety | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=13536 Issue ID: 13536 Summary: Union of delegates breaks @safety Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: DMD Assignee: nobody@puremagic.com Reporter: hsteoh@quickfur.ath.cx ------ 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 } ------ -- |
Copyright © 1999-2021 by the D Language Foundation