Support non-parenthesized annotations on functional types without receiver
^KT-31734 Fixed
This commit is contained in:
+70
@@ -0,0 +1,70 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -CAST_NEVER_SUCCEEDS -CANNOT_CHECK_FOR_ERASED -UNCHECKED_CAST -UNUSED_ANONYMOUS_PARAMETER
|
||||
// SKIP_TXT
|
||||
// Issue: KT-31734
|
||||
|
||||
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Foo
|
||||
|
||||
fun foo1(x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) = x as Iterable<<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit>?
|
||||
|
||||
fun foo2() = null as <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit
|
||||
|
||||
fun foo3(x: Any?) {
|
||||
if (x is (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>Foo<!><!> () -> Unit)?) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo4(x: Any) = x is <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> (() -> Unit?)
|
||||
|
||||
fun foo5(x: Any): <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit = x as @Foo() @[Foo Foo()] <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit
|
||||
|
||||
fun foo6() {
|
||||
val x: @Foo() @[Foo Foo()] <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo7() {
|
||||
val x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) -> Unit = { x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit -> }
|
||||
}
|
||||
|
||||
fun foo8(<!UNUSED_PARAMETER!>x<!>: Any?) {
|
||||
val <!NAME_SHADOWING!>x<!>: (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit)? = {}
|
||||
}
|
||||
|
||||
fun foo9(x: (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit)?) = x as Iterable<(<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit?)?>?
|
||||
|
||||
fun foo10(x: @[Foo] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo11(x: @[Foo ] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo12(x: @[Foo/**/] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
val foo13: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (x: @Foo Any) -> Unit get() = {}
|
||||
|
||||
val foo14: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) -> Unit get() = {}
|
||||
|
||||
val foo15: @Foo () <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo16: @Foo @Foo () <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo17: @Foo() @Foo () <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo18: @Foo()@Foo () <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo19: @Foo@Foo () <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo20: @Foo<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo21: @Foo()<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit get() = {}
|
||||
|
||||
val foo22: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) -> Unit get() = {}
|
||||
|
||||
val foo23: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) -> Unit get() = {}
|
||||
|
||||
val foo24: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit, <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) -> Unit get() = {x, y -> }
|
||||
|
||||
val foo25: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (x: @Foo Any, @Foo Any) -> Unit get() = {x, y -> }
|
||||
|
||||
val foo26: @Foo suspend () -> Unit = {}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
// !LANGUAGE: +NonParenthesizedAnnotationsOnFunctionalTypes
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -CAST_NEVER_SUCCEEDS -CANNOT_CHECK_FOR_ERASED -UNCHECKED_CAST -UNUSED_ANONYMOUS_PARAMETER
|
||||
// SKIP_TXT
|
||||
// Issue: KT-31734
|
||||
|
||||
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Foo
|
||||
|
||||
class MyClass
|
||||
|
||||
fun foo1(x: @Foo () -> Unit) = x as Iterable<@Foo () -> Unit>?
|
||||
|
||||
fun foo2() = null as @Foo () -> Unit
|
||||
|
||||
fun foo3(x: Any?) {
|
||||
if (x is (@<!DEBUG_INFO_MISSING_UNRESOLVED!>Foo<!> () -> Unit)?) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo4(x: Any) = x is @Foo () -> (() -> Unit?)
|
||||
|
||||
fun foo5(x: Any): @Foo () -> Unit = x as @Foo() @[Foo Foo()] @Foo () -> Unit
|
||||
|
||||
fun foo6() {
|
||||
val x: @Foo() @[Foo Foo()] @Foo () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo7() {
|
||||
val x: @Foo (@Foo () -> Unit) -> Unit = { x: @Foo () -> Unit -> }
|
||||
}
|
||||
|
||||
fun foo10(x: @[Foo()] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo11(x: @[Foo] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo12(x: @[Foo ] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo13(x: @[Foo/**/] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
val foo14: @Foo (x: @Foo () -> Unit) -> Unit get() = {}
|
||||
|
||||
val foo15: @Foo () @Foo () -> Unit get() = {}
|
||||
|
||||
val foo16: @Foo @Foo () @Foo () -> Unit get() = {}
|
||||
|
||||
val foo17: @Foo() @Foo () @Foo () -> Unit get() = {}
|
||||
|
||||
val foo18: @Foo()@Foo () @Foo () -> Unit get() = {}
|
||||
|
||||
val foo19: @Foo@Foo () @Foo () -> Unit get() = {}
|
||||
|
||||
val foo20: @Foo@Foo () -> Unit get() = {}
|
||||
|
||||
val foo21: @Foo()@Foo () -> Unit get() = {}
|
||||
|
||||
val foo22: @Foo (x: @Foo () -> Unit) -> Unit get() = {}
|
||||
|
||||
val foo23: @Foo (@Foo () -> Unit) -> Unit get() = {}
|
||||
|
||||
val foo24: @Foo (@Foo () -> Unit, @Foo () -> Unit) -> Unit get() = {x, y -> }
|
||||
|
||||
val foo25: @Foo (x: @Foo Any, @Foo Any) -> Unit get() = {x, y -> }
|
||||
|
||||
val foo26: @Foo suspend () -> Unit = {}
|
||||
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -CAST_NEVER_SUCCEEDS -CANNOT_CHECK_FOR_ERASED -UNCHECKED_CAST -UNUSED_ANONYMOUS_PARAMETER
|
||||
// SKIP_TXT
|
||||
// Issue: KT-31734
|
||||
|
||||
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Foo
|
||||
|
||||
fun foo1(x: @Foo() () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo2() = null as @Foo() () -> Unit
|
||||
|
||||
fun foo3(x: Any?) {
|
||||
if (x is (@<!DEBUG_INFO_MISSING_UNRESOLVED!>Foo<!>() () -> Unit)?) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo4(x: Any) = x is @Foo() () -> (() -> Unit?)
|
||||
|
||||
fun foo5(x: Any): @Foo() () -> Unit = x as @Foo () @[Foo Foo ()] @Foo() () -> Unit
|
||||
|
||||
fun foo6() {
|
||||
val x: @Foo() @[Foo Foo()] @Foo() () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo7() {
|
||||
val x: @Foo() (@Foo() () -> Unit) -> Unit = { x: @Foo() () -> Unit -> }
|
||||
}
|
||||
|
||||
fun foo8(x: @[Foo() ] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo9(x: @[Foo()] () -> Unit) = x as Iterable<@Foo() () -> Unit>?
|
||||
|
||||
fun foo10() {
|
||||
val x: @Foo () @Foo () () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo11() {
|
||||
val x: @Foo @Foo () () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo12() {
|
||||
val x: @Foo() @Foo () () -> Unit = {}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
fun foo() {
|
||||
for (@Foo (i: Int) in y) {}
|
||||
for (@Foo (i: () -> Unit) in y) {}
|
||||
for (@Foo (i) in y) {}
|
||||
for (@Foo (i, j) in y) {}
|
||||
for (@Foo (i, j: Int) in y) {}
|
||||
for (@Foo i: Int in y) {}
|
||||
for (@Foo i in y) {}
|
||||
}
|
||||
Vendored
+282
@@ -0,0 +1,282 @@
|
||||
KtFile: forDestructuring.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
PsiComment(EOL_COMMENT)('// Issue: KT-31734')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiErrorElement:Expecting 'in'
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiErrorElement:Expecting ')'
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
DESTRUCTURING_DECLARATION
|
||||
PsiElement(LPAR)('(')
|
||||
PsiErrorElement:Expecting a name
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting 'in'
|
||||
PsiElement(ARROW)('->')
|
||||
PsiErrorElement:Expecting ')'
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
LAMBDA_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
BLOCK
|
||||
<empty list>
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiErrorElement:Expecting 'in'
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('j')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiErrorElement:Expecting 'in'
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('j')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiErrorElement:Expecting 'in'
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
LOOP_RANGE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
FOR
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
LOOP_RANGE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
fun foo() {
|
||||
val x = { @Foo (foo, bar) -> }
|
||||
val x = { @Foo (foo: kotlin.Any, bar) -> }
|
||||
val x = { @Foo (foo, bar: Any) -> }
|
||||
val x = { @Foo ((foo, bar: Any)) -> }
|
||||
val x = { @Foo () -> Unit }
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
KtFile: lambdaParameterDeclaration.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
PsiComment(EOL_COMMENT)('// Issue: KT-31734')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
LAMBDA_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
ANNOTATED_EXPRESSION
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting an element
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
LAMBDA_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
ANNOTATED_EXPRESSION
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiErrorElement:Expecting ')'
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Any')
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
LAMBDA_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
ANNOTATED_EXPRESSION
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Any')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting an element
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
LAMBDA_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
ANNOTATED_EXPRESSION
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PARENTHESIZED
|
||||
PsiElement(LPAR)('(')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiErrorElement:Expecting ')'
|
||||
<empty list>
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Any')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting an element
|
||||
<empty list>
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
LAMBDA_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
ANNOTATED_EXPRESSION
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting an element
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
compiler/testData/psi/annotation/functionalTypes/regressionForSimilarSyntax/variableDestructuring.kt
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
fun foo() {
|
||||
val @Foo (i) = Pair(1, 2)
|
||||
var @Foo (i: () -> Unit) = Pair(1, 2)
|
||||
var @Foo (i: Int) = Pair(1, 2)
|
||||
val @Foo (i, j) = Pair(1, 2)
|
||||
val @Foo (i, j: Int) = Pair(1, 2)
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
KtFile: variableDestructuring.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
PsiComment(EOL_COMMENT)('// Issue: KT-31734')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Annotations are not allowed in this position
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting property name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Pair')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
DESTRUCTURING_DECLARATION
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Annotations are not allowed in this position
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiErrorElement:Expecting ')'
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
PsiErrorElement:Expecting a name
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Pair')
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Annotations are not allowed in this position
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting property name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Pair')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Annotations are not allowed in this position
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('j')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting property name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Pair')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Annotations are not allowed in this position
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('i')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('j')
|
||||
PsiErrorElement:Unexpected type specification
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting property name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Pair')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@Foo(10) suspend (Int) -> Unit) get() = {}
|
||||
|
||||
val x: @Foo({}) ((x: @Foo(10) (@Foo(11) () -> Int) -> Int) -> Unit) get() = {}
|
||||
|
||||
val x: suspend @Foo(10) (x: @Foo(10) (@Foo("") (x: kotlin.Any) -> Int) -> Int) -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@Foo(10) @Bar(10) @Foo(listOf(10)) (x: kotlin.Any = {}) -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @Foo({ x: Int -> 10}) suspend (x: @Foo(10) Foo) -> (y: @Foo(10) Bar) -> Unit
|
||||
|
||||
fun foo(x: (@Foo(10) (@Foo({ x: Int -> 10}) kotlin.Any)->()->Unit)) = x
|
||||
|
||||
fun foo(x: suspend @Foo(10) @Bar(10 + @Foo 3) (kotlin.Any) -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @Foo(10) suspend @Bar(throw Exception()) (Coomparable<kotlin.Any>) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: suspend @Foo(null) (Coomparable<@Foo(10) @Bar(10) @Foo(10) () -> Unit>) -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @Foo(10 as @Foo suspend (Int) -> ((Int) -> Unit)) suspend (suspend (Int) -> ((Int) -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @Foo(10) @Bar(10) @Foo(Any) (Any) -> Unit) = 10
|
||||
|
||||
fun foo(): @Foo.Bar(@Foo x) suspend (Nothing) -> Unit = {}
|
||||
|
||||
fun foo(): () -> @Foo.Bar('1') suspend (Bar) -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @Foo("") (Coomparable<Nothing>) -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@Foo(object {}) (()->Unit)-> ()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @Foo({}) @Bar(10) @Foo(10) (()->Unit) -> Unit is suspend @Foo(10) @Bar(10) @Foo(10) (()->Unit) -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@Foo({}) suspend (()->Unit) -> (()->Unit) -> Unit) -> Unit
|
||||
}
|
||||
+1774
File diff suppressed because it is too large
Load Diff
+47
@@ -0,0 +1,47 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@Foo() () -> Unit) get() = {}
|
||||
|
||||
val x: @Foo() (() -> Unit) get() = {}
|
||||
|
||||
val x: @Foo() () -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@Fo() @Bar(10) @Foo() () -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @Foo() () -> Unit
|
||||
|
||||
fun foo(x: (@Foo() () -> Unit)) = x
|
||||
|
||||
fun foo(x: @Foo(10) @Bar() () -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @Foo() @Bar() () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: @Foo() () -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @Foo() (() -> (() -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @Foo() @Bar(10) @Foo() () -> Unit) = 10
|
||||
|
||||
fun foo(): @Foo.Bar() () -> Unit = {}
|
||||
|
||||
fun foo(): () -> @Foo.Bar() () -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @Foo() () -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@Foo() ()->()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @Foo() @Bar(10) @Foo() () -> Unit is @Foo() @Bar(10) @Foo() () -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@Foo() () -> () -> Unit) -> Unit
|
||||
}
|
||||
+1116
File diff suppressed because it is too large
Load Diff
+51
@@ -0,0 +1,51 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@[Foo] suspend (Int) -> Unit) get() = {}
|
||||
|
||||
val x: (@[Foo] () -> Unit) get() = {}
|
||||
|
||||
val x: (@[Foo] suspend () -> Unit) get() = {}
|
||||
|
||||
val x: @[Foo] ((x: @[Foo] (@[Foo Foo] () -> Int) -> Int) -> Unit) get() = {}
|
||||
|
||||
val x: suspend @[Foo] (x: @[Foo Foo] (@[Foo Foo] (x: kotlin.Any) -> Int) -> Int) -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@[Foo] @[Bar(10)] @[Foo] () -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @[Foo Foo] suspend (x: @[Foo] Foo) -> (y: @[Foo] Bar) -> Unit
|
||||
|
||||
fun foo(x: (@Foo ()->()->Unit)) = x
|
||||
|
||||
fun foo(x: suspend @[Foo Foo(10)] @[Bar] (kotlin.Any) -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @[Foo(10)] @[Bar] (Coomparable<kotlin.Any>) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: suspend @[Foo Bar] (Coomparable<@[Foo Bar Bar Bar Bar Bar] @[Bar(10)] @[Foo Bar] () -> Unit>) -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @[Foo Bar] suspend (() -> ((Int) -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @[Foo Bar] @[Bar(10)] @[Foo Bar] () -> Unit) = 10
|
||||
|
||||
fun foo(): @[Foo.Bar Foo.Bar(1)] suspend () -> Unit = {}
|
||||
|
||||
fun foo(): () -> @[Foo.Bar] () -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @[Foo()] (Coomparable<Nothing>) -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@[Foo Bar] (()->Unit)-> ()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @[Foo] @[Bar(10) Bar] @[Foo Bar] (()->Unit) -> Unit is suspend @[Foo] @[Bar (10)] @[Foo Bar (10)] (()->Unit) -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@[Foo Bar] suspend (()->Unit) -> (()->Unit) -> Unit) -> Unit
|
||||
}
|
||||
+1752
File diff suppressed because it is too large
Load Diff
+47
@@ -0,0 +1,47 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@Foo suspend (Int) -> Unit) get() = {}
|
||||
|
||||
val x: @Foo ((x: @Foo (@Foo () -> Int) -> Int) -> Unit) get() = {}
|
||||
|
||||
val x: suspend @Foo (x: @Foo (@Foo (x: kotlin.Any) -> Int) -> Int) -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@Foo @Bar(10) @Foo (x: kotlin.Any = {}) -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @Foo suspend (x: @Foo Foo) -> (y: @Foo Bar) -> Unit
|
||||
|
||||
fun foo(x: (@Foo (@Foo kotlin.Any)->()->Unit)) = x
|
||||
|
||||
fun foo(x: suspend @Foo(10) @Bar (kotlin.Any) -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @Foo suspend @Bar (Coomparable<kotlin.Any>) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: suspend @Foo (Coomparable<@Foo @Bar(10) @Foo () -> Unit>) -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @Foo suspend (suspend (Int) -> ((Int) -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @Foo @Bar(10) @Foo (Any) -> Unit) = 10
|
||||
|
||||
fun foo(): @Foo.Bar suspend (Nothing) -> Unit = {}
|
||||
|
||||
fun foo(): () -> @Foo.Bar suspend (Bar) -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @Foo (Coomparable<Nothing>) -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@Foo (()->Unit)-> ()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @Foo @Bar(10) @Foo (()->Unit) -> Unit is suspend @Foo @Bar(10) @Foo (()->Unit) -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@Foo suspend (()->Unit) -> (()->Unit) -> Unit) -> Unit
|
||||
}
|
||||
+1440
File diff suppressed because it is too large
Load Diff
+51
@@ -0,0 +1,51 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@Foo suspend Int.() -> Unit) get() = {}
|
||||
|
||||
val x: @Foo Int.() -> Unit get() = {}
|
||||
|
||||
val x: @Foo Int.(x: kotlin.Int) -> Unit get() = {}
|
||||
|
||||
val x: @Foo ((x: @Foo (@Foo () -> Int) -> Int.(@Foo () -> Int) -> Int) -> Unit) get() = {}
|
||||
|
||||
val x: suspend @Foo (x: @Foo (@Foo ((x: kotlin.Any) -> Int).(x: kotlin.Any) -> Int) -> Int) -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@Foo @Bar(10) @Foo Unit.(x: kotlin.Any = {}) -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @Foo suspend Int.(x: @Foo Foo) -> (y: @Foo Bar) -> Unit
|
||||
|
||||
fun foo(x: (@Foo ((@Foo kotlin.Any)->(Int)).(@Foo kotlin.Any)->()->Unit)) = x
|
||||
|
||||
fun foo(x: suspend @Foo(10) @Bar Comparable<T>.(kotlin.Any) -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @Foo suspend @Bar (Coomparable<kotlin.Any>) -> Unit.(Coomparable<kotlin.Any>) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: suspend @Foo @Foo () -> Unit.(Coomparable<@Foo @Bar(10) @Foo () -> Unit>) -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @Foo suspend (@Foo () -> Unit).(suspend (Int) -> ((Int) -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @Foo @Bar(10) @Foo Any.(Any) -> Unit) = 10
|
||||
|
||||
fun foo(): @Foo.Bar suspend Nothing.(Nothing) -> Unit = {}
|
||||
|
||||
fun foo(): () -> @Foo.Bar suspend Iterable<@Foo.Bar Int.(Bar) -> Unit>.(Bar) -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @Foo (@Foo (Coomparable<Nothing>) -> Unit).(Coomparable<Nothing>) -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@Foo (()->Unit)-> @Foo Int.()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @Foo @Bar(10) @Foo ()->Unit.(()->Unit) -> Unit is suspend @Foo @Bar(10) @Foo ((()->Unit).()->Unit) -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@Foo suspend (suspend (()->Unit)->Int).(()->Unit) -> (Float.()->Unit) -> Unit) -> Unit
|
||||
}
|
||||
+1922
File diff suppressed because it is too large
Load Diff
+47
@@ -0,0 +1,47 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@Foo () -> Unit) get() = {}
|
||||
|
||||
val x: @Foo (() -> Unit) get() = {}
|
||||
|
||||
val x: @Foo () -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@Foo @Bar(10) @Foo () -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @Foo () -> Unit
|
||||
|
||||
fun foo(x: (@Foo () -> Unit)) = x
|
||||
|
||||
fun foo(x: @Foo(10) @Bar () -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @Foo @Bar () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: @Foo () -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @Foo (() -> (() -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @Foo @Bar(10) @Foo () -> Unit) = 10
|
||||
|
||||
fun foo(): @Foo.Bar () -> Unit = {}
|
||||
|
||||
fun foo(): () -> @Foo.Bar () -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @Foo () -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@Foo ()->()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @Foo @Bar(10) @Foo () -> Unit is @Foo @Bar(10) @Foo () -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@Foo () -> () -> Unit) -> Unit
|
||||
}
|
||||
+1047
File diff suppressed because it is too large
Load Diff
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
// Issue: KT-31734
|
||||
|
||||
val x: (@Foo suspend () -> Unit) get() = {}
|
||||
|
||||
val x: @Foo (suspend () -> Unit) get() = {}
|
||||
|
||||
val x: suspend @Foo () -> Unit get() = {}
|
||||
|
||||
val x: Comparable<@Foo suspend @Bar(10) @Foo () -> Unit> get() = {}
|
||||
|
||||
val x: Any = {} as @Foo suspend () -> Unit
|
||||
|
||||
fun foo(x: (suspend @Foo () -> Unit)) = x
|
||||
|
||||
fun foo(x: suspend @Foo(10) @Bar () -> Unit = { x: Int -> x }) {}
|
||||
|
||||
fun foo() {
|
||||
val x: @Foo suspend @Bar () -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = { x: suspend @Foo () -> () -> Unit -> x }
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract var x: @Foo suspend (suspend () -> (() -> Unit)) -> Int
|
||||
}
|
||||
|
||||
fun foo(vararg x: @Foo @Bar(10) @Foo () -> Unit) = 10
|
||||
|
||||
fun foo(): @Foo.Bar suspend () -> Unit = {}
|
||||
|
||||
fun foo(): () -> @Foo.Bar suspend () -> Unit = {}
|
||||
|
||||
val x: Any get() = fun(): @Foo suspend () -> Unit {}
|
||||
|
||||
fun foo() {
|
||||
var x: (@Foo ()->suspend ()->Unit) -> Unit = {}
|
||||
}
|
||||
|
||||
fun foo(x: Any) {
|
||||
if (x as @Foo @Bar(10) suspend @Foo () -> Unit is suspend @Foo @Bar(10) @Foo () -> Unit) {}
|
||||
}
|
||||
|
||||
fun foo(y: Any) {
|
||||
var x = y as (@Foo suspend () -> () -> Unit) -> Unit
|
||||
}
|
||||
Vendored
+1086
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user