File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -673,7 +673,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
673
673
if ctx.mode.is(Mode .Pattern )
674
674
&& ! tree.isType
675
675
&& ! pt.isInstanceOf [ApplyingProto ]
676
- && ! tree.tpe.isStable
676
+ && ! tree.tpe.match
677
+ case tp : NamedType => tp.denot.hasAltWith(_.symbol.isStableMember && tp.prefix.isStable || tp.info.isStable)
678
+ case tp => tp.isStable
677
679
&& ! isWildcardArg(tree)
678
680
then
679
681
report.error(StableIdentPattern (tree, pt), tree.srcPos)
Original file line number Diff line number Diff line change
1
+ sealed trait Op
2
+ object Op {
3
+ case object `==` extends Op
4
+ }
5
+
6
+ def t1 (a : Op ): true = {
7
+ a match {
8
+ case Op .`==` => true // was: won't compile
9
+ }
10
+ }
You can’t perform that action at this time.
0 commit comments