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

REPL crashes with unrecoverable error when defining abstract class extending AnyVal

    Details

      Description

      scala> abstract class Funky(val i: Int) extends AnyVal
      exception when typing $this.i().hashCode()/class scala.reflect.internal.Trees$Apply
      class Funky is abstract; cannot be instantiated in file <console>
      scala.reflect.internal.Types$TypeError: class Funky is abstract; cannot be instantiated
              at scala.tools.nsc.typechecker.Contexts$Context.issueCommon(Contexts.scala:375)
      ...
      ReplGlobal.abort: unrecoverable error
      error: unrecoverable error
      

        Activity

        Hide
        Paul Phillips added a comment -

        Nothing to do with the repl.

        Show
        Paul Phillips added a comment - Nothing to do with the repl.
        Hide
        Josh Suereth added a comment -

        Looks like we just need to fix the error message here. Do you have time to fix this for 2.10.x?

        Show
        Josh Suereth added a comment - Looks like we just need to fix the error message here. Do you have time to fix this for 2.10.x?
        Show
        Paul Phillips added a comment - https://github.com/scala/scala/pull/1206
        Hide
        Mark Harrah added a comment -

        Looks like the pull request was merged, is this fixed now?

        Show
        Mark Harrah added a comment - Looks like the pull request was merged, is this fixed now?
        Hide
        Paul Phillips added a comment -
        scala> abstract class Funky(val i: Int) extends AnyVal
        <console>:7: error: `abstract' modifier cannot be used with value classes
               abstract class Funky(val i: Int) extends AnyVal
                              ^
        
        Show
        Paul Phillips added a comment - scala> abstract class Funky(val i: Int) extends AnyVal <console>:7: error: `abstract' modifier cannot be used with value classes abstract class Funky(val i: Int) extends AnyVal ^

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Martin Egri
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development