File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -3441,19 +3441,20 @@ object Types {
34413441 val tp2w = tp2.widenSingletons
34423442 if ((tp1 eq tp1w) && (tp2 eq tp2w)) this else TypeComparer .lub(tp1w, tp2w, isSoft = isSoft)
34433443
3444- private def ensureAtomsComputed ()(using Context ): Unit =
3444+ private def ensureAtomsComputed ()(using Context ): Boolean =
34453445 if atomsRunId != ctx.runId && ! isProvisional then
34463446 myAtoms = computeAtoms()
34473447 myWidened = computeWidenSingletons()
34483448 atomsRunId = ctx.runId
3449+ true
3450+ else
3451+ false
34493452
34503453 override def atoms (using Context ): Atoms =
3451- ensureAtomsComputed()
3452- if isProvisional then computeAtoms() else myAtoms
3454+ if ensureAtomsComputed() then myAtoms else computeAtoms()
34533455
34543456 override def widenSingletons (using Context ): Type =
3455- ensureAtomsComputed()
3456- if isProvisional then computeWidenSingletons() else myWidened
3457+ if ensureAtomsComputed() then myWidened else computeWidenSingletons()
34573458
34583459 def derivedOrType (tp1 : Type , tp2 : Type , soft : Boolean = isSoft)(using Context ): Type =
34593460 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