Before this commit, extension receivers were declared only for
properties with container source, which is strange & inconsistent.
Now we declare accessor extension receiver iff corresponding property
has extension receiver.
* fixed NoSuchMethod caused by mismatched signatures of the "invoke" method generated for lambda arguments
* added test cases in invoke.kt for KFunction and anonymous functions
* added a transformer to wrap the last expression in the bodies of lambdas with return
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.
This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
Use the same instances from class declaration instead
Otherwise, primary constructor value parameter types when used
in the class body are considered as different from types
based on the class type parameters
See the test genericConstructors.kt, before this commit
"id" call was reported in inapplicable
These changes allow us to accurately distinguish between statements and
expressions in the IR.
This also fixes the types of non-exhaustive conditional statements.
Rely on the frontend weeding out cases that are not supported.
In psi2ir, introduce all the parameters before processing default
values.
Change the DefaultArgumentStubGenerator to generate code that
matches the behavior of the current backend.
- Access underlying fields directly, instead of using accessors. This is
safe since data classes are always final.
- Don't generate a temporary variable in hashCode to use as the
accumulator.
Both optimizations are effectively present in the current JVM backend
and with these changes the generated code is much closer to what the
current backend generates.
This is actually either a LAMBDA or an ANONYMOUS_FUNCTION.
Not quite sure if it's really required, but some tools such as IR-based
decompiler might require this information.