We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e476fe8 + 4de8096 commit ccb7b13Copy full SHA for ccb7b13
compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -70,7 +70,9 @@ trait TypeAssigner {
70
parent
71
}
72
73
- def close(tp: Type) = RecType.closeOver(rt => tp.substThis(cls, rt.recThis))
+ def close(tp: Type) = RecType.closeOver { rt =>
74
+ tp.subst(cls :: Nil, rt.recThis :: Nil).substThis(cls, rt.recThis)
75
+ }
76
77
def isRefinable(sym: Symbol) = !sym.is(Private) && !sym.isConstructor
78
val refinableDecls = info.decls.filter(isRefinable)
tests/pos/i7067.scala
@@ -0,0 +1,13 @@
1
+abstract class Foo[T] {
2
+ type Species
3
+ def foo(s: Species): Nothing = ???
4
+}
5
+
6
+class Test {
7
+def species[T] = {
8
+ class FooT extends Foo[T] {
9
+ type Species = FooT
10
11
+ new FooT()
12
13
0 commit comments