mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A member reference to a function with a dynamic 'Self' result type can introduce a covariant return expression into the AST. This is exposed by the (already deeply cursed) -self method on NSObject(Protocol). Add a regression test and said cursed member to the mock SDK.
16 lines
394 B
Swift
16 lines
394 B
Swift
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -enable-objc-interop -print-indexed-symbols -source-filename %s | %FileCheck %s
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
@objc
|
|
class Foo: NSObject {
|
|
// CHECK-DAG: constructor/Swift | init(object:)
|
|
init(object: Any?) {}
|
|
}
|
|
|
|
extension Foo {
|
|
// CHECK-DAG: static-property/Swift | boom
|
|
static let boom = Foo(object: self)
|
|
}
|