Skip to content

wrap-java: Generated @JavaInterfaces must have JavaObject base functions #430

@ktoso

Description

@ktoso

The way we're generating Swift types for interfaces is problematic:

@JavaInterface("java.lang.reflect.TypeVariable", extends: Type.self)
public struct TypeVariable<D: AnyJavaObject> {
  @JavaMethod
  public func getGenericDeclaration() -> GenericDeclaration!
  
  @JavaMethod
  public func getAnnotatedBounds() -> [AnnotatedType?]

while we know we can call hashCode, equals and toString on those types... Lack of those on extracted types means we can't make ALL java types Hashable, which makes interfaces hard to work with -- and since a lot of java is interface based, that's not ideal.

It also makes our description->toString problematic.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions