Skip to content

Support generic interface implementation #588

@HosseinYousefi

Description

@HosseinYousefi

There are some complex examples where this doesn't work in the experimental version of interface implementation. Such as

interface I<T> {
  T foo(List<T> bar);
}

Because storing the type parameter loses the original type and reconstructing List from the stored type creates a JList<JObject> which is incorrect.

Also generic methods in interfaces need to expose JObjTypes for their type parameters:

interface I {
  <S> S foo(S bar);
}
// Should be exposed like:
$S Function<$S extends JObject>($S bar, {required JObjType<$S> S});

Metadata

Metadata

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions