diff options
author | odersky <odersky@gmail.com> | 2017-04-13 12:28:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 12:28:17 +0200 |
commit | 6b041ee7b5df98a84c3fbf31b8392fe77152529d (patch) | |
tree | ac7856bb41ae216d5aa2972d3e26b02badc9292f /compiler/src/dotty/tools/dotc/core/TypeOps.scala | |
parent | b8ed254e38480eb8892eccd897d525d977d9e6a7 (diff) | |
parent | aaff621f552e6824db4f7c1d73d9e8941e088d96 (diff) | |
download | dotty-6b041ee7b5df98a84c3fbf31b8392fe77152529d.tar.gz dotty-6b041ee7b5df98a84c3fbf31b8392fe77152529d.tar.bz2 dotty-6b041ee7b5df98a84c3fbf31b8392fe77152529d.zip |
Merge pull request #2209 from dotty-staging/fix-#2152
Fix #2152: Instantiate dependent result type parameters
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeOps.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index 9593bfe93..4a1c3d044 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -7,6 +7,7 @@ import SymDenotations._, Denotations.SingleDenotation import config.Printers.typr import util.Positions._ import NameOps._ +import NameKinds.DepParamName import Decorators._ import StdNames._ import Annotations._ @@ -158,7 +159,11 @@ trait TypeOps { this: Context => // TODO: Make standalone object. case tp1 => tp1 } case tp: TypeParamRef => - typerState.constraint.typeVarOfParam(tp) orElse tp + if (tp.paramName.is(DepParamName)) { + val bounds = ctx.typeComparer.bounds(tp) + if (bounds.lo.isRef(defn.NothingClass)) bounds.hi else bounds.lo + } + else typerState.constraint.typeVarOfParam(tp) orElse tp case _: ThisType | _: BoundType | NoPrefix => tp case tp: RefinedType => |