diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/ProtoTypes.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala index 74be3f4cd..16fcc9db7 100644 --- a/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -79,7 +79,9 @@ object ProtoTypes { override def isMatchedBy(tp1: Type)(implicit ctx: Context) = { name == nme.WILDCARD || { val mbr = tp1.member(name) - def qualifies(m: SingleDenotation) = compat.normalizedCompatible(m.info, memberProto) + def qualifies(m: SingleDenotation) = + memberProto.isRef(defn.UnitClass) || + compat.normalizedCompatible(m.info, memberProto) mbr match { // hasAltWith inlined for performance case mbr: SingleDenotation => mbr.exists && qualifies(mbr) case _ => mbr hasAltWith qualifies |