Skip to content

Commit

Permalink
Merge pull request scala#4708 from dotty-staging/fix-merge-issue
Browse files Browse the repository at this point in the history
Use new Tasty context format
  • Loading branch information
allanrenucci authored Jun 23, 2018
2 parents c225b1a + 0e6f756 commit 42698ae
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/run/tasty-getfile/Macro_1.scala
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
}

}

0 comments on commit 42698ae

Please sign in to comment.