Open
Description
Previous ID | SR-12428 |
Radar | rdar://problem/62200992 |
Original Reporter | @krzyzanowskim |
Type | Bug |
Environment
Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
Votes | 1 |
Component/s | |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 2018afc6624a7ec84ffd38dc809a25d5
Issue Description:
This code crashes in runtime at the line where `Self` is used:
class Foo: NSObject {
@objc let value: String = "test"
func test() {
let k1 = \Foo.value // Ok
let k2 = \Self.value // Fatal error: could not demangle keypath type from '��: file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.8.25.8/swift/stdlib/public/core/KeyPath.swift, line 2623
}
}
Foo().test()
https://gist.github.com/krzyzanowskim/2f2dd423ab59ca7a05dfa98a24a730d7
Metadata
Metadata
Assignees
Labels
Area → compiler: The SIL generation stageFeature → types: The 'Self' type in classesA deviation from expected or documented behavior. Also: expected but undesirable behavior.The Swift compiler itselfBug: A crash, i.e., an abnormal termination of softwareFeature: key paths (both native and Objective-C)