package me.august.lumen.compile.parser.ast.expr;

import me.august.lumen.compile.codegen.BuildContext;
import me.august.lumen.compile.parser.ast.Typed;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

// NOTE: unlike most other expressions, this expression type
// has the *same* precedence as RelExpr. They have been separated
// for ease of use.
public class InstanceofExpr extends Typed implements Expression {

    private Expression value;

    public InstanceofExpr(Expression value, String simpleType) {
        super(simpleType);
        this.value = value;
    }

    @Override
    public void generate(MethodVisitor visitor, BuildContext context) {
        value.generate(visitor, context);

        visitor.visitTypeInsn(Opcodes.INSTANCEOF, getResolvedType().getInternalName());
    }

    @Override
    public Expression[] getChildren() {
        return new Expression[]{value};
    }
}

@@ -218,16 +218,47 @@
 Opcodes;
+%0Aimport org.objectweb.asm.Type;
 %0A%0A// NOT
@@ -839,32 +839,122 @@
 Name());%0A    %7D%0A%0A
+    @Override%0A    public Type expressionType() %7B%0A        return Type.BOOLEAN_TYPE;%0A    %7D%0A%0A
     @Override%0A  

Add expressionType() to InstanceofExpr