Class CastInstrAsmGenerator

java.lang.Object
org.ek9lang.compiler.backend.jvm.AbstractAsmGenerator
org.ek9lang.compiler.backend.jvm.CastInstrAsmGenerator
All Implemented Interfaces:
Consumer<CastInstr>

final class CastInstrAsmGenerator extends AbstractAsmGenerator implements Consumer<CastInstr>
Specialized ASM generator for CastInstr processing.

Generates JVM CHECKCAST instruction for explicit type casting. Used in Scenario 2 wrappers where delegate method returns Any but wrapper method returns a more specific type.

  • Constructor Details

  • Method Details

    • accept

      public void accept(CastInstr castInstr)
      Generate JVM bytecode for a cast instruction.

      Loads the source value, applies CHECKCAST to target type, and stores result.

      Specified by:
      accept in interface Consumer<CastInstr>