Open swift-ci opened 6 years ago
cc @jckarter
@DougGregor, @rudkx, or @xedin would be a better judge of the intended behavior here. It seems like the extension `sum` ought to be more specific in this case, but is the type checker set up to score constrained generics in this way (or expected to be)?
I think my changes in https://github.com/apple/swift/pull/15946 are going to fix this case because first extension is supposed to be more specific than other one one with generic signature in `sum` method.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | @xedin | |Priority | Medium | md5: 1ff3c4a77acedeb5a72b9815c51ccc1dIssue Description:
Reproduction scenario:
yields the following not very helpful error:
I suspect the real error is that series is a Sequence of Any? instead of Numeric?
For more context, please see this thread on forums.swift.org:
https://forums.swift.org/t/generic-method-over-a-sequence-of-optionals/12106