OverlayParts

internal class OverlayParts(val pinned: LanguageVersion?)

Rebuilds the package -> file facade map that a jar's META-INF kotlin_module carries, from the @Metadata the overlay pass already parses.

A shaded jar's own copy is regularly broken: Shadow's default duplicates strategy leaves it a 24-byte empty shell, and relocate rewrites class packages without touching the package names encoded inside it. Either way the frontend stops resolving that package's top-level declarations even though the facade class is right there — classes import fine, top-level functions do not.

Recorded from where the classes ACTUALLY are, so a stale name and a missing entry need no telling apart, and a healthy jar just contributes a duplicate of its own truth. Shipped as one extra overlay entry under a name of ours: the provider unions package parts across modules, so ours adds to whatever the real jars say rather than racing them for a filename.

Constructors

Link copied to clipboard
constructor(pinned: LanguageVersion?)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val pinned: LanguageVersion?

Functions

Link copied to clipboard
private fun metadataVersion(): JvmMetadataVersion

The level the frontend was pinned to: it rejects a module file newer than that, and does it silently. Null pinned means nothing pinned it, so our own compiler's level stands.

Link copied to clipboard
fun record(internalName: String, kind: Int, facade: String?)

internalName as it appears as a jar entry (a/b/FooKt); kind and facade straight off @Metadata. Both are stored as JVM internal names — the frontend resolves a part by loading exactly this string.

Link copied to clipboard

The module file's bytes, or null if nothing was recorded (or the writer refused the shape).