Browse Source

Add tests for #5953 (#8399)

Rudy Ges 6 năm trước cách đây
mục cha
commit
708e873eab

+ 17 - 0
tests/misc/projects/Issue5953/Main.hx

@@ -0,0 +1,17 @@
+class Main {
+	static function main() {
+		var map = foo(null);
+		trace(map);
+	}
+
+	static function foo(m:NativeStringMap<String>)
+		return m.toMap();
+}
+
+abstract NativeStringMap<V>(Impl<V>) {
+	@:to public function toMap():Map<String, V> {
+		return new Map();
+	}
+}
+
+typedef Impl<V> = cs.system.collections.generic.IDictionary_2<String, V>;

+ 10 - 0
tests/misc/projects/Issue5953/Reduced.hx

@@ -0,0 +1,10 @@
+@:nativeGen
+class C<T> {}
+
+class C2<T> {}
+
+abstract A<T>(C<T>) {
+	function f():C2<T> return null;
+
+	static function foo(a:A<String>) return a.f();
+}

+ 3 - 0
tests/misc/projects/Issue5953/compile.hxml

@@ -0,0 +1,3 @@
+-main Main
+Reduced
+-cs bin