failing test for pattern matching on patterns
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user