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 b7eae6a commit da66029Copy full SHA for da66029
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