Generate super classes and overridden functions in proper scope

Such references require proper scope so that local symbols are bound.
Example:

```
fun <T> outer() {
    abstract class ALocal<S : T> {
        abstract fun bar()
    }

    class Local<S : T> : ALocal<S>() {
        override fun bar() {}
    }
}
```

Here local classes have type parameters with upper bounds depending on
function type parameters, and members overriding members in other local
classes.
This commit is contained in:
Dmitry Petrov
2018-02-22 10:00:02 +03:00
parent 8fef0f0535
commit e89047d2cc
54 changed files with 2463 additions and 79 deletions
@@ -18,6 +18,8 @@ FILE fqName:<root> fileName:/integerCoercionToT.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:reinterpret visibility:public modality:FINAL <T> ($receiver:CPointed) returnType:T flags:inline
TYPE_PARAMETER name:T index:0 variance: upperBounds:[CPointed]
superClassifiers:
CLASS INTERFACE name:CPointed modality:ABSTRACT visibility:public flags:
$receiver: VALUE_PARAMETER name:<this> type:CPointed flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='reinterpret() on CPointed: T'
@@ -27,6 +29,8 @@ FILE fqName:<root> fileName:/integerCoercionToT.kt
superClasses:
CLASS INTERFACE name:CPointed modality:ABSTRACT visibility:public flags:
TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> () returnType:CInt32VarX<T> flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
@@ -1,7 +1,11 @@
FILE fqName:<root> fileName:/fixationOrder1.kt
FUN name:foo visibility:public modality:FINAL <X, Y> () returnType:Function1<X, Y> flags:
TYPE_PARAMETER name:X index:0 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
TYPE_PARAMETER name:Y index:1 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='foo(): (X) -> Y'
CALL 'TODO(): Nothing' type=kotlin.Nothing origin=null
@@ -10,7 +14,11 @@ FILE fqName:<root> fileName:/fixationOrder1.kt
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
TYPE_PARAMETER name:A index:0 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
TYPE_PARAMETER name:B index:1 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> (other:kotlin.Any?) returnType:Boolean flags:
@@ -26,7 +34,11 @@ FILE fqName:<root> fileName:/fixationOrder1.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:check visibility:public modality:FINAL <T, R> (x:T, y:R, f:(T) -> R) returnType:Inv2<T, R> flags:
TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
TYPE_PARAMETER name:R index:1 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
VALUE_PARAMETER name:x index:0 type:T flags:
VALUE_PARAMETER name:y index:1 type:R flags:
VALUE_PARAMETER name:f index:2 type:(T) -> R flags:
@@ -4,6 +4,8 @@ FILE fqName:<root> fileName:/typeAliasCtorForGenericClass.kt
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
TYPE_PARAMETER name:Q index:0 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> (q:Q) returnType:A<Q> flags:
VALUE_PARAMETER name:q index:0 type:Q flags:
BLOCK_BODY