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
This commit is contained in:
Dmitry Petrov
2017-05-17 13:02:18 +03:00
parent 2500a182e5
commit a2db4dc0d5
21 changed files with 97 additions and 30 deletions
@@ -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()
}
@@ -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
------------------------------------------
@@ -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
------------------------------------------
@@ -0,0 +1,4 @@
package test
val cc = CAlias
val cc2 = CAlias2