Skip to content

Commit

Permalink
Rename scala.compiletime.ErasedFunction => scala.runtime.ErasedFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukagami committed Feb 27, 2023
1 parent 41db4f5 commit 3fa0423
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ class Definitions {
lazy val PolyFunctionClass = requiredClass("scala.PolyFunction")
def PolyFunctionType = PolyFunctionClass.typeRef

lazy val ErasedFunctionClass = requiredClass("scala.compiletime.ErasedFunction")
lazy val ErasedFunctionClass = requiredClass("scala.runtime.ErasedFunction")

/** If `cls` is a class in the scala package, its name, otherwise EmptyTypeName */
def scalaClassName(cls: Symbol)(using Context): TypeName = cls.denot match
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2776,7 +2776,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
def FunctionClass(arity: Int, isImplicit: Boolean = false, isErased: Boolean = false): Symbol =
if arity < 0 then throw IllegalArgumentException(s"arity: $arity")
if isErased then
throw new Exception("Erased function classes are not supported. Use a refined `ErasedFunctionClass`")
throw new Exception("Erased function classes are not supported. Use a refined `scala.runtime.ErasedFunction`")
else dotc.core.Symbols.defn.FunctionSymbol(arity, isImplicit)
def FunctionClass(arity: Int): Symbol =
FunctionClass(arity, false, false)
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4294,7 +4294,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
@experimental
def FunctionClass(arity: Int, isContextual: Boolean): Symbol

/** The `ErasedFunction` built-in trait. */
/** The `scala.runtime.ErasedFunction` built-in trait. */
@experimental
def ErasedFunctionClass: Symbol

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scala.compiletime
package scala.runtime

import scala.annotation.experimental

Expand Down
2 changes: 1 addition & 1 deletion tests/run-custom-args/erased/erased-15.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scala.compiletime.ErasedFunction
import scala.runtime.ErasedFunction

object Test {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,15 @@ val experimentalDefinitionInLibrary = Set(
"scala.quoted.Quotes.reflectModule.SymbolModule.newModule",
"scala.quoted.Quotes.reflectModule.SymbolModule.freshName",
"scala.quoted.Quotes.reflectModule.SymbolMethods.info",
// Quotes for functions with erased parameters.

// New feature: functions with erased parameters.
// Need erasedDefinitions enabled.
"scala.runtime.ErasedFunction",
"scala.quoted.Quotes.reflectModule.MethodTypeMethods.erasedParams",
"scala.quoted.Quotes.reflectModule.MethodTypeMethods.hasErasedParams",
"scala.quoted.Quotes.reflectModule.TermParamClauseMethods.erasedArgs",
"scala.quoted.Quotes.reflectModule.TermParamClauseMethods.hasErasedArgs",
"scala.quoted.Quotes.reflectModule.defnModule.ErasedFunctionClass",

// New feature: functions with erased parameters.
// Need erasedDefinitions enabled.
"scala.compiletime.ErasedFunction"
"scala.quoted.Quotes.reflectModule.defnModule.ErasedFunctionClass"
)


Expand Down

0 comments on commit 3fa0423

Please sign in to comment.