[MPP] Allow smart casts for properties from dependsOn modules

Smartcasts for public properties from different module are not
stable because module declaring a property in general can be
compiled separately from the module using it. However, if client
module has dependsOn relation with declaring module their simultaneous
compilation is guaranteed which makes this smart cast safe.

Cache all transitive 'expected by' modules in module dependencies.
Extend test to check smart casts are allowed for properties from transitive
'expected by' dependencies and prohibited otherwise.

^KT-42754 Fixed
This commit is contained in:
Pavel Kirpichenkov
2020-11-03 18:40:04 +03:00
parent 778bbd76cb
commit b79b94fe75
15 changed files with 101 additions and 19 deletions
@@ -0,0 +1,5 @@
data class CommonDataClass2(val property: CommonObject2?)
object CommonObject2 {
fun doSomething() {}
}