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

STC rejects concatenated string as annotation parameter

    XMLWordPrintableJSON

Details

    Description

      @CompileStatic
      class Example {
        public static final String ASDF = 'asdf'
      
        @Grab(ASDF + ':asdf:123')
        // @CompileDynamic
        void foo() {}
      }
      

      This produces the familiar Attribute 'value' should have type 'java.lang.String'; but found type 'java.lang.Object' in @groovy.lang.Grab on the annotation value, but applying @CompileDynamic to the method declaration (alongside the non-working annotation!) fixes it.

      Attachments

        Activity

          People

            emilles Eric Milles
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: