swift
4c9bca9c - Implement basic support for opaque parameters.

Commit
4 years ago
Implement basic support for opaque parameters. Implement function parameters of the form `some P` be synthesizing an implicit generic parameter whose requirements come from the opaque type. We then map the opaque type back to the generic parameter, and print as the opaque type. This allows us to write functions with implicit generic parameters: ```swift func f(_: some Collection) { } ``` which is equivalent to: ```swift func f<T: Collection>(_: some T) { } ``` where `T` is an otherwise-unused generic parameter name. All of this is behind the experimental frontend flag `-enable-experimental-opaque-parameters`.
Author
Committer
Parents
Loading