Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add reflect defn.FunctionClass overloads" #18473

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2811,10 +2811,6 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
if isErased then
throw new Exception("Erased function classes are not supported. Use a refined `scala.runtime.ErasedFunction`")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new Exception("Erased function classes are not supported. Use a refined `scala.runtime.ErasedFunction`")
throw new Exception("Erased function classes are not supported anymore.")

They should not be using this in 3.3 at all.

else dotc.core.Symbols.defn.FunctionSymbol(arity, isImplicit)
def FunctionClass(arity: Int): Symbol =
FunctionClass(arity, false, false)
def FunctionClass(arity: Int, isContextual: Boolean): Symbol =
FunctionClass(arity, isContextual, false)
def ErasedFunctionClass = dotc.core.Symbols.defn.ErasedFunctionClass
def TupleClass(arity: Int): Symbol =
dotc.core.Symbols.defn.TupleType(arity).nn.classSymbol.asClass
Expand Down
19 changes: 0 additions & 19 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4295,27 +4295,8 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* - ...
* - Nth element is `FunctionN`
*/
// TODO: deprecate in 3.4 and stabilize FunctionClass(Int)/FunctionClass(Int,Boolean)
// @deprecated("Use overload of `FunctionClass` with 1 or 2 arguments","3.4")
def FunctionClass(arity: Int, isImplicit: Boolean = false, isErased: Boolean = false): Symbol

/** Class symbol of a function class `scala.FunctionN`.
*
* @param arity the arity of the function where `0 <= arity`
* @return class symbol of `scala.FunctionN` where `N == arity`
*/
@experimental
def FunctionClass(arity: Int): Symbol

/** Class symbol of a context function class `scala.FunctionN` or `scala.ContextFunctionN`.
*
* @param arity the arity of the function where `0 <= arity`
* @param isContextual if it is a `scala.ContextFunctionN`
* @return class symbol of `scala.FunctionN` or `scala.ContextFunctionN` where `N == arity`
*/
@experimental
def FunctionClass(arity: Int, isContextual: Boolean): Symbol

/** The `scala.runtime.ErasedFunction` built-in trait. */
@experimental
def ErasedFunctionClass: Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ val experimentalDefinitionInLibrary = Set(
"scala.annotation.MacroAnnotation",

//// New APIs: Quotes
// Should be stabilized in 3.4.0
"scala.quoted.Quotes.reflectModule.defnModule.FunctionClass",
"scala.quoted.Quotes.reflectModule.FlagsModule.AbsOverride",
// Can be stabilized in 3.4.0 (unsure) or later
"scala.quoted.Quotes.reflectModule.CompilationInfoModule.XmacroSettings",
Expand Down
26 changes: 0 additions & 26 deletions tests/run-macros/tasty-definitions-1.check
Original file line number Diff line number Diff line change
Expand Up @@ -57,57 +57,31 @@ Function23
Function24
Function25
ContextFunction0
ContextFunction0
ContextFunction1
ContextFunction1
ContextFunction2
ContextFunction2
ContextFunction3
ContextFunction3
ContextFunction4
ContextFunction4
ContextFunction5
ContextFunction5
ContextFunction6
ContextFunction6
ContextFunction7
ContextFunction7
ContextFunction8
ContextFunction8
ContextFunction9
ContextFunction9
ContextFunction10
ContextFunction10
ContextFunction11
ContextFunction11
ContextFunction12
ContextFunction12
ContextFunction13
ContextFunction13
ContextFunction14
ContextFunction14
ContextFunction15
ContextFunction15
ContextFunction16
ContextFunction16
ContextFunction17
ContextFunction17
ContextFunction18
ContextFunction18
ContextFunction19
ContextFunction19
ContextFunction20
ContextFunction20
ContextFunction21
ContextFunction21
ContextFunction22
ContextFunction22
ContextFunction23
ContextFunction23
ContextFunction24
ContextFunction24
ContextFunction25
ContextFunction25
class java.lang.Exception: Erased function classes are not supported. Use a refined `scala.runtime.ErasedFunction`
ErasedFunction
Tuple2
Expand Down
1 change: 0 additions & 1 deletion tests/run-macros/tasty-definitions-1/quoted_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ object Macros {
printout(defn.FunctionClass(i).name)

for (i <- 0 to 25)
printout(defn.FunctionClass(i, isContextual = true).name)
printout(defn.FunctionClass(i, isImplicit = true).name)

// should fail
Expand Down
Loading