[SR-6315] Error: Cannot convert value of type to expected argument type for Self Reference Protocol #48865
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Version 9.1 (9B55)
Toolchain: Swift 4.1 Snapshot 2017-11-05 (a)
Additional Detail from JIRA
md5: 861161fd3c5321d8b1876268e8c52866
Issue Description:
With the version 4.1 of the compiler, I implemented protocols that use self reference associated type.
I got the following errors:
Cannot convert value of type '(Nuke) -> AttackMonad' to expected argument type '(Nuke) -> _'
Cannot convert value of type '(Target) -> (Nuke, Target)' to expected argument type '(Target) -> _'
Were the compiler is not able to match the types of parameters of 2 methods declared in a protocol.
You can find the code in the following repo:
https://github.com/davideme/Functional-Swift-Error-Handling
In particular the 2 following lines:
https://github.com/davideme/Functional-Swift-Error-Handling/blob/master/Sources/main.swift#L175
https://github.com/davideme/Functional-Swift-Error-Handling/blob/master/Sources/main.swift#L179
The text was updated successfully, but these errors were encountered: