Do not suggest "Redundant Unit return type" for Nothing-typed expression
So #KT-20261 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
d87c0b164f
commit
1c7d66c803
@@ -7,4 +7,10 @@ fun bar(): Unit {
|
||||
|
||||
fun baz(): Unit = println("ok")
|
||||
|
||||
fun f1(): Int = 1
|
||||
fun f1(): Int = 1
|
||||
|
||||
fun f2(): Unit {
|
||||
throw UnsupportedOperationException("")
|
||||
}
|
||||
|
||||
fun f3(): Unit = throw UnsupportedOperationException("")
|
||||
@@ -23,6 +23,14 @@
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant 'Unit' return type</problem_class>
|
||||
<description>Redundant Unit return type</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Test.kt</file>
|
||||
<line>12</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/Test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant 'Unit' return type</problem_class>
|
||||
<description>Redundant Unit return type</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>WithLambda.kt</file>
|
||||
<line>11</line>
|
||||
|
||||
Reference in New Issue
Block a user