mirror of
https://github.com/apple/swift.git
synced 2025-12-25 12:15:36 +01:00
Separate out error tests, so that we can more extensively test protocol and non-prototype errors. NFC
34 lines
1006 B
Objective-C
34 lines
1006 B
Objective-C
#ifndef IMPORT_AS_MEMBER_ERR_H
|
|
#define IMPORT_AS_MEMBER_ERR_H
|
|
|
|
struct __attribute__((swift_name("ErrorStruct"))) IAMStruct {
|
|
double x, y, z;
|
|
};
|
|
|
|
@import Foundation;
|
|
|
|
@protocol ImportedProtocolBase;
|
|
@protocol ImportedProtocolBase <NSObject>
|
|
@end
|
|
typedef NSObject<ImportedProtocolBase> *ImportedProtocolBase_t;
|
|
|
|
@protocol ErrorProto;
|
|
@protocol ErrorProto <ImportedProtocolBase>
|
|
@end
|
|
|
|
typedef NSObject<ErrorProto> *ErrorProto_t;
|
|
|
|
// Instance and static member onto protocol
|
|
void mutateSomeStaticState()
|
|
__attribute__((swift_name("ErrorProto.mutateSomeStaticState()"))); // ok
|
|
void mutateSomeInstanceState(ErrorProto_t self) __attribute__((
|
|
swift_name("ErrorProto.mutateSomeInstanceState(self:)"))); // error
|
|
|
|
// Non-prototype declaration
|
|
extern void IAMErrorStructHasPrototype(void)
|
|
__attribute__((swift_name("ErrorStruct.hasPrototype()"))); // ok
|
|
extern void IAMErrorStructNonPrototype()
|
|
__attribute__((swift_name("ErrorStruct.nonPrototype()"))); // error
|
|
|
|
#endif // IMPORT_AS_MEMBER_ERR_H
|