Browse Source

test for #8283 (closes #8283)

Aleksandr Kuzmenko 6 years ago
parent
commit
828f7ff711

+ 16 - 0
tests/misc/projects/Issue8283/Main.hx

@@ -0,0 +1,16 @@
+abstract Future<T>(Dynamic) {
+  @:from static inline function ofAny<T>(v:T):Future<T>
+    return null;
+}
+
+typedef FutureAlias<T> = Future<T>;
+
+class Main {
+  static function main() req([1, '{"baz":"baz"}']);
+  static public function req(?arr, ?body:Source) {}
+}
+
+abstract Source(Int) from Int to Int {
+  @:from static function ofFuture(f:FutureAlias<Source>):Source
+    return null;
+}

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

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

+ 4 - 0
tests/misc/projects/Issue8283/compile-fail.hxml.stderr

@@ -0,0 +1,4 @@
+Main.hx:9: characters 35-48 : Arrays of mixed types are only allowed if the type is forced to Array<Dynamic>
+Main.hx:9: characters 35-48 : Arrays of mixed types are only allowed if the type is forced to Array<Dynamic>
+Main.hx:9: characters 35-48 : String should be Int
+Main.hx:9: characters 35-48 : For optional function argument 'arr'