Browse Source

Merge branch 'feature/eval-libuv' of github.com:Aurel300/haxe into feature/eval-libuv

Aurel Bílý 6 years ago
parent
commit
6b8a04a6c8

+ 1 - 1
Makefile.win

@@ -42,7 +42,7 @@ ifdef FILTER
 CC_CMD=($(COMPILER) $(ALL_CFLAGS) -c $< 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
 endif
 
-PACKAGE_FILES=$(HAXE_OUTPUT) $(HAXELIB_OUTPUT) std "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep zlib1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libpcre-1.dll | sed -e 's/^\s*//')"
+PACKAGE_FILES=$(HAXE_OUTPUT) $(HAXELIB_OUTPUT) std "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep zlib1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libpcre-1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libuv-1.dll | sed -e 's/^\s*//')"
 
 echo_package_files:
 	echo $(PACKAGE_FILES)

+ 1 - 1
extra/azure-pipelines/build-linux.yml

@@ -16,7 +16,7 @@ jobs:
           set -ex
           sudo add-apt-repository ppa:avsm/ppa -y # provides newer version of OCaml and OPAM
           sudo apt-get update -qqy
-          sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev ninja-build
+          sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libuv1-dev libgtk2.0-dev ninja-build
         displayName: Install dependencies
       - template: install-neko-snapshot.yaml
         parameters:

+ 1 - 1
extra/azure-pipelines/build-mac.yml

@@ -31,7 +31,7 @@ jobs:
         displayName: Install OCaml libraries
       - script: |
           set -ex
-          opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" haxe
+          opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a /usr/local/lib/libuv.a" haxe
           opam config exec -- make -s haxelib
           make -s package_bin package_installer_mac
           ls -l out

+ 3 - 1
extra/azure-pipelines/build-windows.yml

@@ -38,9 +38,11 @@ jobs:
       - powershell: |
           Set-PSDebug -Trace 1
           curl.exe -fsSL -o cygwin-setup.exe --retry 3 $(CYGWIN_SETUP)
-          Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $(CYG_ROOT) -l C:/tmp -s $(CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mingw64-$(MINGW_ARCH)-zlib -P mingw64-$(MINGW_ARCH)-gcc-core -P mingw64-$(MINGW_ARCH)-pcre" -Wait
+          Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $(CYG_ROOT) -l C:/tmp -s $(CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P libuv-devel -P mingw64-$(MINGW_ARCH)-zlib -P mingw64-$(MINGW_ARCH)-gcc-core -P mingw64-$(MINGW_ARCH)-pcre" -Wait
           curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$(ARCH).tar.xz
+          curl.exe -fsSL -o "libuv.tar.xz" --retry 3 https://github.com/Simn/mingw64-uv/releases/download/1.32.0/mingw64-$(MINGW_ARCH)-uv-1.32.0-1.tar.xz
           & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
+          & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libuv.tar.xz')
           & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
           & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam$(ARCH)/install.sh')
           & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw$(ARCH)c --switch 4.07.0+mingw$(ARCH)c --auto-setup --yes 2>&1')

+ 1 - 1
extra/haxelib_src

@@ -1 +1 @@
-Subproject commit 25a8ff4dd04be4dd1e151139d679f11fbc871721
+Subproject commit 0ea7cd696bdc4a2d63c4ea0e1466c3a40dd97de5

+ 8 - 0
libs/uv/uv_stubs.c

@@ -1006,6 +1006,14 @@ static void handle_dns_gai_cb(uv_getaddrinfo_t *req, int status, struct addrinfo
 	CAMLreturn0;
 }
 
+#ifndef AI_ADDRCONFIG
+#define AI_ADDRCONFIG 0x0400
+#endif
+
+#ifndef AI_V4MAPPED
+#define AI_V4MAPPED 0x0800
+#endif
+
 CAMLprim value w_dns_getaddrinfo(value loop, value node, value flag_addrconfig, value flag_v4mapped, value hint_family, value cb) {
 	CAMLparam5(loop, node, flag_addrconfig, flag_v4mapped, hint_family);
 	CAMLxparam1(cb);

+ 13 - 2
src/codegen/gencommon/castDetect.ml

@@ -708,8 +708,19 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
 				(* unify applied original *)
 			with
 				| Unify_error el ->
-						(* List.iter (fun el -> gen.gcon.warning (Typecore.unify_error_msg (print_context()) el) pos) el; *)
-						gen.gcon.warning ("This expression may be invalid") pos
+						(match el with
+						(*
+							Don't emit a warning for abstracts if underlying type is the same as the second type.
+							This situation is caused by `Normalize.filter_param` not "unpacking" abstracts.
+						*)
+						| [Cannot_unify (TAbstract(a,params), b)]
+						| [Cannot_unify (b, TAbstract(a,params))] ->
+							let a = apply_params a.a_params params a.a_this in
+							if not (shallow_eq a b) then
+								gen.gcon.warning ("This expression may be invalid") pos
+						| _ ->
+							gen.gcon.warning ("This expression may be invalid") pos
+						)
 				| Invalid_argument _ ->
 						gen.gcon.warning ("This expression may be invalid") pos
 			);

+ 3 - 5
src/codegen/gencommon/normalize.ml

@@ -29,7 +29,7 @@ open Gencommon
 		as it will help normalize the AST
 *)
 
-let rec filter_param stack t =
+let rec filter_param (stack:t list) t =
 	match t with
 	| TInst({ cl_kind = KTypeParameter _ } as c,_) when Meta.has Meta.EnumConstructorParam c.cl_meta ->
 		t_dynamic
@@ -39,10 +39,8 @@ let rec filter_param stack t =
 		| Some t -> filter_param stack t)
 	| TInst(_,[]) | TEnum(_,[]) | TAbstract(_,[]) ->
 		t
-	| TType(td,tl) when Meta.has Meta.Semantics td.t_meta || Meta.has Meta.Strict td.t_meta || List.memq t stack ->
-		TType(td,List.map (filter_param stack) tl)
 	| TType(td,tl) ->
-		filter_param (t :: stack) (apply_params td.t_params tl td.t_type)
+		TType(td,List.map (filter_param stack) tl)
 	| TInst(c,tl) ->
 		TInst(c,List.map (filter_param stack) tl)
 	| TEnum(e,tl) ->
@@ -51,7 +49,7 @@ let rec filter_param stack t =
 		TAbstract(a, List.map (filter_param stack) tl)
 	| TAbstract({a_path = [],"Null"} as a,[t]) ->
 		TAbstract(a,[filter_param stack t])
-	| TAbstract(a,tl) when not (Meta.has Meta.CoreType a.a_meta) ->
+	| TAbstract(a,tl) when (Meta.has Meta.MultiType a.a_meta) ->
 		filter_param stack (Abstract.get_underlying_type a tl)
 	| TAbstract(a,tl) ->
 		TAbstract(a, List.map (filter_param stack) tl)

+ 1 - 1
src/core/error.ml

@@ -34,7 +34,7 @@ let short_type ctx t =
 	let tstr = s_type ctx t in
 	if String.length tstr > 150 then String.sub tstr 0 147 ^ "..." else tstr
 
-let unify_error_msg ctx = function
+let unify_error_msg ctx err = match err with
 	| Cannot_unify (t1,t2) ->
 		s_type ctx t1 ^ " should be " ^ s_type ctx t2
 	| Invalid_field_type s ->

+ 2 - 0
src/core/tPrinting.ml

@@ -48,6 +48,8 @@ let rec s_type ctx t =
 		(match c.cl_kind with
 		| KExpr e -> Ast.Printer.s_expr e
 		| _ -> s_type_path c.cl_path ^ s_type_params ctx tl)
+	| TType ({ t_type = TAnon { a_status = { contents = Statics { cl_kind = KAbstractImpl a }}}}, _) ->
+		"Abstract<" ^ (s_type_path a.a_path) ^ ">"
 	| TType (t,tl) ->
 		s_type_path t.t_path ^ s_type_params ctx tl
 	| TAbstract (a,tl) ->

+ 1 - 1
src/generators/genlua.ml

@@ -917,8 +917,8 @@ and gen_expr ?(local=true) ctx e = begin
     | TWhile (cond,e,Ast.NormalWhile) ->
         gen_loop ctx "while" cond e
     | TWhile (cond,e,Ast.DoWhile) ->
-        println ctx "while true do ";
         gen_block_element ctx e;
+        newline ctx;
         gen_loop ctx "while" cond e
     | TObjectDecl [] ->
         spr ctx "_hx_e()";

+ 1 - 1
std/Std.hx

@@ -19,7 +19,7 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#if !(core_api || cross)
+#if !(core_api || cross || eval)
 #error "Please don't add haxe/std to your classpath, instead set HAXE_STD_PATH env var"
 #end
 

+ 9 - 0
std/eval/_std/Sys.hx

@@ -86,4 +86,13 @@ class Sys {
 	extern static public function stdout():haxe.io.Output;
 
 	extern static public function stderr():haxe.io.Output;
+
+	static function __init__():Void {
+		// This nonsense causes the classes to be loaded. Otherwise they might not make
+		// it into the interpreter, and then stderr() et. al. don't work.
+		var _ = (null : sys.io.FileOutput);
+		var _ = (null : sys.io.FileInput);
+
+		var _ = (null : haxe.Error);
+	}
 }

+ 22 - 7
std/haxe/CallStack.hx

@@ -43,15 +43,15 @@ class CallStack {
 	static function getStack(e:js.lib.Error):Array<StackItem> {
 		if (e == null)
 			return [];
-		// https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
-		var oldValue = (untyped Error).prepareStackTrace;
-		(untyped Error).prepareStackTrace = function(error, callsites:Array<Dynamic>) {
+		// https://v8.dev/docs/stack-trace-api
+		var oldValue = V8Error.prepareStackTrace;
+		V8Error.prepareStackTrace = function(error, callsites) {
 			var stack = [];
 			for (site in callsites) {
 				if (wrapCallSite != null)
 					site = wrapCallSite(site);
 				var method = null;
-				var fullName:String = site.getFunctionName();
+				var fullName = site.getFunctionName();
 				if (fullName != null) {
 					var idx = fullName.lastIndexOf(".");
 					if (idx >= 0) {
@@ -60,7 +60,7 @@ class CallStack {
 						method = Method(className, methodName);
 					}
 				}
-				var fileName:String = site.getFileName();
+				var fileName = site.getFileName();
 				var fileAddr = fileName == null ? -1 : fileName.indexOf("file:");
 				if (wrapCallSite != null && fileAddr > 0)
 					fileName = fileName.substr(fileAddr + 6);
@@ -69,13 +69,13 @@ class CallStack {
 			return stack;
 		}
 		var a = makeStack(e.stack);
-		(untyped Error).prepareStackTrace = oldValue;
+		V8Error.prepareStackTrace = oldValue;
 		return a;
 	}
 
 	// support for source-map-support module
 	@:noCompletion
-	public static var wrapCallSite:Dynamic->Dynamic;
+	public static var wrapCallSite:V8CallSite->V8CallSite;
 	#end
 
 	#if eval
@@ -413,3 +413,18 @@ class CallStack {
 		#end
 	}
 }
+
+#if js
+// https://v8.dev/docs/stack-trace-api
+@:native("Error")
+private extern class V8Error {
+	static var prepareStackTrace:(error:js.lib.Error, structuredStackTrace:Array<V8CallSite>)->Any;
+}
+
+typedef V8CallSite = {
+	function getFunctionName():String;
+	function getFileName():String;
+	function getLineNumber():Int;
+	function getColumnNumber():Int;
+}
+#end

+ 2 - 0
std/js/lib/Map.hx

@@ -108,3 +108,5 @@ extern class Map<K, V> {
 		return new HaxeIterator(this.entries());
 	}
 }
+
+@:deprecated typedef MapEntry<K, V> = KeyValue<K, V>;

+ 57 - 0
std/php/ArrayIterator.hx

@@ -0,0 +1,57 @@
+/*
+ * Copyright (C)2005-2019 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+/**
+	@see https://www.php.net/manual/en/class.arrayiterator.php
+**/
+@:native('ArrayIterator')
+extern class ArrayIterator<K, V> implements php.ArrayAccess<K, V> implements SeekableIterator<K, V> implements Countable implements Serializable {
+	@:phpClassConst static final STD_PROP_LIST:Int;
+	@:phpClassConst static final ARRAY_AS_PROPS:Int;
+
+	function new(?array:NativeArray, ?flags:Int);
+	function append(value:V):Void;
+	function asort():Void;
+	function count():Int;
+	function current():V;
+	function getArrayCopy():NativeArray;
+	function getFlags():Int;
+	function key():K;
+	function ksort():Void;
+	function natcasesort():Void;
+	function natsort():Void;
+	function next():Void;
+	function offsetExists(offset:K):Bool;
+	function offsetGet(offset:K):V;
+	function offsetSet(offset:K, value:V):Void;
+	function offsetUnset(offset:K):Void;
+	function rewind():Void;
+	function seek(position:Int):Void;
+	function serialize():String;
+	function setFlags(flags:Int):Void;
+	function uasort(cmp_function:(a:V, b:V) -> Int):Void;
+	function uksort(cmp_function:(a:K, b:K) -> Int):Void;
+	function unserialize(serialized:String):Void;
+	function valid():Bool;
+}

+ 31 - 0
std/php/Countable.hx

@@ -0,0 +1,31 @@
+/*
+ * Copyright (C)2005-2019 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+ 
+package php;
+
+/**
+	@see https://www.php.net/manual/en/class.countable.php
+**/
+@:native('Countable')
+extern interface Countable {
+	function count():Int;
+}

+ 5 - 3
std/php/IteratorAggregate.hx

@@ -22,13 +22,15 @@
 
 package php;
 
+/**
+	@see https://www.php.net/manual/en/class.iteratoraggregate.php
+**/
 @:native('IteratorAggregate')
-extern interface IteratorAggregate<T> {
+extern interface IteratorAggregate<T> extends Traversable {
 	/**
 		This method is not public to not induce Haxe users to use it ;)
 		Use iterator() instead.
-		The return type would be Aggregator that is unusable in Haxe
 	**/
-	private function getIterator():Iterator<T>; //
+	private function getIterator():Traversable;
 
 }

+ 13 - 21
std/eval/_std/Std.hx → std/php/NativeIterator.hx

@@ -20,25 +20,17 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-import haxe.Error;
-import sys.io.FileOutput;
-import sys.io.FileInput;
-
-@:coreApi extern class Std {
-	public static function is(v:Dynamic, t:Dynamic):Bool;
-
-	public static function downcast<T:{}, S:T>(value:T, c:Class<S>):S;
-
-	@:deprecated('Std.instance() is deprecated. Use Std.downcast() instead.')
-	public static function instance<T:{}, S:T>(value:T, c:Class<S>):S;
-
-	public static function string(s:Dynamic):String;
-
-	public static function int(x:Float):Int;
-
-	public static function parseInt(x:String):Null<Int>;
-
-	public static function parseFloat(x:String):Float;
-
-	public static function random(x:Int):Int;
+package php;
+
+/**
+	Native PHP interface.
+	@see https://www.php.net/manual/en/class.iterator.php
+**/
+@:native('Iterator')
+extern interface NativeIterator<K, V> extends Traversable {
+	function current():V;
+	function key():K;
+	function next():Void;
+	function rewind():Void;
+	function valid():Bool;
 }

+ 31 - 0
std/php/SeekableIterator.hx

@@ -0,0 +1,31 @@
+/*
+ * Copyright (C)2005-2019 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+ 
+package php;
+
+/**
+	@see https://www.php.net/manual/en/class.seekableiterator.php
+**/
+@:native('SeekableIterator')
+extern interface SeekableIterator<K, V> extends NativeIterator<K, V> {
+	function seek(position:Int):Void;
+}

+ 32 - 0
std/php/Serializable.hx

@@ -0,0 +1,32 @@
+/*
+ * Copyright (C)2005-2019 Haxe Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package php;
+
+/**
+	@see https://www.php.net/manual/en/class.serializable.php
+**/
+@:native('Serializable')
+extern interface Serializable {
+    function serialize():String;
+    function unserialize(serialized:String):Void;
+}

+ 8 - 2
std/php/_std/Array.hx

@@ -21,11 +21,12 @@
  */
 
 import php.*;
+import php.ArrayIterator as NativeArrayIterator;
 
 using php.Global;
 
 @:coreApi
-final class Array<T> implements ArrayAccess<Int, T> {
+final class Array<T> implements ArrayAccess<Int, T> implements IteratorAggregate<T> {
 	public var length(default, null):Int;
 
 	var arr:NativeIndexedArray<T>;
@@ -228,6 +229,11 @@ final class Array<T> implements ArrayAccess<Int, T> {
 		}
 	}
 
+	@:noCompletion @:keep
+	private function getIterator():Traversable {
+		return new NativeArrayIterator(arr);
+	}
+
 	static function wrap<T>(arr:NativeIndexedArray<T>):Array<T> {
 		var a = new Array();
 		a.arr = arr;
@@ -272,4 +278,4 @@ private extern interface ArrayAccess<K, V> {
 	private function offsetGet(offset:K):V;
 	private function offsetSet(offset:K, value:V):Void;
 	private function offsetUnset(offset:K):Void;
-}
+}

+ 64 - 64
std/php/db/PDO.hx

@@ -26,70 +26,70 @@ import php.*;
 
 @:native('PDO')
 extern class PDO {
-	@:phpClassConst static var PARAM_BOOL:Int;
-	@:phpClassConst static var PARAM_NULL:Int;
-	@:phpClassConst static var PARAM_INT:Int;
-	@:phpClassConst static var PARAM_STR:Int;
-	@:phpClassConst static var PARAM_LOB:Int;
-	@:phpClassConst static var PARAM_STMT:Int;
-	@:phpClassConst static var PARAM_INPUT_OUTPUT:Int;
-	@:phpClassConst static var FETCH_LAZY:Int;
-	@:phpClassConst static var FETCH_ASSOC:Int;
-	@:phpClassConst static var FETCH_NAMED:Int;
-	@:phpClassConst static var FETCH_NUM:Int;
-	@:phpClassConst static var FETCH_BOTH:Int;
-	@:phpClassConst static var FETCH_OBJ:Int;
-	@:phpClassConst static var FETCH_BOUND:Int;
-	@:phpClassConst static var FETCH_COLUMN:Int;
-	@:phpClassConst static var FETCH_CLASS:Int;
-	@:phpClassConst static var FETCH_INTO:Int;
-	@:phpClassConst static var FETCH_FUNC:Int;
-	@:phpClassConst static var FETCH_GROUP:Int;
-	@:phpClassConst static var FETCH_UNIQUE:Int;
-	@:phpClassConst static var FETCH_KEY_PAIR:Int;
-	@:phpClassConst static var FETCH_CLASSTYPE:Int;
-	@:phpClassConst static var FETCH_SERIALIZE:Int;
-	@:phpClassConst static var FETCH_PROPS_LATE:Int;
-	@:phpClassConst static var ATTR_AUTOCOMMIT:Int;
-	@:phpClassConst static var ATTR_PREFETCH:Int;
-	@:phpClassConst static var ATTR_TIMEOUT:Int;
-	@:phpClassConst static var ATTR_ERRMODE:Int;
-	@:phpClassConst static var ATTR_SERVER_VERSION:Int;
-	@:phpClassConst static var ATTR_CLIENT_VERSION:Int;
-	@:phpClassConst static var ATTR_SERVER_INFO:Int;
-	@:phpClassConst static var ATTR_CONNECTION_STATUS:Int;
-	@:phpClassConst static var ATTR_CASE:Int;
-	@:phpClassConst static var ATTR_CURSOR_NAME:Int;
-	@:phpClassConst static var ATTR_CURSOR:Int;
-	@:phpClassConst static var ATTR_DRIVER_NAME:String;
-	@:phpClassConst static var ATTR_ORACLE_NULLS:Int;
-	@:phpClassConst static var ATTR_PERSISTENT:Int;
-	@:phpClassConst static var ATTR_STATEMENT_CLASS:Int;
-	@:phpClassConst static var ATTR_FETCH_TABLE_NAMES:Int;
-	@:phpClassConst static var ATTR_STRINGIFY_FETCHES:Int;
-	@:phpClassConst static var ATTR_EMULATE_PREPARES:Int;
-	@:phpClassConst static var ERRMODE_SILENT:Int;
-	@:phpClassConst static var ERRMODE_WARNING:Int;
-	@:phpClassConst static var ERRMODE_EXCEPTION:Int;
-	@:phpClassConst static var CASE_NATURAL:Int;
-	@:phpClassConst static var CASE_LOWER:Int;
-	@:phpClassConst static var CASE_UPPER:Int;
-	@:phpClassConst static var NULL_NATURAL:Int;
-	@:phpClassConst static var FETCH_ORI_PRIOR:Int;
-	@:phpClassConst static var FETCH_ORI_FIRST:Int;
-	@:phpClassConst static var FETCH_ORI_LAST:Int;
-	@:phpClassConst static var FETCH_ORI_ABS:Int;
-	@:phpClassConst static var FETCH_ORI_REL:Int;
-	@:phpClassConst static var CURSOR_FWDONLY:Int;
-	@:phpClassConst static var CURSOR_SCROLL:Int;
-	@:phpClassConst static var ERR_NONE:String;
-	@:phpClassConst static var PARAM_EVT_ALLOC:Int;
-	@:phpClassConst static var PARAM_EVT_FREE:Int;
-	@:phpClassConst static var PARAM_EVT_EXEC_PRE:Int;
-	@:phpClassConst static var PARAM_EVT_EXEC_POST:Int;
-	@:phpClassConst static var PARAM_EVT_FETCH_PRE:Int;
-	@:phpClassConst static var PARAM_EVT_FETCH_POST:Int;
-	@:phpClassConst static var PARAM_EVT_NORMALIZE:Int;
+	@:phpClassConst static final PARAM_BOOL:Int;
+	@:phpClassConst static final PARAM_NULL:Int;
+	@:phpClassConst static final PARAM_INT:Int;
+	@:phpClassConst static final PARAM_STR:Int;
+	@:phpClassConst static final PARAM_LOB:Int;
+	@:phpClassConst static final PARAM_STMT:Int;
+	@:phpClassConst static final PARAM_INPUT_OUTPUT:Int;
+	@:phpClassConst static final FETCH_LAZY:Int;
+	@:phpClassConst static final FETCH_ASSOC:Int;
+	@:phpClassConst static final FETCH_NAMED:Int;
+	@:phpClassConst static final FETCH_NUM:Int;
+	@:phpClassConst static final FETCH_BOTH:Int;
+	@:phpClassConst static final FETCH_OBJ:Int;
+	@:phpClassConst static final FETCH_BOUND:Int;
+	@:phpClassConst static final FETCH_COLUMN:Int;
+	@:phpClassConst static final FETCH_CLASS:Int;
+	@:phpClassConst static final FETCH_INTO:Int;
+	@:phpClassConst static final FETCH_FUNC:Int;
+	@:phpClassConst static final FETCH_GROUP:Int;
+	@:phpClassConst static final FETCH_UNIQUE:Int;
+	@:phpClassConst static final FETCH_KEY_PAIR:Int;
+	@:phpClassConst static final FETCH_CLASSTYPE:Int;
+	@:phpClassConst static final FETCH_SERIALIZE:Int;
+	@:phpClassConst static final FETCH_PROPS_LATE:Int;
+	@:phpClassConst static final ATTR_AUTOCOMMIT:Int;
+	@:phpClassConst static final ATTR_PREFETCH:Int;
+	@:phpClassConst static final ATTR_TIMEOUT:Int;
+	@:phpClassConst static final ATTR_ERRMODE:Int;
+	@:phpClassConst static final ATTR_SERVER_VERSION:Int;
+	@:phpClassConst static final ATTR_CLIENT_VERSION:Int;
+	@:phpClassConst static final ATTR_SERVER_INFO:Int;
+	@:phpClassConst static final ATTR_CONNECTION_STATUS:Int;
+	@:phpClassConst static final ATTR_CASE:Int;
+	@:phpClassConst static final ATTR_CURSOR_NAME:Int;
+	@:phpClassConst static final ATTR_CURSOR:Int;
+	@:phpClassConst static final ATTR_DRIVER_NAME:String;
+	@:phpClassConst static final ATTR_ORACLE_NULLS:Int;
+	@:phpClassConst static final ATTR_PERSISTENT:Int;
+	@:phpClassConst static final ATTR_STATEMENT_CLASS:Int;
+	@:phpClassConst static final ATTR_FETCH_TABLE_NAMES:Int;
+	@:phpClassConst static final ATTR_STRINGIFY_FETCHES:Int;
+	@:phpClassConst static final ATTR_EMULATE_PREPARES:Int;
+	@:phpClassConst static final ERRMODE_SILENT:Int;
+	@:phpClassConst static final ERRMODE_WARNING:Int;
+	@:phpClassConst static final ERRMODE_EXCEPTION:Int;
+	@:phpClassConst static final CASE_NATURAL:Int;
+	@:phpClassConst static final CASE_LOWER:Int;
+	@:phpClassConst static final CASE_UPPER:Int;
+	@:phpClassConst static final NULL_NATURAL:Int;
+	@:phpClassConst static final FETCH_ORI_PRIOR:Int;
+	@:phpClassConst static final FETCH_ORI_FIRST:Int;
+	@:phpClassConst static final FETCH_ORI_LAST:Int;
+	@:phpClassConst static final FETCH_ORI_ABS:Int;
+	@:phpClassConst static final FETCH_ORI_REL:Int;
+	@:phpClassConst static final CURSOR_FWDONLY:Int;
+	@:phpClassConst static final CURSOR_SCROLL:Int;
+	@:phpClassConst static final ERR_NONE:String;
+	@:phpClassConst static final PARAM_EVT_ALLOC:Int;
+	@:phpClassConst static final PARAM_EVT_FREE:Int;
+	@:phpClassConst static final PARAM_EVT_EXEC_PRE:Int;
+	@:phpClassConst static final PARAM_EVT_EXEC_POST:Int;
+	@:phpClassConst static final PARAM_EVT_FETCH_PRE:Int;
+	@:phpClassConst static final PARAM_EVT_FETCH_POST:Int;
+	@:phpClassConst static final PARAM_EVT_NORMALIZE:Int;
 
 	function new(dns:String, ?username:String, ?password:String, ?options:NativeArray):Void;
 	function beginTransaction():Bool;

+ 3 - 3
std/php/reflection/ReflectionClass.hx

@@ -26,9 +26,9 @@ import haxe.extern.Rest;
 
 @:native('ReflectionClass')
 extern class ReflectionClass implements Reflector {
-	@:phpClassConst static var IS_IMPLICIT_ABSTRACT:Int;
-	@:phpClassConst static var IS_EXPLICIT_ABSTRACT:Int;
-	@:phpClassConst static var IS_FINAL:Int;
+	@:phpClassConst static final IS_IMPLICIT_ABSTRACT:Int;
+	@:phpClassConst static final IS_EXPLICIT_ABSTRACT:Int;
+	@:phpClassConst static final IS_FINAL:Int;
 
 	static function export(argument:Dynamic, returnValue:Bool = false):String;
 

+ 6 - 6
std/php/reflection/ReflectionMethod.hx

@@ -27,12 +27,12 @@ import haxe.extern.Rest;
 
 @:native('ReflectionMethod')
 extern class ReflectionMethod extends ReflectionFunctionAbstract {
-	@:phpClassConst static var IS_STATIC:Int;
-	@:phpClassConst static var IS_PUBLIC:Int;
-	@:phpClassConst static var IS_PROTECTED:Int;
-	@:phpClassConst static var IS_PRIVATE:Int;
-	@:phpClassConst static var IS_ABSTRACT:Int;
-	@:phpClassConst static var IS_FINAL:Int;
+	@:phpClassConst static final IS_STATIC:Int;
+	@:phpClassConst static final IS_PUBLIC:Int;
+	@:phpClassConst static final IS_PROTECTED:Int;
+	@:phpClassConst static final IS_PRIVATE:Int;
+	@:phpClassConst static final IS_ABSTRACT:Int;
+	@:phpClassConst static final IS_FINAL:Int;
 
 	// public var class : String;
 	public static function export(className:String, name:String, ?returnValue:Bool):String;

+ 4 - 4
std/php/reflection/ReflectionProperty.hx

@@ -24,10 +24,10 @@ package php.reflection;
 
 @:native('ReflectionProperty')
 extern class ReflectionProperty implements Reflector {
-	@:phpClassConst static var IS_STATIC:Int;
-	@:phpClassConst static var IS_:Int;
-	@:phpClassConst static var IS_PROTECTED:Int;
-	@:phpClassConst static var IS_PRIVATE:Int;
+	@:phpClassConst static final IS_STATIC:Int;
+	@:phpClassConst static final IS_:Int;
+	@:phpClassConst static final IS_PROTECTED:Int;
+	@:phpClassConst static final IS_PRIVATE:Int;
 
 	var name:String;
 

+ 1 - 0
tests/Brewfile

@@ -7,3 +7,4 @@ brew "pcre"
 brew "awscli"
 brew "cmake"
 brew "pkg-config"
+brew "libuv"

+ 1 - 1
tests/misc/projects/Issue7526/compile-fail.hxml.stderr

@@ -1,4 +1,4 @@
 Main.hx:16: characters 9-29 : Class<C> should be { member : Int }
 Main.hx:16: characters 9-29 : The field member is not public
-Main.hx:17: characters 9-29 : Class<_Main.A_Impl_> should be { member : Int }
+Main.hx:17: characters 9-29 : Abstract<A> should be { member : Int }
 Main.hx:17: characters 9-29 : The field member is not public

+ 7 - 0
tests/misc/projects/Issue8819/Main.hx

@@ -0,0 +1,7 @@
+class Main {
+	static function main() {
+		Type.allEnums(Foo);
+	}
+}
+
+enum abstract Foo(String) {}

+ 1 - 0
tests/misc/projects/Issue8819/compile-fail.hxml

@@ -0,0 +1 @@
+-main Main

+ 2 - 0
tests/misc/projects/Issue8819/compile-fail.hxml.stderr

@@ -0,0 +1,2 @@
+Main.hx:3: characters 17-20 : Abstract<Foo> should be Enum<Unknown<0>>
+Main.hx:3: characters 17-20 : For function argument 'e'