-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Labels
C-chalk-solveIssues related to the chalk-solve crateIssues related to the chalk-solve cratecurrent-sprintBeing worked on in the current sprintBeing worked on in the current sprint
Description
The goal here is to model Rust's impl Trait. For now the starting plan is to have a version where chalk is given both the opaque type declaration and the hidden type:
opaque type T<..>: Bounds = HiddenTy;Note that opaque types can be generic.
We will model opaque types as an special kind of alias. Like associated types aliases, when an opaque type alias T is equated with some other type U, we will generate an AliasEq(T = U) goal.
The difference is that the two clauses for AliasEq goals work a bit differently. In particular, the "normalization" rule requires a special goal, Reveal, to be in the environment:
AliasEq(T = HiddenTy) :- Reveal.
AliasEq(T = !T).There are also special rules for the !T placeholder:
Implemented(!T: Bounds). // from the declaration
// for auto traits:
Implemented(!T: AutoTrait) :- Implemented(HiddenTy: AutoTrait).
Metadata
Metadata
Assignees
Labels
C-chalk-solveIssues related to the chalk-solve crateIssues related to the chalk-solve cratecurrent-sprintBeing worked on in the current sprintBeing worked on in the current sprint