File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ private[typer] final class PossiblyHoistedValue private (representation: tpd.Tre
50
50
51
51
/** Returns a tree representing the value of `self` along with its hoisted definition, if any. */
52
52
def valueAndDefinition (using Context ): (tpd.Tree , Option [tpd.ValDef ]) =
53
- definition
54
- .map(( d) => (tpd.Ident (d.namedType), Some (d) ))
55
- .getOrElse(( representation, None ) )
53
+ definition match
54
+ case Some ( d) => (tpd.Ident (d.namedType).withSpan(representation.span) , Some (d))
55
+ case _ => ( representation, None )
56
56
57
57
object PossiblyHoistedValue :
58
58
@@ -61,7 +61,7 @@ object PossiblyHoistedValue:
61
61
if isSingleAssignment || (tpd.exprPurity(e) >= TreeInfo .Pure ) then
62
62
new PossiblyHoistedValue (e)
63
63
else
64
- new PossiblyHoistedValue (tpd.SyntheticValDef (TempResultName .fresh(), e))
64
+ new PossiblyHoistedValue (tpd.SyntheticValDef (TempResultName .fresh(), e).withSpan(e.span) )
65
65
66
66
/** The left-hand side of an assignment. */
67
67
private [typer] sealed abstract class LValue :
You can’t perform that action at this time.
0 commit comments