Files
openide/plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ReplaceRangeStartEndInclusiveWithFirstLast.html
Ilya Kirillov 3386f8f5a9 [kotlin] move inspection descriptions to separate module to reuse in K2
GitOrigin-RevId: e9d7382f4d640e27b1958d1bf2d4c3e639915137
2022-07-13 09:59:31 +00:00

20 lines
697 B
HTML

<html>
<body>
Reports <b>boxed</b> <code>Range.start</code> and <code>Range.endInclusive</code> properties.
<p>These properties can be replaced with <b>unboxed</b> <code>first</code> and <code>last</code> properties to avoid redundant calls.</p>
<p>The quick-fix replaces <code>start</code> and <code>endInclusive</code> properties with the corresponding <code>first</code> and <code>last</code>.</p>
<p><b>Example:</b></p>
<pre><code>
fun foo(range: CharRange) {
val lastElement = range.endInclusive
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
fun foo(range: CharRange) {
val lastElement = range.last
}
</code></pre>
<!-- tooltip end -->
</body>
</html>