diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/TypeAssigner.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/TypeAssigner.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala index 3247592c3..ba8d44110 100644 --- a/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -62,9 +62,10 @@ trait TypeAssigner { case info: ClassInfo if variance > 0 => val parentType = info.instantiatedParents.reduceLeft(ctx.typeComparer.andType(_, _)) def addRefinement(parent: Type, decl: Symbol) = { - val inherited = parentType.findMember(decl.name, info.cls.thisType, Private) - val inheritedInfo = inherited.atSignature(decl.info.signature).info - // @smarter atSignature probably wrong now; we are now missing out on types that refine the result type + val inherited = + parentType.findMember(decl.name, info.cls.thisType, Private) + .suchThat(decl.matches(_)) + val inheritedInfo = inherited.info if (inheritedInfo.exists && decl.info <:< inheritedInfo && !(inheritedInfo <:< decl.info)) typr.echo( i"add ref $parent $decl --> ", |