Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use flag in error message
  • Loading branch information
tlively committed Mar 26, 2026
commit d4fd9e3247b21f4fe2fccd64f7a96e8b50475ae0
6 changes: 4 additions & 2 deletions src/wasm/wasm-type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1552,8 +1552,10 @@ std::ostream& operator<<(std::ostream& os,
os << reason.getKind();
if (auto* collision = std::get_if<TypeBuilder::RecGroupCollision>(&reason)) {
if (collision->missingFeatures != FeatureSet(FeatureSet::None)) {
os << " (to resolve this, enable "
<< collision->missingFeatures.toString() << ")";
os << " (to resolve this, use";
collision->missingFeatures.iterFeatures(
[&](auto feat) { os << " --enable-" << FeatureSet::toString(feat); });
os << ")";
}
}
return os;
Expand Down
2 changes: 1 addition & 1 deletion test/lit/validation/type-collision-exact.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; RUN: not wasm-opt %s -all --disable-custom-descriptors 2>&1 | filecheck %s

;; CHECK: error: invalid type: distinct rec groups would be identical after binary writing (to resolve this, enable custom-descriptors)
;; CHECK: error: invalid type: distinct rec groups would be identical after binary writing (to resolve this, use --enable-custom-descriptors)

(module
(type $foo (struct))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/validation/type-collision-funcref.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; RUN: not wasm-opt %s -all --disable-gc 2>&1 | filecheck %s

;; CHECK: error: invalid type: distinct rec groups would be identical after binary writing (to resolve this, enable gc)
;; CHECK: error: invalid type: distinct rec groups would be identical after binary writing (to resolve this, use --enable-gc)

(module
(type $foo (func))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/validation/type-collision-null.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; RUN: not wasm-opt %s -all --disable-gc 2>&1 | filecheck %s

;; CHECK: error: invalid type: distinct rec groups would be identical after binary writing (to resolve this, enable gc)
;; CHECK: error: invalid type: distinct rec groups would be identical after binary writing (to resolve this, use --enable-gc)

(module
(type $A (func (param externref)))
Expand Down
Loading