}
seenNames.clear();
for (IBundleEntity t : loaded) {
String name = t.getName();
IBundleEntity base = nameToEntity.get(name);
if (seenNames.contains(name)) {
String baseKind = base != null ? kindToString(base.getKind()) : "Element";
collector.fireError(t, baseKind + " `" + bundleName + "." + name + "` was already defined");
} else {
if (base != null ) {
if (base.getKind() != t.getKind() || !base.getSignature().equals(t.getSignature())) {
collector.fireError(t, kindToString(t.getKind()) + " `" + t.toString()
+ "` is not compatible with base " + kindToString(base.getKind()).toLowerCase()
+ " `" + base.toString() + "`");
} else {
t.setBase(base);
}
}
nameToEntity.put(name, t);