Skip to content

Commit 4a58ff8

Browse files
authored
New semantic analyzer: add a test for int->float promotion (python#6565)
The bug open for this says that it doesn't seem to work but as far as I can tell it seems to. Add a test calling a forward referenced function that requires a promotion. Closes python#6398.
1 parent 981f42e commit 4a58ff8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test-data/unit/check-newsemanal.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@ a.f(1.0) # E: No overload variant of "f" of "A" matches argument type "float" \
581581
# N: def f(self, x: int) -> int \
582582
# N: def f(self, x: str) -> str
583583

584+
[case testNewAnalyzerPromotion]
585+
y: int
586+
f(y)
587+
f(1)
588+
def f(x: float) -> None: pass
589+
[builtins fixtures/primitives.pyi]
590+
584591
[case testNewAnalyzerFunctionDecorator]
585592
from typing import Callable
586593

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy