Kotlin Facet: Check contradictory values of "coroutine support" option

#KT-16109 Fixed

Original commit: 330beebb2c
This commit is contained in:
Alexey Sedunov
2017-02-08 15:18:33 +03:00
parent 9558f5188a
commit 7bc894d0fe
@@ -74,12 +74,14 @@ enum class CoroutineSupport(
companion object {
val DEFAULT = ENABLED_WITH_WARNING
@JvmStatic fun byCompilerArguments(arguments: CommonCompilerArguments?) = when {
arguments == null -> DEFAULT
@JvmStatic fun byCompilerArguments(arguments: CommonCompilerArguments?) = byCompilerArgumentsOrNull(arguments) ?: DEFAULT
fun byCompilerArgumentsOrNull(arguments: CommonCompilerArguments?) = when {
arguments == null -> null
arguments.coroutinesEnable -> ENABLED
arguments.coroutinesWarn -> ENABLED_WITH_WARNING
arguments.coroutinesError -> DISABLED
else -> DEFAULT
else -> null
}
fun byCompilerArgument(argument: String): CoroutineSupport {