Skip to content

Commit c2a2388

Browse files
author
Jan Svoboda
committed
Fix attribute @ SourceLoc in ASTGen
1 parent 686fbf3 commit c2a2388

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Parse/ASTGen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ TypeRepr *ASTGen::generate(AttributedTypeSyntax Type, SourceLoc &Loc) {
217217
auto Attr = Attribute.castTo<AttributeSyntax>();
218218
auto AttrNameStr = Attr.getAttributeName().getText();
219219

220-
auto AttrLoc = generate(Attr.getAttributeName(), Loc);
220+
auto AtLoc = advanceLocBegin(Loc, Attr.getAtSignToken());
221221
auto AttrKind = TypeAttributes::getAttrKindFromString(AttrNameStr);
222222

223-
TypeAttrs.setAttr(AttrKind, AttrLoc);
223+
TypeAttrs.setAttr(AttrKind, AtLoc);
224224

225225
if (AttrKind == TAK_convention) {
226226
auto Argument = Attr.getArgument()->castTo<TokenSyntax>();
@@ -237,7 +237,7 @@ TypeRepr *ASTGen::generate(AttributedTypeSyntax Type, SourceLoc &Loc) {
237237
}
238238

239239
if (TypeAttrs.AtLoc.isInvalid())
240-
TypeAttrs.AtLoc = AttrLoc;
240+
TypeAttrs.AtLoc = AtLoc;
241241
}
242242

243243
if (!TypeAttrs.empty())

0 commit comments

Comments
 (0)