diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-07-08 15:59:10 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-07-08 15:59:10 +0000 |
commit | 27cdc8ab7f0d688a8fa81dffae2e1b26ac342edb (patch) | |
tree | 590766e20b6c20494b927d3cfa690e211d77b03d /test/files | |
parent | 68aeeae4229a04a8d9d2235e160fd00b21e20926 (diff) | |
download | scala-27cdc8ab7f0d688a8fa81dffae2e1b26ac342edb.tar.gz scala-27cdc8ab7f0d688a8fa81dffae2e1b26ac342edb.tar.bz2 scala-27cdc8ab7f0d688a8fa81dffae2e1b26ac342edb.zip |
closes #3477.
note that all type parameters must be reported in error messages about
failing type inference, but only type parameters that were inferred
successfully should be substituted
the idea of mapping type parameter symbols to the corresponding type
ref in order to make substitution the identity does not seem to work,
leading to errors like:
src/library/scala/collection/immutable/SortedMap.scala:38:
error: type mismatch; found :
scala.collection.immutable.SortedMap[A,B(in method empty)]
required: scala.collection.immutable.SortedMap[A,B(in trait
SortedMap)]
override def empty: SortedMap[A, B] = SortedMap.empty
^
(I guess that's why they were retracted before, but that wasn't done consistently, leading to #3152 -- my first attempt at fixing the latter lead to this bug... I've assigned #3152 to you Martin, as I can't decide how to fix it.)
review by odersky
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t3477.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/pos/t3477.scala b/test/files/pos/t3477.scala new file mode 100644 index 0000000000..660aa55736 --- /dev/null +++ b/test/files/pos/t3477.scala @@ -0,0 +1,7 @@ +class J3 { + def f[K, K1 >: K, V](x: Map[K1, V]): Map[K, V] = error("") +} + +object Test { + (new J3).f(Map[Int, Int]()) +}
\ No newline at end of file |