Add constructors to KtScope

- KtClassLikeSymbol.primaryConstructor was removed
- Constructors were removed from getCallableMembers because
constructors has no name (or special name `<init>`) and previous
implementation was incorrect
- KtScope.getAllSymbols returns constructors as before. Before it was
like this because of the incorrect implementation of getCallableMembers
- getConstructors has sence only for class scope,
for the rest cases it is empty
This commit is contained in:
Stanislav Erokhin
2021-01-13 14:40:28 +01:00
parent c5229291be
commit c1722350b6
42 changed files with 197 additions and 126 deletions
@@ -49,6 +49,11 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
runTest("compiler/testData/asJava/lightClasses/AnnotationClass.kt");
}
@TestMetadata("Constructors.kt")
public void testConstructors() throws Exception {
runTest("compiler/testData/asJava/lightClasses/Constructors.kt");
}
@TestMetadata("DataClassWithCustomImplementedMembers.kt")
public void testDataClassWithCustomImplementedMembers() throws Exception {
runTest("compiler/testData/asJava/lightClasses/DataClassWithCustomImplementedMembers.kt");
@@ -129,6 +134,11 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
runTest("compiler/testData/asJava/lightClasses/NonDataClassWithComponentFunctions.kt");
}
@TestMetadata("OnlySecondaryConstructors.kt")
public void testOnlySecondaryConstructors() throws Exception {
runTest("compiler/testData/asJava/lightClasses/OnlySecondaryConstructors.kt");
}
@TestMetadata("PublishedApi.kt")
public void testPublishedApi() throws Exception {
runTest("compiler/testData/asJava/lightClasses/PublishedApi.kt");