File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -348,14 +348,14 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
348
348
def initValue (tpe : Types .Type )(implicit ctx : Context ) = {
349
349
val tpw = tpe.widen
350
350
351
- if (tpw =:= defn.IntType ) Literal (Constant (0 ))
352
- else if (tpw =:= defn.LongType ) Literal (Constant (0L ))
353
- else if (tpw =:= defn.BooleanType ) Literal (Constant (false ))
354
- else if (tpw =:= defn.CharType ) Literal (Constant ('\u0000 ' ))
355
- else if (tpw =:= defn.FloatType ) Literal (Constant (0f ))
356
- else if (tpw =:= defn.DoubleType ) Literal (Constant (0d ))
357
- else if (tpw =:= defn.ByteType ) Literal (Constant (0 .toByte))
358
- else if (tpw =:= defn.ShortType ) Literal (Constant (0 .toShort))
351
+ if (tpw isRef defn.IntClass ) Literal (Constant (0 ))
352
+ else if (tpw isRef defn.LongClass ) Literal (Constant (0L ))
353
+ else if (tpw isRef defn.BooleanClass ) Literal (Constant (false ))
354
+ else if (tpw isRef defn.CharClass ) Literal (Constant ('\u0000 ' ))
355
+ else if (tpw isRef defn.FloatClass ) Literal (Constant (0f ))
356
+ else if (tpw isRef defn.DoubleClass ) Literal (Constant (0d ))
357
+ else if (tpw isRef defn.ByteClass ) Literal (Constant (0 .toByte))
358
+ else if (tpw isRef defn.ShortClass ) Literal (Constant (0 .toShort))
359
359
else Literal (Constant (null )).select(defn.Any_asInstanceOf ).appliedToType(tpe)
360
360
}
361
361
Original file line number Diff line number Diff line change @@ -88,14 +88,14 @@ class LazyValTranformContext {
88
88
val tpe = x.tpe.widen
89
89
90
90
val holderType =
91
- if (tpe =:= defn.IntType ) " LazyInt"
92
- else if (tpe =:= defn.LongType ) " LazyLong"
93
- else if (tpe =:= defn.BooleanType ) " LazyBoolean"
94
- else if (tpe =:= defn.FloatType ) " LazyFloat"
95
- else if (tpe =:= defn.DoubleType ) " LazyDouble"
96
- else if (tpe =:= defn.ByteType ) " LazyByte"
97
- else if (tpe =:= defn.CharType ) " LazyChar"
98
- else if (tpe =:= defn.ShortType ) " LazyShort"
91
+ if (tpe isRef defn.IntClass ) " LazyInt"
92
+ else if (tpe isRef defn.LongClass ) " LazyLong"
93
+ else if (tpe isRef defn.BooleanClass ) " LazyBoolean"
94
+ else if (tpe isRef defn.FloatClass ) " LazyFloat"
95
+ else if (tpe isRef defn.DoubleClass ) " LazyDouble"
96
+ else if (tpe isRef defn.ByteClass ) " LazyByte"
97
+ else if (tpe isRef defn.CharClass ) " LazyChar"
98
+ else if (tpe isRef defn.ShortClass ) " LazyShort"
99
99
else " LazyRef"
100
100
101
101
val holderImpl = ctx.requiredClass(" dotty.runtime." + holderType)
You can’t perform that action at this time.
0 commit comments