[FIR] Check the presence of delegated constructor call via stubs
After `4b8b7aaa` external classes' secondary constructors should not have a delegated call, so we don't create a call if there's no explicit call. But we need to check if there is. The failing tests were muted in `8fcf91d8`, and are now unmuted back. Those are the ones in the `testData/rawBuilder/declarations` folder. These tests fail because they supply PSI stubs for the secondary constructors, so arbitrary operations (like reading .text of the delegated constructor call) are not allowed for them. This commit modifies secondary constructor stubs to include the required information. ^KT-65268 Fixed Merge-request: KT-MR-13982 Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
77dba281a3
commit
9688865953
+6
-6
@@ -4,7 +4,7 @@ PsiJetFileStubImpl[package=test]
|
||||
IMPORT_LIST
|
||||
CLASS[classId=test/SecondaryConstructors, fqName=test.SecondaryConstructors, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=SecondaryConstructors, superNames=[]]
|
||||
MODIFIER_LIST[public final]
|
||||
PRIMARY_CONSTRUCTOR[fqName=null, hasBody=false, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
PRIMARY_CONSTRUCTOR[fqName=null, hasBody=false, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
MODIFIER_LIST[public]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
@@ -14,7 +14,7 @@ PsiJetFileStubImpl[package=test]
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=Boolean]
|
||||
CLASS_BODY
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
MODIFIER_LIST[public]
|
||||
ANNOTATION_ENTRY[hasValueArguments=false, shortName=anno]
|
||||
CONSTRUCTOR_CALLEE
|
||||
@@ -30,7 +30,7 @@ PsiJetFileStubImpl[package=test]
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=String]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
MODIFIER_LIST[private]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
@@ -65,7 +65,7 @@ PsiJetFileStubImpl[package=test]
|
||||
REFERENCE_EXPRESSION[referencedName=io]
|
||||
REFERENCE_EXPRESSION[referencedName=Serializable]
|
||||
CLASS_BODY
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Inner]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=Inner]
|
||||
MODIFIER_LIST[public]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
@@ -79,7 +79,7 @@ PsiJetFileStubImpl[package=test]
|
||||
CLASS[classId=test/SecondaryConstructors.Nested, fqName=test.SecondaryConstructors.Nested, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Nested, superNames=[]]
|
||||
MODIFIER_LIST[public final]
|
||||
CLASS_BODY
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
MODIFIER_LIST[public]
|
||||
ANNOTATION_ENTRY[hasValueArguments=false, shortName=anno]
|
||||
CONSTRUCTOR_CALLEE
|
||||
@@ -95,6 +95,6 @@ PsiJetFileStubImpl[package=test]
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=Int]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
MODIFIER_LIST[internal]
|
||||
VALUE_PARAMETER_LIST
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@ PsiJetFileStubImpl[package=test]
|
||||
IMPORT_LIST
|
||||
CLASS[classId=test/SecondaryConstructors, fqName=test.SecondaryConstructors, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=SecondaryConstructors, superNames=[]]
|
||||
MODIFIER_LIST[public final]
|
||||
PRIMARY_CONSTRUCTOR[fqName=null, hasBody=false, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
PRIMARY_CONSTRUCTOR[fqName=null, hasBody=false, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
MODIFIER_LIST[public]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
@@ -14,7 +14,7 @@ PsiJetFileStubImpl[package=test]
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=Boolean]
|
||||
CLASS_BODY
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
MODIFIER_LIST[public]
|
||||
ANNOTATION_ENTRY[hasValueArguments=false, shortName=anno]
|
||||
CONSTRUCTOR_CALLEE
|
||||
@@ -30,7 +30,7 @@ PsiJetFileStubImpl[package=test]
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=String]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=SecondaryConstructors]
|
||||
MODIFIER_LIST[private]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
@@ -65,7 +65,7 @@ PsiJetFileStubImpl[package=test]
|
||||
REFERENCE_EXPRESSION[referencedName=io]
|
||||
REFERENCE_EXPRESSION[referencedName=Serializable]
|
||||
CLASS_BODY
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Inner]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=Inner]
|
||||
MODIFIER_LIST[public]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
@@ -79,7 +79,7 @@ PsiJetFileStubImpl[package=test]
|
||||
CLASS[classId=test/SecondaryConstructors.Nested, fqName=test.SecondaryConstructors.Nested, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Nested, superNames=[]]
|
||||
MODIFIER_LIST[public final]
|
||||
CLASS_BODY
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
MODIFIER_LIST[public]
|
||||
ANNOTATION_ENTRY[hasValueArguments=false, shortName=anno]
|
||||
CONSTRUCTOR_CALLEE
|
||||
@@ -95,6 +95,6 @@ PsiJetFileStubImpl[package=test]
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=Int]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
SECONDARY_CONSTRUCTOR[fqName=null, hasBody=true, isDelegatedCallToThis=false, isExplicitDelegationCall=false, isExtension=false, isTopLevel=false, name=Nested]
|
||||
MODIFIER_LIST[internal]
|
||||
VALUE_PARAMETER_LIST
|
||||
|
||||
Reference in New Issue
Block a user