forked from apple/swift
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apple#25447 from jrose-apple/override-the-train
Add the notion of @_implementationOnly overrides
- Loading branch information
Showing
13 changed files
with
376 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/PrintAsObjC/Inputs/custom-modules/MiserablePileOfSecrets.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import Foundation; | ||
|
||
@interface NSObject (Secrets) | ||
- (void)secretMethod; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@interface Base | ||
@end | ||
|
||
@interface Parent : Base | ||
- (nonnull instancetype)init __attribute__((objc_designated_initializer)); | ||
|
||
// The SECRET is on a non-secret property here because we need to enforce that | ||
// it's not printed. | ||
@property (readonly, strong, nullable) Parent *redefinedPropSECRET; | ||
@end | ||
|
||
@interface GenericParent<T: Base *> : Base | ||
- (nonnull instancetype)init __attribute__((objc_designated_initializer)); | ||
@end | ||
|
||
@interface SubscriptParent : Base | ||
- (nullable Parent *)objectAtIndexedSubscript:(int)index; | ||
@end |
35 changes: 35 additions & 0 deletions
35
test/Sema/Inputs/implementation-only-override/FooKit_SECRET.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#import <FooKit.h> | ||
|
||
@interface SECRETType : Base | ||
@end | ||
|
||
@interface Parent () | ||
- (nonnull instancetype)initWithSECRET:(int)secret __attribute__((objc_designated_initializer, swift_name("init(SECRET:)"))); | ||
|
||
- (void)methodSECRET; | ||
- (nullable SECRETType *)methodWithSECRETType; | ||
|
||
@property (readonly, strong, nullable) Parent *roPropSECRET; | ||
@property (readwrite, strong, nullable) Parent *rwPropSECRET; | ||
|
||
- (nullable Parent *)objectAtIndexedSubscript:(int)index; | ||
|
||
@property (readwrite, strong, nullable) Parent *redefinedPropSECRET; | ||
@end | ||
|
||
@protocol MandatorySecrets | ||
- (nonnull instancetype)initWithRequiredSECRET:(int)secret; | ||
@end | ||
|
||
@interface Parent () <MandatorySecrets> | ||
- (nonnull instancetype)initWithRequiredSECRET:(int)secret __attribute__((objc_designated_initializer)); | ||
@end | ||
|
||
@interface GenericParent<T: Base *> () | ||
@property (readonly, strong, nullable) T roPropSECRET; | ||
- (nullable Parent *)objectAtIndexedSubscript:(int)index; | ||
@end | ||
|
||
@interface SubscriptParent () | ||
- (void)setObject:(nullable Parent *)object atIndexedSubscript:(int)index; | ||
@end |
9 changes: 9 additions & 0 deletions
9
test/Sema/Inputs/implementation-only-override/module.modulemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module FooKit { | ||
header "FooKit.h" | ||
export * | ||
} | ||
|
||
module FooKit_SECRET { | ||
header "FooKit_SECRET.h" | ||
export * | ||
} |
Oops, something went wrong.