Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0071-sr3714.swift
2017-06-04 11:08:39 -07:00

24 lines
466 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
#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