Skip to content

Commit 820aafa

Browse files
committed
Revert "[cxx-interop] Fix assertion failure from unavailable NS_ENUM typedef"
This reverts commit 80db054.
1 parent 5ecea4b commit 820aafa

File tree

2 files changed

+3
-76
lines changed

2 files changed

+3
-76
lines changed

lib/ClangImporter/ImportEnumInfo.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -259,23 +259,10 @@ ImportedType importer::findOptionSetEnum(clang::QualType type,
259259
if (!clangEnum)
260260
return ImportedType();
261261

262-
// Only ASSERT() on assertions-enabled builds. This preserves existing
263-
// behavior and de-risks existing builds, but should be removed after 6.2.
264-
#ifndef NDEBUG
265-
// Assert that the typedef has the same underlying integer representation as
266-
// the enum we think it assigns a type name to.
267-
//
268-
// If these fails, it means that we need a stronger predicate for
262+
// If this fails, it means that we need a stronger predicate for
269263
// determining the relationship between an enum and typedef.
270-
if (auto *tdEnum =
271-
dyn_cast<clang::EnumType>(typedefType->getCanonicalTypeInternal())) {
272-
ASSERT(clangEnum.value()->getIntegerType()->getCanonicalTypeInternal() ==
273-
tdEnum->getDecl()->getIntegerType()->getCanonicalTypeInternal());
274-
} else {
275-
ASSERT(clangEnum.value()->getIntegerType()->getCanonicalTypeInternal() ==
276-
typedefType->getCanonicalTypeInternal());
277-
}
278-
#endif // !NDEBUG
264+
assert(clangEnum.value()->getIntegerType()->getCanonicalTypeInternal() ==
265+
typedefType->getCanonicalTypeInternal());
279266

280267
if (auto *swiftEnum = Impl.importDecl(*clangEnum, Impl.CurrentVersion))
281268
return {cast<TypeDecl>(swiftEnum)->getDeclaredInterfaceType(), false};

test/Interop/Cxx/objc-correctness/ns-enum-with-unavailable-typedef.swift

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)