class compiler::Coercer

sys::Obj
  compiler::CompilerSupport
    compiler::Coercer

Source

Coercer handles all the logic for type casts

box

Expr box(Expr expr)

Source

Ensure the specified expression is boxed to an object reference.

canCoerce

Bool canCoerce(Expr expr, CType expected)

Source

Return if coerce would not report a compiler error.

coerce

Expr coerce(Expr expr, CType expected, |->Void| onErr)

Source

Coerce the target expression to the specified type. If the expression is not type compatible run the onErr function.

coerceBoxed

Expr coerceBoxed(Expr expr, CType expected, |->Void| onErr)

Source

Run the standard coerce method and ensure the result is boxed.

doCoerce

Expr doCoerce(Expr expr, CType expected, |->Void| onErr)

Source

Coerce the target expression to the specified type. If the expression is not type compatible run the onErr function. Default Fantom behavior (no FFI checks).

make

new make(Compiler c)

Source

Constructor