Ver código fonte

[java/cs] Add test. Closes #4203

Cauê Waneck 9 anos atrás
pai
commit
4d4a72235b
1 arquivos alterados com 29 adições e 0 exclusões
  1. 29 0
      tests/unit/src/unit/issues/Issue4203.hx

+ 29 - 0
tests/unit/src/unit/issues/Issue4203.hx

@@ -0,0 +1,29 @@
+package unit.issues;
+
+class Issue4203 extends Test {
+	public function test() {
+#if !cpp
+		var val = new Thing1(true);
+		eq(val.getIt(), true);
+		t(val.getIt());
+#end
+	}
+}
+
+#if !cpp
+@:nativeGen
+private interface NativeItem<T> {
+    public function getIt() : T;
+}
+
+private class Thing1 implements NativeItem<Bool> {
+    var value: Bool;
+    public function new(value) {
+        this.value = value;
+    }
+
+    public function getIt() : Bool {
+        return value;
+    }
+}
+#end