diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-08-19 12:20:28 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-08-19 12:20:28 +0000 |
commit | 9d202a7a8d40cac83706e98c59c72f08f355af58 (patch) | |
tree | b0e63c4bdd89ca32c1c5c886dfc6e164237beb95 /src | |
parent | 86d07ffe729e8666a71b4382d764462a8620b9bc (diff) | |
download | scala-9d202a7a8d40cac83706e98c59c72f08f355af58.tar.gz scala-9d202a7a8d40cac83706e98c59c72f08f355af58.tar.bz2 scala-9d202a7a8d40cac83706e98c59c72f08f355af58.zip |
closes #3777.
no review
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 057bf45107..7aed4cd648 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -2244,14 +2244,17 @@ A type's typeSymbol should never be inspected directly. if(params.isEmpty) { // type var has kind * addBound(tp) true - } else // higher-kinded type var with same arity as tp - (typeArgs.length == tp.typeArgs.length) && { - // register type constructor (the type without its type arguments) as bound - addBound(tp.typeConstructor) - // check subtyping of higher-order type vars - // use variances as defined in the type parameter that we're trying to infer (the result is sanity-checked later) - checkArgs(tp.typeArgs, typeArgs, params) - } + } else { // higher-kinded type var with same arity as tp + def unifyHK(tp: Type) = + (typeArgs.length == tp.typeArgs.length) && { + // register type constructor (the type without its type arguments) as bound + addBound(tp.typeConstructor) + // check subtyping of higher-order type vars + // use variances as defined in the type parameter that we're trying to infer (the result is sanity-checked later) + checkArgs(tp.typeArgs, typeArgs, params) + } + unifyHK(tp) || unifyHK(tp.dealias) + } } } |