summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-08-19 12:20:28 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-08-19 12:20:28 +0000
commit9d202a7a8d40cac83706e98c59c72f08f355af58 (patch)
treeb0e63c4bdd89ca32c1c5c886dfc6e164237beb95
parent86d07ffe729e8666a71b4382d764462a8620b9bc (diff)
downloadscala-9d202a7a8d40cac83706e98c59c72f08f355af58.tar.gz
scala-9d202a7a8d40cac83706e98c59c72f08f355af58.tar.bz2
scala-9d202a7a8d40cac83706e98c59c72f08f355af58.zip
closes #3777.
no review
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala19
-rw-r--r--test/files/pos/t3777.scala7
2 files changed, 18 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)
+ }
}
}
diff --git a/test/files/pos/t3777.scala b/test/files/pos/t3777.scala
new file mode 100644
index 0000000000..165eeebfdb
--- /dev/null
+++ b/test/files/pos/t3777.scala
@@ -0,0 +1,7 @@
+object Test {
+ type Point = Map[Symbol, String]
+ type Points = IndexedSeq[Point]
+
+ def makePoints2: Points = IndexedSeq[Point]()
+ val spoints2 = util.Random.shuffle(makePoints2)
+}