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
@@ -79,14 +79,13 @@ fun isContainedByCompiledPartOfOurModule(descriptor: DeclarationDescriptor, outD
}
fun getSourceElement(descriptor: DeclarationDescriptor): SourceElement =
if (descriptor is CallableMemberDescriptor && descriptor.source === SourceElement.NO_SOURCE) {
descriptor.containingDeclaration.toSourceElement
}
else if (descriptor is DeserializedTypeAliasDescriptor) {
descriptor.containingDeclaration.toSourceElement
}
else {
descriptor.toSourceElement
when {
descriptor is CallableMemberDescriptor && descriptor.source === SourceElement.NO_SOURCE ->
getSourceElement(descriptor.containingDeclaration)
descriptor is DeserializedTypeAliasDescriptor ->
getSourceElement(descriptor.containingDeclaration)
else ->
descriptor.toSourceElement
}
private val DeclarationDescriptor.toSourceElement: SourceElement