Revert "Do not write version requirements for suspend functions"
This reverts commit 6807ed6642.
The reason is that Kotlin compilers until and including version 1.6.10
have code that detects obsolete coroutines via these version
requirements (see `versionAndReleaseCoroutinesMismatch`). Since Kotlin
1.6.10 can read metadata of version 1.7, the earliest we can drop these
version requirements is Kotlin 1.8.0.
This commit is contained in:
@@ -124,6 +124,23 @@ abstract class AbstractVersionRequirementTest : TestCaseWithTmpdir() {
|
||||
|
||||
protected abstract fun loadModule(directory: File): ModuleDescriptor
|
||||
|
||||
fun testSuspendFun() {
|
||||
doTest(
|
||||
VersionRequirement.Version(1, 3), DeprecationLevel.ERROR, null, ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION, null,
|
||||
customLanguageVersion = LanguageVersion.KOTLIN_1_3,
|
||||
fqNamesWithRequirements = listOf(
|
||||
"test.topLevel",
|
||||
"test.Foo.member",
|
||||
"test.Foo.<init>",
|
||||
"test.async1",
|
||||
"test.async2",
|
||||
"test.async3",
|
||||
"test.async4",
|
||||
"test.asyncVal"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
fun testDefinitelyNotNull() {
|
||||
doTest(
|
||||
VersionRequirement.Version(1, 7), DeprecationLevel.ERROR, null, ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION, null,
|
||||
@@ -204,6 +221,7 @@ abstract class AbstractVersionRequirementTest : TestCaseWithTmpdir() {
|
||||
"test.Outer.Inner.Deep.<init>",
|
||||
"test.Outer.Inner.Deep.f",
|
||||
"test.Outer.Inner.Deep.x",
|
||||
"test.Outer.Inner.Deep.s",
|
||||
"test.Outer.Nested.g",
|
||||
"test.Outer.Companion"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user