dotty.tools.sjs.ir.Trees.BinaryOp
See theBinaryOp companion object
Binary operation.
All binary operations follow common evaluation steps:
- Let
lhsValuebe the result of evaluatinglhs. - Let
rhsValuebe the result of evaluatingrhs. - Perform an operation that depends on
op,lhsValueandrhsValue.
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_isInstanceandClass_isAssignableFromare pure.Class_castthrows a CCE if its second argument is non-null and not an instance of the class represented by its first argument.Class_newArraythrows aNegativeArraySizeExceptionif its second argument is negative and anIllegalArgumentExceptionif 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