FIR: resolve lambda arguments even if an outer call is unresolved

This commit is contained in:
Mikhail Glukhikh
2019-11-05 14:15:30 +03:00
parent 3b4edb3901
commit bd1127cfa3
19 changed files with 331 additions and 279 deletions
@@ -215,7 +215,7 @@ fun FirFunction<*>.constructFunctionalTypeRef(session: FirSession): FirResolvedT
}
val rawReturnType = (this as FirTypedDeclaration).returnTypeRef.coneTypeUnsafe<ConeKotlinType>()
val functionalType = createFunctionalType(parameters, receiverTypeRef?.coneTypeUnsafe(), rawReturnType)
val functionalType = createFunctionalType(parameters, receiverTypeRef?.coneTypeSafe(), rawReturnType)
return FirResolvedTypeRefImpl(source, functionalType)
}
@@ -70,6 +70,13 @@ open class FirBodyResolveTransformer(
return expressionsTransformer.transformExpression(expression, data)
}
override fun transformWrappedArgumentExpression(
wrappedArgumentExpression: FirWrappedArgumentExpression,
data: ResolutionMode
): CompositeTransformResult<FirStatement> {
return (wrappedArgumentExpression.transformChildren(this, data) as FirStatement).compose()
}
override fun transformQualifiedAccessExpression(
qualifiedAccessExpression: FirQualifiedAccessExpression,
data: ResolutionMode
@@ -289,8 +289,8 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
}
val label = anonymousFunction.label
return if (label != null && receiverTypeRef != null) {
withLabelAndReceiverType(Name.identifier(label.name), anonymousFunction, receiverTypeRef.coneTypeUnsafe()) {
return if (label != null && receiverTypeRef is FirResolvedTypeRef) {
withLabelAndReceiverType(Name.identifier(label.name), anonymousFunction, receiverTypeRef.type) {
transform()
}
} else {
@@ -159,7 +159,11 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
// name.invoke() case
callCompleter.completeCall(resultExplicitReceiver, noExpectedType)
}
callCompleter.completeCall(resultExpression, expectedTypeRef)
val completionResult = callCompleter.completeCall(resultExpression, expectedTypeRef)
if (completionResult.typeRef is FirErrorTypeRef) {
completionResult.transformArguments(transformer, ResolutionMode.LambdaResolution(null))
}
completionResult
} catch (e: Throwable) {
throw RuntimeException("While resolving call ${functionCall.render()}", e)
}
+8 -8
View File
@@ -18,14 +18,14 @@ FILE: lambda.kt
Unit
}
)
<Inapplicable(PARAMETER_MAPPING_ERROR): [/foo]>#(Int(1), <L> = foo@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/foo]>#(Int(1), <L> = foo@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
<Inapplicable(PARAMETER_MAPPING_ERROR): [/foo]>#(f = foo@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/foo]>#(f = foo@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
, <L> = foo@fun <implicit>.<anonymous>(): <implicit> {
, <L> = foo@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
@@ -45,11 +45,11 @@ FILE: lambda.kt
Unit
}
)
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(<L> = bar@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(<L> = bar@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(bar@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(bar@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
@@ -61,15 +61,15 @@ FILE: lambda.kt
Unit
}
, Boolean(false))
<Inapplicable(PARAMETER_MAPPING_ERROR): [/baz]>#(<L> = baz@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/baz]>#(<L> = baz@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
<Inapplicable(PARAMETER_MAPPING_ERROR): [/baz]>#(<L> = baz@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/baz]>#(<L> = baz@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
<Inapplicable(PARAMETER_MAPPING_ERROR): [/baz]>#(other = Boolean(false), <L> = baz@fun <implicit>.<anonymous>(): <implicit> {
<Inapplicable(PARAMETER_MAPPING_ERROR): [/baz]>#(other = Boolean(false), <L> = baz@fun <implicit>.<anonymous>(): R|kotlin/Unit| {
Unit
}
)
+279 -238
View File
@@ -26,57 +26,61 @@ digraph complex_kt {
10 [label="Enter block"];
11 [label="Access variable <Unresolved name: HttpRequests>#"];
12 [label="Access variable R|<local>/url|"];
13 [label="Function call: <Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|)"];
14 [label="Function call: <Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|).<Unresolved name: connect>#(<L> = connect@fun <implicit>.<anonymous>(): <implicit> {
GsonBuilder#().create#().fromJson#(it#.inputStream#.reader#(), <getClass>(Array#<PluginDTO>()).java#)
13 [label="Access variable R|<local>/url|"];
14 [label="Function call: <Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|)"];
15 [label="Function call: <Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|).<Unresolved name: connect>#(<L> = connect@fun <implicit>.<anonymous>(): <ERROR TYPE REF: Empty diagnostic> {
<Unresolved name: GsonBuilder>#().<Unresolved name: create>#().<Unresolved name: fromJson>#(<Unresolved name: it>#.<Unresolved name: inputStream>#.<Ambiguity: reader, [kotlin/io/reader, kotlin/io/reader, kotlin/io/reader]>#(), <getClass>(<Inapplicable(PARAMETER_MAPPING_ERROR): [kotlin/Array.Array]>#<R|class error: Symbol not found, for `PluginDTO`|>()).<Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#)
}
)"];
15 [label="Exit block"];
16 [label="Exit block"];
}
16 [label="Try main block exit"];
17 [label="Try main block exit"];
}
subgraph cluster_5 {
color=blue
17 [label="Catch enter"];
18 [label="Catch enter"];
subgraph cluster_6 {
color=blue
18 [label="Enter block"];
19 [label="Const: String(Can't parse json response)"];
20 [label="Access variable R|<local>/syntaxException|"];
21 [label="Function call: <Unresolved name: ResponseParseException>#(String(Can't parse json response), R|<local>/syntaxException|)"];
22 [label="Throw: throw <Unresolved name: ResponseParseException>#(String(Can't parse json response), R|<local>/syntaxException|)"];
23 [label="Stub" style="filled" fillcolor=gray];
24 [label="Exit block" style="filled" fillcolor=gray];
19 [label="Enter block"];
20 [label="Const: String(Can't parse json response)"];
21 [label="Access variable R|<local>/syntaxException|"];
22 [label="Const: String(Can't parse json response)"];
23 [label="Access variable R|<local>/syntaxException|"];
24 [label="Function call: <Unresolved name: ResponseParseException>#(String(Can't parse json response), R|<local>/syntaxException|)"];
25 [label="Throw: throw <Unresolved name: ResponseParseException>#(String(Can't parse json response), R|<local>/syntaxException|)"];
26 [label="Stub" style="filled" fillcolor=gray];
27 [label="Exit block" style="filled" fillcolor=gray];
}
25 [label="Catch exit" style="filled" fillcolor=gray];
28 [label="Catch exit" style="filled" fillcolor=gray];
}
subgraph cluster_7 {
color=blue
26 [label="Catch enter"];
29 [label="Catch enter"];
subgraph cluster_8 {
color=blue
27 [label="Enter block"];
28 [label="Access variable R|<local>/ioException|"];
29 [label="Function call: <Unresolved name: IOException>#(R|<local>/ioException|)"];
30 [label="Throw: throw <Unresolved name: IOException>#(R|<local>/ioException|)"];
31 [label="Stub" style="filled" fillcolor=gray];
32 [label="Exit block" style="filled" fillcolor=gray];
30 [label="Enter block"];
31 [label="Access variable R|<local>/ioException|"];
32 [label="Access variable R|<local>/ioException|"];
33 [label="Function call: <Unresolved name: IOException>#(R|<local>/ioException|)"];
34 [label="Throw: throw <Unresolved name: IOException>#(R|<local>/ioException|)"];
35 [label="Stub" style="filled" fillcolor=gray];
36 [label="Exit block" style="filled" fillcolor=gray];
}
33 [label="Catch exit" style="filled" fillcolor=gray];
37 [label="Catch exit" style="filled" fillcolor=gray];
}
34 [label="Try expression exit"];
38 [label="Try expression exit"];
}
35 [label="Variable declaration: lval pluginDTOs: R|kotlin/Array<class error: Symbol not found, for `PluginDTO`>|"];
36 [label="Exit block"];
39 [label="Variable declaration: lval pluginDTOs: R|kotlin/Array<class error: Symbol not found, for `PluginDTO`>|"];
40 [label="Exit block"];
}
subgraph cluster_9 {
color=blue
37 [label="Enter annotation"];
38 [label="Access variable <Unresolved name: IOException>#"];
39 [label="Access variable <Unresolved name: ResponseParseException>#"];
40 [label="Exit annotation"];
41 [label="Enter annotation"];
42 [label="Access variable <Unresolved name: IOException>#"];
43 [label="Access variable <Unresolved name: ResponseParseException>#"];
44 [label="Exit annotation"];
}
41 [label="Exit function fetchPluginReleaseDate" style="filled" fillcolor=red];
45 [label="Exit function fetchPluginReleaseDate" style="filled" fillcolor=red];
}
0 -> {1};
@@ -88,133 +92,170 @@ digraph complex_kt {
6 -> {7};
7 -> {8};
8 -> {9};
9 -> {41 26 17 10};
9 -> {45 29 18 10};
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {34};
17 -> {41 18};
18 -> {19};
16 -> {17};
17 -> {38};
18 -> {45 19};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {41};
22 -> {23} [style=dotted];
23 -> {24} [style=dotted];
24 -> {25} [style=dotted];
25 -> {34} [style=dotted];
26 -> {41 27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {41};
30 -> {31} [style=dotted];
31 -> {32} [style=dotted];
32 -> {33} [style=dotted];
33 -> {34} [style=dotted];
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {45};
25 -> {26} [style=dotted];
26 -> {27} [style=dotted];
27 -> {28} [style=dotted];
28 -> {38} [style=dotted];
29 -> {45 30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {45};
34 -> {35} [style=dotted];
35 -> {36} [style=dotted];
36 -> {37} [style=dotted];
37 -> {38} [style=dotted];
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
subgraph cluster_10 {
color=red
42 [label="Enter function close" style="filled" fillcolor=red];
43 [label="Exit function close" style="filled" fillcolor=red];
46 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
47 [label="Enter block"];
48 [label="Function call: <Unresolved name: GsonBuilder>#()"];
49 [label="Function call: <Unresolved name: GsonBuilder>#().<Unresolved name: create>#()"];
50 [label="Access variable <Unresolved name: it>#"];
51 [label="Access variable <Unresolved name: inputStream>#"];
52 [label="Function call: <Unresolved name: it>#.<Unresolved name: inputStream>#.<Ambiguity: reader, [kotlin/io/reader, kotlin/io/reader, kotlin/io/reader]>#()"];
53 [label="Function call: <Inapplicable(PARAMETER_MAPPING_ERROR): [kotlin/Array.Array]>#<R|class error: Symbol not found, for `PluginDTO`|>()"];
54 [label="Access variable <Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#"];
55 [label="Access variable <Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#"];
56 [label="Function call: <Unresolved name: GsonBuilder>#().<Unresolved name: create>#().<Unresolved name: fromJson>#(<Unresolved name: it>#.<Unresolved name: inputStream>#.<Ambiguity: reader, [kotlin/io/reader, kotlin/io/reader, kotlin/io/reader]>#(), <getClass>(<Inapplicable(PARAMETER_MAPPING_ERROR): [kotlin/Array.Array]>#<R|class error: Symbol not found, for `PluginDTO`|>()).<Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#)"];
57 [label="Exit block"];
}
58 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
42 -> {43};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {58};
subgraph cluster_11 {
subgraph cluster_12 {
color=red
44 [label="Enter function closeFinally" style="filled" fillcolor=red];
subgraph cluster_12 {
59 [label="Enter function close" style="filled" fillcolor=red];
60 [label="Exit function close" style="filled" fillcolor=red];
}
59 -> {60};
subgraph cluster_13 {
color=red
61 [label="Enter function closeFinally" style="filled" fillcolor=red];
subgraph cluster_14 {
color=blue
45 [label="Enter block"];
subgraph cluster_13 {
62 [label="Enter block"];
subgraph cluster_15 {
color=blue
46 [label="Enter when"];
subgraph cluster_14 {
color=blue
47 [label="Enter when branch condition "];
48 [label="Access variable this@R|/closeFinally|"];
49 [label="Const: Null(null)"];
50 [label="Operator =="];
51 [label="Exit when branch condition"];
}
subgraph cluster_15 {
color=blue
52 [label="Enter when branch condition "];
53 [label="Access variable R|<local>/cause|"];
54 [label="Const: Null(null)"];
55 [label="Operator =="];
56 [label="Exit when branch condition"];
}
63 [label="Enter when"];
subgraph cluster_16 {
color=blue
57 [label="Enter when branch condition else"];
58 [label="Exit when branch condition"];
64 [label="Enter when branch condition "];
65 [label="Access variable this@R|/closeFinally|"];
66 [label="Const: Null(null)"];
67 [label="Operator =="];
68 [label="Exit when branch condition"];
}
59 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
60 [label="Enter block"];
subgraph cluster_18 {
69 [label="Enter when branch condition "];
70 [label="Access variable R|<local>/cause|"];
71 [label="Const: Null(null)"];
72 [label="Operator =="];
73 [label="Exit when branch condition"];
}
subgraph cluster_18 {
color=blue
74 [label="Enter when branch condition else"];
75 [label="Exit when branch condition"];
}
76 [label="Enter when branch result"];
subgraph cluster_19 {
color=blue
77 [label="Enter block"];
subgraph cluster_20 {
color=blue
61 [label="Try expression enter"];
subgraph cluster_19 {
color=blue
62 [label="Try main block enter"];
subgraph cluster_20 {
color=blue
63 [label="Enter block"];
64 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"];
65 [label="Exit block"];
}
66 [label="Try main block exit"];
}
78 [label="Try expression enter"];
subgraph cluster_21 {
color=blue
67 [label="Catch enter"];
79 [label="Try main block enter"];
subgraph cluster_22 {
color=blue
68 [label="Enter block"];
69 [label="Access variable R|<local>/cause|"];
70 [label="Access variable R|<local>/closeException|"];
71 [label="Function call: R|<local>/cause|.R|kotlin/addSuppressed|(R|<local>/closeException|)"];
72 [label="Exit block"];
80 [label="Enter block"];
81 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"];
82 [label="Exit block"];
}
73 [label="Catch exit"];
83 [label="Try main block exit"];
}
74 [label="Try expression exit"];
subgraph cluster_23 {
color=blue
84 [label="Catch enter"];
subgraph cluster_24 {
color=blue
85 [label="Enter block"];
86 [label="Access variable R|<local>/cause|"];
87 [label="Access variable R|<local>/closeException|"];
88 [label="Function call: R|<local>/cause|.R|kotlin/addSuppressed|(R|<local>/closeException|)"];
89 [label="Exit block"];
}
90 [label="Catch exit"];
}
91 [label="Try expression exit"];
}
75 [label="Exit block"];
92 [label="Exit block"];
}
76 [label="Exit when branch result"];
77 [label="Enter when branch result"];
subgraph cluster_23 {
93 [label="Exit when branch result"];
94 [label="Enter when branch result"];
subgraph cluster_25 {
color=blue
78 [label="Enter block"];
79 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"];
80 [label="Exit block"];
95 [label="Enter block"];
96 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"];
97 [label="Exit block"];
}
81 [label="Exit when branch result"];
82 [label="Enter when branch result"];
subgraph cluster_24 {
98 [label="Exit when branch result"];
99 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
83 [label="Enter block"];
84 [label="Exit block"];
100 [label="Enter block"];
101 [label="Exit block"];
}
85 [label="Exit when branch result"];
86 [label="Exit when"];
102 [label="Exit when branch result"];
103 [label="Exit when"];
}
87 [label="Jump: ^closeFinally when () {
104 [label="Jump: ^closeFinally when () {
==(this@R|/closeFinally|, Null(null)) -> {
}
==(R|<local>/cause|, Null(null)) -> {
@@ -231,166 +272,166 @@ digraph complex_kt {
}
}
"];
88 [label="Stub" style="filled" fillcolor=gray];
89 [label="Exit block" style="filled" fillcolor=gray];
105 [label="Stub" style="filled" fillcolor=gray];
106 [label="Exit block" style="filled" fillcolor=gray];
}
90 [label="Exit function closeFinally" style="filled" fillcolor=red];
107 [label="Exit function closeFinally" style="filled" fillcolor=red];
}
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {82 52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {77 57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {90 67 63};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {74};
67 -> {90 68};
68 -> {69};
66 -> {67};
67 -> {68};
68 -> {99 69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {74};
73 -> {94 74};
74 -> {75};
75 -> {76};
76 -> {86};
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
79 -> {107 84 80};
80 -> {81};
81 -> {86};
81 -> {82};
82 -> {83};
83 -> {84};
84 -> {85};
83 -> {91};
84 -> {107 85};
85 -> {86};
86 -> {87};
87 -> {90};
87 -> {88} [style=dotted];
88 -> {89} [style=dotted];
89 -> {90} [style=dotted];
subgraph cluster_25 {
color=red
91 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red];
subgraph cluster_26 {
color=blue
92 [label="Enter block"];
93 [label="Access variable this@R|/firstIsInstanceOrNull|"];
94 [label="Variable declaration: lval <range>: R|kotlin/sequences/Sequence<*>|"];
95 [label="Access variable R|<local>/<range>|"];
96 [label="Function call: R|<local>/<range>|.R|kotlin/sequences/Sequence.iterator|()"];
97 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<T>|"];
subgraph cluster_27 {
color=blue
98 [label="Enter while loop"];
subgraph cluster_28 {
color=blue
99 [label="Enter loop condition"];
100 [label="Access variable R|<local>/<iterator>|"];
101 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
102 [label="Exit loop condition"];
}
subgraph cluster_29 {
color=blue
103 [label="Enter loop block"];
subgraph cluster_30 {
color=blue
104 [label="Enter block"];
105 [label="Access variable R|<local>/<iterator>|"];
106 [label="Function call: R|<local>/<iterator>|.R|FakeOverride<kotlin/collections/Iterator.next: R|T|>|()"];
107 [label="Variable declaration: lval element: R|T|"];
subgraph cluster_31 {
color=blue
108 [label="Enter when"];
subgraph cluster_32 {
color=blue
109 [label="Enter when branch condition "];
110 [label="Access variable R|<local>/element|"];
111 [label="Type operator: element is T"];
112 [label="Exit when branch condition"];
}
113 [label="Synthetic else branch"];
114 [label="Enter when branch result"];
subgraph cluster_33 {
color=blue
115 [label="Enter block"];
116 [label="Access variable R|<local>/element|"];
117 [label="Jump: ^firstIsInstanceOrNull R|<local>/element|"];
118 [label="Stub" style="filled" fillcolor=gray];
119 [label="Exit block" style="filled" fillcolor=gray];
}
120 [label="Exit when branch result" style="filled" fillcolor=gray];
121 [label="Exit when"];
}
122 [label="Exit block"];
}
123 [label="Exit loop block"];
}
124 [label="Exit whileloop"];
}
125 [label="Const: Null(null)"];
126 [label="Jump: ^firstIsInstanceOrNull Null(null)"];
127 [label="Stub" style="filled" fillcolor=gray];
128 [label="Exit block" style="filled" fillcolor=gray];
}
129 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red];
}
87 -> {88};
88 -> {89};
89 -> {90};
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {94};
93 -> {103};
94 -> {95};
95 -> {96};
96 -> {97};
97 -> {98};
98 -> {99};
98 -> {103};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {124 103};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108};
104 -> {107};
104 -> {105} [style=dotted];
105 -> {106} [style=dotted];
106 -> {107} [style=dotted];
subgraph cluster_27 {
color=red
108 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red];
subgraph cluster_28 {
color=blue
109 [label="Enter block"];
110 [label="Access variable this@R|/firstIsInstanceOrNull|"];
111 [label="Variable declaration: lval <range>: R|kotlin/sequences/Sequence<*>|"];
112 [label="Access variable R|<local>/<range>|"];
113 [label="Function call: R|<local>/<range>|.R|kotlin/sequences/Sequence.iterator|()"];
114 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<T>|"];
subgraph cluster_29 {
color=blue
115 [label="Enter while loop"];
subgraph cluster_30 {
color=blue
116 [label="Enter loop condition"];
117 [label="Access variable R|<local>/<iterator>|"];
118 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
119 [label="Exit loop condition"];
}
subgraph cluster_31 {
color=blue
120 [label="Enter loop block"];
subgraph cluster_32 {
color=blue
121 [label="Enter block"];
122 [label="Access variable R|<local>/<iterator>|"];
123 [label="Function call: R|<local>/<iterator>|.R|FakeOverride<kotlin/collections/Iterator.next: R|T|>|()"];
124 [label="Variable declaration: lval element: R|T|"];
subgraph cluster_33 {
color=blue
125 [label="Enter when"];
subgraph cluster_34 {
color=blue
126 [label="Enter when branch condition "];
127 [label="Access variable R|<local>/element|"];
128 [label="Type operator: element is T"];
129 [label="Exit when branch condition"];
}
130 [label="Synthetic else branch"];
131 [label="Enter when branch result"];
subgraph cluster_35 {
color=blue
132 [label="Enter block"];
133 [label="Access variable R|<local>/element|"];
134 [label="Jump: ^firstIsInstanceOrNull R|<local>/element|"];
135 [label="Stub" style="filled" fillcolor=gray];
136 [label="Exit block" style="filled" fillcolor=gray];
}
137 [label="Exit when branch result" style="filled" fillcolor=gray];
138 [label="Exit when"];
}
139 [label="Exit block"];
}
140 [label="Exit loop block"];
}
141 [label="Exit whileloop"];
}
142 [label="Const: Null(null)"];
143 [label="Jump: ^firstIsInstanceOrNull Null(null)"];
144 [label="Stub" style="filled" fillcolor=gray];
145 [label="Exit block" style="filled" fillcolor=gray];
}
146 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red];
}
108 -> {109};
109 -> {110};
110 -> {111};
111 -> {112};
112 -> {114 113};
113 -> {121};
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
116 -> {117};
117 -> {129};
117 -> {118} [style=dotted];
118 -> {119} [style=dotted];
119 -> {120} [style=dotted];
120 -> {121} [style=dotted];
117 -> {118};
118 -> {119};
119 -> {141 120};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {99};
123 -> {124};
124 -> {125};
125 -> {126};
126 -> {129};
126 -> {127} [style=dotted];
127 -> {128} [style=dotted];
128 -> {129} [style=dotted];
126 -> {127};
127 -> {128};
128 -> {129};
129 -> {131 130};
130 -> {138};
131 -> {132};
132 -> {133};
133 -> {134};
134 -> {146};
134 -> {135} [style=dotted];
135 -> {136} [style=dotted];
136 -> {137} [style=dotted];
137 -> {138} [style=dotted];
138 -> {139};
139 -> {140};
140 -> {116};
141 -> {142};
142 -> {143};
143 -> {146};
143 -> {144} [style=dotted];
144 -> {145} [style=dotted];
145 -> {146} [style=dotted];
}
+1 -1
View File
@@ -4,7 +4,7 @@ fun fetchPluginReleaseDate(pluginId: PluginId, version: String, channel: String?
val pluginDTOs: Array<PluginDTO> = try {
<!UNRESOLVED_REFERENCE!>HttpRequests<!>.<!UNRESOLVED_REFERENCE!>request<!>(url).<!UNRESOLVED_REFERENCE!>connect<!> {
GsonBuilder().create().fromJson(it.inputStream.reader(), Array<PluginDTO>::class.java)
<!UNRESOLVED_REFERENCE!>GsonBuilder<!>().<!UNRESOLVED_REFERENCE!>create<!>().<!UNRESOLVED_REFERENCE!>fromJson<!>(<!UNRESOLVED_REFERENCE!>it<!>.<!UNRESOLVED_REFERENCE!>inputStream<!>.<!AMBIGUITY!>reader<!>(), <!INAPPLICABLE_CANDIDATE!>Array<!><PluginDTO>::class.<!INAPPLICABLE_CANDIDATE!>java<!>)
}
} catch (ioException: JsonIOException) {
throw <!UNRESOLVED_REFERENCE!>IOException<!>(ioException)
+2 -2
View File
@@ -2,8 +2,8 @@ FILE: complex.kt
@R|kotlin/jvm/Throws|(<getClass>(<Unresolved name: IOException>#), <getClass>(<Unresolved name: ResponseParseException>#)) public final fun fetchPluginReleaseDate(pluginId: R|class error: Symbol not found, for `PluginId`|, version: R|kotlin/String|, channel: R|kotlin/String?|): R|class error: Symbol not found, for `LocalDate?`| {
lval url: R|kotlin/String| = <strcat>(String(https://plugins.jetbrains.com/api/plugins/), R|<local>/pluginId|.<Unresolved name: idString>#, String(/updates?version=), R|<local>/version|)
lval pluginDTOs: R|kotlin/Array<class error: Symbol not found, for `PluginDTO`>| = try {
<Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|).<Unresolved name: connect>#(<L> = connect@fun <implicit>.<anonymous>(): <implicit> {
GsonBuilder#().create#().fromJson#(it#.inputStream#.reader#(), <getClass>(Array#<PluginDTO>()).java#)
<Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|).<Unresolved name: connect>#(<L> = connect@fun <implicit>.<anonymous>(): <ERROR TYPE REF: Empty diagnostic> {
<Unresolved name: GsonBuilder>#().<Unresolved name: create>#().<Unresolved name: fromJson>#(<Unresolved name: it>#.<Unresolved name: inputStream>#.<Ambiguity: reader, [kotlin/io/reader, kotlin/io/reader, kotlin/io/reader]>#(), <getClass>(<Inapplicable(PARAMETER_MAPPING_ERROR): [kotlin/Array.Array]>#<R|class error: Symbol not found, for `PluginDTO`|>()).<Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#)
}
)
}
@@ -8,8 +8,8 @@ FILE: main.kt
R|<local>/x|.R|kotlin/Number.toInt|().R|kotlin/Any.toString|()
}
)
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo2]>#(<L> = foo2@fun <implicit>.<anonymous>(x: R|kotlin/Int|): <implicit> {
x#.toString#()
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo2]>#(<L> = foo2@fun <implicit>.<anonymous>(x: R|kotlin/Int|): R|kotlin/String| {
R|<local>/x|.R|kotlin/Any.toString|()
}
)
Q|JavaUsage|.R|/JavaUsage.foo3|<R|ft<kotlin/Int, kotlin/Int>|, R|ft<kotlin/String, kotlin/String>|>(foo3@fun <anonymous>(x: R|ft<kotlin/Int, kotlin/Int>|): R|kotlin/Unit| {
@@ -38,13 +38,13 @@ FILE: kotlinSam.kt
}
)
R|/foo1|(R|<local>/f|)
<Inapplicable(INAPPLICABLE): [/foo2]>#(<L> = foo2@fun <implicit>.<anonymous>(x: <implicit>): <implicit> {
>(x#, Int(1))
<Inapplicable(INAPPLICABLE): [/foo2]>#(<L> = foo2@fun <implicit>.<anonymous>(x: <ERROR TYPE REF: Unsupported: implicit VP type>): R|kotlin/Boolean| {
>(R|<local>/x|, Int(1))
}
)
<Inapplicable(INAPPLICABLE): [/foo2]>#(R|<local>/f|)
<Inapplicable(INAPPLICABLE): [/foo3]>#(<L> = foo3@fun <implicit>.<anonymous>(x: <implicit>): <implicit> {
>(x#, Int(1))
<Inapplicable(INAPPLICABLE): [/foo3]>#(<L> = foo3@fun <implicit>.<anonymous>(x: <ERROR TYPE REF: Unsupported: implicit VP type>): R|kotlin/Boolean| {
>(R|<local>/x|, Int(1))
}
)
<Inapplicable(INAPPLICABLE): [/foo3]>#(R|<local>/f|)
@@ -23,7 +23,7 @@ fun main() {
x > 1
}
JavaUsage.<!INAPPLICABLE_CANDIDATE!>foo<!>({ it > 1 })
JavaUsage.<!INAPPLICABLE_CANDIDATE!>foo<!>({ <!UNRESOLVED_REFERENCE!>it<!> > 1 })
val x = { x: Int -> x > 1 }
@@ -2,12 +2,12 @@ FILE: main.kt
public final fun foo(m: R|MyRunnable|): R|kotlin/Unit| {
}
public final fun main(): R|kotlin/Unit| {
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(<L> = foo@fun <implicit>.<anonymous>(x: <implicit>): <implicit> {
>(x#, Int(1))
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(<L> = foo@fun <implicit>.<anonymous>(x: <ERROR TYPE REF: Unsupported: implicit VP type>): R|kotlin/Boolean| {
>(R|<local>/x|, Int(1))
}
)
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(foo@fun <implicit>.<anonymous>(): <implicit> {
>(it#, Int(1))
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(foo@fun <implicit>.<anonymous>(): R|kotlin/Boolean| {
>(<Unresolved name: it>#, Int(1))
}
)
lval x: R|kotlin/Function1<kotlin/Int, kotlin/Boolean>| = fun <anonymous>(x: R|kotlin/Int|): R|kotlin/Boolean| {
@@ -52,11 +52,11 @@ FILE: main.kt
public final fun main(): R|kotlin/Unit| {
R|/foo1|(Q|KotlinClass|::R|/KotlinClass.Companion.baz|)
R|/foo2|(Q|KotlinClass|::R|/KotlinClass.baz|)
<Ambiguity: foo3, [/foo3, /foo3]>#(Q|KotlinClass|::baz#)
<Ambiguity: foo3, [/foo3, /foo3]>#(Q|KotlinClass|::R|/KotlinClass.baz|)
R|/foo1|(Q|KotlinClass|::R|/JavaClass.bar|)
R|/foo2|(Q|KotlinClass|::R|/JavaClass.bar|)
<Ambiguity: foo3, [/foo3, /foo3]>#(Q|KotlinClass|::bar#)
<Ambiguity: foo3, [/foo3, /foo3]>#(Q|KotlinClass|::R|/JavaClass.bar|)
R|/foo1|(Q|KotlinClass2|::R|/JavaClass.bar|)
<Inapplicable(INAPPLICABLE): [/foo2]>#(Q|KotlinClass2|::bar#)
<Inapplicable(INAPPLICABLE): [/foo2]>#(Q|KotlinClass2|::R|/JavaClass.bar|)
R|/foo3|(Q|KotlinClass2|::R|/JavaClass.bar|)
}
@@ -10,6 +10,6 @@ FILE: resolveCallableReferencesAfterAllSimpleArguments.kt
public final fun <T> baz(e: R|T|, f: R|kotlin/Function1<T, kotlin/Unit>|): R|kotlin/Unit| {
}
public final fun test(a: R|A|, b: R|B|): R|kotlin/Unit| {
<Inapplicable(INAPPLICABLE): [/baz]>#(R|<local>/a|, ::fooB#)
<Inapplicable(INAPPLICABLE): [/bar]>#(::fooB#, R|<local>/a|)
<Inapplicable(INAPPLICABLE): [/baz]>#(R|<local>/a|, ::R|/fooB|)
<Inapplicable(INAPPLICABLE): [/bar]>#(::R|/fooB|, R|<local>/a|)
}
@@ -9,7 +9,7 @@ FILE: implicitTypes.kt
^bar Int(1)
}
public final fun loop1(): <ERROR TYPE REF: Empty diagnostic> {
^loop1 <Inapplicable(INAPPLICABLE): [/use]>#(::loop2#)
^loop1 <Inapplicable(INAPPLICABLE): [/use]>#(::R|/loop2|)
}
public final fun loop2(): <ERROR TYPE REF: cycle> {
^loop2 R?C|/loop1|()
@@ -10,5 +10,5 @@ FILE: main.kt
public final fun main(): R|kotlin/Unit| {
R|/foo1|(Q|JavaClass|::R|/JavaClass.bar|)
R|/foo2|(Q|JavaClass|::R|/JavaClass.bar|)
<Ambiguity: foo3, [/foo3, /foo3]>#(Q|JavaClass|::bar#)
<Ambiguity: foo3, [/foo3, /foo3]>#(Q|JavaClass|::R|/JavaClass.bar|)
}
+4 -4
View File
@@ -6,8 +6,8 @@ FILE: test.kt
)
lval otherResult: R|kotlin/String| = R|<local>/map|.R|FakeOverride<kotlin/collections/Map.getOrDefault: R|kotlin/String|>|(String(key), String(value))
lval anotherResult: <ERROR TYPE REF: Empty diagnostic> = R|<local>/map|.<Unresolved name: replace>#(String(key), String(value))
R|<local>/map|.<Inapplicable(INAPPLICABLE): [kotlin/collections/forEach]>#(<L> = forEach@fun <implicit>.<anonymous>(key: <implicit>, value: <implicit>): <implicit> {
println#(<strcat>(key#, String(: ), value#))
R|<local>/map|.<Inapplicable(INAPPLICABLE): [kotlin/collections/forEach]>#(<L> = forEach@fun <implicit>.<anonymous>(key: <ERROR TYPE REF: Unsupported: implicit VP type>, value: <ERROR TYPE REF: Unsupported: implicit VP type>): R|kotlin/Unit| {
R|kotlin/io/println|(<strcat>(R|<local>/key|, String(: ), R|<local>/value|))
}
)
R|<local>/map|.R|kotlin/collections/forEach|<R|kotlin/String|, R|kotlin/String|>(<L> = forEach@fun <anonymous>(<destruct>: R|kotlin/collections/Map.Entry<kotlin/String, kotlin/String>|): R|kotlin/Unit| <kind=UNKNOWN> {
@@ -24,8 +24,8 @@ FILE: test.kt
)
lval otherResult: R|kotlin/String| = R|<local>/map|.R|FakeOverride<kotlin/collections/Map.getOrDefault: R|kotlin/String|>|(String(key), String(value))
lval anotherResult: <ERROR TYPE REF: Empty diagnostic> = R|<local>/map|.<Unresolved name: replace>#(String(key), String(value))
R|<local>/map|.<Inapplicable(INAPPLICABLE): [kotlin/collections/forEach]>#(<L> = forEach@fun <implicit>.<anonymous>(key: <implicit>, value: <implicit>): <implicit> {
println#(<strcat>(key#, String(: ), value#))
R|<local>/map|.<Inapplicable(INAPPLICABLE): [kotlin/collections/forEach]>#(<L> = forEach@fun <implicit>.<anonymous>(key: <ERROR TYPE REF: Unsupported: implicit VP type>, value: <ERROR TYPE REF: Unsupported: implicit VP type>): R|kotlin/Unit| {
R|kotlin/io/println|(<strcat>(R|<local>/key|, String(: ), R|<local>/value|))
}
)
R|<local>/map|.R|kotlin/collections/forEach|<R|kotlin/String|, R|kotlin/String|>(<L> = forEach@fun <anonymous>(<destruct>: R|kotlin/collections/Map.Entry<kotlin/String, kotlin/String>|): R|kotlin/Unit| <kind=UNKNOWN> {
@@ -3,7 +3,7 @@ FILE fqName:<root> fileName:/samByProjectedType.kt
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/H.bar]>#' type=IrErrorType
FUN_EXPR type=IrErrorType origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (x:kotlin.Any) returnType:IrErrorType
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any
VALUE_PARAMETER name:x index:0 type:kotlin.Any
BLOCK_BODY
ERROR_CALL 'Unresolved reference: x#' type=IrErrorType
GET_VAR 'x: kotlin.Any declared in <root>.test1.<anonymous>' type=kotlin.Any origin=null
@@ -29,5 +29,5 @@ FILE fqName:<root> fileName:/samConstructors.kt
VALUE_PARAMETER name:a index:0 type:IrErrorType
VALUE_PARAMETER name:b index:1 type:IrErrorType
BLOCK_BODY
ERROR_CALL 'Unresolved reference: minus#' type=IrErrorType
ERROR_CALL 'Unresolved reference: b#' type=IrErrorType
ERROR_CALL 'Unresolved reference: <Unresolved name: minus>#' type=IrErrorType
GET_VAR 'b: IrErrorType declared in <root>.test4.<anonymous>' type=IrErrorType origin=null