You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JavaClass type, which is the Swift wrapper for Java's java.lang.Class, is provided in the Swift JavaKit module. Many of the methods on java.lang.Class require classes from java.lang.reflect that are part of the Swift JavaKitReflection module. For example, getDeclaredMethods() requires java.lang.reflect.Method that is only available in JavaKitReflection.
Java2Swift drops any methods/constructors that involve Java classes that have not been wrapped in Swift, so JavaKit is missing any of those methods. Instead, JavaKitReflection has a handcrafted extension of JavaClass that adds all of the methods from java.lang.Class that involve at least one type from the Java classes that are wrapped into Swift within JavaKitReflection.
We should teach Java2Swift to recognize those cases where a Java class has already been wrapped in Swift (e.g., by using the translation manifest) and produce an extension of the Swift wrapper type that includes only those methods/constructors/etc. that involve at least one Java class that's being wrapped in the module being generated. The manually-written JavaKitReflection/JavaClass+Refection.swift file referenced above could therefore be replaced with a generated one.
The text was updated successfully, but these errors were encountered:
The
JavaClass
type, which is the Swift wrapper for Java'sjava.lang.Class
, is provided in the SwiftJavaKit
module. Many of the methods onjava.lang.Class
require classes fromjava.lang.reflect
that are part of the SwiftJavaKitReflection
module. For example,getDeclaredMethods()
requiresjava.lang.reflect.Method
that is only available inJavaKitReflection
.Java2Swift drops any methods/constructors that involve Java classes that have not been wrapped in Swift, so
JavaKit
is missing any of those methods. Instead,JavaKitReflection
has a handcrafted extension ofJavaClass
that adds all of the methods fromjava.lang.Class
that involve at least one type from the Java classes that are wrapped into Swift withinJavaKitReflection
.We should teach
Java2Swift
to recognize those cases where a Java class has already been wrapped in Swift (e.g., by using the translation manifest) and produce an extension of the Swift wrapper type that includes only those methods/constructors/etc. that involve at least one Java class that's being wrapped in the module being generated. The manually-writtenJavaKitReflection/JavaClass+Refection.swift
file referenced above could therefore be replaced with a generated one.The text was updated successfully, but these errors were encountered: