smallrye / jandex

Java Annotation Indexer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restore structural equality of the `Type` hierarchy

Ladicek opened this issue · comments

The Type hierarchy actually documents that it provides structural equality. The addition of TypeVariableReference broke that guarantee (for types that contain references), because equality of type variable references is based on object identity. We need to find a way to restore structural equality even in this case.

Specific use case: ArC (the CDI container in Quarkus) uses TypeVariables as keys to a Map when searching for bean types, during which it has to "resolve type parameters" (apply type arguments supplied by subclasses to generic superclasses, which are effectively type constructors in this context).