fix stupid bug introduced during refactoring

This commit is contained in:
Dmitry Jemerov
2011-05-30 15:46:57 +04:00
parent d4f0486139
commit d0f284fd5f
3 changed files with 12 additions and 1 deletions
@@ -1504,7 +1504,6 @@ public class ExpressionCodegen extends JetVisitor {
throw new UnsupportedOperationException("don't know how to handle non-class types in as/as?");
}
Type type = typeMapper.mapType(jetType, OwnerKind.INTERFACE);
gen(expression.getLeft(), OBJECT_TYPE);
generateInstanceOf(new Runnable() {
@Override
public void run() {
@@ -0,0 +1,7 @@
import java.io.*
fun main(args: Array<String>) {
val reader = new BufferedReader(new InputStreamReader(System.`in`))
while(true) {
val cmd = reader.readLine() as String
}
}
@@ -79,6 +79,11 @@ public class TypeInfoTest extends CodegenTestCase {
assertNull(foo.invoke(null));
}
public void testAsInLoop() throws Exception {
loadFile();
generateFunction(); // assert no exception
}
private Runnable newRunnable() {
return new Runnable() {
@Override