Skip to content

Commit e152b56

Browse files
committed
Review feedback
- Test major TASTy version - strip margins of `s".."` - Cache `CompilationUnit` in `SymbolLoaders`
1 parent 2f36da4 commit e152b56

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class TastyLoader(val tastyFile: AbstractFile) extends SymbolLoader {
422422
val tastyBytes = tastyFile.toByteArray
423423
new tasty.DottyUnpickler(tastyBytes) // reads header and name table
424424

425-
def compilationUnitInfo: CompilationUnitInfo | Null =
425+
val compilationUnitInfo: CompilationUnitInfo | Null =
426426
val tastyHeader = unpickler.unpickler.header
427427
val tastyVersion = TastyVersion(
428428
tastyHeader.majorVersion,
@@ -453,10 +453,10 @@ class TastyLoader(val tastyFile: AbstractFile) extends SymbolLoader {
453453
val message = e match
454454
case e: UnpickleException =>
455455
s"""TASTy file ${tastyFile.canonicalPath} could not be read, failing with:
456-
| ${Option(e.getMessage).getOrElse("")}"""
456+
| ${Option(e.getMessage).getOrElse("")}""".stripMargin
457457
case _ =>
458458
s"""TASTy file ${tastyFile.canonicalPath} is broken, reading aborted with ${e.getClass}
459-
| ${Option(e.getMessage).getOrElse("")}"""
459+
| ${Option(e.getMessage).getOrElse("")}""".stripMargin
460460
throw IOException(message, e)
461461

462462

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ trait Checking {
10731073
case id @ Ident(name: Name) =>
10741074
def methCompiledBeforeDeprecation =
10751075
meth.tastyVersion match
1076-
case Some(version) => version.minor < 4 // compiled before 3.4
1076+
case Some(version) => version.major == 28 && version.minor < 4 // compiled before 3.4
10771077
case _ => false // compiled with the current compiler
10781078
name.toTermName match {
10791079
case name: SimpleName

0 commit comments

Comments
 (0)