File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
crates/ty_python_semantic/src/types Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -9108,12 +9108,12 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
91089108 class : KnownClass ,
91099109 ) -> Type < ' db > {
91109110 let arguments = & * subscript_node. slice ;
9111- let ( args, args_number ) = if let ast:: Expr :: Tuple ( t) = arguments {
9112- ( t . iter ( ) , t . len ( ) )
9111+ let args = if let ast:: Expr :: Tuple ( t) = arguments {
9112+ & * t . elts
91139113 } else {
9114- ( std:: slice:: from_ref ( arguments) . iter ( ) , 1 )
9114+ std:: slice:: from_ref ( arguments)
91159115 } ;
9116- if args_number != expected_arg_count {
9116+ if args . len ( ) != expected_arg_count {
91179117 if let Some ( builder) = self . context . report_lint ( & INVALID_TYPE_FORM , subscript_node) {
91189118 let noun = if expected_arg_count == 1 {
91199119 "argument"
@@ -9122,14 +9122,14 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
91229122 } ;
91239123 builder. into_diagnostic ( format_args ! (
91249124 "Legacy alias `{alias}` expected exactly {expected_arg_count} {noun}, \
9125- got {args_number}",
9125+ got {}",
9126+ args. len( )
91269127 ) ) ;
91279128 }
91289129 }
91299130 let ty = class. to_specialized_instance (
91309131 self . db ( ) ,
9131- args. into_iter ( )
9132- . map ( |node| self . infer_type_expression ( node) ) ,
9132+ args. iter ( ) . map ( |node| self . infer_type_expression ( node) ) ,
91339133 ) ;
91349134 if arguments. is_tuple_expr ( ) {
91359135 self . store_expression_type ( arguments, ty) ;
You can’t perform that action at this time.
0 commit comments