Files
openide/plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/RedundantInnerClassModifier.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

46 lines
1009 B
HTML

<html>
<body>
Reports the <code>inner</code> modifier on a class as redundant if it doesn't reference members of its outer class.
<p><b>Example:</b></p>
<pre><code>
class Foo {
<b>inner</b> class InnerClass { // redundant `inner` modifier
fun hello() {
println("Hi!")
}
}
}
class List {
val objects = Array&lt;Any&gt;(42) { Any() }
<b>inner</b> class Iterator { // Not redundant `inner` modifier
fun next(): Any {
return objects[0]
}
}
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
class Foo {
class InnerClass { // redundant `inner` modifier
fun hello() {
println("Hi!")
}
}
}
class List {
val objects = Array&lt;Any&gt;(42) { Any() }
<b>inner</b> class Iterator { // Not redundant `inner` modifier
fun next(): Any {
return objects[0]
}
}
}
</code></pre>
</body>
</html>