Skip to content

Commit da66029

Browse files
authored
add support for ToExpr[Class[_]]
1 parent b7eae6a commit da66029

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/src/scala/quoted/ToExpr.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ object ToExpr {
8181
}
8282

8383
/** Default implemetation of `ToExpr[Class[T]]` */
84-
given ClassToExpr[T]: ToExpr[Class[T]] with {
85-
def apply(x: Class[T])(using Quotes) = {
84+
given ClassToExpr[T <: Class[_]]: ToExpr[T] with {
85+
def apply(x: T)(using Quotes) = {
8686
import quotes.reflect._
87-
Ref(defn.Predef_classOf).appliedToType(TypeRepr.typeConstructorOf(x)).asExpr.asInstanceOf[Expr[Class[T]]]
87+
Ref(defn.Predef_classOf).appliedToType(TypeRepr.typeConstructorOf(x)).asExpr.asInstanceOf[Expr[T]]
8888
}
8989
}
9090

0 commit comments

Comments
 (0)