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
[SR-12703] Another Occurrence of the Misleading Error Message "subscript 'subscript(_:)' requires the types 'String.Index' and 'Int' be equivalent"
#55147
Open
marcomasser opened this issue
Apr 29, 2020
· 1 comment
SR-10932 Incorrect Error Description For Substrings
SR-11702 Misleading Error Message "Subscript 'subscript(_: )' requires the types 'String.Index' and 'Int' be equivalent"
Issue Description:
Two issues were fixed that resulted in the same misleading error message: SR-11702 and SR-10932. But this code still triggers it:
varlines: [String] = []
letline = "this is a line"lines.append(line[line.startIndex...])
This is the output:
bug.swift:3:18: error: subscript 'subscript(_:)' requires the types 'String.Index' and 'Int' be equivalent
lines.append(line[line.startIndex...])
^
Swift.String:5:12: note: where 'R.Bound' = 'String.Index'
public subscript<R>(bounds: R) -> String where R : RangeExpression, R.Bound == Int { get }
^
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 735fafb0b9ba9b382f64db0d1e7848a9
relates to:
Issue Description:
Two issues were fixed that resulted in the same misleading error message: SR-11702 and SR-10932. But this code still triggers it:
This is the output:
The text was updated successfully, but these errors were encountered: