diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-19 15:47:24 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-24 14:57:49 +0100 |
commit | 958e2a0f8b79402b1a430f0fe7802af9de583d71 (patch) | |
tree | 724b82627676b02683c10b100a6ac5c58c981d5f /src/dotty/tools/dotc/transform/FirstTransform.scala | |
parent | 4df3d2a36162f99ade57e209ce432733e082d2a5 (diff) | |
download | dotty-958e2a0f8b79402b1a430f0fe7802af9de583d71.tar.gz dotty-958e2a0f8b79402b1a430f0fe7802af9de583d71.tar.bz2 dotty-958e2a0f8b79402b1a430f0fe7802af9de583d71.zip |
Fixed type adaptation problem in checkBounds
We need to adapt type parameter bounds with an as-ssen-from to the
prefix of the type constructor.
Makes pos/boundspropagation pass.
Diffstat (limited to 'src/dotty/tools/dotc/transform/FirstTransform.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/FirstTransform.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/transform/FirstTransform.scala b/src/dotty/tools/dotc/transform/FirstTransform.scala index 29cef09fe..0dac38a78 100644 --- a/src/dotty/tools/dotc/transform/FirstTransform.scala +++ b/src/dotty/tools/dotc/transform/FirstTransform.scala @@ -139,8 +139,10 @@ class FirstTransform extends MiniPhaseTransform with IdentityDenotTransformer wi case tree: NamedArg => transform(tree.arg) case AppliedTypeTree(tycon, args) => val tparams = tycon.tpe.typeSymbol.typeParams + val bounds = tparams.map(tparam => + tparam.info.asSeenFrom(tycon.tpe.normalizedPrefix, tparam.owner.owner).bounds) Checking.checkBounds( - args, tparams.map(_.info.bounds), (tp, argTypes) => tp.substDealias(tparams, argTypes)) + args, bounds, (tp, argTypes) => tp.substDealias(tparams, argTypes)) normalizeType(tree) case tree => normalizeType(tree) |