File tree 3 files changed +29
-2
lines changed
src/main/java/org/checkerframework/framework/util/typeinference8 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,11 @@ private ReductionResultPair reduceLambda(Java8InferenceContext context) {
280
280
AbstractType gi = gs .get (i );
281
281
constraintSet .add (new Typing (fi , gi , TypeConstraint .Kind .TYPE_EQUALITY ));
282
282
}
283
- constraintSet .add (new Typing (tPrime , T , TypeConstraint .Kind .SUBTYPE ));
283
+ @ SuppressWarnings ("interning:not.interned" ) // checking for exact object.
284
+ boolean tPrimeNotSameAsT = tPrime != T ;
285
+ if (tPrimeNotSameAsT ) {
286
+ constraintSet .add (new Typing (tPrime , T , TypeConstraint .Kind .SUBTYPE ));
287
+ }
284
288
} else {
285
289
context .addLambdaParms (lambda .getParameters ());
286
290
}
Original file line number Diff line number Diff line change @@ -558,7 +558,7 @@ public boolean hasWildcardParameterizedLowerOrEqualBound() {
558
558
public boolean hasLowerBoundDifferentParam () {
559
559
List <AbstractType > parameteredTypes = new ArrayList <>();
560
560
for (AbstractType type : bounds .get (BoundKind .LOWER )) {
561
- if (! type .isUseOfVariable () && type .isParameterizedType ()) {
561
+ if (type .isProper () && type .isParameterizedType ()) {
562
562
parameteredTypes .add (type );
563
563
}
564
564
}
Original file line number Diff line number Diff line change
1
+ package typearginfer ;
2
+
3
+ import java .util .Set ;
4
+ import java .util .concurrent .Callable ;
5
+
6
+ public abstract class Issue6753 {
7
+
8
+ abstract <E > E call (Callable <E > task );
9
+
10
+ abstract <T > Set <T > list ();
11
+
12
+ void method (int length ) {
13
+ Set <String > resources =
14
+ call (
15
+ () -> {
16
+ if (length > 1 ) {
17
+ return list ();
18
+ } else {
19
+ return list ();
20
+ }
21
+ });
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments