Dotty Documentation


class BubbleUpNothing
extends Object with Optimisation

If a block has a statement that evaluates to Nothing: - Every pure statement dirrectly preceding an expression that returns Nothing can be removed, - as every statement after an expression that returns Nothing can be removed

If an If condition evalutates to Nothing, the entire If can be replaced by condition If an argument evaluates to Nothing, the entire call can be replaced by evaluation of arguments.

This optimisation makes it rather tricky to write meaningful examples since the compiler will often be able to reduce them to a single main method with body = ???.

[-] Constructors

BubbleUpNothing ( )

[-] Members

[+] object Notathing
[+] def clear ( ) : Unit

Clears all the state of this optimisation, to be run last.

[+] def notathing ( t: Tree ) ( implicit ctx: Context ) : Boolean
[+] def transformer ( implicit ctx: Context ) : Tree => Tree

Does the actual Tree => Tree transformation.

[+] def visitor ( implicit ctx: Context ) : Tree => Unit

Gathers information on trees (using mutation), to be run first.