Merge pull request #1627 from markshannon/python-points-to-from-comprehensions

Python points-to: Infer types for comprehensions.
This commit is contained in:
Taus
2019-07-25 16:09:33 +02:00
committed by GitHub
4 changed files with 11 additions and 5 deletions

View File

@@ -253,6 +253,12 @@ predicate literal_instantiation(ControlFlowNode n, ClassObjectInternal cls, Poin
n instanceof SetNode and cls = ObjectInternal::builtin("set")
or
n.getNode() instanceof ImaginaryLiteral and cls = ObjectInternal::builtin("complex")
or
n.getNode() instanceof ListComp and cls = ObjectInternal::builtin("list")
or
n.getNode() instanceof SetComp and cls = ObjectInternal::builtin("set")
or
n.getNode() instanceof DictComp and cls = ObjectInternal::builtin("dict")
)
}

View File

@@ -1,2 +1,2 @@
| 0 | 77 | 77 | 100.0 |
| 1 | 5 | 43 | 11.627906976744185 |
| 0 | 81 | 81 | 100.0 |
| 1 | 6 | 44 | 13.636363636363637 |

View File

@@ -1,2 +1,2 @@
| 0 | 77 | 77 | 100.0 |
| 1 | 3 | 43 | 6.976744186046512 |
| 0 | 81 | 81 | 100.0 |
| 1 | 3 | 44 | 6.818181818181818 |

View File

@@ -1 +1 @@
| 1231 |
| 1189 |