Additional tests for overloads with type aliases and suspend
Failed attempts to reproduce KT-20782, but still may be useful.
This commit is contained in:
@@ -17,6 +17,9 @@ class SuspendLambda {
|
|||||||
var nullableSuspendWithNullableReceiver: (suspend RS?.(P) -> Unit)? = null
|
var nullableSuspendWithNullableReceiver: (suspend RS?.(P) -> Unit)? = null
|
||||||
|
|
||||||
var nullableSuspendWithAnnotation: (@A() suspend (P) -> Unit)? = null
|
var nullableSuspendWithAnnotation: (@A() suspend (P) -> Unit)? = null
|
||||||
|
|
||||||
|
fun override(p: String, b: (suspend (P) -> Unit)) = null
|
||||||
|
fun override(b: (suspend (P) -> Unit)) = null
|
||||||
}
|
}
|
||||||
|
|
||||||
interface P
|
interface P
|
||||||
|
|||||||
@@ -119,6 +119,62 @@ PsiJetFileStubImpl[package=test]
|
|||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
REFERENCE_EXPRESSION[referencedName=Unit]
|
REFERENCE_EXPRESSION[referencedName=Unit]
|
||||||
|
FUN[fqName=test.SuspendLambda.override, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=override]
|
||||||
|
MODIFIER_LIST[public final]
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=String]
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=b]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
MODIFIER_LIST[suspend]
|
||||||
|
FUNCTION_TYPE
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=null]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=test]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=P]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Unit]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
NULLABLE_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Nothing]
|
||||||
|
FUN[fqName=test.SuspendLambda.override, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=override]
|
||||||
|
MODIFIER_LIST[public final]
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=b]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
MODIFIER_LIST[suspend]
|
||||||
|
FUNCTION_TYPE
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=null]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=test]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=P]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Unit]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
NULLABLE_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Nothing]
|
||||||
FUN[fqName=test.SuspendLambda.testCoroutine, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=testCoroutine]
|
FUN[fqName=test.SuspendLambda.testCoroutine, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=testCoroutine]
|
||||||
MODIFIER_LIST[public final]
|
MODIFIER_LIST[public final]
|
||||||
TYPE_PARAMETER_LIST
|
TYPE_PARAMETER_LIST
|
||||||
|
|||||||
@@ -5,3 +5,5 @@ typealias A = () -> Unit
|
|||||||
fun foo(a: A) {
|
fun foo(a: A) {
|
||||||
a.invoke()
|
a.invoke()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SomeClass
|
||||||
@@ -25,4 +25,11 @@ class TypeAliases {
|
|||||||
@Ann
|
@Ann
|
||||||
@Suppress("TOPLEVEL_TYPEALIASES_ONLY")
|
@Suppress("TOPLEVEL_TYPEALIASES_ONLY")
|
||||||
private typealias Parametrized<E, F> = Map<E, F>
|
private typealias Parametrized<E, F> = Map<E, F>
|
||||||
|
|
||||||
|
fun order(path: String) {}
|
||||||
|
fun order(body: Z) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typealias Z = dependency.SomeClass // dependency.SomeClass is before (lexicography) kotlin.String, but test.Z is after
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,34 @@ PsiJetFileStubImpl[package=test]
|
|||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
REFERENCE_EXPRESSION[referencedName=Unit]
|
REFERENCE_EXPRESSION[referencedName=Unit]
|
||||||
|
FUN[fqName=test.TypeAliases.order, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=order]
|
||||||
|
MODIFIER_LIST[public final]
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=path]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=String]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Unit]
|
||||||
|
FUN[fqName=test.TypeAliases.order, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=order]
|
||||||
|
MODIFIER_LIST[public final]
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=body]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=test]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Z]
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||||
|
REFERENCE_EXPRESSION[referencedName=Unit]
|
||||||
TYPEALIAS[fqName=test.TypeAliases.B, isTopLevel=false, name=B]
|
TYPEALIAS[fqName=test.TypeAliases.B, isTopLevel=false, name=B]
|
||||||
MODIFIER_LIST[public]
|
MODIFIER_LIST[public]
|
||||||
ANNOTATION_ENTRY[hasValueArguments=false, shortName=Suppress]
|
ANNOTATION_ENTRY[hasValueArguments=false, shortName=Suppress]
|
||||||
|
|||||||
Reference in New Issue
Block a user