Dmitry Petrov
9a95941ef3
JVM_IR: Rewrite '?.' and '?:' chains
...
This shortens code and avoids unnecessary boxing in some cases.
2020-03-26 12:19:25 +03:00
Juan Chen
aba7706dec
[FIR] fix test module set up (this fixes 193 BB tests)
...
Added creation and initialization of the test module and its dependencies.
When looking at the emptyProgression test,
I found that getProgressionLastElement was not found,
which should be resolved from the dependencies.
2020-03-26 10:30:47 +03:00
Leonid Startsev
2bda31ac38
Exclude annotation properties in 'explicit visibility' api mode check
...
#KT-37432 fixed
2020-03-25 19:41:52 +05:00
pyos
be37e7135a
Add a test for SMAPs with interleaved files
2020-03-25 14:03:32 +01:00
Denis Zharkov
d869ae7826
FIR: Make resolution logic for local classes the same as for top-level
...
Run different phases through common transformers sequentially
It should make code more reusable and may help with avoid common bugs
2020-03-25 15:36:17 +03:00
Denis Zharkov
cdd7e41891
FIR: Support proper implicit return type computation for local classes
2020-03-25 14:53:34 +03:00
Jinseong Jeon
cdf5a2a5a1
FIR: set dispatch receiver parameter for inner class's constructor.
2020-03-25 12:40:09 +03:00
pyos
4558d48481
JVM: add a language feature to omit *E between SMAP strata
...
Fixes #KT-37704
2020-03-25 10:33:59 +01:00
Dmitriy Novozhilov
2c37627b15
[FIR] Add unified diagnostics for psi and light tree
2020-03-25 11:35:43 +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
simon.ogorodnik
59393e06f0
[FIR-test] Mute tests with bad test-data
2020-03-24 18:58:19 +03:00
simon.ogorodnik
f83c20065d
[FIR-test] Unmute passing tests, mostly fir2ir
2020-03-24 18:58:19 +03:00
simon.ogorodnik
0acca52001
[FIR-Test] Unmute blackbox test
2020-03-24 18:58:18 +03:00
simon.ogorodnik
ae54815132
[FIR] Fix varargs of unsigned numbers
2020-03-24 18:58:17 +03:00
Pavel Kirpichenkov
adf3351a8b
[NI] Don't skip constraints with projections during variable fixation
...
Those constraints are only restored for variable fixation stage because of the
influence on pefrormance.
^KT-37650 Fixed
^KT-37380 Fixed
2020-03-24 16:13:49 +03:00
Pavel Kirpichenkov
dc18c62dbc
[NI] Filter out type variable from its dependencies
...
Don't take into account complex variable dependency on itself when determining fixation status.
^KT-37621 Fixed
2020-03-24 12:49:18 +03:00
Mikhail Glukhikh
03143bc788
[FIR2IR] Implement mapping of FIR & IR built-in class members
2020-03-24 12:15:18 +03:00
Dmitry Petrov
afacb4b4b2
KT-37604 Use proper type when generating constructor call
2020-03-24 11:31:47 +03:00
Mikhail Zarechenskiy
ec4d9d2f1f
[NI] Prefer between two complex variables one with proper lower bounds
...
This reverts commit d4d35bb766 .
2020-03-24 11:13:55 +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
Mads Ager
baf1f56859
[JVM_IR] Rebase test of string concatenation codegen.
...
The JVM IR backend code seems saner to me. The string concatenation
lowering for JVM IR calls the stringPlus intrinsic if there are
only two arguments. That leads to a lot less code:
```
load string
load argument
box argument
call Intrinsics.stringPlus
```
instead of
```
allocate StringBuilder
call StringBuilder.<init>
load string
call StringBuilder.append
load argument
call StringBuilder.append
call StringBuilder.toString
```
This will lead to more boxing, but a lot smaller code. We still
use StringBuilders in JVM IR if there are more than two strings
being concatenated.
2020-03-23 16:42:53 +03:00
Mikhail Zarechenskiy
191fb02bf6
[NI] Consider intersection type with number type as Nothing
...
Currently, only for "in": In<in Int & A> == In<in Nothing> == In<*>
#KT-37302 Fixed
2020-03-23 16:39:21 +03:00
Nick
abcd6bd528
[FIR] Support diagnostic SUPER_IS_NOT_AN_EXPRESSION
2020-03-23 15:14:06 +03:00
Mikhail Glukhikh
ca22e05acd
[FIR2IR] Support safe calls
2020-03-23 15:13:50 +03:00
Jinseong Jeon
e46a4246d2
FIR: regard property accessor without body as FirDefaultPropertyAccessor
2020-03-23 15:12:54 +03:00
pyos
ac6036f366
JVM_IR: move state machine generation to ClassCodegen
2020-03-23 12:23:17 +01:00
Dmitry Petrov
b0e916769d
Add test for KT-37570
2020-03-23 12:27:58 +03:00
Georgy Bronnikov
4742057b51
IR: generate lambdas in place in Psi2Ir
...
even when arguments are to be rearranged.
Lambdas have no side effects, and storing them in temporary variables
prevents processing in the backend
(such as inserting continuation parameter in AddContinuationLowering).
2020-03-23 11:09:30 +03:00
Mikhail Zarechenskiy
d4d35bb766
Revert "[NI] Prefer between two complex variables one with proper lower bounds"
...
This reverts commit ced8a92629 .
2020-03-22 17:16:22 +03:00
Dmitriy Novozhilov
6ce8d661ad
[FIR] Add nullability to ILT. #KT-37639 Fixed
2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
5f9f01fe4e
[FIR] Implement new completion mode calculator
...
Note that `testDelegates` now fails due to KT-37638 and
`testSimpleIn` fails due to problems with type parameters
of inner classes
2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
ea02855ba6
[FIR] Fix type arguments and substitution for flexible types
2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
7bfe7061e7
[FIR] Add proper nullability for java enums
2020-03-20 23:11:28 +03:00
max-kammerer
a3125849a0
Merge pull request #3204 from pyos/ir/fix-lambda-inner-classes
...
JVM_IR: restore InnerClasses for objects in lambdas
2020-03-20 17:15:41 +01:00
Mikhail Zarechenskiy
ced8a92629
[NI] Prefer between two complex variables one with proper lower bounds
...
#KT-37554 Fixed
2020-03-20 15:44:53 +03:00
Mikhail Glukhikh
9836520287
[FIR2IR] Generate synthetic bodies for Enum.values() and valueOf()
2020-03-20 11:55:34 +03:00
Mikhail Glukhikh
94fe79578e
[FIR2IR] Generate unconditional branch in exhaustive whens
2020-03-20 11:55:34 +03:00
Victor Petukhov
3b892fe31e
NI: exclude reporting of an unsafe call diagnostic for implicit invoke after safe call in cases when invoke has type parameters (make NI and OI consistent)
...
^KT-37579 Fixed
2020-03-19 19:27:25 +03:00
Mikhail Bogdanov
bc214868ef
Minor. Clean tests
2020-03-19 16:45:10 +01:00
Mikhael Bogdanov
ab7e71fd68
Support per files test directives
2020-03-19 16:45:10 +01:00
pyos
186302d84e
JVM_IR: restore InnerClasses for objects in lambdas
2020-03-19 15:23:44 +01:00
pyos
d06c87207c
Dump class structure in a test that has an object in a lambda
2020-03-19 15:11:20 +01:00
pyos
e0a5ab7146
Do not regenerate objects if all captured lambdas are noinline
2020-03-19 15:11:20 +01:00
Victor Petukhov
ea59ea8aa2
NI: avoid creating useless captured types during incorporation
...
^KT-37546 Fixed
2020-03-19 12:47:03 +03:00
Pavel Punegov
8ffb63ca6b
Ignore test that relies on hashCode implementation
2020-03-19 11:14:58 +03:00
Jinseong Jeon
2352b1fec5
JVM_IR: use fresh source map when generating lambda body for inline.
2020-03-19 08:28:38 +01:00
pyos
72b80ef158
Detect inline cycles faster
...
E.g. in the following code
fun x() {}
inline fun f() { x(); g() }
inline fun g() { x(); f() }
the old implementation of inline cycle detection bailed out after
generating 3 calls of x() in each function, while the new one stops
after 2. In other words, code generation for a single function is no
longer reentered.
2020-03-19 08:13:19 +01:00
Vyacheslav Gerasimov
bcefa68df0
Always checkout/checkin text files with lf endings
...
Different line endings on linux/windows prevents gradle from reusing
build cache since endings make task inputs completely different between
systems
2020-03-18 22:33:15 +03:00
Jiaxiang Chen
03613d4708
JVM_IR: preserve old backend's logic for special mutable collection class stub methods
2020-03-18 19:28:04 +01:00