From 474b35ff0160c1174674757895e93818dc4f2f19 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 17 Mar 2014 18:06:58 +0100 Subject: Fix of t1123 - Unit discarding Need to do unit discarding also in selection prototypes. --- src/dotty/tools/dotc/typer/ProtoTypes.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala') 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 -- cgit v1.2.3