-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:metaprogramming:reflectionIssues related to the quotes reflection APIIssues related to the quotes reflection API
Milestone
Description
Compiler version
3.3.1-RC1-bin-20230216-2507577-NIGHTLY
Minimized example
import scala.quoted.*
inline def test = ${ testImpl }
def testImpl(using Quotes) =
import quotes.reflect.*
PolyType(List("arg"))(_ => List(TypeBounds.empty), _ => TypeRepr.of[Any]) match
case _: TypeLambda => println("is a TypeLambda")
case _ => println("is not a TypeLambda")
'{ () }Output
When expanding, the macro prints is a TypeLambda
Expectation
The documentation shows the type hierarchy:
+
+- LambdaType -+- MethodOrPoly -+- MethodType
| | +- PolyType
| +- TypeLambda
+
Based on this, I would expect the output to be is not a TypeLambda. Of course, it could be that the run time type of what PolyType generates is a subtype of both PolyType and TypeLambda, but given the documentation I find this behavior at least unexpected. I suppose that the type test and the documentation should be aligned.
Metadata
Metadata
Assignees
Labels
area:metaprogramming:reflectionIssues related to the quotes reflection APIIssues related to the quotes reflection API