[Issue 18755] New: std.typecons.Rebindable breaks @safe-ty
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 11 23:57:36 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18755
Issue ID: 18755
Summary: std.typecons.Rebindable breaks @safe-ty
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: safe
Severity: critical
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: code at klickverbot.at
This compiles and runs with DMD 2.079:
---
class Foo {
auto opCast(T)() @system immutable pure nothrow {
*(cast(uint*)0xdeadbeef) = 0xcafebabe;
return T.init;
}
}
void main() @safe {
import std.typecons;
auto r = Rebindable!(immutable Foo)(new Foo); // oops
}
---
--
More information about the Digitalmars-d-bugs
mailing list