[FIR] Support captured type parameters in java symbol provider

This commit is contained in:
simon.ogorodnik
2020-04-09 19:02:23 +03:00
parent af27ca013b
commit 276c393141
9 changed files with 53 additions and 89 deletions
@@ -6,10 +6,15 @@ FILE fqName:<root> fileName:/constructorWithOwnTypeParametersCall.kt
<class: T2>: kotlin.String
$outer: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K1' type=<root>.K1<kotlin.Int> origin=null
<class: T1>: kotlin.Int
FUN name:testJava visibility:public modality:FINAL <> () returnType:<root>.J1.J2<kotlin.Double?>
FUN name:testJava visibility:public modality:FINAL <> () returnType:<root>.J1.J2<kotlin.Double?, kotlin.Int?>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testJava (): <root>.J1.J2<kotlin.Double?> declared in <root>'
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.J1.J2<kotlin.Double?>
RETURN type=kotlin.Nothing from='public final fun testJava (): <root>.J1.J2<kotlin.Double?, kotlin.Int?> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> <Y2> () declared in <root>.J1.J2' type=<root>.J1.J2<kotlin.Double?, kotlin.Int?> origin=null
<class: X2>: kotlin.Double?
<Y2>: kotlin.CharSequence?
$outer: CONSTRUCTOR_CALL 'public constructor <init> <Y1> () declared in <root>.J1' type=<root>.J1<kotlin.Int?> origin=null
<class: X1>: kotlin.Int?
<Y1>: kotlin.String?
CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K1<T1 of <root>.K1>
TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Number]
@@ -1,10 +1,10 @@
FILE fqName:<root> fileName:/samConversionInGenericConstructorCall_NI.kt
FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1<kotlin.String, kotlin.String>, f2:kotlin.Function1<kotlin.Int, kotlin.String>) returnType:<root>.C.D<kotlin.Int?>
FUN name:test3 visibility:public modality:FINAL <> (f1:kotlin.Function1<kotlin.String, kotlin.String>, f2:kotlin.Function1<kotlin.Int, kotlin.String>) returnType:<root>.C.D<kotlin.Int?, kotlin.String?>
VALUE_PARAMETER name:f1 index:0 type:kotlin.Function1<kotlin.String, kotlin.String>
VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1<kotlin.Int, kotlin.String>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1<kotlin.String, kotlin.String>, f2: kotlin.Function1<kotlin.Int, kotlin.String>): <root>.C.D<kotlin.Int?> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> (jxy: <root>.J<X of <root>.C?, Y of <root>.C.D?>?) declared in <root>.C.D' type=<root>.C.D<kotlin.Int?> origin=null
RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1<kotlin.String, kotlin.String>, f2: kotlin.Function1<kotlin.Int, kotlin.String>): <root>.C.D<kotlin.Int?, kotlin.String?> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> (jxy: <root>.J<X of <root>.C?, Y of <root>.C.D?>?) declared in <root>.C.D' type=<root>.C.D<kotlin.Int?, kotlin.String?> origin=null
<class: Y>: kotlin.Int?
$outer: CONSTRUCTOR_CALL 'public constructor <init> (jxx: <root>.J<X of <root>.C?, X of <root>.C?>?) declared in <root>.C' type=<root>.C<kotlin.String?> origin=null
<class: X>: kotlin.String?
@@ -90,10 +90,17 @@ FILE fqName:<root> fileName:/samConversionInGenericConstructorCall_NI.kt
VALUE_PARAMETER name:f index:0 type:kotlin.Function1<kotlin.String, kotlin.Int>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testGenericJavaCtor1 (f: kotlin.Function1<kotlin.String, kotlin.Int>): <root>.G<kotlin.String?> declared in <root>'
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.G<kotlin.String?>
CONSTRUCTOR_CALL 'public constructor <init> <TCtor> (x: <root>.J<TCtor of <root>.G.<init>?, TClass of <root>.G?>?) declared in <root>.G' type=<root>.G<kotlin.String?> origin=null
<class: TClass>: kotlin.String?
<TCtor>: kotlin.Int?
x: GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.Int> declared in <root>.testGenericJavaCtor1' type=kotlin.Function1<kotlin.String, kotlin.Int> origin=null
FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
TYPE_OP type=kotlin.Function1<kotlin.String, kotlin.Int> origin=CAST typeOperand=kotlin.Function1<kotlin.String, kotlin.Int>
GET_VAR 'x: kotlin.Any declared in <root>.testGenericJavaCtor2' type=kotlin.Any origin=null
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.G<kotlin.String?>
CONSTRUCTOR_CALL 'public constructor <init> <TCtor> (x: <root>.J<TCtor of <root>.G.<init>?, TClass of <root>.G?>?) declared in <root>.G' type=<root>.G<kotlin.String?> origin=null
<class: TClass>: kotlin.String?
<TCtor>: kotlin.Int?
x: TYPE_OP type=kotlin.Function1<kotlin.String, kotlin.Int> origin=IMPLICIT_CAST typeOperand=kotlin.Function1<kotlin.String, kotlin.Int>
GET_VAR 'x: kotlin.Any declared in <root>.testGenericJavaCtor2' type=kotlin.Any origin=null
@@ -7,16 +7,23 @@ FILE fqName:<root> fileName:/javaConstructorWithTypeParameters.kt
FUN name:test2 visibility:public modality:FINAL <> () returnType:<root>.J1<kotlin.Int?>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (): <root>.J1<kotlin.Int?> declared in <root>'
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.J1<kotlin.Int?>
FUN name:test3 visibility:public modality:FINAL <> (j1:<root>.J1<kotlin.Any>) returnType:<root>.J1.J2<kotlin.Int?>
CONSTRUCTOR_CALL 'public constructor <init> <X1> (x1: X1 of <root>.J1.<init>?) declared in <root>.J1' type=<root>.J1<kotlin.Int?> origin=null
<class: T1>: kotlin.Int?
<X1>: kotlin.Int?
x1: CONST Int type=kotlin.Int value=1
FUN name:test3 visibility:public modality:FINAL <> (j1:<root>.J1<kotlin.Any>) returnType:<root>.J1.J2<kotlin.Int?, kotlin.Any>
VALUE_PARAMETER name:j1 index:0 type:<root>.J1<kotlin.Any>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (j1: <root>.J1<kotlin.Any>): <root>.J1.J2<kotlin.Int?> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J1.J2' type=<root>.J1.J2<kotlin.Int?> origin=null
RETURN type=kotlin.Nothing from='public final fun test3 (j1: <root>.J1<kotlin.Any>): <root>.J1.J2<kotlin.Int?, kotlin.Any> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J1.J2' type=<root>.J1.J2<kotlin.Int?, kotlin.Any> origin=null
<class: T2>: kotlin.Int?
$outer: GET_VAR 'j1: <root>.J1<kotlin.Any> declared in <root>.test3' type=<root>.J1<kotlin.Any> origin=null
FUN name:test4 visibility:public modality:FINAL <> (j1:<root>.J1<kotlin.Any>) returnType:<root>.J1.J2<kotlin.Int?>
FUN name:test4 visibility:public modality:FINAL <> (j1:<root>.J1<kotlin.Any>) returnType:<root>.J1.J2<kotlin.Int?, kotlin.Any>
VALUE_PARAMETER name:j1 index:0 type:<root>.J1<kotlin.Any>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4 (j1: <root>.J1<kotlin.Any>): <root>.J1.J2<kotlin.Int?> declared in <root>'
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.J1.J2<kotlin.Int?>
RETURN type=kotlin.Nothing from='public final fun test4 (j1: <root>.J1<kotlin.Any>): <root>.J1.J2<kotlin.Int?, kotlin.Any> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> <X2> (x2: X2 of <root>.J1.J2.<init>?) declared in <root>.J1.J2' type=<root>.J1.J2<kotlin.Int?, kotlin.Any> origin=null
<class: T2>: kotlin.Int?
<X2>: kotlin.Int?
$outer: GET_VAR 'j1: <root>.J1<kotlin.Any> declared in <root>.test4' type=<root>.J1<kotlin.Any> origin=null
x2: CONST Int type=kotlin.Int value=1