New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
duplicate keys in SWITCH #7290
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7290?orig=1
|
Tobias (zarat) said (edited on Mar 22, 2013 10:58:06 PM UTC): Token.scala does not contain any switch, so no idea what it is complaining about. The issue #6011 mentioned in the message claims that was something fixed in 2.10.0-M5 so I assume it appearing in 2.10.1 is something not covered by the fixed #6011 |
@magarciaEPFL said: |
Tobias (zarat) said: |
@retronym said (edited on Mar 23, 2013 7:57:40 AM UTC): The line of code that triggers the problem: case '!' | '%' | '&' | '\'' | '*' | '+' | ',' | '.' | '/' | '|' | ';' |
'=' | '?' | '@' | '\\' | '^' | '`' | '|' | '~' | ':' => pushToken[TSymbol] Note that '|' is duplicated. Here's a minimal test case: def foo(a: Char) = a match { case 'b' => 0 case 'a' | 'a' => 0 }
duplicate keys in SWITCH, can't pick arbitrarily one of them to evict, see SI-6011: 97, 97, 98
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:49) By contrast, the redundant cases are collapsed here: scala> def foo(a: Char) = a match { case 'b' => 0 case 'b' => 0 }
<console>:7: warning: unreachable code
def foo(a: Char) = a match { case 'b' => 0 case 'b' => 0 }
^ |
@retronym said: |
scala: duplicate keys in SWITCH, can't pick arbitrarily one of them to evict, see #6011.
scala: uncaught exception during compilation: scala.reflect.internal.FatalError
scala: Error:
while compiling: M:\projects\weltkante\proto\lang\src\weltkante\scanner\Token.scala
during phase: jvm
library version: version 2.10.1
compiler version: version 2.10.1
reconstructed args: -classpath M:\projects\weltkante\proto\lang\out\production\lang -bootclasspath C:\dev\jdk6-32bit\jre\lib\resources.jar;C:\dev\jdk6-32bit\jre\lib\rt.jar;C:\dev\jdk6-32bit\jre\lib\sunrsasign.jar;C:\dev\jdk6-32bit\jre\lib\jsse.jar;C:\dev\jdk6-32bit\jre\lib\jce.jar;C:\dev\jdk6-32bit\jre\lib\charsets.jar;C:\dev\jdk6-32bit\jre\lib\modules\jdk.boot.jar;C:\dev\jdk6-32bit\jre\classes;C:\dev\scala\lib\scala-library.jar
last tree to typer: Literal(Constant(weltkante.scanner.TSymbol))
symbol: null
symbol definition: null
tpe: Class(classOf[weltkante.scanner.TSymbol])
symbol owners:
context owners: anonymous class anonfun$22 -> package scanner
== Enclosing template or block ==
Template( // val <local $anonfun>: , tree.tpe=weltkante.scanner.anonfun$22
"scala.runtime.AbstractFunction0", "scala.Serializable" // parents
ValDef(
private
"_"
)
// 3 statements
DefDef( // final def apply(): weltkante.scanner.TComment
final
"apply"
[]
List(Nil)
// tree.tpe=weltkante.scanner.TComment
Apply( // def (): weltkante.scanner.TComment in class TComment, tree.tpe=weltkante.scanner.TComment
new weltkante.scanner.TComment."" // def (): weltkante.scanner.TComment in class TComment, tree.tpe=()weltkante.scanner.TComment
Nil
)
)
DefDef( // final def apply(): Object
final
"apply"
[]
List(Nil)
// tree.tpe=Object
Apply( // final def apply(): weltkante.scanner.TComment, tree.tpe=weltkante.scanner.TComment
STokenFactories$$anonfun$22.this."apply" // final def apply(): weltkante.scanner.TComment, tree.tpe=()weltkante.scanner.TComment
Nil
)
)
DefDef( // def (): weltkante.scanner.anonfun$22
""
[]
List(Nil)
// tree.tpe=weltkante.scanner.anonfun$22
Block( // tree.tpe=Unit
Apply( // def (): scala.runtime.AbstractFunction0 in class AbstractFunction0, tree.tpe=scala.runtime.AbstractFunction0
STokenFactories$$anonfun$22.super."" // def (): scala.runtime.AbstractFunction0 in class AbstractFunction0, tree.tpe=()scala.runtime.AbstractFunction0
Nil
)
()
)
)
)
== Expanded type of tree ==
ConstantType(value = Constant(weltkante.scanner.TSymbol))
duplicate keys in SWITCH, can't pick arbitrarily one of them to evict, see #6011.
scala.reflect.internal.FatalError:
while compiling: M:\projects\weltkante\proto\lang\src\weltkante\scanner\Token.scala
during phase: jvm
library version: version 2.10.1
compiler version: version 2.10.1
reconstructed args: -classpath M:\projects\weltkante\proto\lang\out\production\lang -bootclasspath C:\dev\jdk6-32bit\jre\lib\resources.jar;C:\dev\jdk6-32bit\jre\lib\rt.jar;C:\dev\jdk6-32bit\jre\lib\sunrsasign.jar;C:\dev\jdk6-32bit\jre\lib\jsse.jar;C:\dev\jdk6-32bit\jre\lib\jce.jar;C:\dev\jdk6-32bit\jre\lib\charsets.jar;C:\dev\jdk6-32bit\jre\lib\modules\jdk.boot.jar;C:\dev\jdk6-32bit\jre\classes;C:\dev\scala\lib\scala-library.jar
last tree to typer: Literal(Constant(weltkante.scanner.TSymbol))
symbol: null
symbol definition: null
tpe: Class(classOf[weltkante.scanner.TSymbol])
symbol owners:
context owners: anonymous class anonfun$22 -> package scanner
== Enclosing template or block ==
Template( // val <local $anonfun>: , tree.tpe=weltkante.scanner.anonfun$22
"scala.runtime.AbstractFunction0", "scala.Serializable" // parents
ValDef(
)
// 3 statements
DefDef( // final def apply(): weltkante.scanner.TComment
)
DefDef( // final def apply(): Object
)
DefDef( // def (): weltkante.scanner.anonfun$22
)
)
== Expanded type of tree ==
ConstantType(value = Constant(weltkante.scanner.TSymbol))
duplicate keys in SWITCH, can't pick arbitrarily one of them to evict, see #6011.
The text was updated successfully, but these errors were encountered: