Commit fa61f6f
committed
Python: Model
Adds `hasOverloadDecorator` as a predicate on functions. It looks for
decorators called `overload` or `something.overload` (usually
`typing.overload` or `t.overload`). These are then filtered out in the
predicates that (approximate) resolving methods according to the MRO.
As the test introduced in the previous commit shows, this removes the
spurious resolutions we had before.@typing.overload in method resolution1 parent 0561a63 commit fa61f6f
File tree
2 files changed
+23
-5
lines changed- python/ql
- lib/semmle/python/dataflow/new/internal
- test/library-tests/dataflow/calls-overload
2 files changed
+23
-5
lines changedLines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
307 | 323 | | |
308 | 324 | | |
309 | 325 | | |
| |||
849 | 865 | | |
850 | 866 | | |
851 | 867 | | |
852 | | - | |
| 868 | + | |
| 869 | + | |
853 | 870 | | |
854 | 871 | | |
855 | 872 | | |
| |||
891 | 908 | | |
892 | 909 | | |
893 | 910 | | |
| 911 | + | |
894 | 912 | | |
895 | 913 | | |
896 | 914 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments