Skip to content
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

val Array(a,b*) = "Str,Str2".split(",") crashes the REPL #3189

Closed
scabug opened this issue Mar 18, 2010 · 9 comments
Closed

val Array(a,b*) = "Str,Str2".split(",") crashes the REPL #3189

scabug opened this issue Mar 18, 2010 · 9 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 18, 2010

Welcome to Scala version 2.8.0.r21209-b20100318020209 (Java HotSpot(TM) Client VM, Java 1.6.0_17).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val Array(a,b*) = "Str,Str2".split(",")                                     

The code line above leads to a crash of the REPL. This happens in versions 2.7.7, 2.8.0.Beta1-prerelease, as well as today's snapshot. On the IRC channel, it was pointed out that this could be a duplicate of a previous bug which I couldn't find in the tracking system.

Exception in thread "main" java.lang.Error: symbol value b does not exist in line0$$object$$$$iw$$$$iw.<init>
        at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:34)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:840)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genLoadArguments(GenICode.scala:1027)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:661)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:866)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genLoadIf(GenICode.scala:368)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:519)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:866)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genLoadIf(GenICode.scala:368)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:519)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:866)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:866)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genStat(GenICode.scala:170)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$genStat$$1.apply(GenICode.scala:153)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$genStat$$1.apply(GenICode.scala:153)
        at scala.collection.LinearSeqLike$$class.foldLeft(LinearSeqLike.scala:159)
        at scala.collection.immutable.List.foldLeft(List.scala:46)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genStat(GenICode.scala:153)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:865)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:124)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:80)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:80)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
        at scala.collection.immutable.List.foreach(List.scala:46)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:80)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:146)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:99)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:80)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:80)
        at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
        at scala.collection.immutable.List.foreach(List.scala:46)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:80)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:90)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:76)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.apply(GenICode.scala:72)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:270)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:270)
        at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:49)
        at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:270)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:248)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:248)
        at scala.collection.Iterator$$class.foreach(Iterator.scala:587)
        at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:287)
        at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:248)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.run(GenICode.scala:65)
        at scala.tools.nsc.Global$$Run.compileSources(Global.scala:727)
        at scala.tools.nsc.Interpreter.compileAndSaveRun(Interpreter.scala:549)
        at scala.tools.nsc.Interpreter$$Request.objRun(Interpreter.scala:904)
        at scala.tools.nsc.Interpreter$$Request.compile(Interpreter.scala:927)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:616)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:608)
        at scala.tools.nsc.InterpreterLoop.reallyInterpret$$1(InterpreterLoop.scala:500)
        at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:537)
        at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:393)
        at scala.tools.nsc.InterpreterLoop.processLine$$1(InterpreterLoop.scala:246)
        at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:259)
        at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:574)
        at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:67)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@scabug
Copy link
Author

scabug commented Mar 18, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3189?orig=1
Reporter: Lukas Pustina (lukas.pustina)

@scabug
Copy link
Author

scabug commented Mar 18, 2010

@SethTisue said:
looks like a dupe of #3050

@scabug
Copy link
Author

scabug commented Apr 5, 2010

@SethTisue said:
#3050 got fixed, but this is still broken

@scabug
Copy link
Author

scabug commented Apr 7, 2010

@dubochet said:
Could not reproduce with r21361.

If it still fails with this version on your side, could you please provide additional information on your environment.

@scabug
Copy link
Author

scabug commented Apr 7, 2010

@paulp said:
I can reproduce this with beta1 and current trunk on os x. It doesn't look like the sort of bug which varies with environment, so I would guess you made a mistake.

@scabug
Copy link
Author

scabug commented Apr 13, 2010

@dubochet said:
Paul, since the similar #3050 is already owned by you — and since this bugs seem to be related to pattern matching —, I assign it to you. Feel free to send it back to scala_reviewer if it turns out to be an unrelated problem.

@scabug
Copy link
Author

scabug commented May 19, 2010

@paulp said:
Remember regular expression patterns? Me neither, since they entered and left the language before I showed up. But that's the culprit here since as we may have noticed, Array(a,b*) is not valid (current) scala syntax. Fixed-ish in r21973. I have in the past tried to remove the remaining vestiges but STARmode put up a fight.

#3050 is unrelated.

@scabug
Copy link
Author

scabug commented Jun 3, 2010

@paulp said:
Am going to revert this for causing #3480.

@scabug
Copy link
Author

scabug commented May 5, 2012

@paulp said:
Contributed fix in 9d925a30c7 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants