You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TokenList.slice(from, to) doesn't have the same behavior as slice in the Scala's std collection. This is due to the fact that the from parameter is exclusive. This is something that rule authors may not expect and can be the cause of bugs for those not familiar with the implementation details of TokenList.
The current behavior also affects usability. For instance, while removing tokens what could take a single step (ctx.removeTokens(tokenList.slice(tk, last)) actually requires 2 (ctx.removeToken(tk) + ctx.removeTokens(tokenList.slice(tk, last)).
TokenList.slice(from, to)
doesn't have the same behavior asslice
in the Scala's std collection. This is due to the fact that thefrom
parameter is exclusive. This is something that rule authors may not expect and can be the cause of bugs for those not familiar with the implementation details ofTokenList
.The current behavior also affects usability. For instance, while removing tokens what could take a single step (
ctx.removeTokens(tokenList.slice(tk, last)
) actually requires 2 (ctx.removeToken(tk) + ctx.removeTokens(tokenList.slice(tk, last)
).See https://github.com/scalacenter/scalafix/pull/474/files#r157779985
The text was updated successfully, but these errors were encountered: