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

STC: no error for multiple instanceof and sparse method call

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

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

          People

            Unassigned Unassigned
            emilles Eric Milles

            Dates

              Created:
              Updated:

              Slack

                Issue deployment