This is needed for further commit, which supports contracts-based
smartcasts in partial body resolve mode.
NB: Stubs can be built from 3 sources:
- source code (contract presence can be checked by PSI)
- binary data (contract presence can be checked by Kotlin Metadata)
- decompiled sources
The last case is a bit of a headache, because usually bodies are omitted
in decompiled sources. To workaround it, we have to inject stubbed
contract-call in the body.
Do not query MultifileClassCodegen#classBuilder early on: this causes the class
file for the facade to be prematurely dumped to the disk in some cases, when
that class file is not yet completely generated. Instead fork the logic in
PropertyCodegen#generateSyntheticMethodIfNeeded: save metadata in parts,
generate method in the facade