Files
swift-mirror/validation-test/compiler_crashers_fixed/0071-issue-46299.swift
Hamish Knight 4e811c3a88 [test] Merge crasher directories
There is no longer much of a good reason to keep these separate,
merge them.
2025-10-18 12:51:30 +01:00

26 lines
514 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module %s -DLIBRARY -o %t/Lib.swiftmodule
// RUN: %target-swift-frontend -typecheck %s -I %t -verify
// REQUIRES: objc_interop
// https://github.com/apple/swift/issues/46299
#if LIBRARY
import Foundation
public class Test: NSObject {
@objc public var prop: NSObject?
}
#else
import Lib
func test() {
_ = #keyPath(Test.prop) // okay
_ = #keyPath(Test.nonexistent) // expected-error {{type 'Test' has no member 'nonexistent'}}
}
#endif