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

Alias is ignored in constructor call

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      foo/Foo.groovy
      package foo
      
      class Foo {}
      
      test/test.groovy
      package test
      import foo.Foo as Bar
      
      class Bar {}
      
      def regular = new Bar()
      def anonymous = new Bar() {}
      println regular.class // class test.Bar
      println anonymous.class.superclass // class foo.Foo
      

      Either both of the invocations should use alias or both of them should use class defined in the same file.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            emilles Eric Milles
            daniilo Daniil Ovchinnikov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment