I noticed that the following code compiles even in SafeD. Is this a bug? If
not, what are the semantics of casting unshared to shared? TDPL doesn't seem
to mention this. Isn't it dangerous to have shared and unshared references to
the same memory?
@safe:
class Foo {
uint num;
}
void main() {
auto foo = new Foo;
auto bar = cast(shared) foo;
}