Skip to content

Commit e0b7eea

Browse files
committed
FE: Add tests for KT-82869
1 parent e66298c commit e0b7eea

File tree

7 files changed

+116
-0
lines changed

7 files changed

+116
-0
lines changed

analysis/low-level-api-fir/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLDiagnosticsFe10TestGenerated.java

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analysis/low-level-api-fir/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLPartialDiagnosticsFe10TestGenerated.java

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analysis/low-level-api-fir/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLReversedDiagnosticsFe10TestGenerated.java

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN_PIPELINE_TILL: FRONTEND
2+
// ISSUE: KT-82869
3+
fun interface MySupplier<T> {
4+
fun get(): T
5+
}
6+
7+
fun foo(supplier: suspend () -> String): String = ""
8+
fun <T> foo(supplier: () -> String): T = TODO()
9+
10+
suspend fun bar(): String = ""
11+
12+
fun main() {
13+
val x: String = foo {
14+
<!ILLEGAL_SUSPEND_FUNCTION_CALL!>bar<!>() // Shouldn't be ILLEGAL_SUSPEND_FUNCTION_CALL?
15+
}
16+
17+
x.length
18+
}
19+
20+
/* GENERATED_FIR_TAGS: funInterface, functionDeclaration, functionalType, interfaceDeclaration, lambdaLiteral,
21+
localProperty, nullableType, propertyDeclaration, stringLiteral, suspend, typeParameter */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN_PIPELINE_TILL: FRONTEND
2+
// ISSUE: KT-82869
3+
fun interface MySupplier<T> {
4+
fun get(): T
5+
}
6+
7+
fun foo(supplier: suspend () -> String): String = ""
8+
fun <T> foo(supplier: () -> String): T = TODO()
9+
10+
suspend fun bar(): String = ""
11+
12+
fun main() {
13+
val x: String = foo {
14+
bar() // Shouldn't be ILLEGAL_SUSPEND_FUNCTION_CALL?
15+
}
16+
17+
x.length
18+
}
19+
20+
/* GENERATED_FIR_TAGS: funInterface, functionDeclaration, functionalType, interfaceDeclaration, lambdaLiteral,
21+
localProperty, nullableType, propertyDeclaration, stringLiteral, suspend, typeParameter */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN_PIPELINE_TILL: FRONTEND
2+
// ISSUE: KT-82869
3+
fun interface MySupplier<T> {
4+
fun get(): T
5+
}
6+
7+
fun foo(supplier: suspend () -> String): String = ""
8+
fun foo(supplier: MySupplier<String>): Any = Any()
9+
10+
suspend fun bar(): String = ""
11+
12+
fun main() {
13+
foo {
14+
<!ILLEGAL_SUSPEND_FUNCTION_CALL!>bar<!>() // Shouldn't be ILLEGAL_SUSPEND_FUNCTION_CALL?
15+
}.<!UNRESOLVED_REFERENCE!>length<!>
16+
}
17+
18+
/* GENERATED_FIR_TAGS: funInterface, functionDeclaration, functionalType, interfaceDeclaration, lambdaLiteral,
19+
nullableType, samConversion, stringLiteral, suspend, typeParameter */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN_PIPELINE_TILL: FRONTEND
2+
// ISSUE: KT-82869
3+
fun interface MySupplier<T> {
4+
fun get(): T
5+
}
6+
7+
fun foo(supplier: suspend () -> String): String = ""
8+
fun foo(supplier: MySupplier<String>): Any = Any()
9+
10+
suspend fun bar(): String = ""
11+
12+
fun main() {
13+
foo {
14+
bar() // Shouldn't be ILLEGAL_SUSPEND_FUNCTION_CALL?
15+
}.length
16+
}
17+
18+
/* GENERATED_FIR_TAGS: funInterface, functionDeclaration, functionalType, interfaceDeclaration, lambdaLiteral,
19+
nullableType, samConversion, stringLiteral, suspend, typeParameter */

0 commit comments

Comments
 (0)