Provide toString method for ScriptCompilationConfigurationWrapper

This is needed for debug and logging proposes
This commit is contained in:
Natalia Selezneva
2019-06-27 13:18:26 +03:00
parent 7215e03a47
commit 923e89db69
3 changed files with 17 additions and 1 deletions
@@ -48,6 +48,10 @@ abstract class ScriptDefinition : UserDataHolderBase() {
inline fun <reified T : KotlinScriptDefinition> asLegacyOrNull(): T? =
if (this is FromLegacy) legacyDefinition as? T else null
override fun toString(): String {
return "ScriptDefinition($name)"
}
@Suppress("OverridingDeprecatedMember", "DEPRECATION")
open class FromLegacy(
override val hostConfiguration: ScriptingHostConfiguration,
@@ -152,6 +152,10 @@ abstract class ScriptCompilationConfigurationWrapper(val script: SourceCode) {
super.equals(other) && other is FromCompilationConfiguration && configuration == other.configuration
override fun hashCode(): Int = super.hashCode() + 23 * (configuration?.hashCode() ?: 1)
override fun toString(): String {
return "FromCompilationConfiguration($configuration)"
}
}
@Suppress("OverridingDeprecatedMember", "DEPRECATION")
@@ -200,6 +204,10 @@ abstract class ScriptCompilationConfigurationWrapper(val script: SourceCode) {
super.equals(other) && other is FromLegacy && legacyDependencies == other.legacyDependencies
override fun hashCode(): Int = super.hashCode() + 31 * (legacyDependencies?.hashCode() ?: 1)
override fun toString(): String {
return "FromLegacy($legacyDependencies)"
}
}
}