Closed
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.