File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
compiler/src/dotty/tools/dotc/ast
tests/pos-custom-args/qualified-types Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,11 @@ object desugar {
213213 def valDef (vdef0 : ValDef )(using Context ): Tree =
214214 val vdef @ ValDef (_, tpt, rhs) = vdef0
215215 val valName = normalizeName(vdef, tpt).asTermName
216- val tpt1 = desugarQualifiedTypes(tpt, valName)
216+ val tpt1 =
217+ if Feature .qualifiedTypesEnabled then
218+ desugarQualifiedTypes(tpt, valName)
219+ else
220+ tpt
217221 var mods1 = vdef.mods
218222
219223 val vdef1 = cpy.ValDef (vdef)(name = valName, tpt = tpt1).withMods(mods1)
@@ -747,7 +751,11 @@ object desugar {
747751 report.error(CaseClassMissingNonImplicitParamList (cdef), namePos)
748752 ListOfNil
749753 }
750- else originalVparamss.nestedMap(toMethParam(_, KeepAnnotations .All , keepDefault = true ))
754+ else
755+ originalVparamss.nestedMap: param =>
756+ val methParam = toMethParam(param, KeepAnnotations .All , keepDefault = true )
757+ valDef(methParam).asInstanceOf [ValDef ] // desugar early to handle qualified types
758+
751759 val derivedTparams =
752760 constrTparams.zipWithConserve(impliedTparams)((tparam, impliedParam) =>
753761 derivedTypeParam(tparam).withAnnotations(impliedParam.mods.annotations))
Original file line number Diff line number Diff line change 1- /* class foo(elem: Int with elem > 0)*/
1+ class foo (elem : Int with elem > 0 )
2+
3+ class Multi (x : Int with x > 0 )(y : String with y.length > 2 , z : Double with z >= 0.0 )
4+
5+ case class MultiCase (x : Int with x > 0 )(val y : String with y.length > 2 , val z : Double with z >= 0.0 )
26
37@ main def Test = ()
You can’t perform that action at this time.
0 commit comments