2
0
Эх сурвалжийг харах

[cs] remove implicit Null<T> -> T operator as discussed in #4721, also protect special __NoValue__ class from being created in any way - it only serves as a dummy type for passing `null` to implicitly create Null<T>

Dan Korostelev 9 жил өмнө
parent
commit
4d686ae814

+ 3 - 5
std/cs/internal/Null.hx

@@ -38,15 +38,13 @@ package cs.internal;
 			return new haxe.lang.Null<T>(val, true);
 		}
 
-		public static implicit operator T(haxe.lang.Null<T> obj) {
-			return obj.@value;
-		}
-
 		public static implicit operator Null<T>(__NoValue__ noValue) {
 			return new haxe.lang.Null<T>(default(T), false);
 		}
 
-		public class __NoValue__ { }
+		public sealed class __NoValue__ {
+			private __NoValue__() {}
+		}
 
 ')
 #if core_api_serialize