In the issue, the MyDataType rule infers a number type (due to its content) instead of the declared string type. This change first checks whether the declared type can be assigned directly to the expected type. Only if that fails will the validation attempt to use the computed type for checking.
Closes https://github.com/eclipse-langium/langium/issues/1256
In the issue, the
MyDataType
rule infers anumber
type (due to its content) instead of the declaredstring
type. This change first checks whether the declared type can be assigned directly to the expected type. Only if that fails will the validation attempt to use the computed type for checking.