View source
enum abstract NullSafetyMode(String)
package haxe.macro
to String
import haxe.macro.Compiler
Available on all platforms
Variables
inlineread onlyLoose:NullSafetyMode = "Loose"
Loose safety.
If an expression is checked != null
, then it's considered safe even if it could be modified after the check.
E.g.
function example(o:{field:Null<String>}) {
if(o.field != null) {
mutate(o);
var notNullable:String = o.field; //no error
}
}
function mutate(o:{field:Null<String>}) {
o.field = null;
}