소스 검색

force the return type of values in MapKeyValueIterator to be non-Null

this way "type tightening" would allow inlining the object
Dan Korostelev 5 년 전
부모
커밋
d0fd88b9b7
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      std/haxe/iterators/MapKeyValueIterator.hx

+ 1 - 1
std/haxe/iterators/MapKeyValueIterator.hx

@@ -49,6 +49,6 @@ class MapKeyValueIterator<K, V> {
 	**/
 	public inline function next():{key:K, value:V} {
 		var key = keys.next();
-		return {value: map.get(key), key: key};
+		return {value: @:nullSafety(Off) (map.get(key) : V), key: key};
 	}
 }