-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of software
Description
Previous ID | SR-11579 |
Radar | None |
Original Reporter | glassomoss (JIRA User) |
Type | Bug |
Status | Closed |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, CompilerCrash |
Assignee | None |
Priority | Medium |
md5: 3fc20d850ccd3dcea6565567feb66ede
Issue Description:
When I am trying to implement @dynamicMemberLookup
subscript having both protocol requirement and default implementation in extension, compiler produces a segfault 11 and "Command CompileSwift failed with a nonzero exit code".
struct Context {
var points: [Int]
}
@dynamicMemberLookup
protocol Proxy: class {
var context: Context { get set }
subscript<T>(dynamicMember keyPath: WritableKeyPath<Context, T>) -> T { get set }
}
extension Proxy {
subscript<T>(dynamicMember keyPath: WritableKeyPath<Context, T>) -> T {
get {
context[keyPath: keyPath]
}
set(newValue) {
context[keyPath: keyPath] = newValue
}
}
}
However, in Xcode 11.0 GM Seed it was at least working correctly in playground. In Xcode 11.1 GM Seed (11A1027) it's not working in pg either: just running endlessly. The only way to make it work is to remove default implementation from extension, which in fact is rightly the opposite situation to SR-8077
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of software