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
Mikhail Glukhikh
05e4539019
Set resolved type for lambdas properly during FIR resolve
...
Partially done by semoro
2019-05-28 10:17:31 +03:00
Simon Ogorodnik
cef108a5ae
FIR: implement qualifier resolver
2019-05-28 10:17:05 +03:00
Mikhail Glukhikh
139557e641
FIR2IR: support super-types & type parameters for external class
2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
2bf80ff64e
FIR: support copy functions in data classes
2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
26974788e9
FIR2IR converter: handle receivers and parents more correctly
2019-05-23 14:02:07 +03:00
Steven Schäfer
90c3269502
Fix type parameters in WrappedClassConstructorDescriptor
...
IrConstructorCall gets type parameters from the class in addition to the
constructor declaration. This behavior is already implemented for
ClassConstructorDescriptorImpl, but was not implemented for
WrappedClassConstructorDescriptor, leading to missing type arguments for calls
to constructors generated in a lowering pass.
2019-05-16 20:26:18 +02:00
Steven Schäfer
f5a78213b2
Fix type of super
2019-05-16 07:58:45 +02:00
Mikhail Glukhikh
5262f0a53f
Fir2Ir: apply major text data update after a bunch of resolve changes
2019-04-30 18:45:57 +03:00
Dmitry Petrov
865e0cc080
IR: IrConstructorCall: fixes after rebase
2019-04-26 17:43:26 +03:00