Skip to content

Commit add696a

Browse files
Merge pull request #10260 from dotty-staging/remove-tasty-loading-workarounds
Remove methods that detected wrong classes loaded
2 parents 4c055c4 + 0141c1d commit add696a

File tree

5 files changed

+1
-47
lines changed

5 files changed

+1
-47
lines changed

compiler/src/dotty/tools/dotc/fromtasty/JavaCompilationUnit.scala

Lines changed: 0 additions & 12 deletions
This file was deleted.

compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ class ReadTasty extends Phase {
4444
Some(unit)
4545
}
4646
case tree: Tree[?] =>
47+
// TODO handle correctly this case correctly to get the tree or avoid it completely.
4748
cls.denot.infoOrCompleter match {
48-
case _: NoLoader => Some(Scala2CompilationUnit(cls.fullName.toString))
49-
case _ if cls.flags.is(Flags.JavaDefined) => Some(JavaCompilationUnit(cls.fullName.toString))
5049
case _ => Some(AlreadyLoadedCompilationUnit(cls.denot.fullName.toString))
5150
}
5251
case _ =>

compiler/src/dotty/tools/dotc/fromtasty/Scala2CompilationUnit.scala

Lines changed: 0 additions & 13 deletions
This file was deleted.

compiler/src/dotty/tools/dotc/quoted/QuoteContextImpl.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,15 +2585,6 @@ class QuoteContextImpl private (ctx: Context) extends QuoteContext, scala.intern
25852585

25862586
object Source extends SourceModule:
25872587
def path: java.nio.file.Path = ctx.compilationUnit.source.file.jpath
2588-
def isJavaCompilationUnit: Boolean = ctx.compilationUnit.isInstanceOf[dotc.fromtasty.JavaCompilationUnit]
2589-
def isScala2CompilationUnit: Boolean = ctx.compilationUnit.isInstanceOf[dotc.fromtasty.Scala2CompilationUnit]
2590-
def isAlreadyLoadedCompilationUnit: Boolean = ctx.compilationUnit.isInstanceOf[dotc.fromtasty.AlreadyLoadedCompilationUnit]
2591-
def compilationUnitClassname: String =
2592-
ctx.compilationUnit match
2593-
case cu: dotc.fromtasty.JavaCompilationUnit => cu.className
2594-
case cu: dotc.fromtasty.Scala2CompilationUnit => cu.className
2595-
case cu: dotc.fromtasty.AlreadyLoadedCompilationUnit => cu.className
2596-
case cu => ""
25972588
end Source
25982589

25992590
object Reporting extends ReportingModule:

library/src/scala/tasty/Reflection.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,17 +3262,6 @@ trait Reflection { reflection =>
32623262
/** Returns the source file being compiled. The path is relative to the current working directory. */
32633263
def path: java.nio.file.Path
32643264

3265-
/** Returns true if we've tried to reflect on a Java class. */
3266-
def isJavaCompilationUnit: Boolean
3267-
3268-
/** Returns true if we've tried to reflect on a Scala2 (non-Tasty) class. */
3269-
def isScala2CompilationUnit: Boolean
3270-
3271-
/** Returns true if we've tried to reflect on a class that's already loaded (e.g. Option). */
3272-
def isAlreadyLoadedCompilationUnit: Boolean
3273-
3274-
/** Class name of the current CompilationUnit */
3275-
def compilationUnitClassname: String
32763265
}
32773266

32783267
///////////////

0 commit comments

Comments
 (0)