[AA FIR] add tests on implicit type in delegated scope

^KT-58727
This commit is contained in:
Dmitrii Gridin
2023-05-16 17:18:12 +02:00
committed by Space Team
parent 6a8981372b
commit 4472e1ae4e
26 changed files with 987 additions and 0 deletions
@@ -0,0 +1,3 @@
fun foo(): kotlin.Int
fun bar(): kotlin.Int
@@ -0,0 +1,67 @@
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /I.foo
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: foo
origin: DELEGATED
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /I.bar
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: bar
origin: DELEGATED
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,13 @@
// DO_NOT_CHECK_SYMBOL_RESTORE_K1
interface I {
fun foo() = 4
fun bar(): Int = 42
}
class A(
private val p: I
) : I by p
// class: A
@@ -0,0 +1,3 @@
open fun foo(): ERROR(empty body)
open fun bar(): kotlin.Int
@@ -0,0 +1,66 @@
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /A.foo
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: foo
origin: DELEGATED
receiverParameter: null
returnType: KtTypeErrorType:
annotationsList: []
type: ERROR CLASS: empty body
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /A.bar
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: bar
origin: DELEGATED
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,18 @@
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
// class: test/ClassWithGenericBase
package test
class Foo
abstract class Base<T> {
fun noGeneric() = 42
fun noGenericWithExplicitType(): Int = 24
fun withOuterGeneric(t: T) = "str"
fun withOuterGenericWithExplicitType(t: T): String = "rts"
fun <TT> withOwnGeneric(tt: TT) = true
fun <TT> withOwnGenericWithExplicitType(tt: TT): Boolean = false
fun <TT> withOuterAndOwnGeneric(t: T, tt: TT) = 4L
fun <TT> withOuterAndOwnGenericWithExplicitType(t: T, tt: TT): Long = 1L
}
class ClassWithGenericBase : Base<Foo>()
@@ -0,0 +1,23 @@
fun noGeneric(): kotlin.Int
fun noGenericWithExplicitType(): kotlin.Int
fun withOuterGeneric(t: test.Foo): ERROR(empty body)
fun withOuterGenericWithExplicitType(t: test.Foo): kotlin.String
fun <TT> withOwnGeneric(tt: TT): kotlin.Boolean
fun <TT> withOwnGenericWithExplicitType(tt: TT): kotlin.Boolean
fun <TT> withOuterAndOwnGeneric(t: test.Foo, tt: TT): ERROR(empty body)
fun <TT> withOuterAndOwnGenericWithExplicitType(t: test.Foo, tt: TT): kotlin.Long
open operator fun equals(other: kotlin.Any?): kotlin.Boolean
open fun hashCode(): kotlin.Int
open fun toString(): kotlin.String
constructor()
@@ -0,0 +1,617 @@
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/Base.noGeneric
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: noGeneric
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtTypeParameterType:
annotationsList: []
type: T
]
type: test/Base<T>
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/Base.noGenericWithExplicitType
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: noGenericWithExplicitType
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtTypeParameterType:
annotationsList: []
type: T
]
type: test/Base<T>
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterGeneric
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: withOuterGeneric
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtTypeErrorType:
annotationsList: []
type: ERROR CLASS: empty body
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: t
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Foo
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/ClassWithGenericBase
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterGenericWithExplicitType
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: withOuterGenericWithExplicitType
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: t
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Foo
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/ClassWithGenericBase
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/Base.withOwnGeneric
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: withOwnGeneric
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(TT)
]
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: tt
origin: SOURCE
receiverParameter: null
returnType: KtTypeParameterType:
annotationsList: []
type: TT
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtTypeParameterType:
annotationsList: []
type: T
]
type: test/Base<T>
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/Base.withOwnGenericWithExplicitType
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: withOwnGenericWithExplicitType
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(TT)
]
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: tt
origin: SOURCE
receiverParameter: null
returnType: KtTypeParameterType:
annotationsList: []
type: TT
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtTypeParameterType:
annotationsList: []
type: T
]
type: test/Base<T>
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterAndOwnGeneric
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: withOuterAndOwnGeneric
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtTypeErrorType:
annotationsList: []
type: ERROR CLASS: empty body
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(TT)
]
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: t
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Foo
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: tt
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtTypeParameterType:
annotationsList: []
type: TT
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/ClassWithGenericBase
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: test/ClassWithGenericBase.withOuterAndOwnGenericWithExplicitType
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: withOuterAndOwnGenericWithExplicitType
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Long
symbolKind: CLASS_MEMBER
typeParameters: [
KtTypeParameterSymbol(TT)
]
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: t
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/Foo
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: tt
origin: SUBSTITUTION_OVERRIDE
receiverParameter: null
returnType: KtTypeParameterType:
annotationsList: []
type: TT
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/ClassWithGenericBase
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.equals
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: true
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: equals
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Boolean
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: other
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any?
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtBinaryModule "Builtins for JVM (1.8)"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
getContainingModule: KtBinaryModule "Builtins for JVM (1.8)"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.hashCode
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: hashCode
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
getContainingModule: KtBinaryModule "Builtins for JVM (1.8)"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: kotlin/Any.toString
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: OPEN
name: toString
origin: LIBRARY
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/String
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Any
getContainingModule: KtBinaryModule "Builtins for JVM (1.8)"
deprecationStatus: null
KtConstructorSymbol:
annotationsList: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: test/ClassWithGenericBase
contextReceivers: []
hasStableParameterNames: true
isExtension: false
isPrimary: true
origin: SOURCE_MEMBER_GENERATED
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: test/ClassWithGenericBase
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null