File tree 1 file changed +5
-7
lines changed
compiler/src/dotty/tools/dotc/transform/patmat 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -733,12 +733,10 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
733
733
}
734
734
735
735
def checkable (tree : Match ): Boolean = {
736
- def isCheckable (tp : Type ): Boolean = tp match {
737
- case AnnotatedType (tp, annot) =>
738
- (ctx.definitions.UncheckedAnnot != annot.symbol) && isCheckable(tp)
739
- case _ =>
740
- // Possible to check everything, but be compatible with scalac by default
741
- ctx.settings.YcheckAllPatmat .value ||
736
+ // Possible to check everything, but be compatible with scalac by default
737
+ def isCheckable (tp : Type ): Boolean =
738
+ ! tp.hasAnnotation(defn.UncheckedAnnot ) && (
739
+ ctx.settings.YcheckAllPatmat .value ||
742
740
tp.typeSymbol.is(Sealed ) ||
743
741
tp.isInstanceOf [OrType ] ||
744
742
(tp.isInstanceOf [AndType ] && {
@@ -749,7 +747,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
749
747
tp.typeSymbol.is(Enum ) ||
750
748
canDecompose(tp) ||
751
749
(defn.isTupleType(tp) && tp.dealias.argInfos.exists(isCheckable(_)))
752
- }
750
+ )
753
751
754
752
val Match (sel, cases) = tree
755
753
val res = isCheckable(sel.tpe.widen.dealiasKeepAnnots)
You can’t perform that action at this time.
0 commit comments