groovy
  1. groovy
  2. GROOVY-3539

Syntax error thrown, but should be semantic error

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.6.3
    • Fix Version/s: 2.x
    • Component/s: Compiler
    • Labels:
    • Number of attachments :
      0

      Description

      This program causes the compiler to throw a syntax error. However it should be a semantic error.

      public class B {
         public void Test() {
            new NotExist()   
         }
      }
      

        Activity

        Paul King made changes -
        Field Original Value New Value
        Description This program causes the compiler to throw a syntax error. However it should be a semantic error.

        public class B {
           public void Test() {
              new NotExist()
           }
        }
        This program causes the compiler to throw a syntax error. However it should be a semantic error.

        {code}
        public class B {
           public void Test() {
              new NotExist()
           }
        }
        {code}
        Hide
        Paul King added a comment -

        The current error message is:

        1 compilation error:
        
        unable to resolve class NotExist 
         at line: 2, column: 22
        

        what are you expecting?

        Show
        Paul King added a comment - The current error message is: 1 compilation error: unable to resolve class NotExist at line: 2, column: 22 what are you expecting?
        Hide
        blackdrag blackdrag added a comment -

        It is more an improvement instead of a bug. The reporting is fine for the command line compiler and for simple reporting to the console. But for IDEs we could improve the error reporting by for example letting the exception have a pointer to the ClassExpression in this case here. Also the message class that is used, is SyntaxErrorMessage, which is simply the wrong name for an error, that is no syntax error.

        Show
        blackdrag blackdrag added a comment - It is more an improvement instead of a bug. The reporting is fine for the command line compiler and for simple reporting to the console. But for IDEs we could improve the error reporting by for example letting the exception have a pointer to the ClassExpression in this case here. Also the message class that is used, is SyntaxErrorMessage, which is simply the wrong name for an error, that is no syntax error.
        blackdrag blackdrag made changes -
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Hide
        Andrew Eisenberg added a comment - - edited

        Moving this down to "minor" because this issue is really only bothersome, but doesn't prevent me from getting my work done.

        And, as Jochen mentions, this is mainly to help with IDE support.

        Show
        Andrew Eisenberg added a comment - - edited Moving this down to "minor" because this issue is really only bothersome, but doesn't prevent me from getting my work done. And, as Jochen mentions, this is mainly to help with IDE support.
        Andrew Eisenberg made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Guillaume Laforge made changes -
        Fix Version/s 1.7-beta-x [ 15538 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        blackdrag blackdrag made changes -
        Fix Version/s 1.8.x [ 15750 ]
        Fix Version/s 2.x [ 17013 ]
        Fix Version/s 1.7.x [ 15538 ]
        CÚdric Champeau made changes -
        Labels contributers-welcome
        CÚdric Champeau made changes -
        Labels contributers-welcome contrib
        blackdrag blackdrag made changes -
        Fix Version/s 1.8.x [ 15750 ]
        blackdrag blackdrag made changes -
        Component/s Compiler [ 13529 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrew Eisenberg
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: