Skip to content

Commit 5ccf540

Browse files
committed
1 parent 4e4b042 commit 5ccf540

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

project/DottyBuild.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ trait DottyBuild { this: BuildCommons =>
2828
.settings(
2929
projectTitle := "Scalactic",
3030
organization := "com.sandinh",
31+
version := "3.1.1-dottybug8581",
3132
moduleName := "scalactic",
3233
initialCommands in console := "import org.scalactic._",
3334
sourceGenerators in Compile += {

scalactic.dotty/src/main/scala/org/scalactic/source/Position.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ object Position {
6969
private def genPosition(implicit qctx: QuoteContext): Expr[Position] = {
7070
import qctx.tasty._
7171

72-
val file = rootPosition.sourceFile
72+
val rootPos = rootPosition
73+
val file = rootPos.sourceFile
7374
val fileName: String = file.jpath.getFileName.toString
7475
val filePath: String = if (showScalacticFillFilePathnames) file.toString else Resources.pleaseDefineScalacticFillFilePathnameEnvVar
75-
val lineNo: Int = rootPosition.startLine
76+
// https://github.com/lampepfl/dotty/issues/8581
77+
val lineNo: Int = if (rootPos.exists) rootPos.startLine else -1
7678
'{ Position(${Expr(fileName)}, ${Expr(filePath)}, ${Expr(lineNo)}) }
7779
}
7880

0 commit comments

Comments
 (0)