Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7435

Compilation failure when using non-ASCII chars as method return type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.6, 2.4.3
    • Fix Version/s: None
    • Component/s: parser
    • Labels:
      None

      Description

      When trying to declare the return type of a method having non-ASCII characters, such as in the following example:

      InternationalizationTest.groovy
      @groovy.transform.ThreadInterrupt
      @groovy.transform.TypeChecked
      
      public class 对象 {
      
      public 对象 get对象()
      {
          return new 对象()
      }
      
      }
      
      def myVar = new 对象()
      

      the compilation fails with the message:

      unexpected token: public at line: 6, column: 1

      Those characters are valid according to the official documentation and using them in other places such as a class or variable declaration works as expected.
      I'm attaching the example in order to provide an easy way to test the issue.

        Attachments

        1. InternationalizationTest.groovy
          0.2 kB
          Rodolfo Cruz

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              RJC Rodolfo Cruz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: