|
31 | 31 | using namespace swift;
|
32 | 32 | using namespace swift::Lowering;
|
33 | 33 |
|
34 |
| -AbstractionPattern TypeConverter::getAbstractionPattern(AbstractStorageDecl *decl) { |
| 34 | +AbstractionPattern |
| 35 | +TypeConverter::getAbstractionPattern(AbstractStorageDecl *decl, |
| 36 | + bool isNonObjC) { |
35 | 37 | if (auto var = dyn_cast<VarDecl>(decl)) {
|
36 |
| - return getAbstractionPattern(var); |
| 38 | + return getAbstractionPattern(var, isNonObjC); |
37 | 39 | } else {
|
38 |
| - return getAbstractionPattern(cast<SubscriptDecl>(decl)); |
| 40 | + return getAbstractionPattern(cast<SubscriptDecl>(decl), isNonObjC); |
39 | 41 | }
|
40 | 42 | }
|
41 | 43 |
|
42 |
| -AbstractionPattern TypeConverter::getAbstractionPattern(SubscriptDecl *decl) { |
| 44 | +AbstractionPattern |
| 45 | +TypeConverter::getAbstractionPattern(SubscriptDecl *decl, bool isNonObjC) { |
43 | 46 | CanGenericSignature genericSig;
|
44 | 47 | if (auto sig = decl->getGenericSignatureOfContext())
|
45 | 48 | genericSig = sig->getCanonicalSignature();
|
@@ -67,14 +70,18 @@ static const clang::Type *getClangType(const clang::Decl *decl) {
|
67 | 70 | return cast<clang::ObjCPropertyDecl>(decl)->getType().getTypePtr();
|
68 | 71 | }
|
69 | 72 |
|
70 |
| -AbstractionPattern TypeConverter::getAbstractionPattern(VarDecl *var) { |
| 73 | +AbstractionPattern |
| 74 | +TypeConverter::getAbstractionPattern(VarDecl *var, bool isNonObjC) { |
71 | 75 | CanGenericSignature genericSig;
|
72 | 76 | if (auto sig = var->getDeclContext()->getGenericSignatureOfContext())
|
73 | 77 | genericSig = sig->getCanonicalSignature();
|
74 | 78 |
|
75 | 79 | CanType swiftType = var->getInterfaceType()
|
76 | 80 | ->getCanonicalType();
|
77 | 81 |
|
| 82 | + if (isNonObjC) |
| 83 | + return AbstractionPattern(genericSig, swiftType); |
| 84 | + |
78 | 85 | if (auto clangDecl = var->getClangDecl()) {
|
79 | 86 | auto clangType = getClangType(clangDecl);
|
80 | 87 | auto contextType = var->getDeclContext()->mapTypeIntoContext(swiftType);
|
|
0 commit comments