EVALUATION
Type-variable bounds might refer to classes belonging to a cyclic inheritance tree which causes the resolution process to enter a loop when looking up for symbols.
In this case, the resolution process hangs in method Resolve.findMemberType() when trying to attribute the declared bound of the type variable Cyclic.T. The resolution process is structured so that the entire inheritance tree (starting from the class in which the symbol is referenced) is browsed until a matching symbol is found. In this case this process never ends since the symbol Cyclic (the bound of Cyclic.T) is searched within the scope of Cyclic itself during the attribution of the bound of Cyclic.T. Since no such symbol is found within the scope of Cyclic, the resolver then tries to find the given symbol inside the scope of the Cyclic' supertype. However, since the supertype of Cyclic happens to be Cyclic itself, this causes the same method to be recusrively invoke with the same arguments.
The solution is to detect anomalies in the inheritance trees BEFORE starting the attribution of type variables.
|