Open nickbattle opened 3 years ago
It ought to be possible to avoid the warning by explicitly re-stating the type of the import:
...
imports from A values PERCENT : set1 of nat renamed PERCENT;
...
But that currently fails too. That is because import/renames ignore the stated type, giving preference to the type of the definition referred to - though as above, that isn't working in some cases. I will push a small fix to allow these explicit re-stated types to take effect. That does not fix the underlying problem, but it gives us a work-around to avoid the warning.
The fix to use the type in the import is now pushed to ncb/development.
The following spec gives an incorrect warning:
This is because the imported definition is a clone of the original export, not a reference to it (as Overture's AST requires). So when the definition in A is type-resolved, that does not update the imported/renamed definition in B. Subsequently it treats PERCENT as an unknown type, which in the bind context looks like it could possibly be an empty set.