Commit Graph

195 Commits

Author SHA1 Message Date
Dmitry Petrov 708e6914bd JVM JVM_IR hide sealed class constructors 2021-01-25 17:29:38 +03:00
Shagen Ogandzhanian d512158c25 [JS IR] Remove redundant guard assertion for extension funs with default params
Introduce corresponding test
See https://youtrack.jetbrains.com/issue/KT-41076
2020-12-02 16:45:12 +01:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Shagen Ogandzhanian 2d0535a713 [JS_IR] Invoke companion init block while instantiating a class
KT-40740, squashed rr/shagen/KT-40740-static-init-js-ir
2020-10-30 16:19:13 +01:00
Mikhail Glukhikh 2dc6467b5d [FIR] Modify signatures also from ERASED_COLLECTION_PARAMETER_SIGNATURES
In this commit we change value parameter type of containsAll, removeAll,
retainAll from Java collections. Originally it's Collection<?>,
we change it to Collection<T>

#KT-42340 Fixed
2020-10-28 18:09:11 +03:00
Mikhail Glukhikh 2f9b7495fc [FIR2IR] Make safe call result always nullable 2020-10-14 16:33:37 +03:00
Denis Zharkov 3dfbd36f15 FIR: Unmute passing blackbox tests 2020-10-01 17:49:02 +03:00
Mikhail Glukhikh 3f5beb77e8 [FIR2IR] Cache delegatable members properly 2020-08-31 14:31:55 +03:00
Mikhail Glukhikh 53ad502d2a [FIR2IR] Generate fake overrides earlier and bind them later
Before this commit, we generated fake overrides at last FIR2IR stage,
after having all functions and classes built. This could lead to a
situation when fake override was called before it was generated.
This commit fixes this situation.
2020-08-25 10:00:26 +03:00
Steven Schäfer ea98062241 JVM IR: Fix compilation of inline functions in anonymous objects...
...in class members. The corresponding classes end up nested in the
class initializer of the surrounding class and we need to take this into
account when creating instances of ClassCodegen.

This fixes KT-40332 on the JVM IR backend.
2020-08-24 14:10:36 +02:00
pyos 5722f889d8 FIR2IR: scan the entire interface tree for delegatable members 2020-08-21 16:50:23 +03:00
Mikhail Glukhikh 99d2fd7c4d [FIR] Handle open in interface correctly during status resolve 2020-08-21 16:50:23 +03:00
Steven Schäfer 53fe30eb45 JVM IR: Don't produce CHECKCASTs on null constants (KT-36650) 2020-08-11 15:13:40 +02: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
Jinseong Jeon 50b2ea7053 FIR: avoid cast exception in Candidate.prepareExpectedType 2020-07-07 16:55:53 +03:00
Denis Zharkov 409e90e7de FIR: Fix codegen test data after safe-call refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +03:00
Mikhail Glukhikh 7818baff1e [FIR2IR] Fix problem with double-generation of local class members 2020-05-26 11:50:33 +03:00
Jinseong Jeon 0d3301b695 FIR: resolve local class in anonymous initializer. 2020-05-21 08:36:49 +03:00
Jinseong Jeon 30e5748fec FIR: set proper visibility of property accessors. 2020-05-12 19:47:37 +03:00
Mikhail Glukhikh 457fb09e3a [FIR] Use tower to resolve delegated constructors, set dispatch receiver 2020-05-12 16:57:07 +03:00
Mikhail Glukhikh 38fc4d0f1f FIR: set & use dispatch receiver for q. access with super reference 2020-05-07 12:02:57 +03:00
Jinseong Jeon 7b01cf7b04 FIR: handle labeled super reference properly 2020-05-07 12:02:56 +03:00
simon.ogorodnik a11866ab5a [FIR2IR] Fix labeled this references 2020-04-30 13:15:43 +03:00
Jinseong Jeon 0890b8bad3 FIR2IR: set superQualifierSymbol for property access 2020-04-30 12:26:47 +03:00
Jinseong Jeon ef09850df8 FIR2IR: set superQualifierSymbol for super call 2020-04-27 11:50:26 +03:00
Jinseong Jeon 57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Dmitriy Novozhilov 7f02d57d88 [FIR] Correctly detect super type in delegated constructor call 2020-04-17 12:37:29 +03:00
Mikhail Bogdanov dec93c8b49 Add ANDROID target 2020-04-14 13:53:22 +02:00
Jinseong Jeon 08b91da6db FIR: fix body generation for data class's copy method 2020-04-14 11:51:30 +03:00
Mikhail Glukhikh e1c78b31a6 [FIR2IR] Convert explicit receiver in advance 2020-04-10 14:49:27 +03:00
Mikhail Glukhikh 630adb34db [FIR] Don't provide receiver as value in delegated constructor call 2020-03-31 20:28:24 +03:00
Jinseong Jeon ff104f4037 [FIR2IR] Set proper visibility of backing fields 2020-03-31 13:12:36 +03:00
Jinseong Jeon 078cf02c8a FIR: Provide dispatch receiver for 'field' according to property type 2020-03-30 16:57:53 +03:00
Mikhail Glukhikh a0978a50e8 [FIR2IR] Correct 'this' conversion when it points to non-closest class 2020-03-30 16:57:52 +03:00
Jinseong Jeon 4388b30f87 [FIR] Fix anonymous object handling as 'this' receiver 2020-03-30 16:57:52 +03:00
Mikhail Glukhikh 697006d782 [FIR2IR] Re-use receiver application logic in callable ref conversion 2020-03-30 16:23:10 +03:00
Mikhail Glukhikh a4c7619c89 [FIR2IR] Introduce & use FirBuiltInsPackageFragment
Without this commit, JVM name mapping logic in BE does not work for FIR,
because FIR cannot use old BuiltInsPackageFragmentImpl descriptor.
In this commit we add our own implementation thus fixing
a pack of FIR black box tests.
2020-03-24 10:37:53 +03:00
Jinseong Jeon e46a4246d2 FIR: regard property accessor without body as FirDefaultPropertyAccessor 2020-03-23 15:12:54 +03:00
Mikhail Glukhikh 6739135d17 [FIR2IR] Add pre-caching of built-in classes to avoid their duplications 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh 0f0e5e603d [FIR2IR] Use IR built-in types, their symbols & constructors directly 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh 1036d8a35a [FIR] Provide dispatch receiver for 'field' synthetic variable 2020-03-18 17:09:36 +03:00
Dmitriy Novozhilov 2b986194fb [FIR] Add desugaring of array assignments and resolve of it
#KT-37516 Fixed
2020-03-18 11:31:53 +03:00
Mikhail Glukhikh 20c4a7b244 [FIR2IR] Introduce staged transformation (first step)
Now FE IR -> BE IR transformation is performed in multiple stages
controller by Fir2IrConverter. Stages are
 * files & classes registration
 * supertypes & type parameters handling
 * functions & properties signature generation
 * body generation

After each step we have guarantee (with exception of local classes &
type inference combination, and external symbols) that required symbols
(class/function/property/variable/type parameter)
are already bound to real declarations and have correct parents.

This commit also fixes incorrect parents for local classes
2020-03-13 12:18:02 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh 0fee8a6946 FIR2IR: cache functions and their parents properly 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +03:00
Mikhail Glukhikh 883dd95e3c FIR: fix class / constructor type parameter duplication 2020-02-28 15:29:02 +03:00
Mikhail Glukhikh 2308e5bb7c FIR2IR: in case of use-site generic type use call from original class 2020-02-28 15:29:02 +03:00