Skip to content

Commit e0beba5

Browse files
committed
Revert "[Clang importer] Fix bridging of the underlying types of typedefs."
This reverts commit 687d753, now that the underlying problem is worked out (no pun intended).
1 parent 8ea0796 commit e0beba5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,18 @@ namespace {
684684
auto typedefBridgeability = getTypedefBridgeability(underlyingType);
685685

686686
// Figure out the typedef we should actually use.
687-
SwiftTypeConverter innerConverter(Impl, AllowNSUIntegerAsInt, Bridging);
687+
auto underlyingBridgeability =
688+
(Bridging == Bridgeability::Full
689+
? typedefBridgeability : Bridgeability::None);
690+
SwiftTypeConverter innerConverter(Impl, AllowNSUIntegerAsInt,
691+
underlyingBridgeability);
688692
auto underlyingResult = innerConverter.Visit(underlyingType);
689693

690694
// If we used different bridgeability than this typedef normally
691-
// would, and therefore the underlying type is different from the
692-
// mapping of the typedef, use the underlying type.
693-
if (Bridging != typedefBridgeability &&
695+
// would because we're in a non-bridgeable context, and therefore
696+
// the underlying type is different from the mapping of the typedef,
697+
// use the underlying type.
698+
if (underlyingBridgeability != typedefBridgeability &&
694699
!underlyingResult.AbstractType->isEqual(mappedType)) {
695700
return underlyingResult;
696701
}

0 commit comments

Comments
 (0)