Object literal to lambda: handle last comment correctly #KT-15670 Fixed

This commit is contained in:
Mikhail Glukhikh
2017-01-26 16:16:23 +03:00
parent c0f5cafbd8
commit 08caf0a011
7 changed files with 63 additions and 7 deletions
@@ -0,0 +1,7 @@
// WITH_RUNTIME
val r = object: Runnable<caret> {
override fun run() {
TODO("not implemented") //To change body ...
}
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
val r = Runnable {
TODO("not implemented") //To change body ...
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
val r = object: Runnable<caret> {
override fun run() = TODO("not implemented") //To change body ...
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
val r = Runnable {
TODO("not implemented") //To change body ...
}
@@ -166,4 +166,22 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Convert object literal to lambda</problem_class>
<description>Convert to lambda</description>
</problem>
<problem>
<file>WithComment.kt</file>
<line>3</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/WithComment.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Object literal can be converted to lambda</problem_class>
<description>Convert to lambda</description>
</problem>
<problem>
<file>WithCommentAfterExpression.kt</file>
<line>3</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/WithCommentAfterExpression.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Object literal can be converted to lambda</problem_class>
<description>Convert to lambda</description>
</problem>
</problems>