Minor, fix warnings in core/ modules

This commit is contained in:
Alexander Udalov
2016-04-17 13:35:17 +03:00
parent f773966458
commit 027cc898e7
9 changed files with 30 additions and 30 deletions
@@ -103,7 +103,7 @@ class LazyJavaStaticClassScope(
private fun getStaticFunctionsFromJavaSuperClasses(name: Name, descriptor: ClassDescriptor): Set<SimpleFunctionDescriptor> {
val staticScope = descriptor.getParentJavaStaticClassScope() ?: return emptySet()
return staticScope.getContributedFunctions(name, NoLookupLocation.WHEN_GET_SUPER_MEMBERS).map { it as SimpleFunctionDescriptor }.toSet()
return staticScope.getContributedFunctions(name, NoLookupLocation.WHEN_GET_SUPER_MEMBERS).toSet()
}
private fun getStaticPropertiesFromJavaSupertypes(name: Name, descriptor: ClassDescriptor): Set<PropertyDescriptor> {
@@ -218,7 +218,7 @@ class LazyJavaTypeResolver(
// Most of the time this means there is an error in the Java code
return typeParameters.map { p -> TypeProjectionImpl(ErrorUtils.createErrorType(p.name.asString())) }.toReadOnlyList()
}
var howTheProjectionIsUsed = if (attr.howThisTypeIsUsed == SUPERTYPE) SUPERTYPE_ARGUMENT else TYPE_ARGUMENT
val howTheProjectionIsUsed = if (attr.howThisTypeIsUsed == SUPERTYPE) SUPERTYPE_ARGUMENT else TYPE_ARGUMENT
return javaType.typeArguments.withIndex().map {
indexedArgument ->
val (i, javaTypeArgument) = indexedArgument
@@ -263,10 +263,9 @@ class LazyJavaTypeResolver(
override fun getCapabilities(): TypeCapabilities = if (isRaw()) RawTypeCapabilities else TypeCapabilities.NONE
private val nullable = c.storageManager.createLazyValue l@ {
when (attr.flexibility) {
FLEXIBLE_LOWER_BOUND -> return@l false
FLEXIBLE_UPPER_BOUND -> return@l true
}
if (attr.flexibility == FLEXIBLE_LOWER_BOUND) return@l false
if (attr.flexibility == FLEXIBLE_UPPER_BOUND) return@l true
!attr.isMarkedNotNull &&
// 'L extends List<T>' in Java is a List<T> in Kotlin, not a List<T?>
// nullability will be taken care of in individual member signatures