Browse Source

awkwardly test the merge thing again

Simon Krajewski 5 years ago
parent
commit
1fcb867d49
1 changed files with 8 additions and 5 deletions
  1. 8 5
      tests/unit/src/unit/TestConstrainedMonomorphs.hx

+ 8 - 5
tests/unit/src/unit/TestConstrainedMonomorphs.hx

@@ -56,14 +56,17 @@ class TestConstrainedMonomorphs extends Test {
 	#end
 
 	static function merge<A:{}, B:{}, C:A & B>(a:A, b:B):C {
-		return null;
+		return cast {
+			foo: (cast a).foo,
+			bar: (cast b).bar
+		};
 	}
+
 	function testMergedConstraints() {
 		var a = merge({foo: 5}, {bar: "bar"});
-		#if todo
-		HelperMacros.typedAs(a, (null : { foo: Int, bar: String }));
-		#end
-		Assert.pass();
+		eq(5, a.foo);
+		eq("bar", a.bar);
+		t(HelperMacros.typeError(a.oh));
 	}
 
 	public static function returnC<C:{foo:Int}>():C {