Browse Source

add tests (closes #2085) (closes #2902) (closes #3615)

Simon Krajewski 10 years ago
parent
commit
ee5c0bc831

+ 22 - 0
tests/unit/src/unit/issues/Issue2085.hx

@@ -0,0 +1,22 @@
+package unit.issues;
+
+private class Object extends Node<Object,Ar<Object>> { }
+
+@:generic
+private class Node<T,Array_t:Ar<T>> {
+    public var ar:Array_t;
+}
+
+@:generic
+private class Ar<T> {
+    public var nongen:Array<T>;
+    public function length():Void {
+        nongen.length;
+    }
+}
+
+class Issue2085 extends Test {
+	function test() {
+
+	}
+}

+ 26 - 0
tests/unit/src/unit/issues/Issue2902.hx

@@ -0,0 +1,26 @@
+package unit.issues;
+
+@:generic
+private class G<T> {
+	var t:T;
+	public function new(t:T) {
+		this.t = t;
+	}
+    public function f(){
+        haxe.Log;
+		return t;
+    }
+}
+
+private class G2 extends G<String> { }
+
+private class G1 extends G<Int> { }
+
+class Issue2902 extends Test {
+	function test() {
+		var g1 = new G1(12);
+		var g2 = new G2("foo");
+		eq(12, g1.f());
+		eq("foo", g2.f());
+	}
+}

+ 26 - 0
tests/unit/src/unit/issues/Issue3615.hx

@@ -0,0 +1,26 @@
+package unit.issues;
+
+@:generic
+private class BaseClass<T>
+{
+    public function new()
+    {
+        haxe.Log;
+    }
+}
+
+private class SubClassOne extends BaseClass<Int>
+{
+    public function new() { super(); haxe.Log; }
+}
+
+private class SubClassTwo extends BaseClass<String>
+{
+    public function new() { super(); haxe.Log; }
+}
+
+class Issue3615 extends Test {
+	function test() {
+
+	}
+}