File tree 2 files changed +4
-1
lines changed 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1225,6 +1225,7 @@ Attribute Parser::parseStridedLayoutAttr() {
1225
1225
// / `[` integer-literal `]<` attribute-value `>`
1226
1226
// /
1227
1227
Attribute Parser::parseDistinctAttr (Type type) {
1228
+ SMLoc loc = getToken ().getLoc ();
1228
1229
consumeToken (Token::kw_distinct);
1229
1230
if (parseToken (Token::l_square, " expected '[' after 'distinct'" ))
1230
1231
return {};
@@ -1269,7 +1270,7 @@ Attribute Parser::parseDistinctAttr(Type type) {
1269
1270
DistinctAttr distinctAttr = DistinctAttr::create (referencedAttr);
1270
1271
it = distinctAttrs.try_emplace (*value, distinctAttr).first ;
1271
1272
} else if (it->getSecond ().getReferencedAttr () != referencedAttr) {
1272
- emitError (" referenced attribute does not match previous definition: " )
1273
+ emitError (loc, " referenced attribute does not match previous definition: " )
1273
1274
<< it->getSecond ().getReferencedAttr ();
1274
1275
return {};
1275
1276
}
Original file line number Diff line number Diff line change @@ -587,3 +587,5 @@ func.func @duplicate_dictionary_attr_key() {
587
587
#attr = distinct [0 ]<42 : i32 >
588
588
// expected-error@below {{referenced attribute does not match previous definition: 42 : i32}}
589
589
#attr1 = distinct [0 ]<43 : i32 >
590
+
591
+ // -----
You can’t perform that action at this time.
0 commit comments