- if (effectiveStatement instanceof TypeDefinition) {
- TypeDefinition<?> typeDefinition = (TypeDefinition<?>) effectiveStatement;
- typeDefinitionsInit.add(typeDefinition);
- }
- if (this.input == null && effectiveStatement instanceof InputEffectiveStatementImpl) {
- this.input = (InputEffectiveStatementImpl) effectiveStatement;
- }
- if (this.output == null && effectiveStatement instanceof OutputEffectiveStatementImpl) {
- this.output = (OutputEffectiveStatementImpl) effectiveStatement;
+ if (effectiveStatement instanceof TypeDefEffectiveStatementImpl) {
+ TypeDefEffectiveStatementImpl typeDef = (TypeDefEffectiveStatementImpl) effectiveStatement;
+ TypeDefinition<?> type = typeDef.getTypeDefinition();
+ if (!mutableTypeDefinitions.contains(type)) {
+ mutableTypeDefinitions.add(type);
+ } else {
+ throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
+ }