File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1225,6 +1225,7 @@ Attribute Parser::parseStridedLayoutAttr() {
12251225// / `[` integer-literal `]<` attribute-value `>`
12261226// /
12271227Attribute Parser::parseDistinctAttr (Type type) {
1228+ SMLoc loc = getToken ().getLoc ();
12281229 consumeToken (Token::kw_distinct);
12291230 if (parseToken (Token::l_square, " expected '[' after 'distinct'" ))
12301231 return {};
@@ -1269,7 +1270,7 @@ Attribute Parser::parseDistinctAttr(Type type) {
12691270 DistinctAttr distinctAttr = DistinctAttr::create (referencedAttr);
12701271 it = distinctAttrs.try_emplace (*value, distinctAttr).first ;
12711272 } 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: " )
12731274 << it->getSecond ().getReferencedAttr ();
12741275 return {};
12751276 }
Original file line number Diff line number Diff line change @@ -587,3 +587,5 @@ func.func @duplicate_dictionary_attr_key() {
587587#attr = distinct [0 ]<42 : i32 >
588588// expected-error@below {{referenced attribute does not match previous definition: 42 : i32}}
589589#attr1 = distinct [0 ]<43 : i32 >
590+
591+ // -----
You can’t perform that action at this time.
0 commit comments