aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ProtoTypes.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-17 18:06:58 +0100
committerTobias Schlatter <tobias@meisch.ch>2014-03-21 11:28:30 +0100
commit474b35ff0160c1174674757895e93818dc4f2f19 (patch)
tree59116d59f88ca74cacea68de71b58043a15ee03d /src/dotty/tools/dotc/typer/ProtoTypes.scala
parent0a1ec31c2a17c5dd0e6bd363979cbf17a8860616 (diff)
downloaddotty-474b35ff0160c1174674757895e93818dc4f2f19.tar.gz
dotty-474b35ff0160c1174674757895e93818dc4f2f19.tar.bz2
dotty-474b35ff0160c1174674757895e93818dc4f2f19.zip
Fix of t1123 - Unit discarding
Need to do unit discarding also in selection prototypes.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala4
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