Properly load top-level constant initializers from multifile classes
Before Kotlin 1.3-M2 we didn't write `has_field` flag for constants
inside multifile classes. Now we write and rely on this when
trying to load constant initializers, which is totally fine for
binaries that were compiled with the 1.3-M2 or newer version.
Unfortunately, constant initializers will not be loaded for old binaries.
One way is to avoid relying on this flag, but then we'll get other
problems (e.g. 3345dc81fd).
Therefore, for binaries that were compiled with at least 1.3-M2 version,
we'll rely on the flag, otherwise, we won't.
This commit is contained in:
@@ -35,6 +35,9 @@ abstract class BinaryVersion(private vararg val numbers: Int) {
|
||||
else major == ourVersion.major && minor <= ourVersion.minor
|
||||
}
|
||||
|
||||
fun isAtLeast(version: BinaryVersion): Boolean =
|
||||
isAtLeast(version.major, version.minor, version.patch)
|
||||
|
||||
fun isAtLeast(major: Int, minor: Int, patch: Int): Boolean {
|
||||
if (this.major > major) return true
|
||||
if (this.major < major) return false
|
||||
|
||||
Reference in New Issue
Block a user