@@ -27,23 +27,22 @@ object Nullables:
27
27
// We cannot check if hi is nullable, because it can cause cyclic reference.
28
28
29
29
/** Create a nullable type bound
30
- * If the lo is `Null`, `| Null` is added to hi
30
+ * If lo is `Null`, `| Null` is added to hi
31
31
*/
32
32
def createNullableTypeBounds (lo : Type , hi : Type )(using Context ): TypeBounds =
33
33
val newHi = if needNullifyHi(lo, hi) then OrType (hi, defn.NullType , soft = false ) else hi
34
34
TypeBounds (lo, newHi)
35
35
36
-
37
36
/** Create a nullable type bound tree
38
- * If the lo is `Null`, `| Null` is added to hi
37
+ * If lo is `Null`, `| Null` is added to hi
39
38
*/
40
39
def createNullableTypeBoundsTree (lo : Tree , hi : Tree , alias : Tree = EmptyTree )(using Context ): TypeBoundsTree =
41
40
val hiTpe = hi.typeOpt
42
41
val newHi = if needNullifyHi(lo.typeOpt, hiTpe) then TypeTree (OrType (hiTpe, defn.NullType , soft = false )) else hi
43
42
TypeBoundsTree (lo, newHi, alias)
44
43
45
44
/** Use unsafe nulls subtyping where `Null` is a subtype of all reference types */
46
- inline def useUnsafeNullsSubTypeIf [T ](cond : Boolean )(inline op : Context ?=> T )(using Context ): T =
45
+ inline def useUnsafeNullsSubTypeIf [T ](inline cond : Boolean )(inline op : Context ?=> T )(using Context ): T =
47
46
val c = if cond then ctx.addMode(Mode .UnsafeNullsSubType ) else ctx
48
47
op(using c)
49
48
0 commit comments