Introduce separate compiler flag for unrestricted builder inference

This commit is contained in:
Victor Petukhov
2021-07-12 12:11:30 +03:00
parent 274dabb61d
commit 33a281c637
7 changed files with 37 additions and 0 deletions
+2
View File
@@ -84,6 +84,8 @@ where advanced options include:
-Xskip-metadata-version-check Allow to load classes with bad metadata version and pre-release classes
-Xskip-prerelease-check Allow to load pre-release classes
-Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions
-Xunrestricted-builder-inference
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
-Xuse-experimental=<fq.name> Enable, but don't propagate usages of experimental API for marker annotation with the given fully qualified name
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
-Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready
+2
View File
@@ -194,6 +194,8 @@ where advanced options include:
-Xskip-metadata-version-check Allow to load classes with bad metadata version and pre-release classes
-Xskip-prerelease-check Allow to load pre-release classes
-Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions
-Xunrestricted-builder-inference
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
-Xuse-experimental=<fq.name> Enable, but don't propagate usages of experimental API for marker annotation with the given fully qualified name
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
-Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready
@@ -0,0 +1,5 @@
$TESTDATA_DIR$/unrestrictedBuilderInference.kt
-d
$TEMP_DIR$
-Xunrestricted-builder-inference
-Xopt-in=kotlin.RequiresOptIn
@@ -0,0 +1,6 @@
@OptIn(ExperimentalStdlibApi::class)
fun main() {
val x = buildMap {
val y = put(1, "")
}
}
@@ -0,0 +1,7 @@
compiler/testData/cli/jvm/unrestrictedBuilderInference.kt:3:9: warning: variable 'x' is never used
val x = buildMap {
^
compiler/testData/cli/jvm/unrestrictedBuilderInference.kt:4:13: warning: variable 'y' is never used
val y = put(1, "")
^
OK