Skip to content
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

Fix arguments handling in KSType.toTypeName() #1529

Merged
merged 4 commits into from
Apr 27, 2023
Merged

Conversation

ZacSweers
Copy link
Collaborator

This more or less undoes #1321 as it broke arguments handling in an unrelated way to annotations. I'm not able to actually repro the original issue it sought to solve in #1304, and added a regression test. This resolves #1513, though the examples there were not helpful either. All in all, I have a headache.

@ZacSweers ZacSweers requested a review from Egorand April 23, 2023 01:20
null
}
val superInterfaces = if (superclassReference != null) {
allSupertypes.drop(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we guaranteed to have the superclass at a specific position in the superTypes list? Would it be safer to do filterNot { it == superclassReference }?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch bf481db

@ZacSweers ZacSweers merged commit c2f0810 into master Apr 27, 2023
@ZacSweers ZacSweers deleted the z/fixArgsInGenerics branch April 27, 2023 19:24
slack-oss-bot referenced this pull request in slackhq/circuit Apr 29, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.squareup:kotlinpoet-ksp](https://github.com/square/kotlinpoet)
| dependencies | patch | `1.13.0` -> `1.13.1` |
| [com.squareup:kotlinpoet](https://github.com/square/kotlinpoet) |
dependencies | patch | `1.13.0` -> `1.13.1` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>square/kotlinpoet</summary>

###
[`v1.13.1`](https://github.com/square/kotlinpoet/releases/tag/1.13.1)

[Compare
Source](https://github.com/square/kotlinpoet/compare/1.13.0...1.13.1)

##### What's Changed

- Fix: Look at canonical names instead of just package names when
generating import aliases by
[@&#8203;Egorand](https://github.com/Egorand) in
[https://github.com/square/kotlinpoet/pull/1519](https://github.com/square/kotlinpoet/pull/1519)
- Fix: Ignore KSP annotation arguments without a value by
[@&#8203;rickclephas](https://github.com/rickclephas) in
[https://github.com/square/kotlinpoet/pull/1523](https://github.com/square/kotlinpoet/pull/1523)
- Fix: Fix arguments handling in KSType.toTypeName() by
[@&#8203;ZacSweers](https://github.com/ZacSweers) in
[https://github.com/square/kotlinpoet/pull/1529](https://github.com/square/kotlinpoet/pull/1529)

##### New Contributors

- [@&#8203;rickclephas](https://github.com/rickclephas) made their
first contribution in
[https://github.com/square/kotlinpoet/pull/1523](https://github.com/square/kotlinpoet/pull/1523)

**Full Changelog**:
square/kotlinpoet@1.13.0...1.13.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS42NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNjQuMCJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KSType.toTypeName function returns ClassName for alias type instead of ParameterizedTypeName
2 participants