Skip to content

Commit 70e390e

Browse files
committed
Fix tests
1 parent b3cff8b commit 70e390e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ class Typer extends Namer
13961396

13971397
// skip exhaustivity check in later phase
13981398
// TODO: move the check above to patternMatcher phase
1399-
val uncheckedTpe = AnnotatedType(sel.tpe, Annotation(defn.UncheckedAnnot))
1399+
val uncheckedTpe = AnnotatedType(sel.tpe.widen, Annotation(defn.UncheckedAnnot))
14001400
tpd.cpy.Match(result)(
14011401
selector = tpd.Typed(sel, tpd.TypeTree(uncheckedTpe)),
14021402
cases = result.cases

tests/run/unchecked-patterns.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object Test extends App {
22
val x: Int = 2: @unchecked
3-
val (y1: Some[Int]) = Some(1): Option[Int]: @unchecked
3+
val (y1: Some[Int]) = Some(1): Option[Int] @unchecked
44

55
val a :: as = List(1, 2, 3): @unchecked
66
val lst @ b :: bs = List(1, 2, 3): @unchecked

0 commit comments

Comments
 (0)