@@ -142,9 +142,9 @@ object desugar {
142
142
// val getter = ValDef(mods, name, tpt, rhs) withPos vdef.pos?
143
143
// right now vdef maps via expandedTree to a thicket which concerns itself.
144
144
// I don't see a problem with that but if there is one we can avoid it by making a copy here.
145
- val setterParam = makeSyntheticParameter(tpt = (new SetterParamTree ).watching(vdef))
145
+ val setterParam = makeSyntheticParameter(tpt = (new SetterParamTree ).watching(vdef)).withSpan(vdef.span)
146
146
// The rhs gets filled in later, when field is generated and getter has parameters (see Memoize miniphase)
147
- val setterRhs = if (vdef.rhs.isEmpty) EmptyTree else unitLiteral
147
+ val setterRhs = if (vdef.rhs.isEmpty) EmptyTree else unitLiteral.withSpan(vdef.rhs.span)
148
148
val setter = cpy.DefDef (vdef)(
149
149
name = name.setterName,
150
150
tparams = Nil ,
@@ -500,7 +500,7 @@ object desugar {
500
500
} :+ defaultCase
501
501
val body = Match (paramRef, patternMatchCases)
502
502
DefDef (nme.productElementName, Nil , List (List (methodParam)), javaDotLangDot(tpnme.String ), body)
503
- .withFlags(if (defn.isNewCollections) Override | Synthetic else Synthetic )
503
+ .withFlags(if (defn.isNewCollections) Override | Synthetic else Synthetic ).withSpan(cdef.span)
504
504
}
505
505
506
506
if (isCaseClass)
@@ -514,7 +514,7 @@ object desugar {
514
514
if (isEnumCase && parents.isEmpty)
515
515
parents1 = enumClassTypeRef :: Nil
516
516
if (isCaseClass | isCaseObject)
517
- parents1 = parents1 :+ scalaDot(str.Product .toTypeName)
517
+ parents1 = parents1 :+ scalaDot(str.Product .toTypeName).withSpan(cdef.span)
518
518
if (isEnum)
519
519
parents1 = parents1 :+ ref(defn.EnumType )
520
520
@@ -719,7 +719,7 @@ object desugar {
719
719
.withSpan(impl.self.span.orElse(impl.span.startPos))
720
720
val clsTmpl = cpy.Template (impl)(self = clsSelf, body = impl.body)
721
721
val cls = TypeDef (clsName, clsTmpl)
722
- .withMods(mods.toTypeFlags & RetainedModuleClassFlags | ModuleClassCreationFlags )
722
+ .withMods(mods.toTypeFlags & RetainedModuleClassFlags | ModuleClassCreationFlags ).withSpan(mdef.span)
723
723
Thicket (modul, classDef(cls).withSpan(mdef.span))
724
724
}
725
725
}
@@ -830,7 +830,7 @@ object desugar {
830
830
val caseDef = CaseDef (pat, EmptyTree , makeTuple(ids))
831
831
val matchExpr =
832
832
if (forallResults(rhs, isMatchingTuple)) rhs
833
- else Match (rhsUnchecked, caseDef :: Nil )
833
+ else Match (rhsUnchecked, caseDef :: Nil ).withSpan(original.span)
834
834
vars match {
835
835
case Nil =>
836
836
matchExpr
0 commit comments