Skip to content

Implement capture conversion.#3922

Merged
mernst merged 279 commits intotypetools:masterfrom
smillst:capture-conversion
Jul 13, 2021
Merged

Implement capture conversion.#3922
mernst merged 279 commits intotypetools:masterfrom
smillst:capture-conversion

Conversation

@smillst
Copy link
Copy Markdown
Member

@smillst smillst commented Nov 23, 2020

Merge with plume-lib/plume-util#157.

This pull request implements capture conversion. This required several related changes:

  1. Re-implementing isContainedBy in DefaultTypeHierarchy.
  2. Removing various workarounds.

To understand capture conversion, you need to understand the following sections of the JLS:

  • 5.1.10.
  • 4.5.1 containment
  • 4.10 subtyping (and note that "|T|" means "the erasure of T")

Reviewing order:

  1. Capture conversion: AnnotatedTypeFactory#applyCaptureConversion(AnnotatedTypeMirror)
  2. Containment: DefaultTypeHierarchy#isContainedBy
  3. All other changes. (Note some of these are removing work arounds for not having capture conversion.)

Fixes #3013, fixes #3754, fixes #3791, fixes #3845, fixes #3970, and fixes #4523.

@mernst mernst assigned smillst and unassigned mernst Nov 23, 2020
@smillst smillst assigned mernst and unassigned smillst Nov 23, 2020
Copy link
Copy Markdown
Member

@mernst mernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are comments on the DefaultTypeHierarchy changes.

…for-loop-capture

# Conflicts:
#	dataflow/src/main/java/org/checkerframework/dataflow/cfg/node/MethodInvocationNode.java
# Conflicts:
#	dataflow/src/main/java/org/checkerframework/dataflow/cfg/builder/CFGTranslationPhaseOne.java
#	dataflow/src/main/java/org/checkerframework/dataflow/cfg/node/MethodInvocationNode.java
#	framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java
…version

# Conflicts:
#	framework/src/main/java/org/checkerframework/framework/type/DefaultTypeHierarchy.java
@smillst smillst assigned mernst and unassigned smillst Jul 12, 2021
Copy link
Copy Markdown
Member

@mernst mernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question, then feel free to merge. Thanks again for this big improvement!

@mernst mernst merged commit 8475fd7 into typetools:master Jul 13, 2021
@mernst mernst deleted the capture-conversion branch July 13, 2021 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment