[FIR] Don't remove subsumed members from intersection overrides's overriddens
This fixes a bunch of missing overridden symbols in IR. This is also required for fixing KT-59921 in the following commit where we need to keep all overridden symbols of intersection overrides so that we can enhance them properly. #KT-57300 Fixed #KT-57299 Fixed #KT-59921 #KT-57300 #KT-62788 #KT-64271 #KT-64382
This commit is contained in:
committed by
Space Team
parent
d80dee6e1c
commit
3b841dcb98
+13
@@ -0,0 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
interface SupervisorApiCallContextImpl : SupervisorApiCallDbContext, TxExecutor
|
||||
|
||||
interface SupervisorApiCallDbContext : TxExecutor, DbContextOwner
|
||||
|
||||
interface DbContextOwner : TxExecutor {
|
||||
override fun foo(p: Int) {}
|
||||
}
|
||||
|
||||
interface TxExecutor {
|
||||
fun foo(p: Int = 1)
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ abstract class Derived : Base {
|
||||
class InterfaceThenClass : Base, Derived() {}
|
||||
|
||||
fun test_1(x: InterfaceThenClass, s: String?) {
|
||||
x.delete(<!ARGUMENT_TYPE_MISMATCH!>s<!>)
|
||||
x.delete(s)
|
||||
}
|
||||
|
||||
class ClassThenInterface : Derived(), Base {}
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
// We inherit getReturnType
|
||||
// from CallableDescriptor with return type String? and
|
||||
// from ClassConstructorDescriptorImpl with return type String
|
||||
// but because ClassConstructorDescriptorImpl.getReturnType subsumes CallableDescriptor.getReturnType, we don't report RETURN_TYPE_MISMATCH_ON_INHERITANCE.
|
||||
class DeserializedClassConstructorDescriptor : CallableDescriptor, ClassConstructorDescriptorImpl()
|
||||
|
||||
// FILE: ClassConstructorDescriptorImpl.java
|
||||
|
||||
// IJ reports an inspection warning
|
||||
// "Non-annotated method 'getReturnType' from 'FunctionDescriptorImpl' implements non-null method from 'ConstructorDescriptor'"
|
||||
// which is the underlying issue.
|
||||
public class ClassConstructorDescriptorImpl extends FunctionDescriptorImpl implements ConstructorDescriptor {}
|
||||
|
||||
// FILE: FunctionDescriptorImpl.java
|
||||
public abstract class FunctionDescriptorImpl implements CallableDescriptor {
|
||||
@Override
|
||||
public String getReturnType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: ConstructorDescriptor.java
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface ConstructorDescriptor extends CallableDescriptor {
|
||||
@NotNull
|
||||
@Override
|
||||
String getReturnType();
|
||||
}
|
||||
|
||||
// FILE: CallableDescriptor.java
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface CallableDescriptor {
|
||||
@Nullable
|
||||
String getReturnType();
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
// FILE: VertLikeTable.java
|
||||
public interface VertLikeTable extends BasicModMajorObject, BasicModTableOrView, BasicModIdentifiedElement
|
||||
// FILE: BasicModMajorObject.java
|
||||
public interface BasicModMajorObject extends BasicMajorObject, BasicModSchemaObject
|
||||
// FILE: BasicMajorObject.java
|
||||
public interface BasicMajorObject extends BasicSchemaObject, DasSchemaChild
|
||||
// FILE: BasicSchemaObject.java
|
||||
public interface BasicSchemaObject extends BasicNamedElement
|
||||
// FILE: BasicNamedElement.java
|
||||
public interface BasicNamedElement extends BasicElement {
|
||||
@Override
|
||||
void foo();
|
||||
}
|
||||
// FILE: BasicElement.java
|
||||
public interface BasicElement extends BasicMixinElement
|
||||
// FILE: BasicMixinElement.java
|
||||
public interface BasicMixinElement extends DasObject
|
||||
// FILE: DasObject.java
|
||||
public interface DasObject {
|
||||
default void foo() {}
|
||||
}
|
||||
// FILE: DasSchemaChild.java
|
||||
public interface DasSchemaChild extends DasObject
|
||||
// FILE: BasicModSchemaObject.java
|
||||
public interface BasicModSchemaObject extends BasicSchemaObject, BasicModNamedElement
|
||||
// FILE: BasicModNamedElement.java
|
||||
public interface BasicModNamedElement extends BasicNamedElement, BasicModElement
|
||||
// FILE: BasicModElement.java
|
||||
public interface BasicModElement extends BasicElement, BasicModMixinElement
|
||||
// FILE: BasicModMixinElement.java
|
||||
public interface BasicModMixinElement extends BasicMixinElement
|
||||
// FILE: BasicModTableOrView.java
|
||||
public interface BasicModTableOrView extends BasicTableOrView, BasicModLikeTable
|
||||
// FILE: BasicTableOrView.java
|
||||
public interface BasicTableOrView extends BasicLikeTable, BasicMixinTableOrView
|
||||
// FILE: BasicLikeTable.java
|
||||
public interface BasicLikeTable extends BasicNamedElement
|
||||
// FILE: BasicMixinTableOrView.java
|
||||
public interface BasicMixinTableOrView extends DasTable
|
||||
// FILE: DasTable.java
|
||||
public interface DasTable extends DasSchemaChild
|
||||
// FILE: BasicModLikeTable.java
|
||||
public interface BasicModLikeTable extends BasicLikeTable, BasicModNamedElement
|
||||
// FILE: BasicModIdentifiedElement.java
|
||||
public interface BasicModIdentifiedElement extends BasicIdentifiedElement, BasicModElement
|
||||
// FILE: BasicIdentifiedElement.java
|
||||
public interface BasicIdentifiedElement extends BasicElement
|
||||
|
||||
// FILE: test.kt
|
||||
fun foo(t: VertLikeTable) {
|
||||
t.foo()
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
abstract class C<T, ModelPropertyT : ModelListPropertyCore<T>>() :
|
||||
A<ModelPropertyT, T>(),
|
||||
I<List<T>>
|
||||
|
||||
abstract class A<out ModelPropertyT : ModelPropertyCore<*>, T> {
|
||||
abstract val property: ModelPropertyT
|
||||
}
|
||||
|
||||
interface I<out T> {
|
||||
val property: ModelPropertyCore<out T>
|
||||
}
|
||||
|
||||
interface ModelListPropertyCore<T> : ModelPropertyCore<List<T>>
|
||||
interface ModelPropertyCore<T>
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
interface UAnnotationEx : UAnnotation, UAnchorOwner
|
||||
interface UAnchorOwner : UElement
|
||||
interface UElement {
|
||||
val psi: PsiElement?
|
||||
|
||||
val javaPsi: PsiElement?
|
||||
get() = psi
|
||||
}
|
||||
interface UAnnotation : UElement {
|
||||
override val javaPsi: PsiAnnotation?
|
||||
}
|
||||
|
||||
interface PsiElement
|
||||
interface PsiAnnotation : PsiElement
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
// inherits accept from FirDeclarationStatusImpl and FirResolvedDeclarationStatus
|
||||
class FirResolvedDeclarationStatusImpl : FirDeclarationStatusImpl(), FirResolvedDeclarationStatus
|
||||
|
||||
// inherits accept from FirElement and FirDeclarationStatus
|
||||
open class FirDeclarationStatusImpl : FirPureAbstractElement(), FirDeclarationStatus
|
||||
|
||||
abstract class FirPureAbstractElement : FirElement
|
||||
|
||||
interface FirResolvedDeclarationStatus : FirDeclarationStatus {
|
||||
override fun accept() {}
|
||||
}
|
||||
|
||||
interface FirDeclarationStatus : FirElement {
|
||||
override fun accept() {}
|
||||
}
|
||||
|
||||
interface FirElement {
|
||||
fun accept() {}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
class KtFirPsiJavaClassSymbol : KtFirNamedClassOrObjectSymbolBase(), KtFirPsiSymbol<String, String>
|
||||
open class KtFirNamedClassOrObjectSymbolBase : KtNamedClassOrObjectSymbol(), KtFirSymbol<String>
|
||||
abstract class KtNamedClassOrObjectSymbol : KtLifetimeOwner
|
||||
|
||||
interface KtFirPsiSymbol<P, S> : KtFirSymbol<S>
|
||||
|
||||
interface KtLifetimeOwner {
|
||||
val token: String
|
||||
}
|
||||
|
||||
interface KtSymbol : KtLifetimeOwner
|
||||
|
||||
interface KtFirSymbol<out S> : KtSymbol, KtLifetimeOwner {
|
||||
override val token: String get() = ""
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: PythonRunParams.java
|
||||
import java.util.Map;
|
||||
|
||||
public interface PythonRunParams {
|
||||
Map<String, String> fetchEnvs();
|
||||
}
|
||||
|
||||
// FILE: AbstractPythonRunConfiguration.java
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AbstractPythonRunConfiguration<T> implements PythonRunParams {
|
||||
public Map<String, String> fetchEnvs() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: PythonRunConfiguration.java
|
||||
public class PythonRunConfiguration extends AbstractPythonRunConfiguration implements PythonRunParams {}
|
||||
|
||||
// FILE: ProjectMain.kt
|
||||
|
||||
fun getRunCommandLine(configuration: PythonRunConfiguration) {
|
||||
fun foo(envs: Map<String, String>) {}
|
||||
checkSubtype<Map<String, String>>(<!ARGUMENT_TYPE_MISMATCH!>configuration.fetchEnvs()<!>)
|
||||
checkSubtype<Map<*, *>>(configuration.fetchEnvs())
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
// FILE: PythonRunParams.java
|
||||
import java.util.Map;
|
||||
|
||||
Reference in New Issue
Block a user