File tree 3 files changed +27
-5
lines changed
compiler/src/dotty/tools/dotc/core
3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -3441,19 +3441,20 @@ object Types {
3441
3441
val tp2w = tp2.widenSingletons
3442
3442
if ((tp1 eq tp1w) && (tp2 eq tp2w)) this else TypeComparer .lub(tp1w, tp2w, isSoft = isSoft)
3443
3443
3444
- private def ensureAtomsComputed ()(using Context ): Unit =
3444
+ private def ensureAtomsComputed ()(using Context ): Boolean =
3445
3445
if atomsRunId != ctx.runId && ! isProvisional then
3446
3446
myAtoms = computeAtoms()
3447
3447
myWidened = computeWidenSingletons()
3448
3448
atomsRunId = ctx.runId
3449
+ true
3450
+ else
3451
+ false
3449
3452
3450
3453
override def atoms (using Context ): Atoms =
3451
- ensureAtomsComputed()
3452
- if isProvisional then computeAtoms() else myAtoms
3454
+ if ensureAtomsComputed() then myAtoms else computeAtoms()
3453
3455
3454
3456
override def widenSingletons (using Context ): Type =
3455
- ensureAtomsComputed()
3456
- if isProvisional then computeWidenSingletons() else myWidened
3457
+ if ensureAtomsComputed() then myWidened else computeWidenSingletons()
3457
3458
3458
3459
def derivedOrType (tp1 : Type , tp2 : Type , soft : Boolean = isSoft)(using Context ): Type =
3459
3460
if ((tp1 eq this .tp1) && (tp2 eq this .tp2) && soft == isSoft) this
Original file line number Diff line number Diff line change
1
+ // defs_1.scala
2
+ import java .time .*
3
+
4
+ type Temporal =
5
+ java.sql.Date |
6
+ LocalDateTime | LocalDate | LocalTime |
7
+ Instant
8
+
9
+ given Conversion [String | Temporal , JsValue ] = ???
10
+
11
+ sealed trait JsValue
12
+ case class JsObject (value : Map [String , JsValue ])
13
+
14
+ object Json {
15
+ def obj (fields : Tuple2 [String , JsValue | Option [JsValue ]]* ): JsObject = ???
16
+ }
17
+
Original file line number Diff line number Diff line change
1
+ // usage_2.scala
2
+ class Bug {
3
+ def searchJson = Json .obj(" foo" -> " bar" )
4
+ }
You can’t perform that action at this time.
0 commit comments