RblSb 4 月之前
父节点
当前提交
699392f492
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      tests/nullsafety/src/cases/TestLoose.hx

+ 8 - 0
tests/nullsafety/src/cases/TestLoose.hx

@@ -146,6 +146,14 @@ class TestLoose {
 		shouldFail(if (foo()) {});
 	}
 
+	static function return_localFuncNullableAccess_shouldPass():Void {
+		if (staticVar == null) return;
+		function foo() {
+			trace(staticVar.length);
+		}
+		foo();
+	}
+
 	static function nullCoal_continue_shouldPass():Void {
 		for (i in 0...1) {
 			var i:String = staticVar ?? continue;