dotty.tools.sjs.ir.Trees.BinaryOp
See theBinaryOp companion object
Binary operation.
All binary operations follow common evaluation steps:
- Let
lhsValue
be the result of evaluatinglhs
. - Let
rhsValue
be the result of evaluatingrhs
. - Perform an operation that depends on
op
,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.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Treetrait TreeOrJSSpreadclass IRNodeclass Objecttrait Matchableclass Any
Members list
In this article