|
|
Previous ID |
SR-11412 |
Radar |
None |
Original Reporter |
@jckarter |
Type |
Task |
Status |
Resolved |
Resolution |
Done |
Additional Detail from JIRA
|
|
Votes |
0 |
Component/s |
Compiler |
Labels |
Task, DiagnosticsQoI |
Assignee |
@theblixguy |
Priority |
Medium |
md5: 9c3965c8e75b831ca4b57e6f55ca261e
Issue Description:
https://twitter.com/0xced/status/1168966245821161472
If a function expects a protocol-typed argument, and the given argument doesn't conform to the protocols, then the compiler suggests force-casting to the protocol type, e.g. insert 'as! P & Q'
. It is more likely that the user intends to make the type conform to those protocols. The compiler should instead offer to add conformances to the required protocols to the type.