-
Notifications
You must be signed in to change notification settings - Fork 55
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
[jnigen] Fix crash on Kotlin wildcards #1881
Conversation
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
@@ -1120,7 +1123,9 @@ class KotlinType implements Element<KotlinType> { | |||
final String kind; | |||
final String? name; | |||
final int id; | |||
final List<KotlinTypeProjection> arguments; | |||
|
|||
/// `null` represents a wildcard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to add an AST element for wildcards, rather than using null to represent it? If wildcards are only permitted in this arguments field, you could add a KotlinTypeArgument
class that can be either a wildcard or a KotlinTypeProjection
. That would be more self documenting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get this from a JSON and use json_serializable
to autogenerate the deserialization. I could do a custom thing for this one class though.
Kotlin wildcards (
*
) would cause the code generator to crash. Now I represent them in the type arg list as null.