mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[java-psi] PsiEllipsisType#withNullability
Part of IDEA-372347 Java type inference should respect nullability GitOrigin-RevId: b612892b0c932d06118615231fd1980ebc386717
This commit is contained in:
committed by
intellij-monorepo-bot
parent
28463a9345
commit
33488fe4c6
@@ -31,7 +31,7 @@ public class PsiArrayType extends PsiType.Stub implements JvmArrayType {
|
||||
this(componentType, provider, JavaTypeNullabilityUtil.getNullabilityFromAnnotations(provider.getAnnotations()));
|
||||
}
|
||||
|
||||
private PsiArrayType(@NotNull PsiType componentType, @NotNull TypeAnnotationProvider provider, @NotNull TypeNullability nullability) {
|
||||
PsiArrayType(@NotNull PsiType componentType, @NotNull TypeAnnotationProvider provider, @NotNull TypeNullability nullability) {
|
||||
super(provider);
|
||||
myComponentType = componentType;
|
||||
myNullability = nullability;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.psi;
|
||||
|
||||
import com.intellij.codeInsight.TypeNullability;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -19,6 +20,10 @@ public class PsiEllipsisType extends PsiArrayType {
|
||||
public PsiEllipsisType(@NotNull PsiType componentType, @NotNull TypeAnnotationProvider provider) {
|
||||
super(componentType, provider);
|
||||
}
|
||||
|
||||
private PsiEllipsisType(@NotNull PsiType componentType, @NotNull TypeAnnotationProvider provider, @NotNull TypeNullability nullability) {
|
||||
super(componentType, provider, nullability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getPresentableText(boolean annotated) {
|
||||
@@ -41,6 +46,11 @@ public class PsiEllipsisType extends PsiArrayType {
|
||||
super.equalsToText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull PsiEllipsisType withNullability(@NotNull TypeNullability nullability) {
|
||||
return new PsiEllipsisType(getComponentType(), getAnnotationProvider(), nullability);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the ellipsis type to an array type with the same component type.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user