PyType (@NotNull TypeEvalContext context) { final PyResolveContext resolveContext = PyResolveContext.defaultContext(context); final List<PyType> members = new ArrayList<>(); final PsiFile realFile = FileContextUtil.getContextFile(this); if (!(getContainingFile() instanceof PyExpressionCodeFragment) || (realFile != null && context.maySwitchToAST(realFile))) { for (PsiElement target : PyUtil.multiResolveTopPriority(getReference(resolveContext))) { if (target == this || target == null) { continue; } if (!target.isValid()) { throw new PsiInvalidElementAccessException(this); } members.add(getTypeFromTarget(target, context, this)); } } return PyUnionType.union(members); }