Details

      Description

      Particularly with longer source files, introducing a wrong or missing brace or paranthesis may result in a compiler error that spots the mistake at a perfectly fine spot, making it practically impossible to find the real mistake. Finding the mistake in the attached source will take me twenty to thirty minutes.

      Expected behaviour: the compiler should report the most likely spot for the mistake, instead of giving up at an arbitrary position.

      1. braces.scala
        0.9 kB
        Nick Vrvilo
      2. TrackComponent.scala
        17 kB
        Jira Admin

        Activity

        Hide
        Jason Zaugg added a comment -

        A smaller version of the problem:

        case class Const {
        }    // missing '{' assumed here
        
        class Var
        {
        
        

        It's actually a remarkably specific bug. Just take a look at the variations below, each of which is competently handled by the missing brace department.

        case class Const
        {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        class Const {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        object Const {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        final case class Const {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        @foo case class Const {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        case
        class Const {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        case class
        Const {
        }
        
        class Var
        {
             // missing '{' assumed here
        
        Show
        Jason Zaugg added a comment - A smaller version of the problem: case class Const { } // missing '{' assumed here class Var { It's actually a remarkably specific bug. Just take a look at the variations below, each of which is competently handled by the missing brace department. case class Const { } class Var { // missing '{' assumed here class Const { } class Var { // missing '{' assumed here object Const { } class Var { // missing '{' assumed here final case class Const { } class Var { // missing '{' assumed here @foo case class Const { } class Var { // missing '{' assumed here case class Const { } class Var { // missing '{' assumed here case class Const { } class Var { // missing '{' assumed here
        Hide
        Jason Zaugg added a comment -

        This needs a bit more polish (I'm new to this neck of the woods), but seems to be an improvement:

        https://github.com/retronym/scala/compare/ticket/2968

        Show
        Jason Zaugg added a comment - This needs a bit more polish (I'm new to this neck of the woods), but seems to be an improvement: https://github.com/retronym/scala/compare/ticket/2968
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1518
        Hide
        Adriaan Moors added a comment -

        reopening for potential backport to 2.10.1-RC1

        Show
        Adriaan Moors added a comment - reopening for potential backport to 2.10.1-RC1
        Hide
        Jason Zaugg added a comment -
        Show
        Jason Zaugg added a comment - backport: https://github.com/scala/scala/pull/1980

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development