[Test] Add nullability annotations on InTextDirectivesUtils methods

This commit is contained in:
Dmitriy Novozhilov
2020-12-25 11:28:11 +03:00
committed by TeamCityServer
parent 49f2ac3545
commit 9378d1ff31
2 changed files with 20 additions and 20 deletions
@@ -40,11 +40,11 @@ interface TestParameters {
}
private fun KParameter.parseValue(text: String): Any? = when (type.classifier as? KClass<*>) {
Boolean::class -> InTextDirectivesUtils.getPrefixedBoolean(text, name) ?: false
Boolean::class -> name?.let { InTextDirectivesUtils.getPrefixedBoolean(text, it) } ?: false
else -> error("Invalid test parameter $name with type $type")
}
private val <T : Any> KClass<T>.primaryConstructorOrError
get() = primaryConstructor ?: error("Primary constructor should present")
}
}
}