Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generics details 6: remove facets (#950)
There were some concerns about facet types leaking out of generic code in return types. Some initial fixes for this were done in [PR #900](#900), but there remain concerns, for example when associated types are involved. In particular, given an interface method with return type using an associated type, as in: ``` interface Deref { let Result:! Type; fn DoDeref[me: Self]() -> Result; } class IntHandle { impl as Deref { let Result:! Type = i32; fn DoDeref[me: Self]() -> Result { ... } } } ``` Since `Result` has type `Type`, we had the problem that `IntHandle.DoDeref` would have to return `i32 as Type`, instead of the desired `i32`. We also think we can simplify the model by eliminating the facet type concept and syntax. This proposal removes facet types, introduces archetypes in their place, clarifies how associated types work outside of a generic function, and specifies how a generic `let` statement in a function body works. Co-authored-by: Wolff Dobson <[email protected]> Co-authored-by: Richard Smith <[email protected]>
- Loading branch information