Commit Graph

100 Commits

Author SHA1 Message Date
Mikhail Glukhikh 6eab6a96cb [FIR2IR] Support type aliases properly 2020-06-08 16:19:37 +03:00
Jinseong Jeon 4a511c7721 FIR: extend arrayOf call transformation to other variants 2020-06-01 10:45:42 +03:00
Jinseong Jeon 18953c4717 FIR: transform resolved arrayOf call inside annotation to FirArrayOfCall 2020-05-27 11:38:34 +03:00
Juan Chen adba0a03a6 [FIR] Create builtin primitive array types for properties
If the primary constructor has a vararg parameter, the corresponding
property has an array type. This commit creates the builtin array
types for such properties if the vararg element type is primitive,
e.g., CharArray instead of Array.
2020-05-26 14:08:47 +03:00
Jinseong Jeon e844c59e7e FIR2IR: filter correct use-site target for value parameter annotations. 2020-05-14 09:41:11 +03:00
Jinseong Jeon 931ba4892a FIR2IR: split property annotations according to use-site targets. 2020-05-14 09:41:11 +03:00
Mikhail Glukhikh b271b6d7a8 [FIR2IR] Add conversion of value parameter annotations 2020-05-08 17:30:28 +03:00
Mikhail Glukhikh 76f6e27e37 [FIR2IR] Add initial support of collection literals 2020-05-08 17:30:24 +03:00
Mikhail Glukhikh f3e2dbf360 [FIR2IR] Add conversion of function annotations 2020-05-08 17:30:19 +03:00
Mikhail Glukhikh 00fedbf6b3 [FIR2IR] Distinguish 'parent' & 'thisReceiver' for fake overrides 2020-04-09 15:22:56 +03:00
Mikhail Glukhikh 5c758af0a6 [FIR] Use ScopeSession from resolve transformer in FIR2IR 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh 036b6c63f6 [FIR] During resolve, set correctly property reference type in delegate 2020-04-03 13:18:47 +03:00
Mikhail Glukhikh 58e00400f1 [FIR2IR] Support PROPERTY_REFERENCE_FROM_DELEGATE origin 2020-04-03 13:05:13 +03:00
Mikhail Glukhikh 5f8fadb220 [FIR2IR] Remove GET_PROPERTY origin from delegate field reads 2020-04-03 13:04:56 +03:00
Jinseong Jeon ff104f4037 [FIR2IR] Set proper visibility of backing fields 2020-03-31 13:12:36 +03:00
Mikhail Glukhikh d1fc6ff6ee [FIR2IR] Don't provide backing field symbols for non-Java property refs 2020-03-30 16:23:11 +03:00
Mikhail Glukhikh 9836520287 [FIR2IR] Generate synthetic bodies for Enum.values() and valueOf() 2020-03-20 11:55:34 +03:00
Mikhail Glukhikh c0f8be5d4e [FIR2IR] Generate setter call for assignments, if any 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh fe658ce47f FIR2IR: remove redundant receiver generation from visitor
Now static functions have no dispatch receiver: they really shouldn't.
2020-03-04 16:55:34 +03:00
Mikhail Glukhikh 940567b8bd FIR2IR: set enum class modality properly for complex entries case 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh 3ffe1a1876 FIR2IR: create IrEnumConstructorCall even in complex entries 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh 5af3d92271 FIR2IR: cache enum entry classes properly 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh 03eab2ec6c FIR2IR: get rid of setParentAndContent + fixes around anonymous objects 2020-03-04 16:55:32 +03:00
Mikhail Glukhikh db7401d8eb FIR2IR: set GET_PROPERTY origin for property reads 2020-02-28 15:29:01 +03:00
Mikhail Glukhikh 5b3b35cd78 FIR2IR: set "external stub" origin for external enum entries 2020-02-28 15:29:01 +03:00
simon.ogorodnik f9483b1f4f [FIR] KT-37027: Add 'out' projection to vararg elements 2020-02-27 19:07:17 +03:00
Mikhail Glukhikh d1fac6dce1 FIR2IR: declare receivers for all accessors of extension properties
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.
2020-02-25 12:13:42 +03:00
Mikhail Glukhikh 39bd97147f [FIR] Don't create initializers for simple enum entries
Usually FIR enum entry is initialized by anonymous object,
which is the container for all enum entry' declarations.
However, for simple enum entries there is no need of initializer at all.
2020-02-21 16:38:52 +03:00
Mikhail Glukhikh b1e9dbf994 [FIR] Use super<Enum> as delegated calls in enum constructors 2020-02-21 16:37:56 +03:00
Mikhail Glukhikh f173af9238 FIR2IR: use enum constructor call for enum entries 2020-02-21 16:37:50 +03:00
Mikhail Glukhikh fdf4f477a6 FIR2IR: fix problems with enum entry / anonymous object visibility 2020-02-18 10:50:03 +03:00
Roman Artemev e57d34dd9e Make fix test:
- [JS IR] Unmute fixed tests
 - [IrText] Update testdata
 - [WASM] Temporary turn wasm test off
 - [FirText] Temporary turn fit text tests off
 - [JVM IR] Turn off klib jvm test
 - [IR] Add new test
2020-02-14 18:22:17 +03:00
Juan Chen 8e35545e10 FIR2IR: provide type arguments for class 'this' receiver 2020-02-11 22:50:06 +03:00
Anton Bannykh 0bcde9dffc IR API: Make IrEnumEntry.initializerExpression IrExpressionBody
All non-declarations should be inside IrBody's now
2020-02-06 21:03:32 +03:00
Juan Chen 7249d2f889 [FIR] Fix translation of invokes & add return expressions for lambdas
* 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
2020-02-06 12:44:14 +03:00
Juan Chen 188abc243a [FIR] add vararg arguments support, improve vararg parameters support 2020-01-31 16:41:25 +03:00
pyos f1669e2230 IR: mark interface delegate fields as synthetic
This requires separating them origin-wise from property delegates.
2020-01-28 10:35:22 +03:00
Dmitriy Novozhilov 3dfad4f0c3 [FIR] Fix generating properties for varargs in primary constructors 2020-01-24 10:57:52 +03:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Juan Chen 573188bdc4 [FIR2IR]: fix translation of this references in instance methods
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.
2020-01-10 10:43:07 +03:00
simon.ogorodnik 961037506a FIR2IR: support FirEnumEntry 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh 684bdc44bb FIR: add implementation of reified type parameter references
This adds support of T::class.java for reified type parameters
2019-12-17 17:28:01 +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
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
Dmitry Petrov 82c527c2cc IR: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00