-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
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 softwarekey pathsFeature: key paths (both native and Objective-C)Feature: key paths (both native and Objective-C)regressionrun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during executionswift 5.0
Description
Previous ID | SR-10264 |
Radar | rdar://problem/50255258 |
Original Reporter | Pakaste (JIRA User) |
Type | Bug |
Environment
-
Xcode 10.2 (10E125)
-
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
-
macOS 10.14.4 (18E226)
-
iOS simulator with iOS 12.2 (16E226)
Additional Detail from JIRA
Votes | 2 |
Component/s | Compiler |
Labels | Bug, 5.0Regression, KeyPaths, RunTimeCrash |
Assignee | Pakaste (JIRA) |
Priority | Medium |
md5: fcc8044a8caab7fcf236a31574835eff
is duplicated by:
Issue Description:
I have the following in an iOS framework target called KeyPathCrash:
class Foo {
var title: String = ""
}
And the following file in the test target:
import XCTest
@testable import KeyPathCrash
class KeyPathCrashTests: XCTestCase {
func test() {
let f = Foo()
f[keyPath: \.title] = "bar"
}
}
The test crashes with "Thread 1: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff8)". If I have the key-path assignment inside the framework target, it works fine.
This is a new problem with Xcode 10.2/Swift 5. It worked with Xcode 10.1/Swift 4.2.
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 softwarekey pathsFeature: key paths (both native and Objective-C)Feature: key paths (both native and Objective-C)regressionrun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during executionswift 5.0