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

STC ignores declaration type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.5
    • Fix Version/s: None
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      static <T> T id(T arg) { arg }
      
      @groovy.transform.CompileStatic
      def ddd() {
        List<String> ls = id(new ArrayList<>())
        ls.get(0).toUpperCase() // Cannot find matching method java.lang.Object#toUpperCase()
      }
      
      println ddd()
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              daniilo Daniil Ovchinnikov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: