Minor. simplified creation of simple type with default scope.
This commit is contained in:
+1
-2
@@ -114,9 +114,8 @@ class JavaTypeResolver(
|
||||
val constructor = computeTypeConstructor(javaType, attr) ?: return null
|
||||
val arguments = computeArguments(javaType, attr, constructor)
|
||||
val isNullable = isNullable(javaType, attr)
|
||||
val memberScope = AbstractLazyType.computeMemberScope(constructor, arguments)
|
||||
|
||||
return KotlinTypeFactory.simpleType(annotations, constructor, arguments, isNullable, memberScope)
|
||||
return KotlinTypeFactory.simpleType(annotations, constructor, arguments, isNullable)
|
||||
}
|
||||
|
||||
private fun computeTypeConstructor(javaType: JavaClassifierType, attr: JavaTypeAttributes): TypeConstructor? {
|
||||
|
||||
+1
-2
@@ -121,8 +121,7 @@ internal object RawSubstitution : TypeSubstitution() {
|
||||
TypeProjectionImpl(componentTypeProjection.projectionKind, eraseType(componentTypeProjection.type))
|
||||
)
|
||||
return KotlinTypeFactory.simpleType(
|
||||
type.annotations, type.constructor, arguments, type.isMarkedNullable,
|
||||
declaration.getMemberScope(arguments)
|
||||
type.annotations, type.constructor, arguments, type.isMarkedNullable
|
||||
) to false
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -129,16 +129,11 @@ private fun SimpleType.enhanceInflexible(qualifiers: (Int) -> JavaTypeQualifiers
|
||||
enhancedNullabilityAnnotations
|
||||
).filterNotNull().compositeAnnotationsOrSingle()
|
||||
|
||||
val newSubstitution = TypeConstructorSubstitution.create(typeConstructor, enhancedArguments)
|
||||
|
||||
val enhancedType = KotlinTypeFactory.simpleType(
|
||||
newAnnotations,
|
||||
typeConstructor,
|
||||
enhancedArguments,
|
||||
enhancedNullability,
|
||||
if (enhancedClassifier is ClassDescriptor)
|
||||
enhancedClassifier.getMemberScope(newSubstitution)
|
||||
else enhancedClassifier.defaultType.memberScope
|
||||
enhancedNullability
|
||||
)
|
||||
|
||||
val result = if (effectiveQualifiers.isNotNullTypeParameter) NotNullTypeParameter(enhancedType) else enhancedType
|
||||
|
||||
Reference in New Issue
Block a user