mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed type naming for dynamically evaluated types (PY-8898).
This commit is contained in:
@@ -30,4 +30,10 @@ public class PyDynamicallyEvaluatedType extends PyUnionType {
|
||||
}
|
||||
return new PyDynamicallyEvaluatedType(members);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
PyType res = excludeNull();
|
||||
return res != null ? res.getName() : "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,8 +163,8 @@ public class PyUnionType implements PyType {
|
||||
/**
|
||||
* Excludes all subtypes of type from the union
|
||||
*
|
||||
* @param type type to exclude. If type is a union all subtypes of union members will be excluded from the union
|
||||
* If type is null only null will be excluded from the union.
|
||||
* @param type type to exclude. If type is a union all subtypes of union members will be excluded from the union
|
||||
* If type is null only null will be excluded from the union.
|
||||
* @param context
|
||||
* @return union with excluded types
|
||||
*/
|
||||
@@ -186,6 +186,11 @@ public class PyUnionType implements PyType {
|
||||
return union(members);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PyType excludeNull() {
|
||||
return exclude(null, null);
|
||||
}
|
||||
|
||||
private static PyType unit(@Nullable PyType type) {
|
||||
if (type instanceof PyUnionType) {
|
||||
Set<PyType> members = new LinkedHashSet<PyType>();
|
||||
|
||||
Reference in New Issue
Block a user