We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 266ee03 commit e8b9aeaCopy full SHA for e8b9aea
library/src/scala/quoted/ToExpr.scala
@@ -81,10 +81,10 @@ object ToExpr {
81
}
82
83
/** Default implemetation of `ToExpr[Class[T]]` */
84
- given ClassToExpr[T]: ToExpr[Class[T]] with {
85
- def apply(x: Class[T])(using Quotes) = {
+ given ClassToExpr[T <: Class[_]]: ToExpr[T] with {
+ def apply(x: T)(using Quotes) = {
86
import quotes.reflect._
87
- Ref(defn.Predef_classOf).appliedToType(TypeRepr.typeConstructorOf(x)).asExpr.asInstanceOf[Expr[Class[T]]]
+ Ref(defn.Predef_classOf).appliedToType(TypeRepr.typeConstructorOf(x)).asExpr.asInstanceOf[Expr[T]]
88
89
90
0 commit comments