File tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/transform/patmat 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,11 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
417
417
case tp @ AppliedType (tycon, args) =>
418
418
if (tycon.isRef(defn.ArrayClass )) tp.derivedAppliedType(tycon, args.map(erase))
419
419
else {
420
- val ignoreWarning = args.forall(p => p.typeSymbol.is(BindDefinedType ) || p.isInstanceOf [TypeBounds ])
420
+ val ignoreWarning = args.forall { p =>
421
+ p.typeSymbol.is(BindDefinedType ) ||
422
+ p.hasAnnotation(defn.UncheckedAnnot ) ||
423
+ p.isInstanceOf [TypeBounds ]
424
+ }
421
425
if (! ignoreWarning)
422
426
warn(" type arguments are not checked since they are eliminated by erasure" )
423
427
Original file line number Diff line number Diff line change 1
1
class Test {
2
2
def f (x : Any ): Int = x match {
3
3
case xs : List [Int ] @ unchecked => xs.head
4
+ case xs : List [Int @ unchecked] => xs.head
5
+ case xs : Array [List [Int ]] => 3
4
6
case _ => 0
5
7
}
6
8
}
You can’t perform that action at this time.
0 commit comments