Fix equality and serializability of scripting data, fix relevant caching behaviour

This commit is contained in:
Ilya Chernikov
2019-03-14 12:00:04 +01:00
parent 7a4d369c9f
commit 931b1c66d8
6 changed files with 52 additions and 5 deletions
@@ -32,4 +32,13 @@ class KotlinType private constructor(
* Constructs KotlinType from reflected [ktype]
*/
constructor(type: KType) : this(type.classifier as KClass<*>)
override fun equals(other: Any?): Boolean =
(other as? KotlinType)?.let { typeName == it.typeName } == true
override fun hashCode(): Int = typeName.hashCode()
companion object {
private const val serialVersionUID: Long = 1L
}
}
@@ -190,14 +190,18 @@ class RefineConfigurationBuilder : PropertiesCollection.Builder() {
typealias RefineScriptCompilationConfigurationHandler =
(ScriptConfigurationRefinementContext) -> ResultWithDiagnostics<ScriptCompilationConfiguration>
class RefineConfigurationUnconditionallyData(
data class RefineConfigurationUnconditionallyData(
val handler: RefineScriptCompilationConfigurationHandler
) : Serializable
) : Serializable {
companion object { private const val serialVersionUID: Long = 1L }
}
class RefineConfigurationOnAnnotationsData(
data class RefineConfigurationOnAnnotationsData(
val annotations: List<KotlinType>,
val handler: RefineScriptCompilationConfigurationHandler
) : Serializable
) : Serializable {
companion object { private const val serialVersionUID: Long = 1L }
}
/**
@@ -66,7 +66,9 @@ interface ExternalSourceCode : SourceCode {
/**
* The source code [range] with the the optional [name]
*/
data class ScriptSourceNamedFragment(val name: String?, val range: SourceCode.Range)
data class ScriptSourceNamedFragment(val name: String?, val range: SourceCode.Range) : Serializable {
companion object { private const val serialVersionUID: Long = 1L }
}
/**
* The general interface to the Script dependency (see platform-specific implementations)