@@ -88,10 +88,7 @@ pub fn get_type_at_call_expr(
88
88
_ => { }
89
89
}
90
90
91
- let Some ( signature_cast) = db
92
- . get_flow_index ( )
93
- . get_signature_cast ( & cache. get_file_id ( ) , & signature_id)
94
- else {
91
+ let Some ( signature_cast) = db. get_flow_index ( ) . get_signature_cast ( & signature_id) else {
95
92
return Ok ( ResultTypeOrContinue :: Continue ) ;
96
93
} ;
97
94
@@ -105,6 +102,7 @@ pub fn get_type_at_call_expr(
105
102
flow_node,
106
103
prefix_expr,
107
104
signature_cast,
105
+ signature_id,
108
106
condition_flow,
109
107
) ,
110
108
name => get_type_at_call_expr_by_signature_param_name (
@@ -200,6 +198,7 @@ fn get_type_at_call_expr_by_signature_self(
200
198
flow_node : & FlowNode ,
201
199
call_prefix : LuaExpr ,
202
200
signature_cast : & LuaSignatureCast ,
201
+ signature_id : LuaSignatureId ,
203
202
condition_flow : InferConditionFlow ,
204
203
) -> Result < ResultTypeOrContinue , InferFailReason > {
205
204
let LuaExpr :: IndexExpr ( call_prefix_index) = call_prefix else {
@@ -221,13 +220,18 @@ fn get_type_at_call_expr_by_signature_self(
221
220
let antecedent_flow_id = get_single_antecedent ( tree, flow_node) ?;
222
221
let antecedent_type = get_type_at_flow ( db, tree, cache, root, var_ref_id, antecedent_flow_id) ?;
223
222
224
- let Some ( cast_op_type) = signature_cast. cast . to_node ( root) else {
223
+ let Some ( syntax_tree) = db. get_vfs ( ) . get_syntax_tree ( & signature_id. get_file_id ( ) ) else {
224
+ return Ok ( ResultTypeOrContinue :: Continue ) ;
225
+ } ;
226
+
227
+ let signature_root = syntax_tree. get_chunk_node ( ) ;
228
+ let Some ( cast_op_type) = signature_cast. cast . to_node ( & signature_root) else {
225
229
return Ok ( ResultTypeOrContinue :: Continue ) ;
226
230
} ;
227
231
228
232
let result_type = cast_type (
229
233
db,
230
- cache . get_file_id ( ) ,
234
+ signature_id . get_file_id ( ) ,
231
235
cast_op_type,
232
236
antecedent_type,
233
237
condition_flow,
@@ -291,13 +295,18 @@ fn get_type_at_call_expr_by_signature_param_name(
291
295
let antecedent_flow_id = get_single_antecedent ( tree, flow_node) ?;
292
296
let antecedent_type = get_type_at_flow ( db, tree, cache, root, var_ref_id, antecedent_flow_id) ?;
293
297
294
- let Some ( cast_op_type) = signature_cast. cast . to_node ( root) else {
298
+ let Some ( syntax_tree) = db. get_vfs ( ) . get_syntax_tree ( & signature_id. get_file_id ( ) ) else {
299
+ return Ok ( ResultTypeOrContinue :: Continue ) ;
300
+ } ;
301
+
302
+ let signature_root = syntax_tree. get_chunk_node ( ) ;
303
+ let Some ( cast_op_type) = signature_cast. cast . to_node ( & signature_root) else {
295
304
return Ok ( ResultTypeOrContinue :: Continue ) ;
296
305
} ;
297
306
298
307
let result_type = cast_type (
299
308
db,
300
- cache . get_file_id ( ) ,
309
+ signature_id . get_file_id ( ) ,
301
310
cast_op_type,
302
311
antecedent_type,
303
312
condition_flow,
0 commit comments