Skip to content

Commit 1c644d7

Browse files
committed
Fix BeanProperties positions
1 parent 6d5ccbb commit 1c644d7

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

compiler/src/dotty/tools/dotc/transform/BeanProperties.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class BeanProperties(thisPhase: DenotTransformer):
3939
}
4040
meth.addAnnotations(annots)
4141
val body: Tree = ref(valDef.symbol)
42-
DefDef(meth, body)
42+
DefDef(meth, body).withSpan(meth.span)
4343

4444
def maybeGenerateSetter(valDef: ValDef, annot: Annotation)(using Context): Option[Tree] =
4545
Option.when(valDef.denot.asSymDenotation.flags.is(Mutable)) {
@@ -55,7 +55,7 @@ class BeanProperties(thisPhase: DenotTransformer):
5555
a.hasOneOfMetaAnnotation(defn.BeanSetterMetaAnnot) | !a.hasOneOfMetaAnnotation(defn.BeanGetterMetaAnnot)
5656
}
5757
meth.addAnnotations(annots)
58-
DefDef(meth, (params: List[List[Tree]]) => Assign(ref(valDef.symbol), params.head.head))
58+
DefDef(meth, (params: List[List[Tree]]) => Assign(ref(valDef.symbol), params.head.head)).withSpan(meth.span)
5959
}
6060

6161
def prefixedName(prefix: String, valName: Name) =

compiler/src/dotty/tools/dotc/transform/Pickler.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package dotty.tools.dotc
1+
package dotty.tools
2+
package dotc
23
package transform
34

45
import core._
@@ -147,6 +148,7 @@ class Pickler extends Phase {
147148
if unequal then
148149
output("before-pickling.txt", previous)
149150
output("after-pickling.txt", unpickled)
151+
//sys.process.Process("diff -u before-pickling.txt after-pickling.txt").!
150152
report.error(em"""pickling difference for $cls in ${cls.source}, for details:
151153
|
152154
| diff before-pickling.txt after-pickling.txt""")

compiler/src/dotty/tools/dotc/util/Spans.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ object Spans {
182182
assert(isSpan)
183183
if (this == NoCoord) NoSpan else Span(-1 - encoding)
184184
}
185+
override def toString = if isSpan then s"$toSpan" else s"Coord(idx=$toIndex)"
185186
}
186187

187188
/** An index coordinate */

0 commit comments

Comments
 (0)