Files
swift-mirror/test/SILGen/keypaths_import_as_member.swift
Joe Groff e5b0ffc2df SILGen: Use the original function address as the ID for key paths to import-as-member properties.
If an import-as-member property was used in a key path, we'd try to identify the component by its
foreign-to-native thunk, which isn't normally generated (causing a crash from the missing symbol)
and wouldn't be globally unique even if it were. Fixes rdar://problem/60519829.
2020-04-03 14:08:24 -07:00

8 lines
322 B
Swift

// RUN: %target-swift-emit-silgen %s -import-objc-header %S/Inputs/keypaths_import_as_member.h | %FileCheck %s
// CHECK-LABEL: sil {{.*}} @$s{{.*}}23keyPathToImportedMember
func keyPathToImportedMember() {
// CHECK: keypath $KeyPath<Butt, Int32>, (root $Butt; gettable_property $Int32, id @ButtSize
_ = \Butt.size
}