Closed restorer closed 5 years ago
This is for Haxe 4.0.0-preview.5 and Safety from master.
Unfortunately, this is not avoidable in the plugin, because Safety cannot modify the typing process.
Use new TypeHolder((s:String))
as a workaround.
Currently I use .unsafe()
, it looks better for me. Probably this should be mentioned in documentation somewhere.
.unsafe()
is not safe :)
If you ever remove or change if(s != null)
, your code will become unsafe. While with (s:String)
it will emit a compilation error.
Another option is new TypeHolder<String>(s)
.
See https://github.com/restorer/haxe-safety-bugs/blob/master/safetybugs/Main.hx#L128 for working example.