swift
c03d7629 - [ConstraintSystem] NFC: Clarify why upward propagation of literal conformances is ncessary at the moment

Commit
5 years ago
[ConstraintSystem] NFC: Clarify why upward propagation of literal conformances is ncessary at the moment This is NFC because only literal protocols are tracked at the moment. Forward propagate (subtype -> supertype) only literal conformance requirements since that helps solver to infer more types at parameter positions. ```swift func foo<T: ExpressibleByStringLiteral>(_: String, _: T) -> T { fatalError() } func bar(_: Any?) {} func test() { bar(foo("", "")) } ``` If one of the literal arguments doesn't propagate its `ExpressibleByStringLiteral` conformance, we'd end up picking `T` with only one type `Any?` which is incorrect. This is not going to be necessary once bindings are filtered based of requirements placed on a type variable.
Author
Committer
Parents
Loading