mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-21692 Fixed: Return type of sum(List[Decimal]) is 'Any' (should be 'Decimal')
Add skeletons for builtin sum function
This commit is contained in:
@@ -475,6 +475,12 @@ public class Py3TypeTest extends PyTestCase {
|
||||
"expr = max(1, 2, 3)");
|
||||
}
|
||||
|
||||
// PY-21692
|
||||
public void testSumResult() {
|
||||
doTest("int",
|
||||
"expr = sum([1, 2, 3])");
|
||||
}
|
||||
|
||||
private void doTest(final String expectedType, final String text) {
|
||||
myFixture.configureByText(PythonFileType.INSTANCE, text);
|
||||
final PyExpression expr = myFixture.findElementByText("expr", PyExpression.class);
|
||||
|
||||
@@ -1524,6 +1524,12 @@ public class PyTypeTest extends PyTestCase {
|
||||
"expr = max(1, 2, 3)");
|
||||
}
|
||||
|
||||
// PY-21692
|
||||
public void testSumResult() {
|
||||
doTest("int",
|
||||
"expr = sum([1, 2, 3])");
|
||||
}
|
||||
|
||||
private static List<TypeEvalContext> getTypeEvalContexts(@NotNull PyExpression element) {
|
||||
return ImmutableList.of(TypeEvalContext.codeAnalysis(element.getProject(), element.getContainingFile()).withTracing(),
|
||||
TypeEvalContext.userInitiated(element.getProject(), element.getContainingFile()).withTracing());
|
||||
|
||||
Reference in New Issue
Block a user