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

Unions with member names matching auto-imported Kotlin symbols fail to codegen correctly #1127

Open
ianbotsf opened this issue Jul 25, 2024 · 0 comments
Labels
bug This issue is a bug.

Comments

@ianbotsf
Copy link
Contributor

Describe the bug

Given a model such as:

union Foo {
    list: BarList
}

list BarList {
    member: Bar
}

string Bar

The generated code will make no attempt to differentiate between the union member Foo.List and the collection kotlin.collections.List:

public sealed class Foo {
    public data class List(val value: List<kotlin.String>) : Foo () { // Compilation error: `List` has no generic args
    }
}

We need smarter handling of Kotlin symbols when codegenning union members (and possibly elsewhere too).

Expected behavior

Shapes should codegen and compile successfully

Current behavior

Compilation fails

Steps to Reproduce

See above model

Possible Solution

No response

Context

No response

Smithy-Kotlin version

1.2.18

Platform (JVM/JS/Native)

JVM

Operating system and version

(n/a)

@ianbotsf ianbotsf added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2024
@ianbotsf ianbotsf removed the needs-triage This issue or PR still needs to be triaged. label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant