Dotty Documentation

0.4.0-bin-SNAPSHOT

class DropGoodCasts
extends Optimisation

Eliminated casts and equality tests whose results can be locally determined at compile time:

  • a.asInstanceOf[T] → a when we know that a: T
  • Simplify (a == null) and (a != null) when the result is statically known

[-] Constructors

DropGoodCasts ( )

[-] Members

[+] def clear ( ) : Unit

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

[+] def collectNullTests ( t: Tree ) ( implicit ctx: Context ) : List [ Symbol ]
[+] def collectTypeTests ( t: Tree ) ( implicit ctx: Context ) : List [ ( Symbol, Type ) ]
[+] 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.