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
Dmitry Petrov
a2dabe11c5
JVM KT-41150: Fix backward compatibility for inline vals in inline class
...
In 1.3.x, for inline class member inline vals 'getFoo-impl' method was
generated in corresponding inline class.
Since 1.4.0, getters for properties returning inline class values are
mangled (so corresponding getters are named 'getFoo-<mangling_hash>'.
However, to maintain backward compatibility with libraries compiled with
1.3.x, inliner should be able to find 'getFoo-impl' method in the
bytecode.
2020-08-24 16:17:12 +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
Mark Punzalan
a9359eb530
RangeContainsLowering: Handle unsigned ranges.
2020-08-21 21:15:27 +02:00
Mark Punzalan
ceba9f231d
RangeContainsLowering: Fix bug in additional condition order for
...
`until` ranges.
2020-08-21 21:15:27 +02:00
Mark Punzalan
60a2f7d03f
RangeContainsLowering: Handle Comparable ranges.
2020-08-21 21:15:27 +02:00
Mark Punzalan
1c1b1b4b0f
Initial version of RangeContainsLowering, which optimizes calls to
...
contains() on ClosedRanges.
2020-08-21 21:15:27 +02:00
Jinseong Jeon
ca541337d1
FIR: skip return insertion for lambda w/ Unit return type
2020-08-21 19:16:43 +03: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
Mikhail Glukhikh
85c1505689
[FIR2IR] Copy type parameters for trivial fake overrides
2020-08-20 16:04:02 +03:00
Mikhail Zarechenskiy
ced151f3af
Add test for KT-41254
...
It was fixed along with #KT-41005
2020-08-20 15:45:32 +03:00
Mikhail Zarechenskiy
6ed13ef1b6
Fix unresolved reference to catch parameter from lambda expression
...
#KT-41140 Fixed
2020-08-19 12:52:16 +03:00
Mikhail Zarechenskiy
f2fba8a469
Fix delegated property resolve when provideDelegate has this as argument
...
#KT-41135 Fixed
2020-08-19 12:52:16 +03:00
Dmitry Petrov
8f0aecce58
JVM_IR: KT-40330 Unify field names for captured 'this' with JVM
...
NB some cases such as captured extension receiver for an extension
lambda are not supported yet; to be discussed, to what extent should we
actually follow JVM code shape here.
2020-08-19 11:07:41 +03:00
Jinseong Jeon
7e22de1e24
FIR2IR: insert coerce-to-unit expressions in statement containers
2020-08-18 21:53:08 +03:00
pyos
1b3ab53e16
FIR2IR: set superQualifierSymbol for setters too
2020-08-18 21:53:08 +03:00
Jinseong Jeon
e9659d9c8a
FIR2IR: make the scope of body of do-while loop transparent
2020-08-18 21:53:07 +03:00
Jinseong Jeon
1b6c4329d2
FIR2IR: handle unbound reference with adapted arguments
2020-08-18 21:53:07 +03:00
Igor Chevdar
e468a347b5
[box-tests] Tests on field init optimization
...
Added tests on all primitive types and a test when the field's type is an inline class
2020-08-15 12:16:33 +05:00
Steven Schäfer
0328fcaf5d
JVM IR: Avoid IMPLICIT_NOTNULL checks on special bridge methods
...
...with dynamic type checks, except for the `@PlatformDependent`
methods, for which the JVM backend adds null checks.
2020-08-14 21:59:33 +02:00
Steven Schäfer
9026f89ba5
JVM IR: Avoid CHECKCASTs on type operators (KT-39520)
...
The type information coming from Java or Kotlin generics may be wrong
due to type erasure and a CHECKCAST instruction could throw an
exception.
2020-08-14 21:58:47 +02:00
Ilmir Usmanov
31e4ddafd1
Minor. Add test with boolean parameter
2020-08-13 15:52:53 +02:00
Ilmir Usmanov
bcbb050326
Use fields for spilled variables for lambda parameters as well
...
In other words, do not generate p$ fields if we can use L$ fields,
which are being cleaned up.
#KT-16222 Fixed
2020-08-13 15:52:51 +02:00
Mikhail Zarechenskiy
aafe41cf7a
Do not force coercion to Unit for nullable lambda return type
...
#KT-41005 Fixed
2020-08-13 10:40:51 +03:00
Ilmir Usmanov
8a098545e6
Minor. Add test
2020-08-11 22:10:51 +02:00
Ilmir Usmanov
00bf07fc41
Force boxing kotlin.Result return type of suspend functions
...
#KT-40843 Fixed
2020-08-11 22:10:47 +02:00
Ilmir Usmanov
b06218c456
Minor. Update test data
2020-08-11 20:27:00 +02:00
Steven Schäfer
53fe30eb45
JVM IR: Don't produce CHECKCASTs on null constants (KT-36650)
2020-08-11 15:13:40 +02:00
Ilmir Usmanov
d861373c6d
Hack attributes for continuation of suspend function in SAM-adapter
2020-08-11 11:58:20 +02:00
Mikhail Zarechenskiy
2e131b870a
Add tests for obsolete issues
...
#KT-38804 Obsolete
#KT-38801 Obsolete
#KT-38835 Obsolete
#KT-38737 Obsolete
#KT-38664 Obsolete
#KT-38549 Obsolete
#KT-38766 Obsolete
#KT-38714 Obsolete
2020-08-11 12:34:02 +03:00
Mikhail Zarechenskiy
e49cdf0ca2
Prohibit using suspend functions as SAM in fun interfaces
...
#KT-40978 Fixed
2020-08-10 22:04:16 +03:00
Mikhael Bogdanov
607f99ed3c
Don't generate implicit overrides delegating to Java defaults
...
#KT-40920 Fixed
2020-08-10 20:03:23 +02:00
Georgy Bronnikov
ea57b4cccb
IR: add and unmute tests
2020-08-10 10:16:24 +03:00
Nick
4669e019d1
[FIR] Add diagnostic CONFLICTING_OVERLOADS & REDECLARATION
2020-08-10 10:09:37 +03:00
Ilmir Usmanov
b403b63f48
Ease field initialization check
...
Since there is already VAL_REASSIGNMENT diagnostics, we can safely only
for direct assignments.
#KT-40893 Fixed
2020-08-07 14:22:18 +02:00
Mads Ager
7f2efabe6a
[JVM_IR]: Improve stepping for when.
...
Additionally, use the line number of the class for default interface
dispatch methods.
2020-08-07 09:16:01 +02:00
Steven Schäfer
ca6e430e89
JVM IR: Handle nested classes in DelegatedPropertyOptimizer
2020-08-06 21:01:59 +02:00
Ilmir Usmanov
68342a1f72
Initialize fake inliner variables on resume path
...
Otherwise, this will cause R8 to complain.
2020-08-05 19:47:55 +02:00
Jinseong Jeon
7ef1c74bbf
FIR2IR: apply adapted reference conversion to coercion-to-unit
2020-08-05 17:07:27 +03:00
Mikhail Glukhikh
f1356a809e
Fir2IrLazySimpleFunction: generate overridden symbols via FirTypeScope
2020-08-05 12:11:33 +03:00
Victor Petukhov
f45de9d8fb
NI: approximate not top-level captured types during code generation
...
^KT-40693 Fixed
2020-08-05 10:36:36 +03:00
Ilmir Usmanov
824991a9dd
Minor. Add tests.
2020-08-04 15:42:38 +02:00
Ilmir Usmanov
bbd4c21595
Cleanup spilled variables
...
#KT-16222
2020-08-04 15:42:37 +02:00
Ilmir Usmanov
405c9743ef
Do not spill dispatch receiver of suspend functions if it is not used
...
#KT-20571
2020-08-04 15:42:36 +02:00
Jinseong Jeon
5db7957230
FIR2IR: use type arguments from fully expanded type
2020-08-04 14:44:38 +03:00
Mikhail Glukhikh
181a8bb79e
[FIR TEST] Mute failing BB test with Byte/Short.and usage
2020-08-04 08:59:16 +03:00
Ivan Kylchik
0a28e5e031
Add argument unwrapping for case when argument is named
2020-08-04 08:59:15 +03:00
Mikhail Glukhikh
8379b3794a
[FIR2IR] Return fallback mode for annotation resolved placeholder
2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov
b63257345b
[FIR] Map Class to KClass in java annotations
2020-08-04 08:59:15 +03:00