Support name-based destructuring declarations#630
Conversation
|
This is terrific! Thank you for your contribution here. Don't forget to update the I think we will still need to handle the case of |
|
Thanks @hick209 updated CHANGELOG.md |
|
That was fast! |
|
@hick209 has imported this pull request. If you are a Meta employee, you can view this in D108969079. |
|
@hick209 I see |
cortinico
left a comment
There was a problem hiding this comment.
LGTM but minor comment
|
@goutamadwant we got this error here Internally we are still on Kotlin 2.2, which might be the reason for the issue. Do you know if there's an alternative here? Else we could work to make this backwards compatible for a while |
…itor.kt Co-authored-by: Nicola Corti <corti.nico@gmail.com>
|
Thanks @hick209 yes.. I think the compatibility path is to avoid From what I checked, I can push this follow up if this sounds good to you. |
|
Yep, sounds good! |
|
addressed the issue @hick209.. it should compile against Kotlin 2.2 while still preserving bracket delimiters on Kotlin 2.3. Let me know if it looks good now. Thanks! |
| .trimMargin() | ||
| ) | ||
| fun `handle name based destructuring declaration`() { | ||
| if (KotlinVersion.CURRENT < KotlinVersion(2, 3)) return |
There was a problem hiding this comment.
Is this check here necessary?
I feel like it would pass regardless
Summary
x = b.Fixes #629
Tests
./gradlew :ktfmt:test --tests "com.facebook.ktfmt.format.FormatterTest.handle name based destructuring declaration" --no-daemon --console=plain --stacktrace./gradlew :ktfmt:test --tests "com.facebook.ktfmt.format.FormatterTest" --no-daemon --console=plain --stacktrace./gradlew :ktfmt:build --no-daemon --console=plain --stacktraceNote: I also tried
./gradlew build --no-daemon --console=plain --stacktrace; the local run reached ktfmt checks, then failed in unrelated:lambda:testdependency resolution because local Maven is missingio.netty:netty-transport-native-epoll:4.1.42.Final:linux-x86_64.