aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorliu fengyun <liu@fengy.me>2017-04-13 15:03:13 +0200
committerGitHub <noreply@github.com>2017-04-13 15:03:13 +0200
commitfb4adc3c9c55476d2fe0deed22cff54e8e945406 (patch)
treeb7577f66688ed793a73ff543042a140e62cbe80d /compiler/src/dotty/tools/dotc/core/TypeOps.scala
parentcf37737f56db7bc2f7429f78328dc5eea1716356 (diff)
parentde6461ab17562dbb46a1ff094590e051d03cb54c (diff)
downloaddotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.tar.gz
dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.tar.bz2
dotty-fb4adc3c9c55476d2fe0deed22cff54e8e945406.zip
Merge branch 'master' into fix-2253
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/TypeOps.scala7
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 =>