Dotty Documentation

0.14.0-bin-SNAPSHOT

object ConstFold
extends Object with Serializable

[-] Constructors

[-] Members

[+] def apply ( tree: T ) ( implicit ctx: Context ) : T

If tree is a constant operation, replace with result.

[+] def apply ( tree: T , pt: Type ) ( implicit ctx: Context ) : T

If tree is a constant value that can be converted to type pt, perform the conversion.

[+] @Body @forceInline private inline def finish ( tree: T ) ( compX: => Constant ) ( implicit ctx: Context ) : T
[+] private def foldBinop ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldBooleanOp ( op: Name , x: Constant , y: Constant ) : Constant

These are local helpers to keep foldBinop from overly taxing the optimizer.

[+] private def foldDoubleOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldFloatOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldLongOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldSubrangeOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldUnop ( op: Name , x: Constant ) : Constant