<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m trying to solve SR-4715, which is about improving the fixit for the diagnostic about out-of-order arguments. Currently I’m stuck with an issue where I can’t figure out the end of an argument expression in the TupleExpr that I have.&nbsp;<div class=""><br class=""></div><div class="">It would seem that this should work:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">auto&nbsp;tuple = cast&lt;TupleExpr&gt;(ArgExpr);</div><div class="">auto end = tuple-&gt;getElement(argIdx)-&gt;getEndLoc();</div></blockquote><div class=""><br class=""></div><div class="">but I have one unit test that’s failing because the range of the argument is incorrect. The only difference I can see in that test, compared to the similar ones that are passing is that the argument is a number with more than one digit. Looking at&nbsp;NumberLiteralExpr (the superclass of&nbsp;IntegerLiteralExpr) I can see that&nbsp;getSourceRange() only returns the DigitsLoc source location, not a range with a length.&nbsp;</div><div class=""><br class=""></div><div class="">If I instead get the CharSourceRange for that range, and get the End source location from that, it get’s me the location that I’m after:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">auto end = Lexer::getCharSourceRangeFromSourceRange(</div><div class="">&nbsp; &nbsp; TC.Context.SourceMgr,&nbsp;</div><div class="">&nbsp; &nbsp; tuple-&gt;getElement(argIdx)-&gt;getSourceRange()</div><div class="">).getEnd();&nbsp;</div></blockquote><div class=""><br class=""></div><div class="">Is this the correct way to get the location of the end of a multi digit&nbsp;NumberLiteralExpr or should the first approach have worked?&nbsp;</div><div class=""><br class=""></div><div class="">Perhaps I don’t understand the distinction between SourceRange and CharSourceRange. Is SourceRange the location of the token (where Start and End would be the same) and CharSourceRange the location of the characters?</div><div class=""><br class=""></div><div class="">Kind regards,</div><div class="">David</div></body></html>