mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
Enable TypeEvalContext#assumeType only if python.use.better.control.flow.type.inference is enabled
(cherry picked from commit da7e3452bfbdbfd618dbe166e5a6c199f28cae6f) IJ-MR-172702 GitOrigin-RevId: f9e8674be9b4a1f0a1f5fda030cef1e194c2a90f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
415fc7276d
commit
27e5a7690d
@@ -198,6 +198,9 @@ public sealed class TypeEvalContext {
|
||||
|
||||
@ApiStatus.Internal
|
||||
public <R> @Nullable R assumeType(@NotNull PyTypedElement element, @Nullable PyType type, @NotNull Function<TypeEvalContext, R> func) {
|
||||
if (!Registry.is("python.use.better.control.flow.type.inference")) {
|
||||
return func.apply(this);
|
||||
}
|
||||
if (getKnownType(element) != null) {
|
||||
// Temporary solution, as overwriting known type might introduce inconsistencies with its dependencies.
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user