mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-83339 Narrow X | None type to X after assert x
(cherry picked from commit a49863065bf26f615100b21f423a650cbebbcab3) IJ-MR-178978 GitOrigin-RevId: 4bf02cab1e94a2ab1aaa70cb0b4578688cea88b9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ac8c5d3987
commit
8c745a5c22
@@ -4170,6 +4170,15 @@ public class Py3TypeTest extends PyTestCase {
|
||||
""");
|
||||
}
|
||||
|
||||
@TestFor(issues="PY-83339")
|
||||
public void testAssertNarrowsOptionalAfterAssert() {
|
||||
doTest("int", """
|
||||
def foo(param: int | None):
|
||||
assert param
|
||||
expr = param
|
||||
""");
|
||||
}
|
||||
|
||||
private void doTest(final String expectedType, final String text) {
|
||||
myFixture.configureByText(PythonFileType.INSTANCE, text);
|
||||
final PyExpression expr = myFixture.findElementByText("expr", PyExpression.class);
|
||||
|
||||
Reference in New Issue
Block a user