Commit Graph

162 Commits

Author SHA1 Message Date
Dmitry Petrov d622542824 PSI2IR: Fix delegated members generation
When generating bodies for members implemented by delegation, invoke
corresponding delegate member, not an interface member. Otherwise we
might lose platform-specific nullability information in case of mixed
Kotlin-Java hierarchies, as in
implicitNotNullOnDelegatedImplementation.kt
2019-12-30 18:36:16 +03:00
Mikhail Glukhikh 1cf582e9ed FIR2IR: set extension receiver for anonymous functions 2019-12-27 15:31:36 +03:00
simon.ogorodnik 5e426fdc71 [FIR] Optimization & checking fix: remove usage of dispatchReceiverValue 2019-12-27 13:45:59 +03:00
Dmitry Petrov fefdce0406 KT-35550 Generate type parameters for delegating property accessors 2019-12-23 10:10:16 +03:00
pyos 1f55b59fa3 Unmute a fixed Fir2IrText test 2019-12-20 15:12:37 +03:00
pyos 26822a0cde Minor: IGNORE_BACKEND: ANY_FIR -> IGNORE_BACKEND_FIR: ANY
for consistency with blackbox tests.
2019-12-20 15:12:36 +03:00
Mikhail Glukhikh 38a3797325 Unmute FIR2IR test (due to fixed bug in FIR) 2019-12-20 14:44:46 +03:00
pyos 2adcb5dec4 Add the ANY_FIR target for muting Fir2IrText tests 2019-12-20 13:03:39 +03:00
pyos a4b005fd5d PSI2IR: generate field writes for all val property assignments
Assuming the frontend is correct, and it hopefully is, all of them are
initializations even if not done in the owner class directly.
2019-12-20 13:03:39 +03:00
Alexander Udalov 5f367278c1 Psi2ir: support generic properties in class delegation
Since property accessor descriptors (unlike corresponding IR elements)
do not have type parameters, we need to take them from the corresponding
property to ensure the correct IR for delegated property accessors.
2019-12-12 15:02:32 +03:00
Dmitriy Novozhilov d840671620 [FIR] Don't create delegating super constructor call to kotlin.Enum for enums 2019-12-05 17:47:14 +03:00
Denis Zharkov b8984d154b FIR: Do not copy type parameters from class to constructors
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
2019-12-05 13:08:51 +03:00
Dmitry Petrov 2435b8d9fa Update testData for enum constructor result type in IR 2019-12-03 11:54:41 +03:00
pyos 35c2573b33 PSI2IR: generate IrEnumConstructorCalls with correct return type
Normally, the fact that is was Unit was not visible as enum constructors
are lowered to normal class constructors anyway. The exception is when
the arguments are reordered, causing the incorrect return type to leak
into the block that holds temporary variables.
2019-12-03 11:54:41 +03:00
Dmitry Petrov cb1b9c2ccf IR testData: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Simon Ogorodnik dbf0742c00 [FIR] Fix self-type for enum 2019-11-28 17:23:05 +03:00
Mark Punzalan 5afab1ac2b [FIR] FIR2IR: Populate calls with type arguments and function type
parameters with bounds/supertypes.
2019-11-25 09:37:47 +03:00
Mikhail Glukhikh 48938a20a7 Raw FIR: add synthesized Enum.valueOf() function 2019-11-08 09:58:02 +03:00
Mikhail Glukhikh 581504aac5 Raw FIR: add synthesized Enum.values() function #KT-24076 Fixed 2019-11-07 09:29:00 +03:00
Dmitriy Novozhilov 010dae454e [FIR] Fix extracting parameters from extension function types 2019-11-05 15:22:23 +03:00
Steven Schäfer 733c7579aa Normalize names of temporary variables in IrTextTests 2019-11-05 14:58:47 +03:00
Dmitry Petrov 82c527c2cc IR: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov 2682057767 IR tests: update testData for IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov 843fb88459 IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitriy Novozhilov 36ad065792 [FIR] Fix testdata broken after d2b895d8 2019-10-30 18:49:07 +03:00
Mikhail Glukhikh 384134a069 FIR2IR: fix handling constructors & their symbols (related also to local classes) 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh 7dee1cd9d2 Build member scope for FirAnonymousObject correctly 2019-10-29 16:27:41 +03:00
Steven Schäfer 76ab631214 psi2ir: Optimize generated data class members
- 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.
2019-09-18 18:56:42 +02:00
Mikhail Glukhikh 5386cfe254 FIR2IR: support fake overridden properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh bd5e1aeef5 FIR2IR: change backing field visibility to private 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh 652fd7ee73 FIR: fix dispatch receivers for objects 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh 29b406c731 FIR: set dispatch receiver for backing field access 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh 13d14df8ae FIR: set dispatch receiver for data class generated functions 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh 0d5cfa97a5 FIR2IR: read & set dispatch & extension receivers
NB: this commit includes receiver-based assertions yet failing for some tests
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh da22898a19 FIR2IR: set 'SetField' type to Unit, convert explicit 'this' references 2019-08-30 11:47:30 +03:00
Steven Schäfer a90ac2438d Set correct field visibility in psi2ir 2019-08-28 19:41:11 +02:00
Mikhail Glukhikh 27ccff12c1 FIR: add resolve for delegated super-type
This commit fixes FIR modularized resolve test on whole Kotlin project
(without it we had empty super-type set with delegated super-types)
2019-08-22 18:53:15 +03:00
Dmitriy Novozhilov e3e1f3c2aa [FIR] Fix transforming value parameters of anonymous functions 2019-08-22 14:14:55 +03:00
Dmitry Petrov 1d0ba4edd4 IR: IrTypeAlias: update testData after rebase on master 2019-08-06 12:42:44 +03:00
Dmitry Petrov bdec8b04e8 Minor: trim in RenderIrElementVisitor 2019-07-31 10:37:35 +03:00
Mikhail Glukhikh 63b7fa70f9 FIR2IR: add extension receiver parameters to functions 2019-07-25 09:46:29 +03:00
Dmitry Petrov ffd9b45ef3 IrFunctionExpression: add 'origin'
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.
2019-07-19 11:36:19 +03:00
Dmitry Petrov 41b59f9b9a IrFunctionExpression: update fir2ir tests 2019-07-19 11:36:19 +03:00
Dmitry Petrov ed2b4a8bec Introduce IrFunctionExpression IR element
Use it to represent proper function expressions (lambdas and anonymous
functions).
2019-07-19 11:36:18 +03:00
Mikhail Glukhikh d96c66adac FIR: partially implement invoke resolution 2019-07-08 16:59:37 +03:00
Igor Chevdar e8ac22e238 Fixed some IR tests on enums 2019-06-27 19:04:01 +03:00
Mikhail Glukhikh c8003518a5 FIR: set super type reference properly 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh ca401cb01d FIR2IR: support backing field symbols from FIR, fix test data 2019-06-20 15:26:40 +03:00
Simon Ogorodnik d3f00280e9 Disable data class copy function body in raw FIR
After this commit we require 'copy' body generation in FIR2IR converter
2019-05-28 10:18:00 +03:00
Simon Ogorodnik 58873b2d7b FIR resolve: set setter value-parameter type properly 2019-05-28 10:17:57 +03:00