-
Notifications
You must be signed in to change notification settings - Fork 46
Add Support for Static Fields to Java2Swift tool #61
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ struct HelloSwift { | |
} | ||
|
||
extension JavaClass<HelloSwift> { | ||
@JavaField | ||
@JavaStaticField | ||
var initialValue: Double | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be a static var? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an instance in JavaClass similar to how static methods are instance methods on their Java class. I was thinking of how to get this be a static var, but everything needs the JNIEnvironment (from my understanding), which is an instance var on all Java structs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. Java static methods/vars become non-static members on the appropriately-specialized There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For bonus points, one could have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm do we have access to the surrounding context of a macro? I know you did some work there, but I lost where that ended up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, the |
||
} | ||
|
||
|
@@ -117,4 +117,4 @@ struct HelloSubclass { | |
|
||
@JavaMethod | ||
init(greeting: String, environment: JNIEnvironment) | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.