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

lazy val in local block crashes mixin with NPE

    Details

      Description

      Regression, worked with 2.10.0-20120425-140228-8f3f0724f9, fails with current master (I don't know when it started failing)

      compiling

      object Bug {
        def foo() {
          val v = {
            lazy val s = 0
            s
          }
        }
      }
      

      crashes with

      Exception in thread "main" java.lang.NullPointerException
      	at scala.tools.nsc.transform.Mixin$MixinTransformer.scala$tools$nsc$transform$Mixin$MixinTransformer$$postTransform(Mixin.scala:1139)
      	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$transform$1.apply(Mixin.scala:1248)
      	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$transform$1.apply(Mixin.scala:1248)
      	at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:187)
      	at scala.reflect.internal.SymbolTable.afterPhase(SymbolTable.scala:196)
      	at scala.tools.nsc.Global.afterMixin(Global.scala:947)
      	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:1248)
      [...]
      

        Issue Links

          Activity

          Hide
          Paul Phillips added a comment -

          Regressed somewhere among these commits, which is what you'd expect given the significant changes to lazy vals.

          git log --no-merges --oneline aa555debf7..598e3f8586
          454c2a0c77 GenASM activated via -target:jvm-1.6 or -target:jvm-1.5-asm
          c5d9e88b89 Changes scala.math.signum to return negative zeros.
          f9943432a6 glue ASM <-> GenASM, the only part of scala.tools.asm to maintain manually
          df4df0ada2 subset of the ASM framework, re-namespaced as scala.tools.asm
          07546bd803 compile Java files under src/compiler
          d5fff51494 make strap build use exact same compiler options as quick build
          3769f4dc10 Part IV of the Lazy Vals Saga: Optimized local vals. That's all folks.
          76b6fd4e94 documentation about BasicBlock and Inliner
          afa60fcc00 BytecodeWriters can do without the FJBG dependency
          7d219774a6 Add test for t5564 in pending/pos
          73fb63f115 overriding rather than pattern matching in icode.Opcodes
          b7f92af64d Fixes SI-5344.
          a3d4d17b77 Part III of the Lazy Vals Saga: Inliner strikes back. Or at least let's hope it will.
          3631f1dadc Part II of the Lazy Vals Saga: Saving bitmap by the Three Musketeers: Byte, Int and Long. And Boolean (hey, he also deserves some credit!).
          bdd9abedd8 Part I of the Lazy Vals Saga: Bitmaps are no longer inherited.
          
          Show
          Paul Phillips added a comment - Regressed somewhere among these commits, which is what you'd expect given the significant changes to lazy vals. git log --no-merges --oneline aa555debf7..598e3f8586 454c2a0c77 GenASM activated via -target:jvm-1.6 or -target:jvm-1.5-asm c5d9e88b89 Changes scala.math.signum to return negative zeros. f9943432a6 glue ASM <-> GenASM, the only part of scala.tools.asm to maintain manually df4df0ada2 subset of the ASM framework, re-namespaced as scala.tools.asm 07546bd803 compile Java files under src/compiler d5fff51494 make strap build use exact same compiler options as quick build 3769f4dc10 Part IV of the Lazy Vals Saga: Optimized local vals. That's all folks. 76b6fd4e94 documentation about BasicBlock and Inliner afa60fcc00 BytecodeWriters can do without the FJBG dependency 7d219774a6 Add test for t5564 in pending/pos 73fb63f115 overriding rather than pattern matching in icode.Opcodes b7f92af64d Fixes SI-5344. a3d4d17b77 Part III of the Lazy Vals Saga: Inliner strikes back. Or at least let's hope it will. 3631f1dadc Part II of the Lazy Vals Saga: Saving bitmap by the Three Musketeers: Byte, Int and Long. And Boolean (hey, he also deserves some credit!). bdd9abedd8 Part I of the Lazy Vals Saga: Bitmaps are no longer inherited.
          Hide
          Hubert Plociniczak added a comment -

          Fixed in efdac16e04bc1cd6

          Show
          Hubert Plociniczak added a comment - Fixed in efdac16e04bc1cd6

            People

            • Assignee:
              Hubert Plociniczak
              Reporter:
              Lukas Rytz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development