diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-18 15:18:19 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-18 15:18:19 +0100 |
commit | ea06d6618f63339fec0af8ca6835a3f34a100d0f (patch) | |
tree | 049d0deba496172146edd358da5aa5c5fa4e2458 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | b60f085e543e71577e0132b938facd0b6d544e81 (diff) | |
download | dotty-ea06d6618f63339fec0af8ca6835a3f34a100d0f.tar.gz dotty-ea06d6618f63339fec0af8ca6835a3f34a100d0f.tar.bz2 dotty-ea06d6618f63339fec0af8ca6835a3f34a100d0f.zip |
Check that overriding members refine the types of overridden ones.
Somehow this was lost in porting (or was this done somewhere else
in scalac?).
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 5ed0ebfb2..236bdb7f4 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -240,20 +240,8 @@ object Denotations { val sym1 = denot1.symbol val sym2 = denot2.symbol val sym2Accessible = sym2.isAccessibleFrom(pre) - def resultType(tp: Type) = tp match { - case tp @ MethodType(Nil, _) => tp.resultType - case ExprType(rt) => rt - case _ => NoType - } - def isAsGood(tp1: Type, tp2: Type) = - tp1 <:< tp2 || { - val rtp1 = resultType(tp1) - val rtp2 = resultType(tp2) - rtp1 <:< rtp2 - } def prefer(info1: Type, sym1: Symbol, info2: Type, sym2: Symbol) = - isAsGood(info1, info2) && - (sym1.isAsConcrete(sym2) || !(info2 <:< info1)) + info1.overrides(info2) && (sym1.isAsConcrete(sym2) || !info2.overrides(info1)) if (sym2Accessible && prefer(info2, sym2, info1, sym1)) denot2 else { val sym1Accessible = sym1.isAccessibleFrom(pre) |