Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants * Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData * Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR * Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN * Fix testData for SafeCallsAreAlwaysNullable * Change T -> T & Any in test dumps * Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR * TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
This commit is contained in:
compiler/testData/diagnostics/testsWithStdLib/builderInference/inferCoroutineTypeInOldVersion.fir.kt
Vendored
-29
@@ -1,29 +0,0 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Builder<T> {
|
||||
suspend fun add(t: T) {}
|
||||
}
|
||||
|
||||
fun <S> build(g: suspend Builder<S>.() -> Unit): List<S> = TODO()
|
||||
fun <S> wrongBuild(g: Builder<S>.() -> Unit): List<S> = TODO()
|
||||
|
||||
fun <S> Builder<S>.extensionAdd(s: S) {}
|
||||
|
||||
suspend fun <S> Builder<S>.safeExtensionAdd(s: S) {}
|
||||
|
||||
val member = build {
|
||||
add(42)
|
||||
}
|
||||
|
||||
val memberWithoutAnn = wrongBuild {
|
||||
<!ILLEGAL_SUSPEND_FUNCTION_CALL!>add<!>(42)
|
||||
}
|
||||
|
||||
val extension = build {
|
||||
extensionAdd("foo")
|
||||
}
|
||||
|
||||
val safeExtension = build {
|
||||
safeExtensionAdd("foo")
|
||||
}
|
||||
Vendored
+5
-4
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@@ -12,18 +13,18 @@ fun <S> Builder<S>.extensionAdd(s: S) {}
|
||||
|
||||
suspend fun <S> Builder<S>.safeExtensionAdd(s: S) {}
|
||||
|
||||
val member = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
|
||||
val member = build {
|
||||
add(42)
|
||||
}
|
||||
|
||||
val memberWithoutAnn = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>wrongBuild<!> {
|
||||
val memberWithoutAnn = wrongBuild {
|
||||
<!ILLEGAL_SUSPEND_FUNCTION_CALL!>add<!>(42)
|
||||
}
|
||||
|
||||
val extension = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
|
||||
val extension = build {
|
||||
extensionAdd("foo")
|
||||
}
|
||||
|
||||
val safeExtension = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
|
||||
val safeExtension = build {
|
||||
safeExtensionAdd("foo")
|
||||
}
|
||||
|
||||
Vendored
+4
-12
@@ -1,17 +1,9 @@
|
||||
package
|
||||
|
||||
public val extension: [ERROR : Type for build {
|
||||
extensionAdd("foo")
|
||||
}]
|
||||
public val member: [ERROR : Type for build {
|
||||
add(42)
|
||||
}]
|
||||
public val memberWithoutAnn: [ERROR : Type for wrongBuild {
|
||||
add(42)
|
||||
}]
|
||||
public val safeExtension: [ERROR : Type for build {
|
||||
safeExtensionAdd("foo")
|
||||
}]
|
||||
public val extension: kotlin.collections.List<kotlin.String>
|
||||
public val member: kotlin.collections.List<kotlin.Int>
|
||||
public val memberWithoutAnn: kotlin.collections.List<kotlin.Int>
|
||||
public val safeExtension: kotlin.collections.List<kotlin.String>
|
||||
public fun </*0*/ S> build(/*0*/ g: suspend Builder<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||
public fun </*0*/ S> wrongBuild(/*0*/ g: Builder<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||
public fun </*0*/ S> Builder<S>.extensionAdd(/*0*/ s: S): kotlin.Unit
|
||||
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: annotation.kt
|
||||
|
||||
package kotlin
|
||||
|
||||
annotation class BuilderInference
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class Builder<T> {
|
||||
fun add(t: T) {}
|
||||
}
|
||||
|
||||
fun <S> build(@BuilderInference g: Builder<S>.() -> Unit): List<S> = TODO()
|
||||
fun <S> wrongBuild(g: Builder<S>.() -> Unit): List<S> = TODO()
|
||||
|
||||
fun <S> Builder<S>.extensionAdd(s: S) {}
|
||||
|
||||
@BuilderInference
|
||||
fun <S> Builder<S>.safeExtensionAdd(s: S) {}
|
||||
|
||||
val member = build {
|
||||
add(42)
|
||||
}
|
||||
|
||||
val memberWithoutAnn = wrongBuild {
|
||||
add(42)
|
||||
}
|
||||
|
||||
val extension = build {
|
||||
extensionAdd("foo")
|
||||
}
|
||||
|
||||
val safeExtension = build {
|
||||
safeExtensionAdd("foo")
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
@@ -25,7 +26,7 @@ val member = build {
|
||||
add(42)
|
||||
}
|
||||
|
||||
val memberWithoutAnn = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>wrongBuild<!> {
|
||||
val memberWithoutAnn = wrongBuild {
|
||||
add(42)
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -2,9 +2,7 @@ package
|
||||
|
||||
public val extension: kotlin.collections.List<kotlin.String>
|
||||
public val member: kotlin.collections.List<kotlin.Int>
|
||||
public val memberWithoutAnn: [ERROR : Type for wrongBuild {
|
||||
add(42)
|
||||
}]
|
||||
public val memberWithoutAnn: kotlin.collections.List<kotlin.Int>
|
||||
public val safeExtension: kotlin.collections.List<kotlin.String>
|
||||
public fun </*0*/ S> build(/*0*/ @kotlin.BuilderInference g: Builder<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||
public fun </*0*/ S> wrongBuild(/*0*/ g: Builder<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ val member = build {
|
||||
add(42)
|
||||
}
|
||||
|
||||
val memberWithoutAnn = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>wrongBuild<!> {
|
||||
val memberWithoutAnn = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>wrongBuild<!> {
|
||||
add(42)
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -2,9 +2,7 @@ package
|
||||
|
||||
public val extension: kotlin.collections.List<kotlin.String>
|
||||
public val member: kotlin.collections.List<kotlin.Int>
|
||||
public val memberWithoutAnn: [ERROR : Type for wrongBuild {
|
||||
add(42)
|
||||
}]
|
||||
public val memberWithoutAnn: kotlin.collections.List<kotlin.Int>
|
||||
public val safeExtension: kotlin.collections.List<kotlin.String>
|
||||
public fun </*0*/ S> build(/*0*/ @kotlin.BuilderInference g: Builder<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||
public fun </*0*/ S> wrongBuild(/*0*/ g: Builder<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||
|
||||
Reference in New Issue
Block a user