Commit c60e8a0
authored
[red-knot] Add support for calling
## Summary
This fixes the non-diagnostics part of #15948.
## Test Plan
New Markdown tests.
Negative diff on the ecosystem checks:
```diff
zipp (https://github.com/jaraco/zipp)
- error: lint:call-non-callable
- --> /tmp/mypy_primer/projects/zipp/zipp/__init__.py:393:16
- |
- 392 | def _next(self, at):
- 393 | return self.__class__(self.root, at)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Object of type `type[Unknown]` is not callable
- 394 |
- 395 | def is_dir(self):
- |
-
- Found 9 diagnostics
+ Found 8 diagnostics
arrow (https://github.com/arrow-py/arrow)
+ |
+ |
+ warning: lint:unused-ignore-comment
+ --> /tmp/mypy_primer/projects/arrow/arrow/arrow.py:576:66
+ 574 | values.append(1)
+ 575 |
+ 576 | floor = self.__class__(*values, tzinfo=self.tzinfo) # type: ignore[misc]
+ | -------------------- Unused blanket `type: ignore` directive
+ 577 |
+ 578 | if frame_absolute == "week":
- error: lint:call-non-callable
- --> /tmp/mypy_primer/projects/arrow/arrow/arrow.py:1080:16
- |
- 1078 | dt = self._datetime.astimezone(tz)
- 1079 |
- 1080 | return self.__class__(
- | ________________^
- 1081 | | dt.year,
- 1082 | | dt.month,
- 1083 | | dt.day,
- 1084 | | dt.hour,
- 1085 | | dt.minute,
- 1086 | | dt.second,
- 1087 | | dt.microsecond,
- 1088 | | dt.tzinfo,
- 1089 | | fold=getattr(dt, "fold", 0),
- 1090 | | )
- | |_________^ Object of type `type[Unknown]` is not callable
- 1091 |
- 1092 | # string output and formatting
- |
black (https://github.com/psf/black)
-
- |
- |
- error: lint:call-non-callable
- --> /tmp/mypy_primer/projects/black/src/blib2to3/pgen2/grammar.py:135:15
- 133 | Copy the grammar.
- 134 | """
- 135 | new = self.__class__()
- | ^^^^^^^^^^^^^^^^ Object of type `type[@todo]` is not callable
- 136 | for dict_attr in (
- 137 | "symbol2number",
- Found 328 diagnostics
+ Found 327 diagnostics
```type[…] (#16597)1 parent f19cb86 commit c60e8a0
File tree
2 files changed
+57
-0
lines changed- crates/red_knot_python_semantic
- resources/mdtest/call
- src
2 files changed
+57
-0
lines changedLines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2678 | 2678 | | |
2679 | 2679 | | |
2680 | 2680 | | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
2681 | 2688 | | |
2682 | 2689 | | |
2683 | 2690 | | |
| |||
0 commit comments