mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed the return type of 'object.__new__' after switching to Typeshed
For a while we will have it specified programmatically in our code instead of Typeshed since we don't support Type[C] yet.
This commit is contained in:
@@ -159,6 +159,11 @@ public class PyStdlibTypeProvider extends PyTypeProviderBase {
|
||||
else if ("tuple.__mul__".equals(qname) && callSite instanceof PyBinaryExpression) {
|
||||
return getTupleMultiplicationResultType((PyBinaryExpression)callSite, context);
|
||||
}
|
||||
else if ("object.__new__".equals(qname) && callSite instanceof PyCallExpression) {
|
||||
final PyExpression firstArgument = ((PyCallExpression)callSite).getArgument(0, PyExpression.class);
|
||||
final PyClassLikeType classLikeType = as(firstArgument != null ? context.getType(firstArgument) : null, PyClassLikeType.class);
|
||||
return classLikeType != null ? Ref.create(classLikeType.toInstance()) : null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user