You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extension::add_op_.... takes an ExtensionRegistry which it uses to validate the type params, type scheme etc. of the new op. But if the op refers to types defined in the same extension, this is very tricky!!
One possible but far-from-ideal situation is to break every extension into two - the types and the ops - then you can build an ExtensionRegistry from the types before starting on the ops.
Another possibility would be for add_op_xxx to include the extension (to which the op is added) together in the ExtensionRegistry when validating the type scheme. That allows an Extension's ops to refer to types in the same Extension, but is still difficult if you are making two Extensions each of which has ops referring to the others types, say.
Instead we propose a solution where adding an op, etc., does not perform validation or require an ExtensionRegistry (?). Instead validation of the whole ExtensionRegistry is performed in a single step (when building the ExtensionRegistry out of a Vec, say). Feedback is a little slower but this recovers most flexibility.
The text was updated successfully, but these errors were encountered:
…701)
Closes#676
* Replace PolyFunc::new_validated with ::new to allow (a) building
without an ExtensionRegistry and (b) PolyFuncTypes with free variables
(necessary for nested instances)
* Update a bunch of code in std_extensions code and elsewhere using a
`temp_reg` or similar, this is no longer needed
* Change `[Extension1, Extension2, ...].into()` into
`ExtensionRegistry::try_new` which does validation and can fail with an
`(ExtensionId, SignatureError)`
* This required updating the test_quantum extension's registry to
include float_types
* Some commoning up of registries, and move `test_registry` to the one
file that actually used it (it doesn't seem so distinguished now we have
registries all over the place!)
Extension::add_op_.... takes an ExtensionRegistry which it uses to validate the type params, type scheme etc. of the new op. But if the op refers to types defined in the same extension, this is very tricky!!
One possible but far-from-ideal situation is to break every extension into two - the types and the ops - then you can build an ExtensionRegistry from the types before starting on the ops.
Another possibility would be for
add_op_xxx
to include the extension (to which the op is added) together in the ExtensionRegistry when validating the type scheme. That allows an Extension's ops to refer to types in the same Extension, but is still difficult if you are making two Extensions each of which has ops referring to the others types, say.Instead we propose a solution where adding an op, etc., does not perform validation or require an ExtensionRegistry (?). Instead validation of the whole ExtensionRegistry is performed in a single step (when building the ExtensionRegistry out of a Vec, say). Feedback is a little slower but this recovers most flexibility.
The text was updated successfully, but these errors were encountered: