Enhanced constructor descriptor should not loose its source!

#KT-11256 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-03-01 16:08:31 +03:00
parent 508e1937d6
commit 5aca50b4ca
4 changed files with 20 additions and 1 deletions
@@ -118,7 +118,7 @@ public class JavaConstructorDescriptor extends ConstructorDescriptorImpl impleme
@NotNull List<KotlinType> enhancedValueParametersTypes,
@NotNull KotlinType enhancedReturnType
) {
JavaConstructorDescriptor enhanced = createSubstitutedCopy(getContainingDeclaration(), /* original = */ null, getKind(), null, false);
JavaConstructorDescriptor enhanced = createSubstitutedCopy(getContainingDeclaration(), /* original = */ null, getKind(), null, true);
// We do not use doSubstitute here as in JavaMethodDescriptor.enhance because type parameters of constructor belongs to class
enhanced.initialize(
enhancedReceiverType,
@@ -0,0 +1,6 @@
import org.jetbrains.annotations.NotNull;
public class JavaClass {
public JavaClass(@NotNull String s) {
}
}
@@ -0,0 +1,7 @@
class A {
fun foo() {
<caret>JavaClass()
}
}
// REF: (in JavaClass).JavaClass(String)
@@ -245,6 +245,12 @@ public class ReferenceResolveTestGenerated extends AbstractReferenceResolveTest
doTest(fileName);
}
@TestMetadata("JavaConstructorNotNullParameter.kt")
public void testJavaConstructorNotNullParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/references/JavaConstructorNotNullParameter.kt");
doTest(fileName);
}
@TestMetadata("JavaEnumEntry.kt")
public void testJavaEnumEntry() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/references/JavaEnumEntry.kt");