Closed waneck closed 11 years ago
In which cases does that happen? The haxe compiler does not allow structural subtyping between two structs.
Some untyped / unsafe cast call may generate this. I'd rather have haxe throwing a nice error than delegating it to the C compiler
In untyped mode you could cast a struct to anything, even an Int. So I don't quite understand why we should treat the struct vs. struct case in a special way.
Hmm that's true. We may run into issues when dealing with e.g. @:generic, which is known to generate code that is a little annoying to handle... Well, it doesn't hurt to check and send an error message
I don't really see the point of allocating any effort to that just to give "This expression probably doesn't compile through C"-style errors. If something like that originates from typed code, we should check why that happens. If it comes from using untyped then it's the user's own problem IMHO.
While struct unboxing should be allowed, casting from a struct into another should be an error when both aren't the same type