File: print_clang_objc_effectful_properties.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (47 lines) | stat: -rw-r--r-- 2,612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// RUN: %empty-directory(%t)

// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -print-module -print-implicit-attrs -source-filename %s -module-to-print=EffectfulProperties -function-definitions=false -enable-experimental-feature SendableCompletionHandlers > %t/EffectfulProperties.printed.txt
// RUN: %FileCheck -input-file %t/EffectfulProperties.printed.txt %s

// REQUIRES: concurrency
// REQUIRES: objc_interop
// REQUIRES: asserts

// CHECK-LABEL: class EffProps : NSObject {
// CHECK:       @available(*, renamed: "getter:doggo()")
// CHECK-NEXT:  func getDogWithCompletion(_ completionHandler: @escaping @Sendable (NSObject) -> Void)
// CHECK:       var doggo: NSObject { get async }

// CHECK:       @available(*, renamed: "getter:catto()")
// CHECK-NEXT:  func obtainCat(_ completionHandler: @escaping @Sendable (NSObject?, (any Error)?) -> Void)
// CHECK-NEXT:  var catto: NSObject? { get async throws }

// CHECK:       @available(*, renamed: "getter:available()")
// CHECK-NEXT:  func checkAvailability(completionHandler: @escaping @Sendable (Bool) -> Void)
// CHECK-NEXT:  var available: Bool { get async }
// CHECK-NEXT:  @available(swift, obsoleted: 3, renamed: "checkAvailability(completionHandler:)")
// CHECK-NEXT:  func checkAvailabilityWithCompletionHandler(_ completionHandler: @escaping @Sendable (Bool) -> Void)

// CHECK:       @available(*, renamed: "getter:touch()")
// CHECK-NEXT:  func returnNothing(completion completionHandler: @escaping @Sendable () -> Void)
// CHECK-NEXT:  var touch: Void { get async }
// CHECK-NEXT:  @available(swift, obsoleted: 3, renamed: "returnNothing(completion:)")
// CHECK-NEXT:  func returnNothingWithCompletion(_ completionHandler: @escaping @Sendable () -> Void)

// CHECK:       @available(*, renamed: "getter:fromNullableHandler()")
// CHECK-NEXT:  func nullableHandler(_ completion: (@Sendable (String) -> Void)? = nil)
// CHECK-NEXT:  var fromNullableHandler: String { get async }

// CHECK:       @available(*, renamed: "getter:mainDogProp()")
// CHECK-NEXT:  func getMainDog(_ completion: @escaping @MainActor @Sendable (String) -> Void)
// CHECK-NEXT:  var mainDogProp: String { get async }

// CHECK:       @available(*, renamed: "regularMainDog()")
// CHECK-NEXT:  func regularMainDog(_ completion: @escaping @MainActor @Sendable (String) -> Void)
// CHECK-NEXT:  @discardableResult
// CHECK-NEXT:  func regularMainDog() async -> String
// CHECK: }

// CHECK-LABEL: class NotEffProps : NSObject {
// CHECK-NOT: var
// CHECK: func EffPropGetDogWithCompletion(_ s: OpaquePointer, _ myBlock: @escaping (NSObject) -> Void) -> Double