|
| 1 | +// This test checks that swift-ide-test output under either -swift-version 6 or |
| 2 | +// -enable-upcoming-feature ImportObjCForwardDeclarations the output matches the |
| 3 | +// import capabilities of the compiler. |
| 4 | + |
| 5 | +// (1) Print the interface with -enable-upcoming-feature ImportObjCForwardDeclarations |
| 6 | +// RUN: %target-swift-ide-test -print-module -module-to-print IncompleteTypeLibrary1 -I %S/Inputs/custom-modules/IncompleteTypes \ |
| 7 | +// RUN: -enable-objc-interop -enable-upcoming-feature ImportObjcForwardDeclarations -source-filename x | %FileCheck %s |
| 8 | + |
| 9 | +// (2) Print the interface with -swift-version 6 |
| 10 | +// RUN: %target-swift-ide-test -print-module -module-to-print IncompleteTypeLibrary1 -I %S/Inputs/custom-modules/IncompleteTypes \ |
| 11 | +// RUN: -enable-objc-interop -swift-version 6 -source-filename x | %FileCheck %s |
| 12 | + |
| 13 | +// REQUIRES: objc_interop |
| 14 | +// REQUIRES: asserts |
| 15 | + |
| 16 | +// CHECK: import Foundation |
| 17 | +// CHECK: @available(*, unavailable, message: "This Objective-C class has only been forward-declared; import its owning module to use it") |
| 18 | +// CHECK: class ForwardDeclaredInterface { |
| 19 | +// CHECK: } |
| 20 | +// CHECK: @available(*, unavailable, message: "This Objective-C protocol has only been forward-declared; import its owning module to use it") |
| 21 | +// CHECK: protocol ForwardDeclaredProtocol { |
| 22 | +// CHECK: } |
| 23 | +// CHECK: class IncompleteTypeConsumer1 : NSObject { |
| 24 | +// CHECK: var propertyUsingAForwardDeclaredProtocol1: (any ForwardDeclaredProtocol)! |
| 25 | +// CHECK: var propertyUsingAForwardDeclaredInterface1: ForwardDeclaredInterface! |
| 26 | +// CHECK: init!() |
| 27 | +// CHECK: func methodReturningForwardDeclaredProtocol1() -> (any ForwardDeclaredProtocol & NSObjectProtocol)! |
| 28 | +// CHECK: func methodReturningForwardDeclaredInterface1() -> ForwardDeclaredInterface! |
| 29 | +// CHECK: func methodTakingAForwardDeclaredProtocol1(_ param: (any ForwardDeclaredProtocol)!) |
| 30 | +// CHECK: func methodTakingAForwardDeclaredInterface1(_ param: ForwardDeclaredInterface!) |
| 31 | +// CHECK: } |
| 32 | +// CHECK: func CFunctionReturningAForwardDeclaredInterface1() -> ForwardDeclaredInterface! |
| 33 | +// CHECK: func CFunctionTakingAForwardDeclaredInterface1(_ param: ForwardDeclaredInterface!) |
| 34 | +// CHECK: func CFunctionReturningAForwardDeclaredProtocol1() -> (any ForwardDeclaredProtocol & NSObjectProtocol)! |
| 35 | +// CHECK: func CFunctionTakingAForwardDeclaredProtocol1(_ param: (any ForwardDeclaredProtocol)!) |
0 commit comments