File tree 2 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -854,7 +854,7 @@ object TypeOps:
854
854
855
855
val getAbstractSymbols = new TypeAccumulator [List [Symbol ]]:
856
856
def apply (xs : List [Symbol ], tp : Type ) = tp.dealias match
857
- case tp : TypeRef if ! tp.symbol.isClass => foldOver(tp.symbol :: xs, tp)
857
+ case tp : TypeRef if tp.symbol.exists && ! tp.symbol.isClass => foldOver(tp.symbol :: xs, tp)
858
858
case tp => foldOver(xs, tp)
859
859
val syms2 = getAbstractSymbols(Nil , tp2).reverse
860
860
if syms2.nonEmpty then ctx.gadt.addToConstraint(syms2)
Original file line number Diff line number Diff line change
1
+ // scalac: -Werror
2
+ sealed trait T
3
+ class C extends T
4
+
5
+ class AClass
6
+ type AType = AClass {
7
+ type TypeMember <: T
8
+ }
9
+
10
+ def list2Product (
11
+ atype : AType ,
12
+ opt : atype.TypeMember
13
+ ): Unit =
14
+ opt match {
15
+ case _ : C => ()
16
+ }
You can’t perform that action at this time.
0 commit comments