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
1389
1389
def typedArg (arg : untpd.Tree , tparam : ParamInfo ) = {
1390
1390
def tparamBounds = tparam.paramInfoAsSeenFrom(tpt1.tpe.appliedTo(tparams.map(_ => TypeBounds .empty)))
1391
1391
val (desugaredArg, argPt) =
1392
- if ( ctx.mode is Mode .Pattern )
1392
+ if ctx.mode.is( Mode .Pattern ) then
1393
1393
(if (untpd.isVarPattern(arg)) desugar.patternVar(arg) else arg, tparamBounds)
1394
+ else if ctx.mode.is(Mode .QuotedPattern ) then
1395
+ (arg, tparamBounds)
1394
1396
else
1395
1397
(arg, WildcardType )
1396
1398
if (tpt1.symbol.isClass)
@@ -3030,7 +3032,7 @@ class Typer extends Namer
3030
3032
tree.tpe.EtaExpand (tp.typeParamSymbols)
3031
3033
tree.withType(tp1)
3032
3034
}
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
3034
3036
else err.typeMismatch(tree1, pt)
3035
3037
}
3036
3038
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