Skip to content

Conversation

@pivovarit
Copy link
Member

@pivovarit pivovarit commented Aug 17, 2024

Internal Array.appendAll optimizations sometimes would result in returning arrays of the wrong type.

private interface SomeInterface { } enum OneEnum implements SomeInterface { A1, A2, A3; } enum SecondEnum implements SomeInterface { A1, A2, A3; } public static void main(String[] args) { Array<SomeInterface> empty = Array.empty(); Array<SomeInterface> copy1 = empty.appendAll(Array.<SomeInterface>of(OneEnum.values())); Array<SomeInterface> copy2 = copy1.appendAll(Array.<SomeInterface>of(SecondEnum.values())); }

fixes: #2781

@pivovarit pivovarit marked this pull request as ready for review August 17, 2024 15:42
@pivovarit pivovarit merged commit 1425b74 into version/0.10.5 Aug 17, 2024
@pivovarit pivovarit deleted the fix-type-mismatch branch August 17, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants