Commit Graph

135 Commits

Author SHA1 Message Date
Denis.Zharkov 377a0aa237 FIR2IR: Adjust test data for updated overridden structure 2021-02-20 10:59:22 +03:00
Mikhail Glukhikh d4b0688690 FIR: introduce delegate field initializers
Before this commit we initialized delegate fields in primary constructor,
that could provoke NPE in case delegate is used in initializer of
some property backing field.
Now we initialize delegate fields directly instead.
2021-02-08 14:28:27 +03:00
Mikhail Glukhikh 4fd4f504d0 FIR: make componentX functions operator 2021-01-22 18:11:57 +03:00
Dmitriy Novozhilov 4752924b13 [TD] Update FQN's in testdata of IR text tests 2021-01-22 13:51:29 +03:00
Jinseong Jeon fe0c25693d FIR2IR: do not convert @ExtensionFunctionType twice 2020-12-18 12:17:21 +03:00
Zalim Bashorov 69f0f4ef19 [IR] update testdata: unify printing custom/non-standard modifiers 2020-11-26 00:15:21 +03:00
Zalim Bashorov 7df6575a18 [IR] update testdata: unify representation for error nodes 2020-11-26 00:15:16 +03:00
Zalim Bashorov c68040753d [IR] dumpKotlinLike: add testdata for FIR tests 2020-11-26 00:15:13 +03:00
Zalim Bashorov 2dbd784a6a [IR] update testdata: print else -> ... 2020-11-26 00:14:55 +03:00
Zalim Bashorov 64b42401a1 [IR] update testdata: print a parameter in catch 2020-11-26 00:14:34 +03:00
Zalim Bashorov 21da2b0350 [IR] update testdata: print whole string concatenation at one line 2020-11-26 00:14:30 +03:00
Zalim Bashorov a6b408978f [IR] update testdata: super and receiver for field accesses 2020-11-26 00:14:28 +03:00
Zalim Bashorov e56787c0b0 [IR] update testdata: IrInstanceInitializerCall 2020-11-26 00:14:25 +03:00
Zalim Bashorov ab8188b032 [IR] update testdata: removed extra indentation for function expressions 2020-11-26 00:14:23 +03:00
Zalim Bashorov 602f0ddbc8 [IR] update testdata after using maxBlankLines=1 for Printer 2020-11-26 00:14:20 +03:00
Zalim Bashorov b518c19b38 [IR] update testdata: support for IrDelegatingConstructorCall 2020-11-26 00:14:17 +03:00
Zalim Bashorov 2a19dc32f2 [IR] update testdata: better support for IrConstructorCall 2020-11-26 00:14:15 +03:00
Zalim Bashorov fc5c674c60 [IR] update testdata 2020-11-26 00:14:11 +03:00
Zalim Bashorov 3b1a6389ab [IR] update testdata after rebase 2020-11-26 00:14:06 +03:00
Zalim Bashorov 8d5facb15f [IR] add testdata for dumpKotlinLike 2020-11-26 00:14:03 +03:00
Kristoffer Andersen 5967e8295e [IR] Align captured receiver variable naming with old BE 2020-11-18 15:18:10 +01:00
Denis Zharkov 2589de6c49 FIR: Refine delegated members introduced to use-site scope
- Do not add hashCode/equals/toString
- Do not add privates and ones that are already declared
2020-10-28 11:43:25 +03:00
Denis Zharkov b241161c35 FIR2IR: Rework DelegatedMemberGenerator
Use scope content instead of manual traversing of declarations
2020-10-01 17:49:02 +03:00
Jinseong Jeon 89ffce22d8 FIR2IR: set proper IR origin for variable as function 2020-09-14 09:05:08 +03:00
Dmitry Petrov 5b53663eb8 PSI2IR KT-41181 don't generate deep trees in hashCode 2020-09-07 16:09:42 +03:00
Mikhail Glukhikh 02b6f34067 [FIR2IR] Add extension receiver parameter to delegated members 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 85c1505689 [FIR2IR] Copy type parameters for trivial fake overrides 2020-08-20 16:04:02 +03:00
Simon Ogorodnik 97b10b5ab3 [FIR2IR] Hack-in setting of extension function type annotation 2020-08-18 21:53:55 +03:00
Jinseong Jeon 7e22de1e24 FIR2IR: insert coerce-to-unit expressions in statement containers 2020-08-18 21:53:08 +03:00
Jinseong Jeon bff36e0199 FIR2IR: convert annotations on FirTypeRef 2020-07-30 11:25:36 +03:00
Dmitriy Novozhilov 236dfe60f1 [FIR] Correctly build scopes for resolve of different parts of constructors
#KT-40409 Fixed
2020-07-20 14:38:17 +03:00
Juan Chen 2ea3579281 [FIR] add support for generic cases of delegation by implementation
Add type parameters for generic delegated members and type
substitution when implementing instantiated super interfaces.
2020-07-15 13:36:29 +03:00
Juan Chen d163853c97 [FIR] add support for implementation by delgation
This commit handles "subclass: super-interface by delegate-expression".

During Psi2Fir, for each delegate, we add to the subclass a synthetic
field (which has type super-interface), and an assignment of the
delegate-expression to the synthetic field in the primary constructor,
so that the delegate-expression can be resolved and transformed along
the way.

During Fir2Ir, we look up delegatable members from the super-interface
and generate corresponding functions/properties for the subclass.

TODO: support for generic delegatable members and generic
super-interface.
2020-07-08 09:42:24 +03:00
Mikhail Glukhikh 6f0eeecc64 [FIR2IR] Fix generation of type arguments of delegated constructor calls 2020-06-09 11:40:26 +03:00
Mikhail Glukhikh 457fb09e3a [FIR] Use tower to resolve delegated constructors, set dispatch receiver 2020-05-12 16:57:07 +03:00
Jinseong Jeon 9a561f4a7c FIR2IR: generate synthetic members for inline class 2020-04-30 13:09:53 +03:00
Mikhail Glukhikh fe02c2bab3 FIR: return Unit from empty lambda 2020-04-20 17:05:34 +03:00
Jinseong Jeon 9f1ecadd65 IR: more consolidation of synthetic member generation for data class. 2020-04-17 12:38:38 +03:00
Jinseong Jeon 08b91da6db FIR: fix body generation for data class's copy method 2020-04-14 11:51:30 +03:00
simon.ogorodnik 356e42196c [FIR2IR] Fix inner class constructor receiver parameter type 2020-04-13 20:26:19 +03:00
simon.ogorodnik 132c8ee210 [FIR] Apply GOOD testData changes after type parameters support 2020-04-13 20:26:18 +03:00
Jinseong Jeon c370b86141 IR: consolidate generation of synthetic members for data class 2020-04-13 17:30:05 +03:00
Mikhail Glukhikh 00fedbf6b3 [FIR2IR] Distinguish 'parent' & 'thisReceiver' for fake overrides 2020-04-09 15:22:56 +03:00
Jinseong Jeon cdf5a2a5a1 FIR: set dispatch receiver parameter for inner class's constructor. 2020-03-25 12:40:09 +03:00
Mikhail Glukhikh 95108a1bce [FIR2IR] Enable type parameter index >= 0 requirement 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh 10c2aa1657 [FIR2IR] Set origin properly for set field / variable 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh 3d17ce05b5 [FIR] Introduce FirResolvedArgumentList with argument-parameter mapping
#KT-36345 Fixed
2020-03-11 22:08:59 +03:00
Mikhail Glukhikh e9699e7173 FIR2IR: provide correct origins for arithmetic operators 2020-03-10 15:19:35 +03:00
Dmitriy Novozhilov 770dfb69ba [FIR] Analyze all statements in block except last one in independent mode
Some broken tests will be fixed in next commit
#KT-37176 Fixed
2020-03-05 16:48:47 +03:00
Mikhail Glukhikh db7401d8eb FIR2IR: set GET_PROPERTY origin for property reads 2020-02-28 15:29:01 +03:00