@@ -1447,7 +1447,7 @@ impl<'db> TypeInferenceBuilder<'db> {
1447
1447
) -> Type < ' db > {
1448
1448
// TODO: Handle async with statements (they use `aenter` and `aexit`)
1449
1449
if is_async {
1450
- return todo_type ! ( "async with statement" ) ;
1450
+ return todo_type ! ( "async ` with` statement" ) ;
1451
1451
}
1452
1452
1453
1453
let context_manager_ty = context_expression_ty. to_meta_type ( self . db ( ) ) ;
@@ -1680,7 +1680,8 @@ impl<'db> TypeInferenceBuilder<'db> {
1680
1680
default,
1681
1681
} = node;
1682
1682
self . infer_optional_expression ( default. as_deref ( ) ) ;
1683
- self . add_declaration_with_binding ( node. into ( ) , definition, todo_type ! ( ) , todo_type ! ( ) ) ;
1683
+ let pep_695_todo = todo_type ! ( "PEP-695 ParamSpec definition types" ) ;
1684
+ self . add_declaration_with_binding ( node. into ( ) , definition, pep_695_todo, pep_695_todo) ;
1684
1685
}
1685
1686
1686
1687
fn infer_typevartuple_definition (
@@ -1694,7 +1695,8 @@ impl<'db> TypeInferenceBuilder<'db> {
1694
1695
default,
1695
1696
} = node;
1696
1697
self . infer_optional_expression ( default. as_deref ( ) ) ;
1697
- self . add_declaration_with_binding ( node. into ( ) , definition, todo_type ! ( ) , todo_type ! ( ) ) ;
1698
+ let pep_695_todo = todo_type ! ( "PEP-695 TypeVarTuple definition types" ) ;
1699
+ self . add_declaration_with_binding ( node. into ( ) , definition, pep_695_todo, pep_695_todo) ;
1698
1700
}
1699
1701
1700
1702
fn infer_match_statement ( & mut self , match_statement : & ast:: StmtMatch ) {
@@ -1729,7 +1731,11 @@ impl<'db> TypeInferenceBuilder<'db> {
1729
1731
// against the subject expression type (which we can query via `infer_expression_types`)
1730
1732
// and extract the type at the `index` position if the pattern matches. This will be
1731
1733
// similar to the logic in `self.infer_assignment_definition`.
1732
- self . add_binding ( pattern. into ( ) , definition, todo_type ! ( ) ) ;
1734
+ self . add_binding (
1735
+ pattern. into ( ) ,
1736
+ definition,
1737
+ todo_type ! ( "`match` pattern definition types" ) ,
1738
+ ) ;
1733
1739
}
1734
1740
1735
1741
fn infer_match_pattern ( & mut self , pattern : & ast:: Pattern ) {
@@ -2483,8 +2489,7 @@ impl<'db> TypeInferenceBuilder<'db> {
2483
2489
ast:: Expr :: YieldFrom ( yield_from) => self . infer_yield_from_expression ( yield_from) ,
2484
2490
ast:: Expr :: Await ( await_expression) => self . infer_await_expression ( await_expression) ,
2485
2491
ast:: Expr :: IpyEscapeCommand ( _) => {
2486
- // TODO Implement Ipy escape command support
2487
- todo_type ! ( )
2492
+ todo_type ! ( "Ipy escape command support" )
2488
2493
}
2489
2494
} ;
2490
2495
@@ -2922,8 +2927,7 @@ impl<'db> TypeInferenceBuilder<'db> {
2922
2927
self . infer_parameters ( parameters) ;
2923
2928
}
2924
2929
2925
- // TODO function type
2926
- todo_type ! ( )
2930
+ todo_type ! ( "typing.Callable type" )
2927
2931
}
2928
2932
2929
2933
fn infer_call_expression ( & mut self , call_expression : & ast:: ExprCall ) -> Type < ' db > {
@@ -2959,11 +2963,8 @@ impl<'db> TypeInferenceBuilder<'db> {
2959
2963
2960
2964
fn infer_yield_expression ( & mut self , yield_expression : & ast:: ExprYield ) -> Type < ' db > {
2961
2965
let ast:: ExprYield { range : _, value } = yield_expression;
2962
-
2963
2966
self . infer_optional_expression ( value. as_deref ( ) ) ;
2964
-
2965
- // TODO awaitable type
2966
- todo_type ! ( )
2967
+ todo_type ! ( "yield expressions" )
2967
2968
}
2968
2969
2969
2970
fn infer_yield_from_expression ( & mut self , yield_from : & ast:: ExprYieldFrom ) -> Type < ' db > {
@@ -2975,16 +2976,13 @@ impl<'db> TypeInferenceBuilder<'db> {
2975
2976
. unwrap_with_diagnostic ( & self . context , value. as_ref ( ) . into ( ) ) ;
2976
2977
2977
2978
// TODO get type from `ReturnType` of generator
2978
- todo_type ! ( )
2979
+ todo_type ! ( "Generic `typing.Generator` type" )
2979
2980
}
2980
2981
2981
2982
fn infer_await_expression ( & mut self , await_expression : & ast:: ExprAwait ) -> Type < ' db > {
2982
2983
let ast:: ExprAwait { range : _, value } = await_expression;
2983
-
2984
2984
self . infer_expression ( value) ;
2985
-
2986
- // TODO awaitable type
2987
- todo_type ! ( )
2985
+ todo_type ! ( "generic `typing.Awaitable` type" )
2988
2986
}
2989
2987
2990
2988
/// Look up a name reference that isn't bound in the local scope.
@@ -3521,7 +3519,7 @@ impl<'db> TypeInferenceBuilder<'db> {
3521
3519
( left, Type :: BooleanLiteral ( bool_value) , op) => {
3522
3520
self . infer_binary_expression_type ( left, Type :: IntLiteral ( i64:: from ( bool_value) ) , op)
3523
3521
}
3524
- _ => Some ( todo_type ! ( ) ) , // TODO
3522
+ _ => Some ( todo_type ! ( "Support for more binary expressions" ) ) ,
3525
3523
}
3526
3524
}
3527
3525
@@ -4040,10 +4038,9 @@ impl<'db> TypeInferenceBuilder<'db> {
4040
4038
}
4041
4039
}
4042
4040
}
4043
- // TODO: handle more types
4044
4041
_ => match op {
4045
4042
ast:: CmpOp :: Is | ast:: CmpOp :: IsNot => Ok ( KnownClass :: Bool . to_instance ( self . db ( ) ) ) ,
4046
- _ => Ok ( todo_type ! ( ) ) ,
4043
+ _ => Ok ( todo_type ! ( "Binary comparisons between more types" ) ) ,
4047
4044
} ,
4048
4045
}
4049
4046
}
@@ -4795,7 +4792,7 @@ impl<'db> TypeInferenceBuilder<'db> {
4795
4792
single_element => {
4796
4793
let single_element_ty = self . infer_type_expression ( single_element) ;
4797
4794
if element_could_alter_type_of_whole_tuple ( single_element, single_element_ty) {
4798
- todo_type ! ( )
4795
+ todo_type ! ( "full tuple[...] support" )
4799
4796
} else {
4800
4797
Type :: tuple ( self . db ( ) , [ single_element_ty] )
4801
4798
}
@@ -5034,39 +5031,39 @@ impl<'db> TypeInferenceBuilder<'db> {
5034
5031
5035
5032
KnownInstanceType :: ReadOnly => {
5036
5033
self . infer_type_expression ( arguments_slice) ;
5037
- todo_type ! ( "Required[] type qualifier" )
5034
+ todo_type ! ( "`ReadOnly[]` type qualifier" )
5038
5035
}
5039
5036
KnownInstanceType :: NotRequired => {
5040
5037
self . infer_type_expression ( arguments_slice) ;
5041
- todo_type ! ( "NotRequired[] type qualifier" )
5038
+ todo_type ! ( "` NotRequired[]` type qualifier" )
5042
5039
}
5043
5040
KnownInstanceType :: ClassVar => {
5044
5041
self . infer_type_expression ( arguments_slice) ;
5045
- todo_type ! ( "ClassVar[] type qualifier" )
5042
+ todo_type ! ( "` ClassVar[]` type qualifier" )
5046
5043
}
5047
5044
KnownInstanceType :: Final => {
5048
5045
self . infer_type_expression ( arguments_slice) ;
5049
- todo_type ! ( "Final[] type qualifier" )
5046
+ todo_type ! ( "` Final[]` type qualifier" )
5050
5047
}
5051
5048
KnownInstanceType :: Required => {
5052
5049
self . infer_type_expression ( arguments_slice) ;
5053
- todo_type ! ( "Required[] type qualifier" )
5050
+ todo_type ! ( "` Required[]` type qualifier" )
5054
5051
}
5055
5052
KnownInstanceType :: TypeIs => {
5056
5053
self . infer_type_expression ( arguments_slice) ;
5057
- todo_type ! ( "TypeIs[] special form" )
5054
+ todo_type ! ( "` TypeIs[]` special form" )
5058
5055
}
5059
5056
KnownInstanceType :: TypeGuard => {
5060
5057
self . infer_type_expression ( arguments_slice) ;
5061
- todo_type ! ( "TypeGuard[] special form" )
5058
+ todo_type ! ( "` TypeGuard[]` special form" )
5062
5059
}
5063
5060
KnownInstanceType :: Concatenate => {
5064
5061
self . infer_type_expression ( arguments_slice) ;
5065
- todo_type ! ( "Concatenate[] special form" )
5062
+ todo_type ! ( "` Concatenate[]` special form" )
5066
5063
}
5067
5064
KnownInstanceType :: Unpack => {
5068
5065
self . infer_type_expression ( arguments_slice) ;
5069
- todo_type ! ( "Unpack[] special form" )
5066
+ todo_type ! ( "` Unpack[]` special form" )
5070
5067
}
5071
5068
KnownInstanceType :: NoReturn | KnownInstanceType :: Never | KnownInstanceType :: Any => {
5072
5069
self . context . report_lint (
0 commit comments