[FIR] Properly add the outer type parameters
Looks like a type. ^KT-59393 Fixed (because other differences are related to nested typealiases)
This commit is contained in:
committed by
Space Team
parent
4bba93f633
commit
a41273b966
@@ -113,10 +113,9 @@ fun FirResolvedQualifier.continueQualifier(
|
|||||||
symbol = nestedClassSymbol as FirClassLikeSymbol<*>
|
symbol = nestedClassSymbol as FirClassLikeSymbol<*>
|
||||||
isFullyQualified = true
|
isFullyQualified = true
|
||||||
|
|
||||||
val outerTypeArguments = this.typeArguments.toList()
|
|
||||||
this.typeArguments.clear()
|
this.typeArguments.clear()
|
||||||
this.typeArguments.addAll(typeArguments)
|
this.typeArguments.addAll(typeArguments)
|
||||||
this.typeArguments.addAll(outerTypeArguments)
|
this.typeArguments.addAll(this@continueQualifier.typeArguments)
|
||||||
this.nonFatalDiagnostics.addAll(nonFatalDiagnosticsFromExpression.orEmpty())
|
this.nonFatalDiagnostics.addAll(nonFatalDiagnosticsFromExpression.orEmpty())
|
||||||
this.nonFatalDiagnostics.addAll(
|
this.nonFatalDiagnostics.addAll(
|
||||||
extractNonFatalDiagnostics(
|
extractNonFatalDiagnostics(
|
||||||
|
|||||||
+4
-4
@@ -1124,14 +1124,14 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
|
|||||||
ConeStarProjection
|
ConeStarProjection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val typeRef = symbol?.constructType(typeArguments, isNullable = false)
|
val coneType = symbol?.constructType(typeArguments, isNullable = false)
|
||||||
if (typeRef != null) {
|
if (coneType != null) {
|
||||||
lhs.replaceTypeRef(
|
lhs.replaceTypeRef(
|
||||||
buildResolvedTypeRef { type = typeRef }.also {
|
buildResolvedTypeRef { type = coneType }.also {
|
||||||
session.lookupTracker?.recordTypeResolveAsLookup(it, getClassCall.source, components.file.source)
|
session.lookupTracker?.recordTypeResolveAsLookup(it, getClassCall.source, components.file.source)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
typeRef
|
coneType
|
||||||
} else {
|
} else {
|
||||||
lhs.resultType.coneType
|
lhs.resultType.coneType
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ val n1 = A.Nested::class
|
|||||||
val n2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>A.Nested<*>::class<!>
|
val n2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>A.Nested<*>::class<!>
|
||||||
|
|
||||||
val i1 = A.Inner::class
|
val i1 = A.Inner::class
|
||||||
val i2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>A<*>.Inner<*>::class<!>
|
val i2 = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>A<*>.Inner<*><!>::class
|
||||||
val i3 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>A<Int>.Inner<CharSequence>::class<!>
|
val i3 = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>A<Int>.Inner<CharSequence><!>::class
|
||||||
|
|
||||||
val m1 = Map::class
|
val m1 = Map::class
|
||||||
val m2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>Map<Int, *>::class<!>
|
val m2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>Map<Int, *>::class<!>
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ fun test() {
|
|||||||
a<Foo.Bar<String>>()
|
a<Foo.Bar<String>>()
|
||||||
a<Foo.Bar.Baz>()
|
a<Foo.Bar.Baz>()
|
||||||
|
|
||||||
Foo<String>.Bar::class
|
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>Foo<String>.Bar::class<!>
|
||||||
Foo<String>.Bar.Baz::class
|
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<String>.Bar.Baz<!>::class
|
||||||
|
|
||||||
a<Foo<String>.<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Bar<!>>()
|
a<Foo<String>.<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Bar<!>>()
|
||||||
a<Foo<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>.Bar.Baz>()
|
a<Foo<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>.Bar.Baz>()
|
||||||
|
|||||||
Reference in New Issue
Block a user