-
Notifications
You must be signed in to change notification settings - Fork 47
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
can't inference type of a Nothing value #278
Comments
You are right that this is annoying lack of type inference, but you've hit this before in #254 which is a duplicate of #46. The workaround is to specify the type in the relation, but the long-term fix would be for the backend to deduce that the type of |
A note: after looking into the code, I guess the type deduction and equality-check should happen in binary operations like union. |
Yea, it's tricky. It might be possible to walk both sides of a union and then apply one set of type hints to the other side of the union, but perhaps a better strategy is to extract the relvar's type and not pass it down the union, or perhaps this is a special case for extracting type hints. It's a tough choice which is why I haven't jumped on a solution. |
I would like to offer some thought about type deduction and type check here: relvar1 :: {a a} relvar2 :: {a e} deducedType of attribute a in relvar1 = (a <> (b <> c <> D)) I believe this covers all the three cases you mentioned, and if any of the types is specified, that may be the best type to deduce to. |
`
TutorialD (master/main): a :: {a Maybe Integer}
TutorialD (master/main): insert a relation{tuple{ a Nothing}}
ERR: TypeConstructorTypeVarMissing "a"
`
The text was updated successfully, but these errors were encountered: