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
[RFC007] Extract runtime contract equality out of typecheck (#2130)
* Extract runtime contract equality out of typecheck
This continues the preparative work to migrate the typechecker to the
new AST. One current blocker is that the `typecheck::eq` is used both by
the typechecker and at runtime for contract deduplication; however we
will get rid of it eventually, while still needing to perform contract
deduplication (until the landing of the bytecode virtual machine).
This commit extract the code from `typecheck::eq` for contract
deduplication in a new module, so that the runtime isn't dependent on
`typecheck` anymore. The code is specialized (as it doesn't need to
handle static contract equality), and in order to eliminate the
dependence on `UnifType`, we drop the ability to compare polymorphic
type. The latter is the only reason `typecheck::eq` operated on
`UnifType` instead of `Type`, but the motivation is not very convincing:
how many times do we encounter a type annotation, itself inside a
contract annotation, such that annotation is a polymorphic type AND it
happens to be a candidate for deduplication? Our intuition would be: zero.
This hypothesis will be validated on our working benchmarks
(instrumentation counts each contract deduplication)
* Update core/src/eval/contract_eq.rs
Co-authored-by: jneem <[email protected]>
---------
Co-authored-by: jneem <[email protected]>
0 commit comments