summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala13
-rw-r--r--test/files/neg/xmltruncated6.check2
-rw-r--r--test/files/run/interpreter.check2
3 files changed, 12 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 112f419bcd..87dd555db4 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -2260,9 +2260,16 @@ A type's typeSymbol should never be inspected directly.
/** Map this function over given list of symbols */
def mapOver(origSyms: List[Symbol]): List[Symbol] = {
- val origInfos = origSyms map (_.info)
- val newInfos = List.mapConserve(origInfos)(this)
- if (newInfos eq origInfos) origSyms // fast path in case nothing changes due to map
+ var change = false
+ val newInfos = for (sym <- origSyms) yield {
+ val v = variance
+ if (sym.isAliasType) variance = 0
+ val result = this(sym.info)
+ if (result ne sym.info) change = true
+ variance = v
+ result
+ }
+ if (!change) origSyms // fast path in case nothing changes due to map
else { // map is not the identity --> do cloning properly
val clonedSyms = origSyms map (_.cloneSymbol)
val clonedInfos = clonedSyms map (_.info.substSym(origSyms, clonedSyms))
diff --git a/test/files/neg/xmltruncated6.check b/test/files/neg/xmltruncated6.check
index f638f2f090..6123114560 100644
--- a/test/files/neg/xmltruncated6.check
+++ b/test/files/neg/xmltruncated6.check
@@ -1,4 +1,4 @@
-xmltruncated6.scala:2: error: in XML literal: expected end of Scala block
+xmltruncated6.scala:2: error: ';' expected but eof found.
val stuff = <a>{ "no closing brace"
^
one error found
diff --git a/test/files/run/interpreter.check b/test/files/run/interpreter.check
index 31dadfd65b..b07f69ea2e 100644
--- a/test/files/run/interpreter.check
+++ b/test/files/run/interpreter.check
@@ -144,7 +144,7 @@ scala> <console>:1: error: '=' expected but '=>' found.
scala> <console>:1: error: identifier expected but integer literal found.
[1,2,3]
^
-<console>:1: error: ']' expected but ';' found.
+<console>:1: error: ']' expected but eof found.
[1,2,3]
^