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

REPL/compiler: @static var x = 42 crashes compiler

    Details

      Description

      when i do this in the REPL

      import annotation.static
      @static var x = 42
      

      I get a stacktrace and at the end

      That entry seems to have slain the compiler.  Shall I replay
      your session? I can re-run each line except the last one.
      [y/n]
      

      btw

      import annotation.static
      @static val x = 42
      

      does that too

      but

      import annotation.static
      @static def x = 42
      

      not

      This works in the REPL

      import annotation.static
      object Test {
        @static
        var x = 42
      }
      

      This crashes the REPL and compiler:

      import annotation.static
      class Test {
        @static
        def x = 42
      }
      

        Issue Links

          Activity

          Show
          Aleksandar Prokopec added a comment - https://github.com/scala/scala/pull/1138

            People

            • Assignee:
              Aleksandar Prokopec
              Reporter:
              DaveScala
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development