Introduce -Xpolymorphic-signature compiler flag as more priority than -XXLanguage:+PolymorphicSignature

This commit is contained in:
Victor Petukhov
2019-07-26 08:57:35 +03:00
parent 944ee8fcd5
commit e25b315319
3 changed files with 12 additions and 0 deletions
@@ -134,6 +134,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
)
var inlineClasses: Boolean by FreezableVar(false)
@Argument(
value = "-Xpolymorphic-signature",
description = "Enable experimental support for @PolymorphicSignature (MethodHandle/VarHandle)"
)
var polymorphicSignature: Boolean by FreezableVar(false)
@Argument(
value = "-Xlegacy-smart-cast-after-try",
description = "Allow var smart casts despite assignment in try block"
@@ -336,6 +342,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
put(LanguageFeature.InlineClasses, LanguageFeature.State.ENABLED)
}
if (polymorphicSignature) {
put(LanguageFeature.PolymorphicSignature, LanguageFeature.State.ENABLED)
}
if (legacySmartCastAfterTry) {
put(LanguageFeature.SoundSmartCastsAfterTry, LanguageFeature.State.DISABLED)
}