https://issues.dlang.org/show_bug.cgi?id=17284
--- Comment #5 from [email protected] --- Oh my, it gets worse: ref has nothing to do with it at all! Look at this blatant violation of @safe: ------ class C { } union U { C c; int i; } void func(T)(T t) { t.c = new C; t.i++; // !!! } pragma(msg, typeof(func!U)); ------ Compiler output: ------ pure nothrow @safe void(U t) ------ Looks like attribute inference is a free license to violate @safety. :-D Or, more precisely, attribute inference completely forgets to check for overlapping pointers. --
