Add inspection "main should return Unit" #KT-16085 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
8784d89f38
commit
1cd438c3f7
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.MainFunctionReturnUnitInspection
|
||||
@@ -0,0 +1,2 @@
|
||||
// PROBLEM: none
|
||||
<caret>fun test(args: Array<String>): Int = 1
|
||||
@@ -0,0 +1,3 @@
|
||||
// FIX: Add explicit Unit return type
|
||||
// DISABLE-ERRORS
|
||||
<caret>fun main(args: Array<String>) = 1
|
||||
@@ -0,0 +1,3 @@
|
||||
// FIX: Add explicit Unit return type
|
||||
// DISABLE-ERRORS
|
||||
<caret>fun main(args: Array<String>): Unit = 1
|
||||
@@ -0,0 +1,3 @@
|
||||
// FIX: Change return type to Unit
|
||||
// DISABLE-ERRORS
|
||||
<caret>fun main(args: Array<String>): Int = 1
|
||||
@@ -0,0 +1,3 @@
|
||||
// FIX: Change return type to Unit
|
||||
// DISABLE-ERRORS
|
||||
<caret>fun main(args: Array<String>): Unit = 1
|
||||
@@ -0,0 +1,4 @@
|
||||
// DISABLE-ERRORS
|
||||
<caret>fun main(args: Array<String>): Int {
|
||||
return 1
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// DISABLE-ERRORS
|
||||
<caret>fun main(args: Array<String>): Unit {
|
||||
return 1
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// PROBLEM: none
|
||||
<caret>fun main(args: Array<String>) {}
|
||||
Reference in New Issue
Block a user