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

REPL crashes on tab completion #7418

Closed
scabug opened this issue Apr 25, 2013 · 10 comments
Closed

REPL crashes on tab completion #7418

scabug opened this issue Apr 25, 2013 · 10 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Apr 25, 2013

REPL crashes when pressing tab on "delayed".toU -> tab

Welcome to Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_17).
Type in expressions to have them evaluated.
Type :help for more information.

scala> "delayed".toUerror: uncaught exception during compilation: java.lang.AssertionError
                 toUpperCase

Failed to initialize the REPL due to an unexpected error.
This is a bug, please, report it along with the error diagnostics printed below.
java.lang.AssertionError: assertion failed:
     while compiling: <console>
        during phase: global=icode, atPhase=patmat
     library version: version 2.10.1
    compiler version: version 2.10.1
  reconstructed args:

  last tree to typer: term value
              symbol: variable value in object $eval (flags: <mutable> <triedcooking> private[this])
   symbol definition: private[this] var value: tools.nsc.interpreter.IMain
                 tpe: <notype>
       symbol owners: variable value -> object $eval -> package $line1
      context owners: object $eval -> package $line1

== Enclosing template or block ==

Template( // val <local $eval>: <notype> in object $eval, tree.tpe=$line1.$eval.type
  "java.lang.Object" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  // 5 statements
  ValDef( // private[this] var value: scala.tools.nsc.interpreter.IMain in object $eval
    private <mutable> <local> <defaultinit> <triedcooking>
    "value "
    <tpt> // tree.tpe=tools.nsc.interpreter.IMain
    <empty>
  )
  DefDef( // def value: scala.tools.nsc.interpreter.IMain in object $eval
    <method> <accessor> <defaultinit> <triedcooking>
    "value"
    []
    List(Nil)
    <tpt> // tree.tpe=tools.nsc.interpreter.IMain
    $eval.this."value " // private[this] var value: scala.tools.nsc.interpreter.IMain in object $eval, tree.tpe=tools.nsc.interpreter.IMain
  )
  DefDef( // def value_=(x$1: scala.tools.nsc.interpreter.IMain): Unit in object $eval
    <method> <accessor> <defaultinit> <triedcooking>
    "value_$eq"
    []
    // 1 parameter list
    ValDef( // x$1: tools.nsc.interpreter.IMain
      <param> <synthetic> <triedcooking>
      "x$1"
      <tpt> // tree.tpe=tools.nsc.interpreter.IMain
      <empty>
    )
    <tpt> // tree.tpe=Unit
    Assign( // tree.tpe=Unit
      $eval.this."value " // private[this] var value: scala.tools.nsc.interpreter.IMain in object $eval, tree.tpe=tools.nsc.interpreter.IMain
      "x$1" // x$1: tools.nsc.interpreter.IMain, tree.tpe=tools.nsc.interpreter.IMain
    )
  )
  DefDef( // def set(x: Any): Unit in object $eval
    <method>
    "set"
    []
    // 1 parameter list
    ValDef( // x: Any
      <param> <triedcooking>
      "x"
      <tpt> // tree.tpe=Object
      <empty>
    )
    <tpt> // tree.tpe=Unit
    Apply( // def value_=(x$1: scala.tools.nsc.interpreter.IMain): Unit in object $eval, tree.tpe=Unit
      $eval.this."value_$eq" // def value_=(x$1: scala.tools.nsc.interpreter.IMain): Unit in object $eval, tree.tpe=(x$1: tools.nsc.interpreter.IMain)Unit
      Apply( // final def $asInstanceOf[T0](): T0 in class Object, tree.tpe=tools.nsc.interpreter.IMain
        TypeApply( // final def $asInstanceOf[T0](): T0 in class Object, tree.tpe=()tools.nsc.interpreter.IMain
          "x"."$asInstanceOf" // final def $asInstanceOf[T0](): T0 in class Object, tree.tpe=[T0 >: ? <: ?]()T0
          <tpt> // tree.tpe=tools.nsc.interpreter.IMain
        )
        Nil
      )
    )
  )
  DefDef( // def <init>(): $line1.$eval.type in object $eval
    <method>
    "<init>"
    []
    List(Nil)
    <tpt> // tree.tpe=$line1.$eval.type
    Block( // tree.tpe=Unit
      Apply( // def <init>(): Object in class Object, tree.tpe=Object
        $eval.super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object
        Nil
      )
      ()
    )
  )
)

== Expanded type of tree ==

<notype>

Duplicate primitive method ==
	at scala.tools.nsc.backend.ScalaPrimitives.addPrimitive(ScalaPrimitives.scala:440)
	at scala.tools.nsc.backend.ScalaPrimitives.addPrimitives(ScalaPrimitives.scala:449)
	at scala.tools.nsc.backend.ScalaPrimitives.init(ScalaPrimitives.scala:328)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:55)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1582)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1556)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1552)
	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:428)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:801)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:761)
	at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:618)
	at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:661)
	at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:660)
	at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:660)
	at scala.tools.nsc.interpreter.IMain.beQuietDuring(IMain.scala:232)
	at scala.tools.nsc.interpreter.IMain.quietBind(IMain.scala:660)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1$$anonfun$apply$mcZ$sp$2.apply$mcV$sp(ILoop.scala:838)
	at scala.tools.nsc.interpreter.ILoopInit$class.runThunks(ILoopInit.scala:122)
	at scala.tools.nsc.interpreter.ILoop.runThunks(ILoop.scala:42)
	at scala.tools.nsc.interpreter.ILoopInit$class.postInitialization(ILoopInit.scala:95)
	at scala.tools.nsc.interpreter.ILoop.postInitialization(ILoop.scala:42)
	at scala.tools.nsc.interpreter.ILoopInit$$anonfun$createAsyncListener$1.apply$mcV$sp(ILoopInit.scala:63)
	at scala.tools.nsc.interpreter.ILoopInit$$anonfun$createAsyncListener$1.apply(ILoopInit.scala:60)
	at scala.tools.nsc.interpreter.ILoopInit$$anonfun$createAsyncListener$1.apply(ILoopInit.scala:60)
	at scala.tools.nsc.io.package$$anon$3.call(package.scala:40)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)

.

@scabug
Copy link
Author

scabug commented Apr 25, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7418?orig=1
Reporter: Darius (pushkinas)
Affected Versions: 2.10.1

@scabug
Copy link
Author

scabug commented Jun 5, 2013

@retronym said:
scala/scala#2627

@scabug
Copy link
Author

scabug commented Jul 10, 2013

@adriaanm said:
Unassigning and rescheduling to M6 as previous deadline was missed.

@scabug
Copy link
Author

scabug commented Jul 11, 2013

@som-snytt said:
Does this still happen? Or is there lack of certainty about it never happening? I saw the manic tabbing crash go away. IIRC.

@scabug
Copy link
Author

scabug commented Jul 11, 2013

@retronym said:
We just forgot to close the ticket after it was merged. Adriaan's comment was part of a bulk change.

@scabug
Copy link
Author

scabug commented Jul 11, 2013

@som-snytt said:
OK, thanks. It kept showing up when I searched for REPL bugs. I remembered this was the fix where paulp said you're my hero, that is, the moment when he realized he could retire from saving the world because there was always retronym to swoop in and save the day. That's why turnover was always a big problem at the Justice League, too.

@scabug
Copy link
Author

scabug commented Nov 12, 2013

Scaal (scaal) said:
Same bug in Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45).

@scabug
Copy link
Author

scabug commented Nov 12, 2013

Scaal (scaal) said:
Is it going to be fixed in Scala 2.10.4 ? Or only in the 2.11.* branch ?

@scabug
Copy link
Author

scabug commented Nov 12, 2013

@retronym said:
We only made this fix in 2.11. The workaround in 2.10 is to wait a few seconds before tab completing.

@scabug scabug closed this as completed Nov 12, 2013
@scabug
Copy link
Author

scabug commented Nov 12, 2013

Scaal (scaal) said:
Thanks a lot for the workaround.

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

No branches or pull requests

2 participants