[FIR JS] Don't create secondary constructor calls for externals
The change in PSI consistency test is needed, because we may sometimes observe empty `KtConstructorDelegationCall`s, and we don't want to build delegation calls for constructors of `external` classes with such calls. ^KT-64548 Fixed
This commit is contained in:
committed by
Space Team
parent
9a598026c8
commit
4b8b7aaa54
+4
-1
@@ -1161,7 +1161,7 @@ class LightTreeRawFirDeclarationBuilder(
|
||||
private fun convertConstructorDelegationCall(
|
||||
constructorDelegationCall: LighterASTNode,
|
||||
classWrapper: ClassWrapper
|
||||
): FirDelegatedConstructorCall {
|
||||
): FirDelegatedConstructorCall? {
|
||||
var thisKeywordPresent = false
|
||||
val firValueArguments = mutableListOf<FirExpression>()
|
||||
constructorDelegationCall.forEachChildren {
|
||||
@@ -1172,6 +1172,9 @@ class LightTreeRawFirDeclarationBuilder(
|
||||
}
|
||||
|
||||
val isImplicit = constructorDelegationCall.textLength == 0
|
||||
if (isImplicit && classWrapper.modifiers.hasExternal()) {
|
||||
return null
|
||||
}
|
||||
val isThis = thisKeywordPresent //|| (isImplicit && classWrapper.hasPrimaryConstructor)
|
||||
val delegatedType =
|
||||
when {
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.fir.lightTree.fir.modifier.Modifier
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
|
||||
class ClassWrapper(
|
||||
private val modifiers: Modifier,
|
||||
val modifiers: Modifier,
|
||||
private val classKind: ClassKind,
|
||||
val classBuilder: FirClassBuilder,
|
||||
val hasSecondaryConstructor: Boolean,
|
||||
|
||||
Reference in New Issue
Block a user