Repository navigation
Conversation
In a subclass of AbstractCollection, `return super.toArray();` printed `(super as java.util.Collection<*>).toArray()` (6fa50d2); kotlinc: 'super' cannot be a callee. Kotlin's super is no value: it can be neither cast nor the receiver of toTypedArray. The toArray branches now leave a call on super alone. Now: `super.toArray()` and `super.toArray(array)`. Test: TestJavaToKotlinStructure.toArrayOnSuper (output compiles with kotlinc). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tom Tourwe <Tom.Tourwe@codelaser.io>
Contributor
|
Incorporated into maddi as a cherry-pick with you as author, rather than merged from this branch. Closing this PR in favour of that commit. Commit: 21366b3. Devel had changed the same condition in The whole batch (#146–#155) passes the Kotlin, C#, printer, front-end, inspection and bytecode suites on JDK 26 and JDK 27. It goes into 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In a subclass of AbstractCollection,
return super.toArray();printed(super as java.util.Collection<*>).toArray()(6fa50d2); kotlinc: 'super' cannot be a callee.Kotlin's super is no value: it can be neither cast nor the receiver of toTypedArray. The toArray
branches now leave a call on super alone.
Now:
super.toArray()andsuper.toArray(array).Test: TestJavaToKotlinStructure.toArrayOnSuper (output compiles with kotlinc).
How it was found
A mutation-testing run (PIT) over the lines that maddi's latest 100 commits changed listed the changed code no
existing test checks. Tests written for those lines, from what each commit says the code should do, exposed this
bug in the lines 6fa50d2 changed.
Tests
On
devel07b926b: the new test fails without the fix and passes with it.With this fix and the nine others of this series applied together, every maddi test passes
(run on 7bc974b: 2,743 tests, 0 failures).
🤖 Generated with Claude Code