Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.0.0-alpha-2, 4.0.15
-
None
Description
The new SequencedCollection interface introduced in Java 21 has altered the type inference results for mixed use of List and Set. Consider the following:
def x x = [] as List if (predicate()) { x = [] as Set } x
Under STC, the inferred type of the last occurrence of "x" has changed from Collection to Object.