import scala.quoted._

import scala.tasty.Universe

object SourceFiles {

  implicit inline def getThisFile: String =
    ~getThisFileImpl(Universe.compilationUniverse) // FIXME infer Universe.compilationUniverse within top level ~

  private def getThisFileImpl(implicit u: Universe): Expr[String] = {
    import u.tasty._
    u.context.source.getFileName.toString.toExpr
  }

}

import scala.quoted._
import scala.tasty.{Tasty, TopLevelSplice}

object SourceFiles {

  implicit inline def getThisFile: String =
    ~getThisFileImpl(TopLevelSplice.tastyContext) // FIXME infer TopLevelSplice.tastyContext within top level ~

  private def getThisFileImpl(implicit tasty: Tasty): Expr[String] = {
    import tasty._
    rootContext.source.getFileName.toString.toExpr
  }

}

Use new Tasty context format
Use new Tasty context format
