use of com.jetbrains.python.psi.types.PyCollectionTypeImpl in project intellij-community by JetBrains.
the class PyListCompExpressionImpl method getType.
@Nullable
@Override
public PyType getType(@NotNull TypeEvalContext context, @NotNull TypeEvalContext.Key key) {
final PyExpression resultExpr = getResultExpression();
final PyBuiltinCache cache = PyBuiltinCache.getInstance(this);
final PyClass list = cache.getClass("list");
if (resultExpr != null && list != null) {
final PyType elementType = context.getType(resultExpr);
return new PyCollectionTypeImpl(list, false, Collections.singletonList(elementType));
}
return cache.getListType();
}
Aggregations