Open
Description
Bug Report 🐛
The ModelManager fails to throw semantic validation errors in the following two scenarios, which violate the expected behavior as per the Concerto modeling rules:
1. MODEL_FILE_002: Cannot import multiple declarations from the same namespace using separate import statements
Valid syntax (single import statement):
import org.external.types.{Type, AnotherType}
Invalid syntax (multiple separate imports from same namespace):
import org.external.types.Type
import org.external.types.AnotherType
File: model_file_002_duplicate_namespace_imports.cto:
namespace org.example.bad
import org.external.types.Type
import org.external.types.AnotherType
enum Thing {
o ISSUE
}
File: importedTypes.cto:
namespace org.external.types
enum Type {
o VALUE
}
enum AnotherType {
o VALUE
}
ModelManager.validateModelFiles()
does not throw an error here, but it should throw an error due to multiple imports from the same namespace.
2. DECLARATION_002: Declared name conflicts with imported type:
Should throw an error if a local declaration reuses an imported name
File: declaration_002_conflict_with_imported_type.cto:
namespace org.example.conflict
import org.external.types.Type
enum Type {
o OTHER
}
File: importedTypes.cto:
namespace org.external.types
enum Type {
o VALUE
}
ModelManager.validateModelFiles()
does not detect this name conflict even though the declared type Type shadows the imported one, violating namespace/type safety.
Expected Behavior
ModelManager.validateModelFiles()
should throw an error if:
- Multiple import statements are used for the same namespace.
- A local declaration uses the same name as an imported type.
Metadata
Metadata
Assignees
Labels
No labels