@@ -8,8 +8,7 @@ use crate::{
88 check_type_compact,
99 db_index:: { DbIndex , LuaGenericType , LuaType } ,
1010 semantic:: {
11- member:: { find_index_operations, get_member_map} ,
12- LuaInferCache ,
11+ generic:: tpl_context:: TplContext , member:: { find_index_operations, get_member_map} , LuaInferCache
1312 } ,
1413 InferFailReason , LuaFunctionType , LuaMemberKey , LuaMemberOwner , LuaObjectType ,
1514 LuaSemanticDeclId , LuaTupleType , LuaUnionType , VariadicType ,
@@ -27,6 +26,13 @@ pub fn tpl_pattern_match_args(
2726 root : & LuaSyntaxNode ,
2827 substitutor : & mut TypeSubstitutor ,
2928) -> TplPatternMatchResult {
29+ let _ = TplContext {
30+ tpl_param_types : func_param_types,
31+ call_arg_types,
32+ substitutor,
33+ root : root. clone ( ) ,
34+ } ;
35+
3036 for ( i, func_param_type) in func_param_types. iter ( ) . enumerate ( ) {
3137 let call_arg_type = if i < call_arg_types. len ( ) {
3238 & call_arg_types[ i]
@@ -129,6 +135,9 @@ fn tpl_pattern_match(
129135 substitutor : & mut TypeSubstitutor ,
130136) -> TplPatternMatchResult {
131137 let target = escape_alias ( db, target) ;
138+ if !pattern. contain_tpl ( ) {
139+ return Ok ( ( ) ) ;
140+ }
132141
133142 match pattern {
134143 LuaType :: TplRef ( tpl) => {
0 commit comments