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

import org.objectweb.asm.Type;

public class NullExpr extends TerminalExpression {

    private static final Type OBJECT_TYPE = Type.getType(Object.class);

    @Override
    public boolean isConstant() {
        return true;
    }

    // null can be any object
    @Override
    public Type expressionType() {
        return OBJECT_TYPE;
    }
}

@@ -43,16 +43,143 @@
 .expr;%0A%0A
+import me.august.lumen.compile.codegen.BuildContext;%0Aimport org.objectweb.asm.MethodVisitor;%0Aimport org.objectweb.asm.Opcodes;%0A
 import o
@@ -515,11 +515,152 @@
 E;%0A    %7D
+%0A%0A    @Override%0A    public void generate(MethodVisitor visitor, BuildContext context) %7B%0A        visitor.visitInsn(Opcodes.ACONST_NULL);%0A    %7D
 %0A%7D%0A

Add codegen for NullExpr