Add fallback flag for legacy var smart casts after try #KT-21377 Fixed

This commit is contained in:
Mikhail Glukhikh
2017-11-22 14:59:22 +03:00
parent 8b6e63dc18
commit 078c27efa3
8 changed files with 35 additions and 0 deletions
+1
View File
@@ -7,6 +7,7 @@ where advanced options include:
-Xcoroutines={enable|warn|error}
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
+1
View File
@@ -34,6 +34,7 @@ where advanced options include:
-Xcoroutines={enable|warn|error}
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/legacySmartCastsAfterTry.kt
-d
$TEMP_DIR$
-Xlegacy-smart-cast-after-try
+9
View File
@@ -0,0 +1,9 @@
fun foo() {
var some: String? = null
some = "alpha"
try {
some = "omega"
}
catch (e: Exception) {}
some.length
}
@@ -0,0 +1,4 @@
compiler/testData/cli/jvm/legacySmartCastsAfterTry.kt:2:25: warning: variable 'some' initializer is redundant
var some: String? = null
^
OK