Skip to content

[c++-interop] APINotes test for ObjCMethods #41998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/Interop/Cxx/apinotes/Inputs/SomeModule.apinotes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ Name: SomeModule
Classes:
- Name: NSSomeClass
SwiftName: SomeClass
Methods:
- Selector: 'didMoveToParentViewController:'
SwiftName: didMove(toParent:)
MethodKind: Instance
6 changes: 6 additions & 0 deletions test/Interop/Cxx/apinotes/Inputs/SomeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
-(instancetype)init;
@end

// Extension, inspired by UIKit UIViewController.h
@interface NSSomeClass (UIContainerViewControllerCallbacks)

- (void)didMoveToParentViewController:(NSSomeClass *)parent;

@end
13 changes: 13 additions & 0 deletions test/Interop/Cxx/apinotes/apinotes-objcxx-smoke.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ import SomeModule
// CHECK-IDE-TEST: typealias NSSomeClass = SomeClass
// CHECK-IDE-TEST-NEXT: class SomeClass
class MyClass : SomeClass { }

// CHECK-IDE-TEST: extension SomeClass {
// CHECK-IDE-TEST-NEXT: class func didMove(toParent parent
// CHECK-IDE-TEST-NEXT: func didMove(toParent parent:
// CHECK-IDE-TEST-NEXT: @available
// CHECK-IDE-TEST-NEXT: class func didMoveToParentViewController(_ parent
// CHECK-IDE-TEST-NEXT: @available
// CHECK-IDE-TEST-NEXT: func didMoveToParentViewController(_ parent

// CHECK: didMove
let a = SomeClass()
let b = MyClass()
let c = b!.didMove(toParent: a!)