@@ -1447,7 +1447,7 @@ impl<'db> TypeInferenceBuilder<'db> {
14471447 ) -> Type < ' db > {
14481448 // TODO: Handle async with statements (they use `aenter` and `aexit`)
14491449 if is_async {
1450- return todo_type ! ( "async with statement" ) ;
1450+ return todo_type ! ( "async ` with` statement" ) ;
14511451 }
14521452
14531453 let context_manager_ty = context_expression_ty. to_meta_type ( self . db ( ) ) ;
@@ -1680,7 +1680,8 @@ impl<'db> TypeInferenceBuilder<'db> {
16801680 default,
16811681 } = node;
16821682 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) ;
16841685 }
16851686
16861687 fn infer_typevartuple_definition (
@@ -1694,7 +1695,8 @@ impl<'db> TypeInferenceBuilder<'db> {
16941695 default,
16951696 } = node;
16961697 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) ;
16981700 }
16991701
17001702 fn infer_match_statement ( & mut self , match_statement : & ast:: StmtMatch ) {
@@ -1729,7 +1731,11 @@ impl<'db> TypeInferenceBuilder<'db> {
17291731 // against the subject expression type (which we can query via `infer_expression_types`)
17301732 // and extract the type at the `index` position if the pattern matches. This will be
17311733 // 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+ ) ;
17331739 }
17341740
17351741 fn infer_match_pattern ( & mut self , pattern : & ast:: Pattern ) {
@@ -2483,8 +2489,7 @@ impl<'db> TypeInferenceBuilder<'db> {
24832489 ast:: Expr :: YieldFrom ( yield_from) => self . infer_yield_from_expression ( yield_from) ,
24842490 ast:: Expr :: Await ( await_expression) => self . infer_await_expression ( await_expression) ,
24852491 ast:: Expr :: IpyEscapeCommand ( _) => {
2486- // TODO Implement Ipy escape command support
2487- todo_type ! ( )
2492+ todo_type ! ( "Ipy escape command support" )
24882493 }
24892494 } ;
24902495
@@ -2922,8 +2927,7 @@ impl<'db> TypeInferenceBuilder<'db> {
29222927 self . infer_parameters ( parameters) ;
29232928 }
29242929
2925- // TODO function type
2926- todo_type ! ( )
2930+ todo_type ! ( "typing.Callable type" )
29272931 }
29282932
29292933 fn infer_call_expression ( & mut self , call_expression : & ast:: ExprCall ) -> Type < ' db > {
@@ -2959,11 +2963,8 @@ impl<'db> TypeInferenceBuilder<'db> {
29592963
29602964 fn infer_yield_expression ( & mut self , yield_expression : & ast:: ExprYield ) -> Type < ' db > {
29612965 let ast:: ExprYield { range : _, value } = yield_expression;
2962-
29632966 self . infer_optional_expression ( value. as_deref ( ) ) ;
2964-
2965- // TODO awaitable type
2966- todo_type ! ( )
2967+ todo_type ! ( "yield expressions" )
29672968 }
29682969
29692970 fn infer_yield_from_expression ( & mut self , yield_from : & ast:: ExprYieldFrom ) -> Type < ' db > {
@@ -2975,16 +2976,13 @@ impl<'db> TypeInferenceBuilder<'db> {
29752976 . unwrap_with_diagnostic ( & self . context , value. as_ref ( ) . into ( ) ) ;
29762977
29772978 // TODO get type from `ReturnType` of generator
2978- todo_type ! ( )
2979+ todo_type ! ( "Generic `typing.Generator` type" )
29792980 }
29802981
29812982 fn infer_await_expression ( & mut self , await_expression : & ast:: ExprAwait ) -> Type < ' db > {
29822983 let ast:: ExprAwait { range : _, value } = await_expression;
2983-
29842984 self . infer_expression ( value) ;
2985-
2986- // TODO awaitable type
2987- todo_type ! ( )
2985+ todo_type ! ( "generic `typing.Awaitable` type" )
29882986 }
29892987
29902988 /// Look up a name reference that isn't bound in the local scope.
@@ -3521,7 +3519,7 @@ impl<'db> TypeInferenceBuilder<'db> {
35213519 ( left, Type :: BooleanLiteral ( bool_value) , op) => {
35223520 self . infer_binary_expression_type ( left, Type :: IntLiteral ( i64:: from ( bool_value) ) , op)
35233521 }
3524- _ => Some ( todo_type ! ( ) ) , // TODO
3522+ _ => Some ( todo_type ! ( "Support for more binary expressions" ) ) ,
35253523 }
35263524 }
35273525
@@ -4040,10 +4038,9 @@ impl<'db> TypeInferenceBuilder<'db> {
40404038 }
40414039 }
40424040 }
4043- // TODO: handle more types
40444041 _ => match op {
40454042 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" ) ) ,
40474044 } ,
40484045 }
40494046 }
@@ -4795,7 +4792,7 @@ impl<'db> TypeInferenceBuilder<'db> {
47954792 single_element => {
47964793 let single_element_ty = self . infer_type_expression ( single_element) ;
47974794 if element_could_alter_type_of_whole_tuple ( single_element, single_element_ty) {
4798- todo_type ! ( )
4795+ todo_type ! ( "full tuple[...] support" )
47994796 } else {
48004797 Type :: tuple ( self . db ( ) , [ single_element_ty] )
48014798 }
@@ -5034,39 +5031,39 @@ impl<'db> TypeInferenceBuilder<'db> {
50345031
50355032 KnownInstanceType :: ReadOnly => {
50365033 self . infer_type_expression ( arguments_slice) ;
5037- todo_type ! ( "Required[] type qualifier" )
5034+ todo_type ! ( "`ReadOnly[]` type qualifier" )
50385035 }
50395036 KnownInstanceType :: NotRequired => {
50405037 self . infer_type_expression ( arguments_slice) ;
5041- todo_type ! ( "NotRequired[] type qualifier" )
5038+ todo_type ! ( "` NotRequired[]` type qualifier" )
50425039 }
50435040 KnownInstanceType :: ClassVar => {
50445041 self . infer_type_expression ( arguments_slice) ;
5045- todo_type ! ( "ClassVar[] type qualifier" )
5042+ todo_type ! ( "` ClassVar[]` type qualifier" )
50465043 }
50475044 KnownInstanceType :: Final => {
50485045 self . infer_type_expression ( arguments_slice) ;
5049- todo_type ! ( "Final[] type qualifier" )
5046+ todo_type ! ( "` Final[]` type qualifier" )
50505047 }
50515048 KnownInstanceType :: Required => {
50525049 self . infer_type_expression ( arguments_slice) ;
5053- todo_type ! ( "Required[] type qualifier" )
5050+ todo_type ! ( "` Required[]` type qualifier" )
50545051 }
50555052 KnownInstanceType :: TypeIs => {
50565053 self . infer_type_expression ( arguments_slice) ;
5057- todo_type ! ( "TypeIs[] special form" )
5054+ todo_type ! ( "` TypeIs[]` special form" )
50585055 }
50595056 KnownInstanceType :: TypeGuard => {
50605057 self . infer_type_expression ( arguments_slice) ;
5061- todo_type ! ( "TypeGuard[] special form" )
5058+ todo_type ! ( "` TypeGuard[]` special form" )
50625059 }
50635060 KnownInstanceType :: Concatenate => {
50645061 self . infer_type_expression ( arguments_slice) ;
5065- todo_type ! ( "Concatenate[] special form" )
5062+ todo_type ! ( "` Concatenate[]` special form" )
50665063 }
50675064 KnownInstanceType :: Unpack => {
50685065 self . infer_type_expression ( arguments_slice) ;
5069- todo_type ! ( "Unpack[] special form" )
5066+ todo_type ! ( "` Unpack[]` special form" )
50705067 }
50715068 KnownInstanceType :: NoReturn | KnownInstanceType :: Never | KnownInstanceType :: Any => {
50725069 self . context . report_lint (
0 commit comments