UnaryOp

dotty.tools.sjs.ir.Trees.UnaryOp
See theUnaryOp companion object
sealed case class UnaryOp(op: Code, lhs: Tree)(implicit pos: Position) extends Tree

Unary operation.

All unary operations follow common evaluation steps:

  1. Let lhsValue be the result of evaluating lhs.
  2. Perform an operation that depends on op and lhsValue.

The Class_x operations take a jl.Class! argument, i.e., a non-nullable jl.Class.

Likewise, Array_length, GetClass, Clone and UnwrapFromThrowable take arguments of non-nullable types.

CheckNotNull throws NPEs subject to UB.

Throw always throws, obviously.

Clone and WrapAsThrowable are side-effect-free but not pure.

Otherwise, unary operations preserve pureness.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Tree
class IRNode
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def show: String

Attributes

Inherited from:
IRNode

Concrete fields

val tpe: Type

Implicits

Implicits

implicit val pos: Position