Commit Graph

71 Commits

Author SHA1 Message Date
Juan Chen bfac0355bf WIP: [FIR] unmute testKt14227 with FULL_JDK
The test used to fail because it has an augmented assignment for
elements in a HashMap of Strings, and "plus" fails to resolve due to
ambiguity: besides String.plus, BigDecimal.plus in the standard
library is also considered. BigDecimal is not resolved and thus
isError returns true. During type checking, the context has
isErrorTypeEqualsAnything set to true, and BigDecimal is now regarded
as a super type of String and BigDecimal.plus is a valid
candidate. Adding the directive "FULL_JDK" enables resolving of
BigDecimal so that BigDecimal.plus is excluded.
2020-06-01 16:47:15 +03:00
Jinseong Jeon 57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Mikhail Zarechenskiy befa1e114c Add tests for obsolete issues
#KT-38092 Obsolete
 #KT-38179 Obsolete
 #KT-35105 Obsolete
 #KT-36696 Obsolete
 #KT-36947 Obsolete
 #KT-37337 Obsolete
 #KT-37309 Obsolete
 #KT-37727 Obsolete
 #KT-37735 Obsolete
 #KT-37853 Obsolete
 #KT-37920 Obsolete
 #KT-37709 Obsolete
 #KT-37706 Obsolete
2020-04-20 04:10:37 +03:00
Jinseong Jeon c370b86141 IR: consolidate generation of synthetic members for data class 2020-04-13 17:30:05 +03:00
Mikhail Glukhikh 5c758af0a6 [FIR] Use ScopeSession from resolve transformer in FIR2IR 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh d7460d47de [FIR] Generate dispatch & extension receivers for variable assignments 2020-04-03 17:21:21 +03:00
Mikhail Glukhikh a0978a50e8 [FIR2IR] Correct 'this' conversion when it points to non-closest class 2020-03-30 16:57:52 +03:00
Mikhail Glukhikh b27152f903 Replace some FIR syntax errors with more proper diagnostics 2020-03-27 16:46:59 +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 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
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 1812b490a1 FIR: set anonymous object constructor return type properly 2020-03-11 16:01:57 +03:00
Mikhail Glukhikh 0fee8a6946 FIR2IR: cache functions and their parents properly 2020-03-04 16:55:33 +03:00
Denis Zharkov 8fca343ef0 FIR: Support FirComparisonOperator in Fir2Ir
^KT-31163 Fixed
2020-02-27 18:21:34 +03:00
Mikhail Glukhikh 8c21f04bf4 FIR2IR: determine type parameters before value parameters
Type parameters can be referred from value parameters,
so we should determine them earlier to be able to set their indexes
2020-02-20 18:34:51 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Alexander Udalov c3729c8189 Reorganize codegen tests for old language versions
Put all files under a single "oldLanguageVersions" directory under test
data of each test
2019-11-07 18:49:27 +01:00
Kristoffer Andersen 8af3b3e51e [Backend] Reorganize version 1.0 codegen tests
- Extract all backend codegen tests that specifically target behaviour
  in to-be-deprecated functionality from language versions < 1.3"
- Remove those tests from the JVM IR test suite.
2019-10-24 16:51:19 +02:00
Anton Bannykh aad9cbbf01 [JS IR BE] Fix tests failing due to reduced runtime 2019-10-04 17:30:45 +03:00
Mikhail Zarechenskiy f8449bf15a [NI] Clear partially resolved calls after resolve of top-level call
#KT-32433 Fixed
2019-09-09 11:04:17 +03:00
Mikhael Bogdanov 4c59d161d4 Support basic reification in IR 2019-04-08 13:10:22 +02:00
Svyatoslav Kuzmich 75328f26ea [JS IR BE] Add missing KJS_WITH_FULL_RUNTIME to some tests
+ ranges test generator
2019-01-27 01:14:51 +03:00
Svyatoslav Kuzmich aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Alexander Udalov 5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Dmitry Petrov 08d1c47ac3 KT-14227 Intrinsify MutableMap.set
This fixes the most common (and rather annoying) bug in augmented
assignment desugaring with collection element receiver.

Fix is somewhat hackish: introduce an intrinsic for MutableMap.set,
thus bypassing discrepancies in 'get' and 'set' call generation.
Fixing it properly requires design decisions for corner cases where
ad hoc augmented assignment desugaring with collection element receiver
"accidentally" works, producing identical objects and vararg arrays for
arguments of 'get' and 'set'.
2018-12-11 12:43:03 +03:00
Roman Artemev fb709cae92 [JS IR BE] Fix private field names 2018-11-01 16:18:44 +03:00
Svyatoslav Kuzmich 4c38d55f21 [JS IR BE] Unmute tests 2018-10-15 00:03:45 +03:00
Anton Bannykh 2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov 06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Dmitry Petrov acf0bb349c Update testData for restricted expression annotations retention 2018-07-20 10:39:51 +03:00
Mikhail Zarechenskiy 857cc0f728 Make tests about mod and varargs valid for 1.3 version 2018-07-16 14:01:59 +03:00
Anton Bannykh 07b3b66fd9 JS IR: unmute tests 2018-07-10 13:34:19 +03:00
Svyatoslav Kuzmich 83f8cfaa66 [JS IR BE] hashCode, toString, number conversion support 2018-07-03 19:51:58 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Roman Artemev f69bd54d6c [JS IR BE] Update test data 2018-06-19 17:09:31 +03:00
Roman Artemev 6ac4fd2e5f [JS IR BE] Update test data 2018-06-14 19:54:30 +03:00
Anton Bannykh 96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Dmitry Petrov f4f1ea91d9 Use accessible get/set arguments for collection element receiver
When generating collection element receiver (such as 'a[i]'), accessible
descriptor for get/set operator should be used.
Otherwise, if the corresponding get/set operator fun is called via an
accessor, its argument types may be different in case of generic fun
specialized with primitive types.

 #KT-20387 Fixed
2017-09-28 14:55:11 +03:00
Alexey Andreev dde50a34db Fix comparison of boolean values in JS BE
See KT-16984
2017-05-26 18:26:08 +03:00
Denis Zharkov 5f843f6759 Fix intrinsic for String.plus for explicit calls
#KT-14567 Fixed
2017-02-10 16:05:15 +03:00
Mikhail Zarechenskiy e7ea076093 Do not apply constant folding for non built-in functions
#KT-15872 Fixed
2017-02-08 15:42:39 +03:00
Dmitry Petrov a974ed1049 Support custom accessors for top-level properties in scripts. 2017-01-26 10:12:13 +03:00
Anton Bannykh 07bb7ef4d3 JS: extension lambdas translated same as local lambdas (KT-13312 fixed) 2017-01-23 20:09:36 +03:00
Alexey Andreev 4eed7c1fcb JS: fix translation of augmented assignment in class initializer. See KT-15569 2017-01-12 18:12:38 +03:00
Alexey Andreev 175d37fdc8 JS: add test to prove that KT-13523 is no more reproducible 2016-12-29 16:00:54 +03:00
Alexey Andreev eb5c79c70d JS: support int overflow behaviour in augmented assignment 2016-12-20 15:47:38 +03:00
Mikhail Zarechenskiy 5a829809d9 Add operator 'rem' as extension to BigInteger
#KT-14650 Fixed

 Note that after this change behaviour of '%' on BigInteger is changed,
now it works like a proper remainder
2016-12-14 15:29:00 +03:00