Skip to content

Support stand-alone subtype relationships #76

Open

Description

@eernstg

The discussion about issue #69 and #72 revealed that the operations isSubtypeOf and isAssignableTo are quite demanding in terms of reflection support, because they require that all the supertypes of the receiver resp. the receiver and the argument are covered. This is because, for instance, aMirror.isSubtypeOf(bMirror) will search through all supertypes of aMirror until it encounters bMirror (returning true) or the supertype graph has been visited completely (returning false), and the latter scenario calls for complete coverage of all the direct and indirect supertypes of aMirror.

With non-generic classes only, it would be rather easy to generate a matrix where the subtyping relationship is specified for every pair of covered classes, without needing reflection support for all the intermediate classes nor all other supertypes of the involved types. However, that strategy does not extend easily to generic classes.

At this point the best advice is probably to use isSubtypeOf and isAssignableTo sparingly, especially in cases where the reflection support is requested for a complete subtype hierarchy. In cases that differ substantially from this it is likely to be rather expensive in terms of program size to cover all the classes needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions