Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scabug opened this issue Aug 13, 2013 · 1 comment
Open
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Aug 13, 2013

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 ).

#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>();
      ()
    }
  }
}
@scabug
Copy link
Author

@scabug scabug commented Aug 13, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7749?orig=1
Reporter: @magarciaEPFL
Affected Versions: 2.11.0-M4
See #6089

@scabug scabug added the patmat label Apr 7, 2017
@scabug scabug added this to the Backlog milestone Apr 7, 2017
@adriaanm adriaanm removed their assignment Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants