You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
slavapestov opened this issue
Apr 12, 2018
· 5 comments
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
protocol P {
subscript<T : Y>(_: T) -> Int { get set }
}
struct Q : P {
subscript<T : X>(_ idx: T) -> Int {
get { return 0 } set { idx.foo() }
}
}
protocol Y : X {}
protocol X { func foo() }
struct Idx : Y {
func foo() { print("Hello world") }
}
func foo<T : P>(_ t: inout T) {
t[Idx()] += 1
}
var q = Q()
foo(&q)
The materializeForSet callback has an incompatible generic signature from the protocol requirement, because it expects the conformance to X but receives the conformance to Y.
The text was updated successfully, but these errors were encountered:
@rjmccall I'm assuming that coroutines will "just work" here, because the generic environment will be saved in the context and not passed to the continuation.
#15890 should address this in the short term, but we might want to keep this ticket open as a reminder. If coroutines don't make the cut, we should look into making the materializeForSet ABI pass the generic environment through the context to systematically address this class of problems.
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Additional Detail from JIRA
md5: 476c482fcc53a3fe5635b0686f1bc69e
Issue Description:
The materializeForSet callback has an incompatible generic signature from the protocol requirement, because it expects the conformance to X but receives the conformance to Y.
The text was updated successfully, but these errors were encountered: