FIR checker: substitute type parameters in dispatch receiver type
Consider the following code:
```
fun test(a: List<String>) {
a.first()
}
```
The dispatch receiver type of `first` in this case is `List<T>` before
this change. After this change, it's `List<String>`.
In addition, this change also replace the dispatch receiver type with
the more specific type if available. For example, consider the following
```
class MyList: ArrayList<String>()
fun test(a: MyList) {
a.get(0)
}
```
The dispatch receiver type of `get` is `MyList`, instead of
`ArrayList<String>`. That is, a fake override is created in this case.
This commit is contained in:
committed by
teamcityserver
parent
c047adbaec
commit
765cad8448
+2
-2
@@ -93,7 +93,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.InlineMutableSet
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-size> (): kotlin.Int declared in <root>.InlineMutableSet'
|
||||
CALL 'public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.Set' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public abstract fun <get-size> (): kotlin.Int [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CALL 'private final fun <get-ms> (): kotlin.collections.MutableSet<<root>.IT> declared in <root>.InlineMutableSet' type=kotlin.collections.MutableSet<<root>.IT> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.<get-size>' type=<root>.InlineMutableSet origin=null
|
||||
FUN name:contains visibility:public modality:FINAL <> ($this:<root>.InlineMutableSet, element:<root>.IT) returnType:kotlin.Boolean [operator]
|
||||
@@ -124,7 +124,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.InlineMutableSet
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun isEmpty (): kotlin.Boolean declared in <root>.InlineMutableSet'
|
||||
CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Set' type=kotlin.Boolean origin=null
|
||||
CALL 'public abstract fun isEmpty (): kotlin.Boolean [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null
|
||||
$this: CALL 'private final fun <get-ms> (): kotlin.collections.MutableSet<<root>.IT> declared in <root>.InlineMutableSet' type=kotlin.collections.MutableSet<<root>.IT> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.isEmpty' type=<root>.InlineMutableSet origin=null
|
||||
FUN name:add visibility:public modality:FINAL <> ($this:<root>.InlineMutableSet, element:<root>.IT) returnType:kotlin.Boolean
|
||||
|
||||
Reference in New Issue
Block a user