-
Notifications
You must be signed in to change notification settings - Fork 7
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
Handle ExtensionSet type parameters in inference #713
Comments
@croyzor is this just "deal with them when we find them" or the broader "use extension typevars instead of the current notion of variables in inference"? If the former, do we have an issue for the latter? |
I think it's probably the former. I don't think there's a separate issue for the latter yet |
Ok, so I think there are two possibilities here:
TBH I think the latter is saner, and probably easier. |
...particularly given the nested FuncDefn cannot depend on TypeParams declared by any enclosing FuncDefn, e.g. hugr/quantinuum-hugr/src/hugr/validate.rs Lines 591 to 597 in a2e4d05
|
Sorry, I've missed this in my last two comments above - this now is the latter ("use extensionset typevars instead of the current notion of variables in inference"). However, maybe we don't need to do anything just to deal with these, at least after #906 - at that point there will be no nested binders, so (within the scope of a binder, i.e. a FuncDefn) the same DeBruijn index always means the same type variable. We probably should check that ExtensionSet TypeVars don't "escape" their binders (and one way, though not the only way, to do that would be to solve recursively, as suggested) - but perhaps the same solution does both "deal with them when we find them" and the broader "use extension typevars instead of variables"... |
Further discussion - in theory it should be possible to define a Hugr with:
If that all works then we may not need anything more |
Tests in previous
These tests added in #939 and #1003. Further work in #709 should handle the rest |
No description provided.
The text was updated successfully, but these errors were encountered: