@@ -2848,7 +2848,8 @@ namespace {
2848
2848
SwiftType = Impl.importTypeIgnoreIUO (
2849
2849
ClangType, ImportTypeKind::Typedef,
2850
2850
ImportDiagnosticAdder (Impl, Decl, Decl->getLocation ()),
2851
- isInSystemModule (DC), getTypedefBridgeability (Decl), OTK_Optional);
2851
+ isInSystemModule (DC), getTypedefBridgeability (Decl),
2852
+ getImportTypeAttrs (Decl), OTK_Optional);
2852
2853
}
2853
2854
2854
2855
if (!SwiftType)
@@ -2862,14 +2863,6 @@ namespace {
2862
2863
Loc,
2863
2864
/* genericparams*/ nullptr , DC);
2864
2865
2865
- // If the typedef is marked with @Sendable and not @_nonSendable, make
2866
- // any function type in it Sendable.
2867
- auto sendability = Result->getAttrs ().getEffectiveSendableAttr ();
2868
- if (isa_and_nonnull<SendableAttr>(sendability))
2869
- SwiftType = applyToFunctionType (SwiftType, [](ASTExtInfo info) {
2870
- return info.withConcurrent ();
2871
- });
2872
-
2873
2866
Result->setUnderlyingType (SwiftType);
2874
2867
2875
2868
// Make Objective-C's 'id' unavailable.
@@ -2967,7 +2960,7 @@ namespace {
2967
2960
// Compute the underlying type of the enumeration.
2968
2961
auto underlyingType = Impl.importTypeIgnoreIUO (
2969
2962
decl->getIntegerType (), ImportTypeKind::Enum, addDiag,
2970
- isInSystemModule (dc), Bridgeability::None);
2963
+ isInSystemModule (dc), Bridgeability::None, ImportTypeAttrs () );
2971
2964
if (!underlyingType)
2972
2965
return nullptr ;
2973
2966
@@ -3000,7 +2993,7 @@ namespace {
3000
2993
// Compute the underlying type.
3001
2994
auto underlyingType = Impl.importTypeIgnoreIUO (
3002
2995
decl->getIntegerType (), ImportTypeKind::Enum, addDiag,
3003
- isInSystemModule (dc), Bridgeability::None);
2996
+ isInSystemModule (dc), Bridgeability::None, ImportTypeAttrs () );
3004
2997
if (!underlyingType)
3005
2998
return nullptr ;
3006
2999
@@ -3932,7 +3925,7 @@ namespace {
3932
3925
auto type = Impl.importTypeIgnoreIUO (
3933
3926
clangContext.getTagDeclType (clangEnum), ImportTypeKind::Value,
3934
3927
ImportDiagnosticAdder (Impl, clangEnum, clangEnum->getLocation ()),
3935
- isInSystemModule (dc), Bridgeability::None);
3928
+ isInSystemModule (dc), Bridgeability::None, ImportTypeAttrs () );
3936
3929
if (!type)
3937
3930
return nullptr ;
3938
3931
@@ -3999,7 +3992,8 @@ namespace {
3999
3992
auto importedType =
4000
3993
Impl.importType (decl->getType (), ImportTypeKind::Variable,
4001
3994
ImportDiagnosticAdder (Impl, decl, decl->getLocation ()),
4002
- isInSystemModule (dc), Bridgeability::None);
3995
+ isInSystemModule (dc), Bridgeability::None,
3996
+ ImportTypeAttrs ());
4003
3997
if (!importedType)
4004
3998
return nullptr ;
4005
3999
@@ -4522,7 +4516,8 @@ namespace {
4522
4516
auto importedType =
4523
4517
Impl.importType (decl->getType (), ImportTypeKind::RecordField,
4524
4518
ImportDiagnosticAdder (Impl, decl, decl->getLocation ()),
4525
- isInSystemModule (dc), Bridgeability::None);
4519
+ isInSystemModule (dc), Bridgeability::None,
4520
+ ImportTypeAttrs ());
4526
4521
if (!importedType) {
4527
4522
Impl.addImportDiagnostic (
4528
4523
decl, Diagnostic (diag::record_field_not_imported, decl),
@@ -4649,7 +4644,8 @@ namespace {
4649
4644
(isAudited ? ImportTypeKind::AuditedVariable
4650
4645
: ImportTypeKind::Variable),
4651
4646
ImportDiagnosticAdder (Impl, decl, decl->getLocation ()),
4652
- isInSystemModule (dc), Bridgeability::None);
4647
+ isInSystemModule (dc), Bridgeability::None,
4648
+ ImportTypeAttrs ());
4653
4649
4654
4650
if (!importedType)
4655
4651
return nullptr ;
@@ -5852,7 +5848,7 @@ namespace {
5852
5848
superclassType = Impl.importTypeIgnoreIUO (
5853
5849
clangSuperclassType, ImportTypeKind::Abstract,
5854
5850
ImportDiagnosticAdder (Impl, decl, decl->getLocation ()),
5855
- isInSystemModule (dc), Bridgeability::None);
5851
+ isInSystemModule (dc), Bridgeability::None, ImportTypeAttrs () );
5856
5852
if (superclassType) {
5857
5853
assert (superclassType->is <ClassType>() ||
5858
5854
superclassType->is <BoundGenericClassType>());
@@ -6449,7 +6445,7 @@ SwiftDeclConverter::importSwiftNewtype(const clang::TypedefNameDecl *decl,
6449
6445
ImportDiagnosticAdder addImportDiag (Impl, decl, decl->getLocation ());
6450
6446
auto storedUnderlyingType = Impl.importTypeIgnoreIUO (
6451
6447
decl->getUnderlyingType (), ImportTypeKind::Value, addImportDiag,
6452
- isInSystemModule (dc), Bridgeability::None, OTK_None);
6448
+ isInSystemModule (dc), Bridgeability::None, ImportTypeAttrs (), OTK_None);
6453
6449
6454
6450
if (!storedUnderlyingType)
6455
6451
return nullptr ;
@@ -6470,7 +6466,7 @@ SwiftDeclConverter::importSwiftNewtype(const clang::TypedefNameDecl *decl,
6470
6466
// Find a bridged type, which may be different
6471
6467
auto computedPropertyUnderlyingType = Impl.importTypeIgnoreIUO (
6472
6468
decl->getUnderlyingType (), ImportTypeKind::Property, addImportDiag,
6473
- isInSystemModule (dc), Bridgeability::Full, OTK_None);
6469
+ isInSystemModule (dc), Bridgeability::Full, ImportTypeAttrs (), OTK_None);
6474
6470
if (auto objTy = computedPropertyUnderlyingType->getOptionalObjectType ())
6475
6471
computedPropertyUnderlyingType = objTy;
6476
6472
@@ -6731,7 +6727,7 @@ SwiftDeclConverter::importAsOptionSetType(DeclContext *dc, Identifier name,
6731
6727
auto underlyingType = Impl.importTypeIgnoreIUO (
6732
6728
decl->getIntegerType (), ImportTypeKind::Enum,
6733
6729
ImportDiagnosticAdder (Impl, decl, decl->getLocation ()),
6734
- isInSystemModule (dc), Bridgeability::None);
6730
+ isInSystemModule (dc), Bridgeability::None, ImportTypeAttrs () );
6735
6731
if (!underlyingType)
6736
6732
return nullptr ;
6737
6733
@@ -6952,7 +6948,7 @@ SwiftDeclConverter::getImplicitProperty(ImportedName importedName,
6952
6948
propertyType, ImportTypeKind::Property,
6953
6949
ImportDiagnosticAdder (Impl, getter, getter->getLocation ()),
6954
6950
Impl.shouldAllowNSUIntegerAsInt (isFromSystemModule, getter),
6955
- Bridgeability::Full, OTK_ImplicitlyUnwrappedOptional);
6951
+ Bridgeability::Full, ImportTypeAttrs (), OTK_ImplicitlyUnwrappedOptional);
6956
6952
if (!importedType)
6957
6953
return nullptr ;
6958
6954
@@ -8138,7 +8134,7 @@ Optional<GenericParamList *> SwiftDeclConverter::importObjCGenericParams(
8138
8134
Type superclassType = Impl.importTypeIgnoreIUO (
8139
8135
clang::QualType (unqualifiedClangBound, 0 ), ImportTypeKind::Abstract,
8140
8136
ImportDiagnosticAdder (Impl, decl, decl->getLocation ()),
8141
- false , Bridgeability::None);
8137
+ false , Bridgeability::None, ImportTypeAttrs () );
8142
8138
if (!superclassType) {
8143
8139
return None;
8144
8140
}
0 commit comments