forked from dotty-staging/dotty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#4708 from dotty-staging/fix-merge-issue
Use new Tasty context format
- Loading branch information
Showing
1 changed file
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import scala.quoted._ | ||
|
||
import scala.tasty.Universe | ||
import scala.tasty.{Tasty, TopLevelSplice} | ||
|
||
object SourceFiles { | ||
|
||
implicit inline def getThisFile: String = | ||
~getThisFileImpl(Universe.compilationUniverse) // FIXME infer Universe.compilationUniverse within top level ~ | ||
~getThisFileImpl(TopLevelSplice.tastyContext) // FIXME infer TopLevelSplice.tastyContext within top level ~ | ||
|
||
private def getThisFileImpl(implicit u: Universe): Expr[String] = { | ||
import u.tasty._ | ||
u.context.source.getFileName.toString.toExpr | ||
private def getThisFileImpl(implicit tasty: Tasty): Expr[String] = { | ||
import tasty._ | ||
rootContext.source.getFileName.toString.toExpr | ||
} | ||
|
||
} |