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

Try to get rid of warnings in Java2Swift generated sources: generics #169

Open
ktoso opened this issue Nov 9, 2024 · 2 comments
Open

Try to get rid of warnings in Java2Swift generated sources: generics #169

ktoso opened this issue Nov 9, 2024 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed Java2Swift

Comments

@ktoso
Copy link
Collaborator

ktoso commented Nov 9, 2024

We have a lot of noise thanks to these:

 98 | extension TreeMap {
 99 |   @JavaClass("java.util.AbstractMap$SimpleImmutableEntry")
100 |   open class SimpleImmutableEntry<K: AnyJavaObject, V: AnyJavaObject>: JavaObject {
    |                                                     `- warning: generic parameter 'V' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode

it'd be nice to avoid them, e.g. make those V1 or something

@ktoso ktoso added good first issue Good for newcomers help wanted Extra attention is needed Java2Swift labels Nov 9, 2024
@AbdAlRahmanGad
Copy link
Contributor

Hi @ktoso,
Could you point me to which file I should implement this change inside?

@ktoso
Copy link
Collaborator Author

ktoso commented Nov 28, 2024

Most of this is in JavaTranslator however some of it may be spread around that Java2SwiftLib module.

We should somehow keep track that a V is already used in an outer scope and then use a V1 for example or different name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed Java2Swift
Projects
None yet
Development

No branches or pull requests

2 participants