class compiler::Coercer
sys::Obj compiler::CompilerSupport compiler::Coercer
Coercer handles all the logic for type casts
- box
-
Ensure the specified expression is boxed to an object reference.
- canCoerce
-
Bool canCoerce(Expr expr, CType expected)
Return if
coerce
would not report a compiler error. - coerce
-
Expr coerce(Expr expr, CType expected, |->Void| onErr)
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)
Run the standard coerce method and ensure the result is boxed.
- doCoerce
-
Expr doCoerce(Expr expr, CType expected, |->Void| onErr)
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)
Constructor