You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have identified an issue with how aliased imports are resolved in the metamodel's abstract syntax tree (AST). Currently, we determine the presence of an aliased import by checking for the aliased types property in the import statement and verifying the available names.
However, when parsing models, we observe that the alias name is used as the reference instead of the original imported name. During model resolution involving alias imports, we expect the actual import type name to be used along with its corresponding namespace to differentiate between locally declared types and imported types. Historically, the alias name has been used as the reference, while still being linked to the namespace of the imported model. This behavior is problematic because the alias name does not exist in the imported model. Consequently, we should use the actual imported type name for references.
Expected Behavior
The model should resolve using the actual name of the imported type, ensuring that the namespace is correctly referenced to differentiate between local types and imports.
Current Behavior
Currently, when a model is resolved, the alias name is used as the reference, which is invalid because the alias name does not exist in the imported model.
To resolve this issue, we should update the logic to use the original type name rather than the alias. This ensures that when we resolve models, the reference is based on the imported type name, as shown below:
Bug Report 🐛
We have identified an issue with how aliased imports are resolved in the metamodel's abstract syntax tree (AST). Currently, we determine the presence of an aliased import by checking for the aliased types property in the import statement and verifying the available names.
However, when parsing models, we observe that the alias name is used as the reference instead of the original imported name. During model resolution involving alias imports, we expect the actual import type name to be used along with its corresponding namespace to differentiate between locally declared types and imported types. Historically, the alias name has been used as the reference, while still being linked to the namespace of the imported model. This behavior is problematic because the alias name does not exist in the imported model. Consequently, we should use the actual imported type name for references.
Expected Behavior
The model should resolve using the actual name of the imported type, ensuring that the namespace is correctly referenced to differentiate between local types and imports.
Current Behavior
Currently, when a model is resolved, the alias name is used as the reference, which is invalid because the alias name does not exist in the imported model.
Example:
Given the following model:
The resolution would look like:
Possible Solution
To resolve this issue, we should update the logic to use the original type name rather than the alias. This ensures that when we resolve models, the reference is based on the imported type name, as shown below:
Corrected Example:
Steps to Reproduce
-resolve
command via the CLI.Context (Environment)
Desktop
Detailed Description
Possible Implementation
The text was updated successfully, but these errors were encountered: