eclipse-jdt / eclipse-jdt/eclipse.jdt.core

revisit post-inference compatibility check

Open
#2,768 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Carried over from https://bugs.eclipse.org/506741 :

> Dan claims ecj has a bug: https://bugs.openjdk.java.net/browse/JDK-8164611 (might be a future language enhancement though :) ).

A quick check reveals that we rule out one method in `Scope.parameterCompatibilityLevel(MethodBinding, TypeBinding[], InvocationSite)` by the code section commented thusly:
> 1.8+ Post inference compatibility check policy: For non-functional-type arguments, trust inference. For functional type arguments apply compatibility checks after inference has completed to ensure arguments that were not pertinent to applicability which have only seen potential compatibility checks are actually compatible.

@srikanth-sankaran it seems your strategy is better than allowed. OTOH, it may as well compensate for extra-constituational smartness in javac, just at a slightly different scope. So if removing that section causes a lot of harm we should probably prefer being "too smart" over "looking dumb" ;-P

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.