Ver Fonte

[std] remove Null from optional fields, arguments

Dmitry Maganov há 5 anos atrás
pai
commit
6be7eca4f5

+ 1 - 1
std/cpp/_std/haxe/Utf8.hx

@@ -29,7 +29,7 @@ using cpp.NativeString;
 class Utf8 {
 	var __s:Array<Int>;
 
-	public function new(?size:Null<Int>):Void {
+	public function new(?size:Int):Void {
 		__s = new Array<Int>();
 		if (size != null && size > 0)
 			cpp.NativeArray.reserve(__s, size);

+ 1 - 1
std/cpp/_std/sys/ssl/Certificate.hx

@@ -30,7 +30,7 @@ class Certificate {
 	var __x:Dynamic;
 
 	@:allow(sys.ssl.Socket)
-	function new(x:Dynamic, ?h:Null<Certificate>) {
+	function new(x:Dynamic, ?h:Certificate) {
 		__x = x;
 		__h = h;
 	}

+ 1 - 1
std/haxe/CallStack.hx

@@ -28,7 +28,7 @@ package haxe;
 enum StackItem {
 	CFunction;
 	Module(m:String);
-	FilePos(s:Null<StackItem>, file:String, line:Int, ?column:Null<Int>);
+	FilePos(s:Null<StackItem>, file:String, line:Int, ?column:Int);
 	Method(classname:Null<String>, method:String);
 	LocalFunction(?v:Int);
 }

+ 8 - 8
std/haxe/macro/Expr.hx

@@ -283,7 +283,7 @@ typedef Case = {
 	/**
 		The optional guard expressions of the case, if available.
 	**/
-	var ?guard:Null<Expr>;
+	var ?guard:Expr;
 
 	/**
 		The expression of the case, if available.
@@ -508,7 +508,7 @@ enum ExprDef {
 	/**
 		A `return` or `return e` expression.
 	**/
-	EReturn(?e:Null<Expr>);
+	EReturn(?e:Expr);
 
 	/**
 		A `break` expression.
@@ -647,7 +647,7 @@ typedef TypePath = {
 		Sub is set on module sub-type access:
 		`pack.Module.Type` has `name = "Module"`, `sub = "Type"`, if available.
 	**/
-	var ?sub:Null<String>;
+	var ?sub:String;
 }
 
 /**
@@ -734,7 +734,7 @@ typedef FunctionArg = {
 	/**
 		The optional value of the function argument, if available.
 	**/
-	var ?value:Null<Expr>;
+	var ?value:Expr;
 
 	/**
 		The metadata of the function argument.
@@ -780,7 +780,7 @@ typedef Field = {
 		The documentation of the field, if available. If the field has no
 		documentation, the value is `null`.
 	**/
-	var ?doc:Null<String>;
+	var ?doc:String;
 
 	/**
 		The access modifiers of the field. By default fields have private access.
@@ -876,7 +876,7 @@ enum FieldType {
 	/**
 		Represents a variable field type.
 	**/
-	FVar(t:Null<ComplexType>, ?e:Null<Expr>);
+	FVar(t:Null<ComplexType>, ?e:Expr);
 
 	/**
 		Represents a function field type.
@@ -886,7 +886,7 @@ enum FieldType {
 	/**
 		Represents a property with getter and setter field type.
 	**/
-	FProp(get:String, set:String, ?t:Null<ComplexType>, ?e:Null<Expr>);
+	FProp(get:String, set:String, ?t:ComplexType, ?e:Expr);
 }
 
 /**
@@ -907,7 +907,7 @@ typedef TypeDefinition = {
 		The documentation of the type, if available. If the type has no
 		documentation, the value is `null`.
 	**/
-	var ?doc:Null<String>;
+	var ?doc:String;
 
 	/**
 		The position to the type definition.

+ 1 - 1
std/haxe/zip/Entry.hx

@@ -38,5 +38,5 @@ typedef Entry = {
 	var dataSize:Int;
 	var data:Null<haxe.io.Bytes>;
 	var crc32:Null<Int>;
-	var ?extraFields:Null<List<ExtraField>>;
+	var ?extraFields:List<ExtraField>;
 }

+ 1 - 1
std/hl/_std/sys/ssl/Certificate.hx

@@ -33,7 +33,7 @@ class Certificate {
 	var __x:CertificatePtr;
 
 	@:allow(sys.ssl.Socket)
-	function new(x:CertificatePtr, ?h:Null<Certificate>) {
+	function new(x:CertificatePtr, ?h:Certificate) {
 		__x = x;
 		__h = h;
 	}

+ 1 - 1
std/neko/_std/sys/ssl/Certificate.hx

@@ -28,7 +28,7 @@ class Certificate {
 	var __x:Dynamic;
 
 	@:allow(sys.ssl.Socket)
-	function new(x:Dynamic, ?h:Null<Certificate>) {
+	function new(x:Dynamic, ?h:Certificate) {
 		__x = x;
 		__h = h;
 	}

+ 1 - 1
std/python/lib/subprocess/Popen.hx

@@ -78,7 +78,7 @@ extern class Popen {
 		universal_newlines:Bool = false, startupinfo:StartupInfo = null, creationflags:Int = 0):Void;
 
 	function kill():Void;
-	function wait(?timeout:Null<Int>):Null<Int>;
+	function wait(?timeout:Int):Null<Int>;
 	function poll():Null<Int>;
 	function terminate():Void;