Don't collect names in parameter default and annotation for visited function (PY-19599)

Because they are collected in the outer scope and outer scope is considered as their owner in ScopeUtil.getScopeOwner.
This commit is contained in:
Semyon Proshev
2018-04-02 19:01:29 +03:00
parent c80c39e29e
commit 87cfacbb3f
2 changed files with 17 additions and 5 deletions
@@ -714,6 +714,13 @@ public class PyUnresolvedReferencesInspectionTest extends PyInspectionTestCase {
" self.value = self.datetime(2016, 1, 1)");
}
// PY-19599
public void testDefinedInParameterDefaultAndBody() {
doTestByText("def f(p=(x for x in [])):\n" +
" x = 1\n" +
" return x");
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {