Fix incorrect inheritance loop warning in some rare cases with generics, closes #281

This evaluated to true solely based on the generic type, which can go wrong pretty easily if two types in one file have the same one (e.g. via "inheritance" with `typedef One = Array<Int>;` and `typedef Two = Class<Int>;`).