Simon Krajewski 13 éve
szülő
commit
8bef8da4ba

+ 11 - 1
codegen.ml

@@ -661,7 +661,6 @@ let add_rtti ctx t =
 let remove_extern_fields ctx t = match t with
 	| TClassDecl c ->
 		let do_remove f =
-			(match follow f.cf_type with TAbstract({a_path=[],"Void"},_) -> error "Fields of type Void are not allowed" f.cf_pos | _ -> ());
 			(not ctx.in_macro && f.cf_kind = Method MethMacro) || has_meta ":extern" f.cf_meta || has_meta ":generic" f.cf_meta
 		in
 		if not (Common.defined ctx.com Define.DocGen) then begin
@@ -776,6 +775,17 @@ let check_remove_metadata ctx t = match t with
 	| _ ->
 		()
 
+(* Checks for Void class fields *)
+let check_void_field ctx t = match t with
+	| TClassDecl c ->
+		let check f =
+			match follow f.cf_type with TAbstract({a_path=[],"Void"},_) -> error "Fields of type Void are not allowed" f.cf_pos | _ -> ();
+		in
+		List.iter check c.cl_ordered_fields;
+		List.iter check c.cl_ordered_statics;
+	| _ ->
+		()
+
 (* -------------------------------------------------------------------------- *)
 (* LOCAL VARIABLES USAGE *)
 

+ 1 - 0
main.ml

@@ -1108,6 +1108,7 @@ try
 			Codegen.add_field_inits;
 			Codegen.add_meta_field;
 			Codegen.check_remove_metadata;
+			Codegen.check_void_field;
 		] in
 		List.iter (fun t -> List.iter (fun f -> f tctx t) type_filters) com.types;
 		if ctx.has_error then raise Abort;

+ 3 - 2
std/haxe/remoting/SocketWrapper.hx

@@ -71,12 +71,13 @@ class SocketWrapper {
 	}
 
 	static function init() {
-		if( !flash.external.ExternalInterface.available ) return;
+		if( !flash.external.ExternalInterface.available ) return null;
 		var ctx = new Context();
 		var o = {};
 		Reflect.setField(o,"create",create);
 		ctx.addObject("api",o);
-		haxe.remoting.ExternalConnection.jsConnect("SocketWrapper",ctx);
+		haxe.remoting.ExternalConnection.jsConnect("SocketWrapper", ctx);
+		return null;
 	}
 
 	static var _ = init();

+ 1 - 1
std/neko/Random.hx

@@ -23,7 +23,7 @@ package neko;
 
 class Random {
 
-	var r : Void;
+	var r : Dynamic;
 
 	public function new() {
 		r = random_new();

+ 1 - 1
std/neko/vm/Deque.hx

@@ -22,7 +22,7 @@
 package neko.vm;
 
 class Deque<T> {
-	var q : Void;
+	var q : Dynamic;
 	public function new() {
 		q = deque_create();
 	}

+ 1 - 1
std/neko/vm/Mutex.hx

@@ -22,7 +22,7 @@
 package neko.vm;
 
 class Mutex {
-	var m : Void;
+	var m : Dynamic;
 	public function new() {
 		m = mutex_create();
 	}

+ 1 - 1
std/neko/zip/Compress.hx

@@ -23,7 +23,7 @@ package neko.zip;
 
 class Compress {
 
-	var s : Void;
+	var s : Dynamic;
 
 	public function new( level : Int ) {
 		s = _deflate_init(level);

+ 2 - 2
std/php/_std/sys/db/Sqlite.hx

@@ -23,8 +23,8 @@ package sys.db;
 
 private class SqliteConnection implements Connection {
 
-	var c : Void;
-	var e : Void;
+	var c : Dynamic;
+	var e : Dynamic;
 
 	public function new( file : String ) {
 		c = untyped __call__("sqlite_open", file, 0666, e);

+ 1 - 1
std/php/_std/sys/io/Process.hx

@@ -78,7 +78,7 @@ private class Stdout extends haxe.io.Input {
 
 @:coreApi
 class Process {
-	var p : Void;
+	var p : Dynamic;
 	var st : NativeArray;
 	var cl : Int;
 	public var stdout(default,null) : haxe.io.Input;

+ 2 - 2
std/php/db/Sqlite.hx

@@ -25,8 +25,8 @@ import php.db.Connection;
 
 private class SqliteConnection implements Connection {
 
-	var c : Void;
-	var e : Void;
+	var c : Dynamic;
+	var e : Dynamic;
 
 	public function new( file : String ) {
 		c = untyped __call__("sqlite_open", file, 0666, e);