Skip to content

Import prefixes should have $ in them not to conflict with names. #614

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

Closed
Tracked by #1171
HosseinYousefi opened this issue Jun 28, 2023 · 2 comments · Fixed by #1785
Closed
Tracked by #1171

Import prefixes should have $ in them not to conflict with names. #614

HosseinYousefi opened this issue Jun 28, 2023 · 2 comments · Fixed by #1785
Assignees
Labels
package:jni package:jnigen type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@HosseinYousefi
Copy link
Member

For example, we're importing 'package:jni' as jni, and so we can not use jni.xyz inside a method that is also called jni.

Although rare, java method names can contain underscores, so we should use $ and make sure it doesn't conflict with our type parameters (which also use $).

@HosseinYousefi HosseinYousefi added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) package:jnigen labels Jun 28, 2023
@mahesh-hegde
Copy link
Contributor

Isn't the import name added to renaming context, (causing the method name to be renamed)?

@HosseinYousefi
Copy link
Member Author

Isn't the import name added to renaming context, (causing the method name to be renamed)?

No, I didn't change the renaming logic, it has been like this. Plus, I think it's a good idea to stay true to the method names as these are used by the end user and import prefixes are generated. In this case, if a method name is ffi we should strive to keep it as ffi (instead of say – ffi0).

@ghost ghost mentioned this issue Aug 6, 2023
@HosseinYousefi HosseinYousefi transferred this issue from dart-archive/jnigen Nov 17, 2023
parlough pushed a commit to parlough/native that referenced this issue Apr 8, 2024
* Fix dart-lang#614

* Update test expectations

* Hacky fix

* Refactor

* Fix analysis

* Fix analysis

* Fix analysis
@HosseinYousefi HosseinYousefi moved this to Backlog in JNIgen tracker Apr 11, 2024
@HosseinYousefi HosseinYousefi added this to the JNI / JNIgen 0.14.0 milestone May 22, 2024
@HosseinYousefi HosseinYousefi self-assigned this May 22, 2024
@HosseinYousefi HosseinYousefi moved this from Backlog to Todo in JNIgen tracker May 22, 2024
@HosseinYousefi HosseinYousefi moved this from Todo to In Progress in JNIgen tracker Dec 6, 2024
HosseinYousefi added a commit that referenced this issue Dec 6, 2024
HosseinYousefi added a commit that referenced this issue Dec 6, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in JNIgen tracker Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:jni package:jnigen type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants