Forráskód Böngészése

[std] modernize the docs on Null<T> (#7737)

* [std] modernize the docs on Null<T>

* improve wording [skip ci]
Jens Fischer 6 éve
szülő
commit
f45f8cf091
1 módosított fájl, 7 hozzáadás és 4 törlés
  1. 7 4
      std/StdTypes.hx

+ 7 - 4
std/StdTypes.hx

@@ -65,10 +65,13 @@
 #end
 
 /**
-	`Null` can be useful in two cases. In order to document some methods
-	that accept or can return a `null` value, or for the Flash compiler and AS3
-	generator to distinguish between base values that can be `null` and others that
-	can't.
+	`Null<T>` is a wrapper that can be used to make the basic types `Int`,
+	`Float` and `Bool` nullable on static targets.
+
+	If null safety is enabled, only types wrapped in `Null<T>` are nullable.
+
+	Otherwise, it has no effect on non-basic-types, but it can be useful as a way to document
+	that `null` is an acceptable value for a method argument, return value or variable.
 
 	@see https://haxe.org/manual/types-nullability.html
 **/