This code:
class ClassType<U> {
U fu;
ClassType() {}
ClassType(ClassType<U> other) {
this.fu = other.fu;
}
ClassType(U fu) {
this.fu = fu;
}
@Override
public String toString() {
return "ClassType: " + String.valueOf(fu);
}
}
public class Hang {
static <U> ClassType<U> m(ClassType<U> src) {
return new ClassType<U>(src);
}
public static void main(String argv[]) {
ClassType<Number> c = m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>(m(new ClassType<>())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
String result = c.toString();
if (!result.equals("ClassType: null")) {
throw new Error();
}
}
}
Takes forever to be compiled. Main reason naive implementation of some incorporation steps. A huge speed-up can be obtained if some heavy operations like type substitution are not executed for those cases when they imply a no-op