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 a4f0d35 + 58379db commit c101ce9Copy full SHA for c101ce9
compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -465,7 +465,8 @@ trait TypeAssigner {
465
def addRefinement(parent: Type, refinement: Tree): Type = {
466
val rsym = refinement.symbol
467
val rinfo = if (rsym is Accessor) rsym.info.resultType else rsym.info
468
- RefinedType(parent, rsym.name, rinfo)
+ if (rinfo.isError) rinfo
469
+ else RefinedType(parent, rsym.name, rinfo)
470
}
471
val refined = (parent.tpe /: refinements)(addRefinement)
472
tree.withType(RecType.closeOver(rt => refined.substThis(refineCls, RecThis(rt))))
tests/neg/i2533.scala
@@ -0,0 +1,3 @@
1
+object Foo {
2
+ def test(f: { type A = A }): Int = ??? // error
3
+}
0 commit comments