Skip to content

Commit 4a6d78e

Browse files
committed
[MLIR][ODS] Improve diagnostic for using a property as an anchor
The diagnostic make it more clear that it does not have an optionalParser field defined. Fix #147020
1 parent d0db199 commit 4a6d78e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/tools/mlir-tblgen/OpFormatGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3779,7 +3779,8 @@ LogicalResult OpFormatParser::verifyOptionalGroupElement(SMLoc loc,
37793779
Property prop = propEle->getVar()->prop;
37803780
if (isAnchor && !(prop.hasDefaultValue() && prop.hasOptionalParser()))
37813781
return emitError(loc, "only properties with default values "
3782-
"that can be optionally parsed "
3782+
"that can be optionally parsed (have the `let "
3783+
"optionalParser = ...` field defined) "
37833784
"can be used to anchor an optional group");
37843785
return success();
37853786
})

0 commit comments

Comments
 (0)