File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -724,7 +724,6 @@ object SpaceEngine {
724
724
&& cls.isOneOf(AbstractOrTrait ) // ignore sealed non-abstract classes
725
725
&& ! cls.hasAnonymousChild // can't name anonymous classes as counter-examples
726
726
&& cls.children.nonEmpty // can't decompose without children
727
- && ! sym.isOpaqueAlias // can't instantiate subclasses to conform to an opaque type (i19275)
728
727
729
728
val ListOfNoType = List (NoType )
730
729
val ListOfTypNoType = ListOfNoType .map(Typ (_, decomposed = true ))
Original file line number Diff line number Diff line change
1
+ opaque type R [T ] <: T = T
2
+
3
+ object Test {
4
+ enum E :
5
+ case A (a : Int )
6
+
7
+ val v : R [E ] = ???
8
+ v match
9
+ case E .A (_) =>
10
+ }
11
+
12
+ sealed trait Foo
13
+
14
+ case class FooA () extends Foo
15
+ case class FooB () extends Foo
16
+
17
+ object O {
18
+ opaque type OpaqueFoo <: Foo = Foo
19
+ def fooB (): OpaqueFoo = FooB ()
20
+ }
21
+
22
+ @ main def main =
23
+ val p : O .OpaqueFoo = O .fooB()
24
+
25
+ p match
26
+ case _ : FooA => println(" fooA" )
27
+ case _ : FooB => println(" fooB" )
You can’t perform that action at this time.
0 commit comments