-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generics: Set associated constants using
where
constraints (#1013)
Change the syntax for setting the associated constants and types in an interface implementation for a type from using `let` declarations as in: ``` class Vector(T:! Type) { impl as Iterable { let ElementType:! Type = T; ... } } ``` to using `where` clauses as in: ``` class Vector(T:! Type) { impl as Iterable where .ElementType = T { ... } } ``` This is an attempt to simplify by removing redundancy, improve consistency by removing a use of `let` that was different than other examples, and better support forward declaration that a type implements an interface while retaining the information needed for type checking. Co-authored-by: Richard Smith <[email protected]>
- Loading branch information
Showing
4 changed files
with
250 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.