Add inspection to move the variable declaration into when

#KT-29001 Fixed
This commit is contained in:
Dmitry Gridin
2019-02-14 13:25:27 +03:00
parent 7abe9333c8
commit 33954c7632
15 changed files with 220 additions and 0 deletions
@@ -2932,6 +2932,15 @@
language="kotlin"
/>
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.MoveVariableDeclarationIntoWhenInspection"
displayName="Variable declaration could be moved inside `when`"
groupPath="Kotlin"
groupName="Style issues"
enabledByDefault="true"
level="WEAK WARNING"
language="kotlin"
/>
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.MainFunctionReturnUnitInspection"
displayName="Entry point function should return Unit"
groupPath="Kotlin"
@@ -0,0 +1,5 @@
<html>
<body>
This inspection reports the variable declaration that can be moved inside <code>when</code> expression.
</body>
</html>