Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Commit a99e88d

Browse files
committed
Add position range check before accessing TypeTree.pos
1 parent d09cab8 commit a99e88d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

org.scala-refactoring.library/src/main/scala/scala/tools/refactoring/sourcegen/ReusingPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ trait ReusingPrinter extends TreePrintingTraversals with AbstractPrinter {
980980

981981
def existsTptInFile = tpt match {
982982
case tpt: TypeTree =>
983-
val textInFile = betweenStartAndEnd(tpt).asText
984-
textInFile == tpt.toString() || textInFile == tpt.original.toString()
983+
lazy val textInFile = betweenStartAndEnd(tpt).asText
984+
tpt.pos.isRange && (textInFile == tpt.toString() || textInFile == tpt.original.toString())
985985
case _ => false
986986
}
987987

0 commit comments

Comments
 (0)