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

STC: no error for multiple instanceof and sparse method call

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      @groovy.transform.TypeChecked void test(o) {
        o instanceof Map || o instanceof List ? o.entrySet() : null
      }
      

      "entrySet" is available from Map but not from List, so the expectation is a STC error to guard against the MissingMethodException for STC or ClassCastException for SC when a list is given.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: