Skip to content

Koltin: support collection literals #10822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Oct 13, 2022

These are reserved for use in annotation initialisers at the moment. This would also replace the array-copying use of IrVararg outside the context of a call with .clone() call, similar to the treatment of arrayOf(*otherArray) -- this likely the intent of the synthetic code that uses this construct, in common with e.g. Python x = [*y], which would similarly amount to a clone op.

@smowton smowton requested review from a team as code owners October 13, 2022 17:50
Copy link
Contributor

@tamasvajk tamasvajk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests are failing, possibly with type access expressions on int[] -> int vs Integer.

@smowton
Copy link
Contributor Author

smowton commented Oct 17, 2022

Yep, I had accidentally knocked out the distinction between primitive and non-primitive arrays. It appears annotations cannot carry a non-primitive int array or the like, so that path always translates Integer -> int and so on.

@smowton smowton force-pushed the smowton/feature/kotlin-collection-literals branch from 8abaca4 to 595a66a Compare October 17, 2022 17:30
@smowton smowton merged commit 67aa6c7 into github:main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants