New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler warning if two types have any field names in common #775
Comments
To follow up on this, is there any way to get this warning to go away? I ran into this same situation and have tried disambiguating in various ways but the warning still shows |
you can do
which should prevent the warning. |
This project looks really interesting!
Could you clarify further? Considering the following code:
I'm guessing it's a compiler bug that And assuming so it's possible to work around by disambiguating manually, what's the correct syntax for the final line in this sample? |
The name of this issue has been changed because this isnt exclusive to records. Record IssueThe initial issue references Records which can be handled just by adding a as @SteveSandersonMS referenced above with EnumsEnums have the same issue take the example program here:
as can be seen in the sample program we are able to dissambiguate at the deffinition the same way we do for records A note is lets say you had a program like:
you would get an error on the line Work Arroundsfor now in the case of records with the same fields and defining enums you can just append |
Fixed in #2072 |
The compiler emits a warning for the following program. Unless there's something fundamental I don't understand about Grain's type system, I think the two record types should coexist peacefully and stay independent of each other if I use explicit type annotations.
Same happens in this case:
The text was updated successfully, but these errors were encountered: