- use ResolvedCall where possible
- 'call' parameter to invokeMethodWithArguments was used only to generate
callee, e.g. in "A()" where A is an expression which can be invoke()'d.
In case of constructors and enum entry delegation specifiers there's no need
to generate callee, so 'call' is made Nullable with a subsequent assert
- remove generateJavaConstructorCall() method, since it did no useful work.
Java constructor invocation is broken anyway and needs to be fixed (KT-3532)
- minor code style / formatting issues fixed, several methods renamed to better
reflect semantics
- make several commonly used parameters ClosureCodegen's fields
- take an arbitrary strategy for closure function body codegen
- don't make extra binding context lookups
Instead of invokevirtual on FunctionImpl class, do invokeinterface on a
Function trait. This will allow to invoke functions on classes which don't
inherit from FunctionImpl classes.
Also rename the method to the more sensible name
- CLASS_FOR_FUNCTION slice was used for two purposes: to record closure classes
for functions and for scripts. Separate this slice into two slices:
CLASS_FOR_FUNCTION and CLASS_FOR_SCRIPT
- add classNameForAnonymousClass() overloaded method to CodegenBinding, taking
a function descriptor (not a PSI element)
Extract some methods, replace types with more generic (ExpressionCodegen ->
LocalLookup), make more stuff fields instead of parameters passed to every
method, annotate with Nullable/NotNull
It's not clear in which order should the two receiver arguments be passed to
them, and there's no corresponding K*FunctionN class for now
#KT-1183 In Progress
Now it's ENABLED everywhere. DISABLED will be used for resolving callable
reference expressions, since there won't be any arguments near the function
call to check
#KT-1183 In Progress
Reuse the obsolete hash qualified expression as a newly born callable reference
expression: Foo::bar. It's not a qualified expression anymore, since the
receiver part is now a JetTypeReference and it also can be empty ("::bar")
#KT-1183 In Progress
Superclass of closures should now be FunctionImplN instead of FunctionN. Since
these -Impl classes are needed only in JVM, the corresponding descriptors and
types are created in the back-end only.
FunctionN and ExtensionFunctionN are now interfaces, with the corresponding
implementations in FunctionImplN and ExtensionFunctionImplN
Update test data
GenerateFunctions now also generates Java classes in runtime/src/jet/
directory, and they have the matching declarations to those in
compiler/src/jet/
Delete ExtensionFunctionN's protected constructor, as it wasn't needed
Delete toString(), a more useful version will be implemented soon
Introduce FunctionKind enum to store differences between functions and
extension functions (and possible future function-like classes)
Also remove some useless checks