sealed case class BinaryOp(op: Code, lhs: Tree, rhs: Tree)(implicit pos: Position) extends Tree with Product with Serializable
Binary operation.
All binary operations follow common evaluation steps:
- Let
lhsValue
be the result of evaluatinglhs
. 2. LetrhsValue
be the result of evaluatingrhs
. 3. Perform an operation that depends onop
,lhsValue
andrhsValue
.
Unless lhsValue
throws, rhsValue
will therefore always be evaluated,
even if the operation op
would throw based only on lhsValue
.
The integer dividing operators (Int_/
, Int_%
, Long_/
and Long_%
)
throw an ArithmeticException
when their right-hand-side is 0. That
exception is not subject to undefined behavior.
String_charAt
throws a StringIndexOutOfBoundsException
.
The Class_x
operations take a jl.Class!
as lhs, i.e., a
non-nullable jl.Class
. Class_isAssignableFrom
also takes a
jl.Class!
as rhs.
Class_isInstance
andClass_isAssignableFrom
are pure.Class_cast
throws a CCE if its second argument is non-null and not an instance of the class represented by its first argument.Class_newArray
throws aNegativeArraySizeException
if its second argument is negative and anIllegalArgumentException
if its first argument isclassOf[Unit]
.
Otherwise, binary operations preserve pureness.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- BinaryOp
- Serializable
- Serializable
- Product
- Equals
- Tree
- TreeOrJSSpread
- IRNode
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val lhs: Tree
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val op: Code
- implicit val pos: Position
- val rhs: Tree
-
def
show: String
- Definition Classes
- IRNode
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val tpe: Type
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()