New J2K: Do not remove semicolon after if expression when then branch is empty in RedundantSemicolonInspection

This commit is contained in:
Ilya Kirillov
2019-03-28 13:43:02 +03:00
committed by Ilya Kirillov
parent b13f7431f2
commit 02c8e4cede
3 changed files with 18 additions and 11 deletions
+1
View File
@@ -34,6 +34,7 @@ fun bar() {
fun baz(args: Array<String>) {
for (arg in args);
while (args.size > 0);
if (args.size > 0);
// But here redundant!
do while (args.size > 0);
}
@@ -72,16 +72,7 @@
</problem>
<problem>
<file>Test.kt</file>
<line>38</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 semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>43</line>
<line>39</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 semicolon</problem_class>
@@ -108,7 +99,16 @@
<problem>
<file>Test.kt</file>
<line>49</line>
<line>46</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 semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>50</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 semicolon</problem_class>