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

@CompileStatic resolves the 'in' operator wrongly

    XMLWordPrintableJSON

    Details

      Description

      class Test {
          @CompileStatic
          static void main(String... a) {
              println('a' in String)
          }
      }
      

      From what I can understand, based on the lhs type, the compiler assumes that 'in' refers to String.contains(), while it actually refers to instanceof

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              ddimitrov Dimitar Dimitrov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: