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

well-formed or not? A jumping-Apply whose sole argument is a LabelDef node

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.11.0-M4
    • Fix Version/s: None
    • Component/s: Pattern Matcher
    • Labels:
      None

      Description

      In the example below, there's a jumping-Apply-node "matchEnd4" whose argument "while$1" has an isLabel symbol (that's no surprise because that argument is itself a LabelDef ).

      SI-6089 (initially) makes me believe that's non-well-formed, on the other hand the emitted bytecode is fine. Please bring clarity to the issue.

      Test.scala
      object Test {
      
        def main(args: Array[String]) {
          args(0) match {
            case a: String => while(a == null) {}
          }
        }
      
      }
      
      [[syntax trees at end of                   cleanup]]
      package <empty> {
        <module> object Test extends Object {
          <method> def main(args: Array[String]): scala.this.Unit = {
            case <synthetic> val x1: String = args.apply(0);
            case5(){
              if (x1.ne(null))
                {
                  <synthetic> val x2: String = x1;
                  matchEnd4(while$1(){
                    if (x2.$eq$eq(null))
                      {
                        ();
                        while$1()
                      }
                    else
                      ();
                    scala.runtime.BoxedUnit.UNIT
                  })
                }
              else
                case6()
            };
            case6(){
              matchEnd4(throw new MatchError.<init>(x1))
            };
            matchEnd4(x: runtime.this.BoxedUnit){
              ()
            }
          };
          <method> def <init>(): <empty>.this.Test.type = {
            Test.super.<init>();
            ()
          }
        }
      }
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Adriaan Moors
            Reporter:
            Miguel Garcia
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development