Inspection detecting redundant Unit return type (#1144)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
fun foo(): Unit {
|
||||
}
|
||||
|
||||
fun bar(): Unit {
|
||||
return Unit
|
||||
}
|
||||
|
||||
fun baz(): Unit = println("ok")
|
||||
|
||||
fun f1(): Int = 1
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.kt</file>
|
||||
<line>1</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>Test.kt</file>
|
||||
<line>4</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>Test.kt</file>
|
||||
<line>8</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>
|
||||
</problems>
|
||||
+1
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.intentions.RedundantUnitReturnTypeInspection
|
||||
+4
-4
@@ -4,15 +4,15 @@
|
||||
<line>4</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant setter parameter type</problem_class>
|
||||
<description>Remove explicit type specification</description>
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant setter parameter type</problem_class>
|
||||
<description>Redundant setter parameter type</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>10</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant setter parameter type</problem_class>
|
||||
<description>Remove explicit type specification</description>
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant setter parameter type</problem_class>
|
||||
<description>Redundant setter parameter type</description>
|
||||
</problem>
|
||||
</problems>
|
||||
Reference in New Issue
Block a user