Files
swift-mirror/test/IDE/Inputs/custom-modules/ImportAsMemberError.h
Michael Ilseman 884155c09c [Import as member] Refactor testing.
Separate out error tests, so that we can more extensively test
protocol and non-prototype errors. NFC
2016-03-28 15:41:48 -07:00

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