mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[python] Unnecessary instance field (ReadWriteInstruction)
GitOrigin-RevId: 19164bd80bcb4482d6c305270946143fb8c1dc49
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0ed14734d9
commit
94aaceafb6
+6
-8
@@ -28,13 +28,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class ReadWriteInstruction extends InstructionImpl {
|
||||
final InstructionTypeCallback EXPR_TYPE = new InstructionTypeCallback() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Ref<PyType> getType(TypeEvalContext context, @Nullable PsiElement anchor) {
|
||||
return Ref.create(myElement instanceof PyExpression ? context.getType((PyExpression)myElement) : null);
|
||||
}
|
||||
};
|
||||
private static InstructionTypeCallback instructionTypeCallback(@Nullable PsiElement element) {
|
||||
return element instanceof PyExpression expression
|
||||
? (context, anchor) -> Ref.create(context.getType(expression))
|
||||
: (context, anchor) -> Ref.create(null);
|
||||
}
|
||||
|
||||
public enum ACCESS {
|
||||
READ(true, false, false, false),
|
||||
@@ -91,7 +89,7 @@ public final class ReadWriteInstruction extends InstructionImpl {
|
||||
super(builder, element);
|
||||
myName = name;
|
||||
myAccess = access;
|
||||
myGetType = getType != null ? getType : EXPR_TYPE;
|
||||
myGetType = getType != null ? getType : instructionTypeCallback(element);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
Reference in New Issue
Block a user