Skip to content

Commit a67341c

Browse files
committed
Revert "Swift: make unknown entity type check more solid"
This reverts commit b52a4e1.
1 parent b52a4e1 commit a67341c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

swift/extractor/infra/SwiftDispatcher.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ class SwiftDispatcher {
8080
void emitUnknown(E* entity) {
8181
auto label = assignNewLabel(entity);
8282
using Trap = BindingTrapOf<E>;
83-
Trap entry{label};
84-
// check that Trap only has the `id` field by using structured binding on it
85-
auto [id] = entry;
86-
std::ignore = id;
87-
emit(entry);
83+
static_assert(sizeof(Trap) == sizeof(label),
84+
"Binding traps of unknown entities must only have the `id` field (the class "
85+
"should be empty in schema.yml)");
86+
emit(Trap{label});
8887
emit(ElementIsUnknownTrap{label});
8988
}
9089

0 commit comments

Comments
 (0)