Kotlin Facet: Check contradictory values of "coroutine support" option
#KT-16109 Fixed
Original commit: 330beebb2c
This commit is contained in:
@@ -74,12 +74,14 @@ enum class CoroutineSupport(
|
|||||||
companion object {
|
companion object {
|
||||||
val DEFAULT = ENABLED_WITH_WARNING
|
val DEFAULT = ENABLED_WITH_WARNING
|
||||||
|
|
||||||
@JvmStatic fun byCompilerArguments(arguments: CommonCompilerArguments?) = when {
|
@JvmStatic fun byCompilerArguments(arguments: CommonCompilerArguments?) = byCompilerArgumentsOrNull(arguments) ?: DEFAULT
|
||||||
arguments == null -> DEFAULT
|
|
||||||
|
fun byCompilerArgumentsOrNull(arguments: CommonCompilerArguments?) = when {
|
||||||
|
arguments == null -> null
|
||||||
arguments.coroutinesEnable -> ENABLED
|
arguments.coroutinesEnable -> ENABLED
|
||||||
arguments.coroutinesWarn -> ENABLED_WITH_WARNING
|
arguments.coroutinesWarn -> ENABLED_WITH_WARNING
|
||||||
arguments.coroutinesError -> DISABLED
|
arguments.coroutinesError -> DISABLED
|
||||||
else -> DEFAULT
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun byCompilerArgument(argument: String): CoroutineSupport {
|
fun byCompilerArgument(argument: String): CoroutineSupport {
|
||||||
|
|||||||
Reference in New Issue
Block a user