Like function arguments, they are context-dependent, but unlike function
arguments, callable references should be resolved eagerly as if they are
explicit receivers.
Namely, remove incorporation “otherInsideMyConstraint” to eliminate
constraint system redundancy and produce a potentially very large number
of constructs.
Instead, introduce not so “spreadable” incorporation during variable
fixation (equality constraint with result type into other constraints).
^KT-41644 Fixed
^KT-42195 Fixed
^KT-42920 Fixed
^KT-42791 Fixed
^KT-41741 Fixed
This allows to get rid of the situation where a JvmStatic function in
object can be seen in different states in different lowerings: unlowered
with a dispatch receiver parameter, declaration is lowered but calls are
not, and both declaration and calls are lowered.
Now it works like this:
1) JvmStatic functions in objects coming from dependencies are always
loaded as lowered, without the extra dispatch receiver parameter. In
psi2ir this is done via JVM-specific extension; in fir2ir it's done
in place (but probably should be extracted to extension too).
2) Functions from sources are created as unlowered by both psi2ir and
fir2ir, and are lowered in a module-wide phase at the beginning of
JvmLower.
3) Calls to all JvmStatic functions from objects (from sources and
dependencies) are lowered in the same phase at the beginning of
JvmLower.
This ensures that all lowerings after the module-wide phase
`jvmStaticInObjectPhase`, which include all per-file phases, see all
JvmStatic functions in objects without the additional dispatch receiver
parameter, and calls do not have dispatch receiver either.
The only issue with this approach is that function/property reference
representation in reflection needs to have that dispatch receiver
parameter, and that is achieved via a hack in those lowerings, which
seems not too out of place anyway, given that they're handled specially
in kotlin-reflect as well.
Allow to replace "this" references not only inside IrBody, but inside
any IrElement. This will be useful in JvmStatic in object lowering where
we want not only to replace usages inside the function body, but also in
default values of its parameters.
because some other compiler plugins (Compose) copy/rewrite IR declarations
completely, and in the end, functions that are present in the final IR tree
do not have bodies.
Correctly create IrProperty and IrField when they were absent from the
descriptors (in case for private serializer properties)
Do not use symbol table because 'declare' API is not available in plugins.
Fixes https://github.com/JetBrains/compose-jb/issues/46
After a seemingly innocent refactoring in 61548a0a36, we've lost the
optimization that was enabled by the suppressorAbove logic in
isSuppressedByAnnotated.
- rename fileToPurenessInitializers onto fileToInitializerPureness
- remove redundant check on top-level property
[JS IR] Rename initialis* to initializ* for consistency
[JS IR] Move propertyLazyInitialization property to context from configuration
[JS IR] Add test on lazy initialization properties order
[JS IR] Add multi module for lazy initialization of properties
[JS IR] Move tests onto js.translator
[JS IR] Rename fileToInitializerPureness according to context name
^KT-43222 fixed
^KT-43222 fixed
[JS IR] Not create initialisation function for file if there were attempt to create it earlier
^KT-43222 fixed
[JS IR] Pureness for PIR and memoize file fields pureness
^KT-43222 fixed