jextract: support extracting class members - #890
Conversation
| public class var classVariable: Int64 { | ||
| 42 | ||
| } | ||
| // snippet.end |
There was a problem hiding this comment.
Thanks for adding snippets but we're not using them it seems -- can you add a small bit in FeaturesJextract.md around static methods somewhere:
+### Class methods
+
+Swift `class` methods and computed properties are imported as `static` methods on the generated Java wrapper type.
+
+@TabNavigator {
+ @Tab("Swift") {
+ @Snippet(path: "Snippets/ClassesSwift.swift", slice: "classMembers")
+ }
+ @Tab("Java (JNI)") {
+ @Snippet(path: "Snippets/MySwiftClassTest", slice: "classMembers")
+ }
+ @Tab("Java (FFM)") {
+ @Snippet(path: "Snippets/MySwiftClassTest", slice: "classMembers")
+ }
+}And make sure we have the snippets for the usage as well
|
I think we missed a condition in JNISwift2JavaGenerator.swift:175 in |
|
Just a minor nit, I think these semantics will work out fine given how we generate code for the java side :) |
It's actually there, but maybe we should drop the condition since protocols doesn't support |
|
Hm yeah, good question -- we could drop it there I think indeed; This PR is good though so let's land this and we can think about the latter :) |
closes: #835