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 1a1e8f6 commit f5d900eCopy full SHA for f5d900e
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2021,7 +2021,10 @@ class Typer extends Namer
2021
*/
2022
private def typedQuotePattern(quoted: untpd.Tree, pt: Type, quoteSpan: Span)(implicit ctx: Context): Tree = {
2023
val exprPt = pt.baseType(defn.QuotedExprClass)
2024
- val quotedPt = if (exprPt.exists) exprPt.argTypesHi.head else defn.AnyType
+ val quotedPt = exprPt.argInfos.headOption match {
2025
+ case Some(argPt: ValueType) => argPt // excludes TypeBounds
2026
+ case _ => defn.AnyType
2027
+ }
2028
val quoted0 = desugar.quotedPattern(quoted, untpd.TypedSplice(TypeTree(quotedPt)))
2029
val quoted1 = typedExpr(quoted0, WildcardType)(quoteContext.addMode(Mode.QuotedPattern))
2030
0 commit comments