mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
PY-78653 Fix constrained type variable substitution
Subtypes of types constrained by a type variable should be treated as their respective explicitly listed base types in the context of the type variable. GitOrigin-RevId: ecaac1614f66974b6e6c2217ac0a90321d049f76
This commit is contained in:
committed by
intellij-monorepo-bot
parent
28a490867b
commit
af57462aa7
@@ -1,8 +1,11 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.jetbrains.python.psi.types;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a type parameter that should be substituted with a single type during the unification process.
|
||||
* Normally, it's declared using {@code TypeVar} function from the "typing" module, as in
|
||||
@@ -14,6 +17,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
* but can also come from other sources, such as docstrings.
|
||||
*/
|
||||
public interface PyTypeVarType extends PyTypeParameterType, PyInstantiableType<PyTypeVarType> {
|
||||
@NotNull List<@Nullable PyType> getConstraints();
|
||||
|
||||
/**
|
||||
* Returns the upper bound for this type parameter if it was specified.
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user