Closed restorer closed 5 years ago
class Bug7 { public function bug() : Void { var s : Null<String> = ((Math.random() > 0.5) ? "A" : null); if (s == null || s.length == 42) { return; } // Safety: Cannot access "length" of a nullable value. s.length; } }
See https://github.com/restorer/haxe-safety-bugs/blob/master/safetybugs/Main.hx#L109 for working example.
This is for Haxe 4.0.0-preview.5 and Safety from master.
Fixed in https://github.com/HaxeFoundation/haxe/pull/7717
See https://github.com/restorer/haxe-safety-bugs/blob/master/safetybugs/Main.hx#L109 for working example.