File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 9
9
### Fixes
10
10
- Handle positional only ` / ` parameters in overload implementation inference
11
11
- Render inferred literal without ` ? `
12
+ - Fix infer from defaults for inner functions
12
13
13
14
## [ 1.5.0]
14
15
### Added
Original file line number Diff line number Diff line change @@ -3040,7 +3040,7 @@ def analyze_simple_literal_type(
3040
3040
"""Return builtins.int if rvalue is an int literal, etc.
3041
3041
3042
3042
If this is a 'Final' context, we return "Literal[...]" instead."""
3043
- if self .options .semantic_analysis_only or self .function_stack :
3043
+ if self .options .semantic_analysis_only or self .function_stack and not do_bools :
3044
3044
# Skip this if we're only doing the semantic analysis pass.
3045
3045
# This is mostly to avoid breaking unit tests.
3046
3046
# Also skip inside a function; this is to avoid confusing
Original file line number Diff line number Diff line change @@ -468,3 +468,9 @@ def deco(func: T) -> T: ...
468
468
def b(b=True) -> None: ...
469
469
470
470
reveal_type(b) # N: Revealed type is "def (b: bool =) -> None"
471
+
472
+
473
+ [case testInferFromDefaultNested]
474
+ def f1():
475
+ def f2(a=True): ...
476
+ reveal_type(f2) # N: Revealed type is "def (a: bool =) -> None"
You can’t perform that action at this time.
0 commit comments