File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1389,8 +1389,10 @@ class Typer extends Namer
13891389 def typedArg (arg : untpd.Tree , tparam : ParamInfo ) = {
13901390 def tparamBounds = tparam.paramInfoAsSeenFrom(tpt1.tpe.appliedTo(tparams.map(_ => TypeBounds .empty)))
13911391 val (desugaredArg, argPt) =
1392- if ( ctx.mode is Mode .Pattern )
1392+ if ctx.mode.is( Mode .Pattern ) then
13931393 (if (untpd.isVarPattern(arg)) desugar.patternVar(arg) else arg, tparamBounds)
1394+ else if ctx.mode.is(Mode .QuotedPattern ) then
1395+ (arg, tparamBounds)
13941396 else
13951397 (arg, WildcardType )
13961398 if (tpt1.symbol.isClass)
@@ -3030,7 +3032,7 @@ class Typer extends Namer
30303032 tree.tpe.EtaExpand (tp.typeParamSymbols)
30313033 tree.withType(tp1)
30323034 }
3033- if (( ctx.mode is Mode .Pattern ) || tree1.tpe <:< pt) tree1
3035+ if (ctx.mode.is( Mode .Pattern ) || ctx.mode.is( Mode . QuotedPattern ) || tree1.tpe <:< pt) tree1
30343036 else err.typeMismatch(tree1, pt)
30353037 }
30363038
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+ class Foo {
3+ def f [T2 : Type ](e : Expr [T2 ])(given QuoteContext ) = e match {
4+ case ' { $x : *: [Int , Any ] } => // error: Type argument Any does not conform to upper bound Tuple
5+
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments