mirror of
https://github.com/apple/swift.git
synced 2025-12-25 12:15:36 +01:00
This introduces support for swift_newtype(struct) attribute (also known as swift_wrapper). The Clang importer will create a brand new struct corresponding to the annotated typedefs, which has a backing raw value. Globals of that type are imported as static members on the struct. Additionally, this interacts seamlessly with prior import-as-member work, meaning that the newly created type can be imported onto. Tests included.
55 lines
748 B
Plaintext
55 lines
748 B
Plaintext
module OmitNeedlessWords {
|
|
export *
|
|
header "OmitNeedlessWords.h"
|
|
}
|
|
|
|
module ImportedProtocols {
|
|
export *
|
|
module SubModule {
|
|
requires objc
|
|
header "ImportedProtocols.h"
|
|
}
|
|
}
|
|
|
|
module Newtype {
|
|
export *
|
|
header "Newtype.h"
|
|
}
|
|
|
|
module ImportAsMember {
|
|
export *
|
|
|
|
module A {
|
|
header "ImportAsMember.h"
|
|
}
|
|
|
|
module B {
|
|
header "ImportAsMemberB.h"
|
|
}
|
|
|
|
module C {
|
|
requires objc
|
|
header "ImportAsMemberC.h"
|
|
}
|
|
|
|
module Proto {
|
|
requires objc
|
|
header "ImportAsMemberProto.h"
|
|
}
|
|
|
|
module Class {
|
|
requires objc
|
|
header "ImportAsMemberClass.h"
|
|
}
|
|
}
|
|
|
|
module IAMError {
|
|
export *
|
|
requires objc
|
|
header "ImportAsMemberError.h"
|
|
}
|
|
|
|
module InferImportAsMember {
|
|
export *
|
|
header "InferImportAsMember.h"
|
|
} |