failing test for pattern matching on patterns

This commit is contained in:
Dmitry Jemerov
2011-05-19 16:12:58 +02:00
parent 92a3e9275c
commit cd96508c63
2 changed files with 11 additions and 0 deletions
@@ -0,0 +1,4 @@
fun isString(x: Any) = when(x) {
is String => "string"
else => "something"
}
@@ -34,4 +34,11 @@ public class PatternMatchingTest extends CodegenTestCase {
}
assertTrue(caught);
}
public void _testPattern() throws Exception {
loadFile();
Method foo = generateFunction();
assertEquals("string", foo.invoke(null, ""));
assertEquals("something", foo.invoke(null, new Object()));
}
}