[JS IR BE] Fix main function detector
- Do not consider extension functions as main candidate
This commit is contained in:
+1
@@ -26,6 +26,7 @@ object JsMainFunctionDetector {
|
|||||||
if (!isSuitableForMainParametersSize(allowEmptyParameters)) return false
|
if (!isSuitableForMainParametersSize(allowEmptyParameters)) return false
|
||||||
if (!returnType.isUnit()) return false
|
if (!returnType.isUnit()) return false
|
||||||
if (name.asString() != "main") return false
|
if (name.asString() != "main") return false
|
||||||
|
if (extensionReceiverParameter != null) return false
|
||||||
|
|
||||||
if (valueParameters.size == 1) {
|
if (valueParameters.size == 1) {
|
||||||
val parameter = valueParameters.single()
|
val parameter = valueParameters.single()
|
||||||
|
|||||||
@@ -20,4 +20,8 @@ fun main(args: Array<String>): Unit? {
|
|||||||
return Unit
|
return Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Any.main(args: Array<String>) {
|
||||||
|
ok += "Fail Any.main(...)"
|
||||||
|
}
|
||||||
|
|
||||||
fun box() = ok
|
fun box() = ok
|
||||||
Reference in New Issue
Block a user