We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd63bab commit b52a4e1Copy full SHA for b52a4e1
swift/extractor/infra/SwiftDispatcher.h
@@ -80,10 +80,11 @@ class SwiftDispatcher {
80
void emitUnknown(E* entity) {
81
auto label = assignNewLabel(entity);
82
using Trap = BindingTrapOf<E>;
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});
+ Trap entry{label};
+ // check that Trap only has the `id` field by using structured binding on it
+ auto [id] = entry;
+ std::ignore = id;
87
+ emit(entry);
88
emit(ElementIsUnknownTrap{label});
89
}
90
0 commit comments