mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'python-fixes'
This commit is contained in:
@@ -1091,11 +1091,6 @@ public class PyClassImpl extends PyPresentableElementImpl<PyClassStub> implement
|
||||
@NotNull
|
||||
@Override
|
||||
public List<PyClassLikeType> getAncestorTypes(@NotNull TypeEvalContext context) {
|
||||
return calculateAncestorTypes(context);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<PyClassLikeType> calculateAncestorTypes(@NotNull TypeEvalContext context) {
|
||||
myCachedAncestorsProvider.setTypeEvalContext(context);
|
||||
try {
|
||||
// TODO: Return different cached copies depending on the type eval context parameters
|
||||
|
||||
@@ -135,7 +135,10 @@ public class PyTargetExpressionImpl extends PyPresentableElementImpl<PyTargetExp
|
||||
final PsiElement parent = getParent();
|
||||
if (parent instanceof PyAssignmentStatement) {
|
||||
final PyAssignmentStatement assignmentStatement = (PyAssignmentStatement)parent;
|
||||
final PyExpression assignedValue = assignmentStatement.getAssignedValue();
|
||||
PyExpression assignedValue = assignmentStatement.getAssignedValue();
|
||||
if (assignedValue instanceof PyParenthesizedExpression) {
|
||||
assignedValue = ((PyParenthesizedExpression)assignedValue).getContainedExpression();
|
||||
}
|
||||
if (assignedValue != null) {
|
||||
if (assignedValue instanceof PyReferenceExpressionImpl) {
|
||||
final PyReferenceExpressionImpl refex = (PyReferenceExpressionImpl)assignedValue;
|
||||
|
||||
@@ -340,6 +340,15 @@ public class PyTypeTest extends PyTestCase {
|
||||
assertNull(actual);
|
||||
}
|
||||
|
||||
// PY-9590
|
||||
public void testYieldParensType() {
|
||||
PyExpression expr = parseExpr("def f():\n" +
|
||||
" expr = (yield 2)\n");
|
||||
TypeEvalContext context = TypeEvalContext.slow().withTracing();
|
||||
PyType actual = context.getType(expr);
|
||||
assertNull(actual);
|
||||
}
|
||||
|
||||
// PY-6702
|
||||
public void testYieldFromType() {
|
||||
PythonLanguageLevelPusher.setForcedLanguageLevel(myFixture.getProject(), LanguageLevel.PYTHON33);
|
||||
|
||||
Reference in New Issue
Block a user