Open voidc opened 1 year ago
One solution might be to only allow the attribute on fully concrete types.
Why would it change anything?
open_inv
on functions and fields is unsound (thing about resolves) and should be removed at some point. If we think it is really needed somewhere in our tests, then we should think again about the design, because this basically means that invariants cannot be used as we want.open_inv
on function argument or return values (which is a feature that does not exists) should be useful, but we have to take care of the interaction with #842.
The
#[open_inv]
attribute can be applied to functions, function arguments, and fields to declare them as having an open type invariant. Concretely:In its current state, the feature is only meant to be used as an escape hatch for cases where would otherwise run into problems with translation cycles (e.g. the map tests). A proper implementation should have additional checks ensuring that it is used correctly. The issue becomes especially relevant with #842 which enables the following unsound uses: