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:
Nikolay Krasko
2017-10-27 15:09:52 +03:00
parent 2d7fe98e55
commit d75656d571
5 changed files with 96 additions and 0 deletions
@@ -17,6 +17,9 @@ class SuspendLambda {
var nullableSuspendWithNullableReceiver: (suspend RS?.(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
@@ -119,6 +119,62 @@ PsiJetFileStubImpl[package=test]
USER_TYPE
REFERENCE_EXPRESSION[referencedName=kotlin]
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]
MODIFIER_LIST[public final]
TYPE_PARAMETER_LIST
@@ -5,3 +5,5 @@ typealias A = () -> Unit
fun foo(a: A) {
a.invoke()
}
class SomeClass
@@ -25,4 +25,11 @@ class TypeAliases {
@Ann
@Suppress("TOPLEVEL_TYPEALIASES_ONLY")
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
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=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]
MODIFIER_LIST[public]
ANNOTATION_ENTRY[hasValueArguments=false, shortName=Suppress]