Fix incremental compilation problems related to type alias constructors
1. Determine source element for descriptors with NO_SOURCE recursively.
2. Always provide type abbreviation for type alias constructor
return type.
#KT-15495 Fixed
Original commit: a2db4dc0d5
This commit is contained in:
+12
@@ -557,6 +557,18 @@ public class ExperimentalIncrementalJpsTestGenerated extends AbstractExperimenta
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("internalTypealiasConstructor")
|
||||
public void testInternalTypealiasConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/internalTypealiasConstructor/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("internalTypealiasObject")
|
||||
public void testInternalTypealiasObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/internalTypealiasObject/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("localClassChanged")
|
||||
public void testLocalClassChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/localClassChanged/");
|
||||
|
||||
+12
@@ -557,6 +557,18 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("internalTypealiasConstructor")
|
||||
public void testInternalTypealiasConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/internalTypealiasConstructor/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("internalTypealiasObject")
|
||||
public void testInternalTypealiasObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/internalTypealiasObject/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("localClassChanged")
|
||||
public void testLocalClassChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/localClassChanged/");
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package foo
|
||||
|
||||
internal typealias TypeAlias = Int
|
||||
internal typealias TypeAlias = Int
|
||||
internal typealias TypeAlias2 = TypeAlias
|
||||
@@ -2,4 +2,8 @@ package foo
|
||||
|
||||
internal fun useTypeAlias(x: TypeAlias) {
|
||||
x.toString()
|
||||
}
|
||||
|
||||
internal fun useTypeAlias2(x: TypeAlias2) {
|
||||
x.toString()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package test
|
||||
|
||||
class C
|
||||
|
||||
internal typealias CAlias = C
|
||||
internal typealias CAlias2 = CAlias
|
||||
@@ -0,0 +1,11 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/UseTypeAliasConstructorKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/useTypeAliasConstructor.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package test
|
||||
|
||||
val c = CAlias()
|
||||
val c2 = CAlias2()
|
||||
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
class C {
|
||||
companion object
|
||||
}
|
||||
|
||||
internal typealias CAlias = C
|
||||
internal typealias CAlias2 = CAlias
|
||||
@@ -0,0 +1,11 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/UseTypeAliasObjectKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/useTypeAliasObject.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package test
|
||||
|
||||
val cc = CAlias
|
||||
val cc2 = CAlias2
|
||||
Reference in New Issue
Block a user