Instance Constructors
-
new
SimplifyNullChecks(equalityBehavior: EqualityBehavior)
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
-
-
def
apply(ast: Ast): Ast
-
-
-
-
-
-
-
-
-
-
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Due to the introduction of null checks in
Now, let's add a
This of course is highly redundant and can be reduced to simply:
This reduction is done by the "Center Rule." There are some other simplification rules as well. Note how we are force to null-check both
map
,flatMap
, andexists
, inFlattenOptionOperation
in order to resolve #1053, as well as to support non-ansi compliant string concatenation as outlined in #1295, large conditional composites became common. For example:getOrElse
statement to the clause that requires an additional wrapped null check. We cannot rely on there being amap
call beforehand since we could be readingvalue
as a nullable field directly from the database).h.value
as well as(h.value || 'foo')
because a user may useOption[T].flatMap
and explicitly transform a particular value tonull
.