aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala4
-rw-r--r--tests/pos/t1123.scala (renamed from tests/untried/pos/t1123.scala)2
2 files changed, 4 insertions, 2 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
diff --git a/tests/untried/pos/t1123.scala b/tests/pos/t1123.scala
index 3812fa3eb..e3a89c14a 100644
--- a/tests/untried/pos/t1123.scala
+++ b/tests/pos/t1123.scala
@@ -7,5 +7,5 @@ object Test {
}
def f = extraListener.h
}
- def main(args : Array[String]) : Unit = (new Editor).f
+ def main(args : Array[String]): Unit = (new Editor).f
}