mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
PY-20057 Unify type vars constrained by class types and instance types
so that annotations like "def f(x: Type[T]) -> T" (and vice-versa) work as expected. Additionally, I've added a new method toClass() in PyInstantiableType interface that is supposed to be the opposite to existing toInstance().
This commit is contained in:
@@ -128,11 +128,18 @@ public class PyJavaClassType implements PyClassLikeType {
|
||||
return myDefinition;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PyClassLikeType toInstance() {
|
||||
return myDefinition ? new PyJavaClassType(myClass, false) : this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PyClassLikeType toClass() {
|
||||
return myDefinition ? this : new PyJavaClassType(myClass, true);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getClassQName() {
|
||||
|
||||
Reference in New Issue
Block a user