Provide additional information about missing supertypes
Add -X flag to report extra compiler diagnostics which migth break compatibility. Use the flag to unconditionally check constructors without fear of prematurely evaluating lazy supertypes. KT-19234 KT-42404 KT-44583
This commit is contained in:
+11
@@ -357,6 +357,13 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
)
|
||||
var suppressVersionWarnings: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xextended-compiler-checks",
|
||||
description = "Enable additional compiler checks that might provide verbose diagnostic information for certain errors.\n" +
|
||||
"Warning: this mode is not backward-compatible and might cause compilation errors in previously compiled code."
|
||||
)
|
||||
var extendedCompilerChecks: Boolean by FreezableVar(false)
|
||||
|
||||
open fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
||||
return HashMap<AnalysisFlag<*>, Any>().apply {
|
||||
put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
||||
@@ -424,6 +431,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
put(LanguageFeature.InferenceCompatibility, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
if (extendedCompilerChecks) {
|
||||
put(LanguageFeature.ExtendedCompilerChecks, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
if (progressiveMode) {
|
||||
LanguageFeature.values().filter { it.kind.enabledInProgressiveMode }.forEach {
|
||||
// Don't overwrite other settings: users may want to turn off some particular
|
||||
|
||||
Reference in New Issue
Block a user