KT-2873: VerifyError on instantiating a local class inside a closure
KT-3210 Inline Class: CompilationException: Back-end (JVM) Internal error: wrong code generated java.lang.ArrayIndexOutOfBoundsException null
#KT-3389 Fixed
- 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