Closed restorer closed 5 years ago
This is for Haxe 4.0.0-preview.5 and Safety from master.
It also doesn't make sense for a single-threaded environment if there are some calls before the access to h.s.length
.
I'm not sure if it worth to change.
Hmm. Something like
if (h.s != null) {
h.s = null;
h.s.length;
}
Make sense. Kotlin do the same thing: Smart cast to 'String' is impossible, because 'h.s' is a mutable property that could have been changed by this time
.
New proposal: maybe more descriptive error message (like in kotlin)?
Duplicated in the official Haxe repo: https://github.com/HaxeFoundation/haxe/issues/7723
See https://github.com/restorer/haxe-safety-bugs/blob/master/safetybugs/Main.hx#L140 for working example.