Scala Programming Language
  1. Scala Programming Language
  2. SI-4874

REPL crashes on TAB completion (2.9.0.1, Mac OS X, Java SDK 1.6)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Repl / Interpreter
    • Labels:
      None

      Description

      anonymous-class example from the website - hit x.<TAB> in REPL - crash:

      scala> val x = new AnyRef

      { def kltpzyxm = "back to the 5th dimension" }

      x: java.lang.Object

      {def kltpzyxm: java.lang.String}

      = $anon$1@1387498

      scala> x.java.lang.AssertionError: assertion failed: fatal: <refinement> has non-class owner value x after flatten.
      at scala.Predef$.assert(Predef.scala:103)
      at scala.tools.nsc.symtab.Symbols$Symbol.scala$tools$nsc$symtab$Symbols$$flattenName(Symbols.scala:614)
      at scala.tools.nsc.symtab.Symbols$ClassSymbol.name(Symbols.scala:2043)
      at scala.tools.nsc.symtab.Symbols$ClassSymbol.name(Symbols.scala:2013)
      at scala.reflect.generic.Symbols$AbsSymbol.isRefinementClass(Symbols.scala:145)
      at scala.tools.nsc.symtab.Symbols$Symbol.defaultFlagMask(Symbols.scala:1711)
      at scala.tools.nsc.symtab.Symbols$Symbol.defaultFlagString(Symbols.scala:1714)
      at scala.tools.nsc.symtab.Symbols$Symbol.defString(Symbols.scala:1718)
      at scala.tools.nsc.symtab.Scopes$Scope$$anonfun$mkString$1.apply(Scopes.scala:316)
      at scala.tools.nsc.symtab.Scopes$Scope$$anonfun$mkString$1.apply(Scopes.scala:316)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
      at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      at scala.collection.immutable.List.foreach(List.scala:45)
      at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)
      at scala.collection.immutable.List.map(List.scala:45)
      at scala.tools.nsc.symtab.Scopes$Scope.mkString(Scopes.scala:316)
      at scala.tools.nsc.symtab.Types$CompoundType.safeToString(Types.scala:1377)
      at scala.reflect.generic.Types$AbsType.toString(Types.scala:27)
      at java.lang.String.valueOf(String.java:2826)
      at scala.runtime.StringAdd.$plus(StringAdd.scala:16)
      at scala.tools.nsc.interpreter.JLineCompletion$TypeMemberCompletion.completions(JLineCompletion.scala:118)
      at scala.tools.nsc.interpreter.CompletionAware$class.completionsFor(CompletionAware.scala:68)
      at scala.tools.nsc.interpreter.JLineCompletion$TypeMemberCompletion.completionsFor(JLineCompletion.scala:99)
      at scala.tools.nsc.interpreter.CompletionAware$$anonfun$2.apply(CompletionAware.scala:76)
      at scala.tools.nsc.interpreter.CompletionAware$$anonfun$2.apply(CompletionAware.scala:76)
      at scala.Option.map(Option.scala:134)
      at scala.tools.nsc.interpreter.CompletionAware$class.completionsFor(CompletionAware.scala:76)
      at scala.tools.nsc.interpreter.JLineCompletion$ids$.completionsFor(JLineCompletion.scala:155)
      at scala.tools.nsc.interpreter.JLineCompletion$$anonfun$topLevelFor$1.apply(JLineCompletion.scala:262)
      at scala.tools.nsc.interpreter.JLineCompletion$$anonfun$topLevelFor$1.apply(JLineCompletion.scala:261)
      at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      at scala.collection.immutable.List.foreach(List.scala:45)
      at scala.tools.nsc.interpreter.JLineCompletion.topLevelFor(JLineCompletion.scala:261)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion$$anonfun$regularCompletion$1$1.apply(JLineCompletion.scala:357)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion$$anonfun$regularCompletion$1$1.apply(JLineCompletion.scala:357)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion.tryCompletion$1(JLineCompletion.scala:332)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion.regularCompletion$1(JLineCompletion.scala:357)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion$$anonfun$complete$2.apply(JLineCompletion.scala:368)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion$$anonfun$complete$2.apply(JLineCompletion.scala:368)
      at scala.Option.orElse(Option.scala:219)
      at scala.tools.nsc.interpreter.JLineCompletion$JLineTabCompletion.complete(JLineCompletion.scala:368)
      at scala.tools.nsc.interpreter.JLineReader$$anon$1.complete(JLineReader.scala:31)
      at scala.tools.jline.console.completer.ArgumentCompleter.complete(ArgumentCompleter.java:150)
      at scala.tools.jline.console.ConsoleReader.complete(ConsoleReader.java:1518)
      at scala.tools.jline.console.ConsoleReader.readLine(ConsoleReader.java:1291)
      at scala.tools.jline.console.ConsoleReader.readLine(ConsoleReader.java:1149)
      at scala.tools.nsc.interpreter.JLineReader.readOneLine(JLineReader.scala:70)
      at scala.tools.nsc.interpreter.InteractiveReader$$anonfun$readLine$2.apply(InteractiveReader.scala:43)
      at scala.tools.nsc.interpreter.InteractiveReader$$anonfun$readLine$2.apply(InteractiveReader.scala:43)
      at scala.tools.nsc.interpreter.InteractiveReader$.restartSysCalls(InteractiveReader.scala:50)
      at scala.tools.nsc.interpreter.InteractiveReader$class.readLine(InteractiveReader.scala:43)
      at scala.tools.nsc.interpreter.JLineReader.readLine(JLineReader.scala:17)
      at scala.tools.nsc.interpreter.ILoop.readOneLine$1(ILoop.scala:548)
      at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:560)
      at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:827)
      at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:67)
      at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80)
      at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89)
      at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

      The repl compiler has crashed spectacularly.

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r25486) Turned up the defense against compiler exceptions in the repl.
        And gave in and disabled an assertion I should have disabled two
        years ago. Closes SI-4874, no review.

        Show
        Commit Message Bot added a comment - (extempore in r25486 ) Turned up the defense against compiler exceptions in the repl. And gave in and disabled an assertion I should have disabled two years ago. Closes SI-4874 , no review.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Thomas J. Schrader
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development