don't forget to put receiver on stack when calling extension functions

This commit is contained in:
Dmitry Jemerov
2011-05-27 18:11:42 +04:00
parent ff6fcabd00
commit 6dfa8ca8c6
5 changed files with 52 additions and 21 deletions
@@ -2,7 +2,6 @@ package org.jetbrains.jet.codegen;
import jet.NoPatternMatchedException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
@@ -25,14 +24,7 @@ public class PatternMatchingTest extends CodegenTestCase {
loadFile();
Method foo = generateFunction();
assertTrue((Boolean) foo.invoke(null, 0));
boolean caught = false;
try {
foo.invoke(null, 1);
}
catch(InvocationTargetException ex) {
caught = ex.getTargetException() instanceof NoPatternMatchedException;
}
assertTrue(caught);
assertThrows(foo, NoPatternMatchedException.class, null, 1);
}
public void testPattern() throws Exception {