aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/FirstTransform.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-11-21 15:55:07 +0100
committerMartin Odersky <odersky@gmail.com>2014-11-24 14:57:49 +0100
commit832957339c850a64fb7093f3ed6b19c91c5bdfac (patch)
tree1ae369bd8b685c4ec017716a19e660b204e31cb8 /src/dotty/tools/dotc/transform/FirstTransform.scala
parent7427c671f9a5321dd13a74b5175bba512699b385 (diff)
downloaddotty-832957339c850a64fb7093f3ed6b19c91c5bdfac.tar.gz
dotty-832957339c850a64fb7093f3ed6b19c91c5bdfac.tar.bz2
dotty-832957339c850a64fb7093f3ed6b19c91c5bdfac.zip
Fix to checkBounds
Need to account for the fact that some argument types may be TypeBoudns themselves. The change makes Jason's latest example work.
Diffstat (limited to 'src/dotty/tools/dotc/transform/FirstTransform.scala')
-rw-r--r--src/dotty/tools/dotc/transform/FirstTransform.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/FirstTransform.scala b/src/dotty/tools/dotc/transform/FirstTransform.scala
index 0dac38a78..a58e8a643 100644
--- a/src/dotty/tools/dotc/transform/FirstTransform.scala
+++ b/src/dotty/tools/dotc/transform/FirstTransform.scala
@@ -141,8 +141,12 @@ class FirstTransform extends MiniPhaseTransform with IdentityDenotTransformer wi
val tparams = tycon.tpe.typeSymbol.typeParams
val bounds = tparams.map(tparam =>
tparam.info.asSeenFrom(tycon.tpe.normalizedPrefix, tparam.owner.owner).bounds)
- Checking.checkBounds(
- args, bounds, (tp, argTypes) => tp.substDealias(tparams, argTypes))
+ def instantiateUpperBound(tp: Type, argTypes: List[Type]): Type = {
+ tp.substDealias(tparams, argTypes).bounds.hi
+ // not that argTypes can contain a TypeBounds type for arguments that are
+ // not fully determined. In that case we need to check against the hi bound.
+ }
+ Checking.checkBounds(args, bounds, instantiateUpperBound)
normalizeType(tree)
case tree =>
normalizeType(tree)