COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT is an ERROR now.

Migrated code.
Updated test data in IDE tests.
Dropped whenWithRangeTestsAndMultiConditions.kt:
"Introduce subject" is not applicable to 'when' with ||-ed conditions.
This commit is contained in:
Dmitry Petrov
2015-12-10 12:12:44 +03:00
parent 199827635f
commit 0fe74a8b43
26 changed files with 36 additions and 58 deletions
@@ -31,7 +31,7 @@ public abstract class ReflectJavaType : JavaType {
fun create(type: Type): ReflectJavaType {
return when {
type is Class<*> && type.isPrimitive() -> ReflectJavaPrimitiveType(type)
type is GenericArrayType, type is Class<*> && type.isArray() -> ReflectJavaArrayType(type)
type is GenericArrayType || type is Class<*> && type.isArray() -> ReflectJavaArrayType(type)
type is WildcardType -> ReflectJavaWildcardType(type)
else -> ReflectJavaClassifierType(type)
}
@@ -34,7 +34,7 @@ public val Class<*>.classId: ClassId
get() = when {
isPrimitive() -> throw IllegalArgumentException("Can't compute ClassId for primitive type: $this")
isArray() -> throw IllegalArgumentException("Can't compute ClassId for array type: $this")
getEnclosingMethod() != null, getEnclosingConstructor() != null, getSimpleName().isEmpty() -> {
getEnclosingMethod() != null || getEnclosingConstructor() != null || getSimpleName().isEmpty() -> {
val fqName = FqName(getName())
ClassId(fqName.parent(), FqName.topLevel(fqName.shortName()), /* local = */ true)
}