Commit Graph

167 Commits

Author SHA1 Message Date
Georgy Bronnikov c015463926 IR: remove field fake overrides 2020-06-17 20:02:26 +03:00
Denis Zharkov 38922a84f1 FIR: Do not create synthetic properties for non-Java accessors
^KT-35495 Fixed
2020-06-11 11:01:43 +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
Jinseong Jeon 0890b8bad3 FIR2IR: set superQualifierSymbol for property access 2020-04-30 12:26:47 +03:00
Jinseong Jeon c26adf53dd FIR: resolve suspend lambda properly 2020-04-20 17:05:30 +03:00
Mikhail Glukhikh a93c7a39e0 [FIR] Provide object [dispatch] && callable reference receivers properly 2020-04-09 15:22:56 +03:00
Anton Bannykh 998218716d IR: make lateinit lowering traverse local classes 2020-04-08 14:44:25 +03:00
Dmitriy Novozhilov 8a2b39d647 [FIR] Add checking receivers of callable references 2020-04-08 10:38:45 +03:00
Igor Chevdar b54148a6f1 Added a test on lateinit var inside a local class 2020-04-08 10:33:14 +03:00
Jinseong Jeon fa9d79392f [FIR] Handle lateinit local variable properly 2020-04-07 14:06:38 +03:00
Mikhail Glukhikh d7460d47de [FIR] Generate dispatch & extension receivers for variable assignments 2020-04-03 17:21:21 +03:00
Mikhail Glukhikh f374c36cd2 [FIR2IR] Generate property extension receiver references properly 2020-04-03 13:31:15 +03:00
Mikhail Glukhikh f3f7bf70f6 [FIR] Set delegate field receiver properly 2020-04-03 13:29:55 +03:00
Jinseong Jeon 44c34ab8c3 [FIR2IR] Don't create fake overrides for private property accessors 2020-04-02 12:43:06 +03:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +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 810b607a65 [FIR2IR] Provide receivers also for property callable references 2020-03-30 16:23:10 +03:00
Roman Artemev 6e01ec8dd3 [IR] Fix translation of synthetic generic java properties
- Compute substituted accessor descriptor to avoid unbound type parameters
2020-03-27 10:52:33 +03:00
Jinseong Jeon acbe3126b1 FIR: consider all functions in scope when computing dispatch receiver parameter. 2020-03-25 09:20:07 +03:00
Jinseong Jeon de0c9a5c73 FIR: use dispatch receiver of the enclosing function if any. 2020-03-25 08:27:21 +03:00
Mikhail Glukhikh 03143bc788 [FIR2IR] Implement mapping of FIR & IR built-in class members 2020-03-24 12:15:18 +03:00
Jinseong Jeon e46a4246d2 FIR: regard property accessor without body as FirDefaultPropertyAccessor 2020-03-23 15:12:54 +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
Mikhail Glukhikh c0f8be5d4e [FIR2IR] Generate setter call for assignments, if any 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh 1812b490a1 FIR: set anonymous object constructor return type properly 2020-03-11 16:01:57 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Dmitriy Novozhilov e3e7b40f85 [FIR] Fix determining coercion to Unit 2020-03-05 16:48:48 +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 cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +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
Mikhail Glukhikh 8c155578f7 FIR2IR: generate both dispatch & extension receiver without 'else if' 2020-02-25 12:13:42 +03:00
Juan Chen 4f6fe1d0ca [FIR]: fix translation of top-level property accesses like array.indices
This commit addresses the following issues:

* accessors didn't take into account their property's receiver type,
which caused NoSuchMethod due to signature mismatch. Now the property's
receiver type is passed to Fir2Ir translation of accessors.

* property's parent was not class, e.g., kotlin.collections.indices.
Now the symbol table collects WrappedPropertyDescriptorWithContainerSource
besides WrappedFunctionDescriptorWithContainerSource, so that
facade classes for such properties can be generated before codegen.

* accessor's parent was not class. Now the containerSource of
the property descriptor is passed to accessor descriptor.
2020-02-25 12:13:42 +03:00
Juan Chen 9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +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
Anton Bannykh 70a4c265de Add tests extracted from regressions 2020-02-06 21:03:41 +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 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
Steven Schäfer 929fb5c82b Mute FIR tests containing broken function calls 2020-01-08 13:20:00 +01:00
Mikhael Bogdanov 650cfeaaed Update inline tests to void PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR 2019-12-19 12:46:36 +01:00
Dmitriy Novozhilov b76c984b26 [FIR] Support IntegerLiteralTypes 2019-12-09 17:24:26 +03:00
Mikhail Glukhikh 4e1cd6bcd5 Mute 2 black-box FIR test due to disallowed Kotlin synthetic properties problem
Yet FIR allows synthetic properties both in Kotlin & Java code.
It's unclear how to forbid them in Kotlin fast. Subject to discussion.
2019-12-02 11:33:22 +03:00
Mikhail Glukhikh f1eb0dff1f FIR: disable synthetic scope, make accessor symbols synthetic
Before this commit, we had two methods to do generally the same synthetic thing.
It's an attempt to keep only one of them.
Accessor symbols are generated in Java use-site member scopes,
at this place we know better whether we are in Java class or not.
However, we have to do this at every use-site level, which is relatively slow.
Also we could encounter problems when accessor function is overridden in Kotlin,
and accessor symbol can still contain reference to Java accessor.
2019-11-29 18:09:07 +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
Alexander Udalov b38153e402 Minor, add runtime and comment to test on multi-file isInitialized 2019-11-21 13:46:53 +01:00
pyos 0f4f3f2429 FIR: set correspondingPropertySymbol of backing fields 2019-11-21 15:27:53 +03:00
Georgy Bronnikov 119a3f1306 JVM_IR: do not generate accessors to lateinit private properties 2019-11-19 16:30:04 +03:00