Details

      Description

      Works for 2.9.1, 2.9.2 and 2.10.0-M2. Does not work for 2.10.0-M7.

      object TailrecAfterTryCatch {
      
        @annotation.tailrec
        final def good1() {
          1 match {
            case 2 => {
              try {
              //  return
              } catch {
                case e: ClassNotFoundException =>
              }
              good1()
            }
          }
        }
      
        @annotation.tailrec
        final def good2() {
          //1 match {
          //  case 2 => {
              try {
                return
              } catch {
                case e: ClassNotFoundException =>
              }
              good2()
          //  }
          //}
        }
      
        @annotation.tailrec
        final def good3() {
          val 1 = 2
          try {
            return
          } catch {
            case e: ClassNotFoundException =>
          }
          good3()
        }
      
        @annotation.tailrec
        final def bad() {
          1 match {
            case 2 => {
              try {
                return
              } catch {
                case e: ClassNotFoundException =>
              }
              bad()
            }
          }
        }
      
      }
      

        Activity

        Hide
        Jason Zaugg added a comment -

        Not really a pattern matcher bug, but rather an existing issue in Uncurry with label jumps:

        https://github.com/scala/scala/pull/1892

        Show
        Jason Zaugg added a comment - Not really a pattern matcher bug, but rather an existing issue in Uncurry with label jumps: https://github.com/scala/scala/pull/1892

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            杨博
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development