Steven Schäfer
44ffb1fb3e
Psi2Ir: Fix SAM conversion with new inference
2020-09-08 11:14:14 +03:00
Dmitry Petrov
b00ce872ea
JVM: record JVM signature for equals/hashCode/toString in inline classes
2020-09-07 12:25:50 +03:00
Victor Petukhov
85d99612a2
Don't create inconsistent types (with contradictive use site and declaration site variances) for star projections with corresponding contravariant type parameters during substitution
...
^KT-41388 Fixed
2020-09-03 16:24:28 +03:00
Alexander Udalov
5aca8ebda8
Minor, add test case on metadata of lambdas in constructors
...
KT-41465
2020-09-02 20:04:05 +02:00
pyos
6b65a2ea7d
JVM_IR: move classes out of lambdas inlined into initializers
...
Fixes KT-41465
2020-09-02 20:03:38 +02:00
Pavel Kirpichenkov
2979c37001
[NI] Fix resolution status for UnstableSmartCastDiagnostic
...
RESOLVED_WITH_ERROR was initially added for reproducing OI behavior.
The intention was to preserve resolution into unstable smart cast and to keep failing candidate.
However, this idea was abandoned after OI behavior proved inconsistent in cases involving generics.
This commit restores RUNTIME_ERROR status of UnstableSmartCastDiagnostic.
^KT-41357 Fixed
2020-09-01 11:21:13 +03:00
Steven Schäfer
b02f0f0a25
JVM IR: Fix compilation of nested inner classes
2020-08-28 20:03:19 +02:00
Mikhail Zarechenskiy
23f87d413a
Use initial system for completion if common one is effectively empty
...
Otherwise we can get unsubstituted type variables as expected types and
then write wrong information for assertions
#KT-41470 Fixed
2020-08-28 17:47:08 +03:00
Alexander Udalov
74c6d2b951
Do not generate non-standard compareTo as primitive comparison in all backends
...
Previous changes related to this in the old JVM backend were in
582b1c5e66 and
0482f7e9c5 , but they did not affect the
`ProperIeee754Comparisons` mode which became the default in 1.4.0. As a
result, we had a regression here.
Since the `PRIMITIVE_NUMERIC_COMPARISON_INFO` slice is used in psi2ir to
determine how to generate the comparison, this fixes the regression both
in the old JVM backend, and in all IR backends.
#KT-41426 Fixed
2020-08-27 19:00:11 +02:00
Dmitriy Novozhilov
9cde42e2bc
[NI] Fix shouldRunCompletion for builder inference session
...
#KT-41308 Fixed
#KT-41363
2020-08-27 16:51:12 +03:00
Dmitriy Novozhilov
e98cbf81cf
[NI] Don't always complete builder inference lambda in FULL mode
...
#KT-41164 Fixed
2020-08-27 16:51:11 +03:00
Mikhail Zarechenskiy
cba13c3c35
Take into account captured types with variables during fixation
...
#KT-41202 Fixed
2020-08-27 11:06:14 +03:00
Mikhail Zarechenskiy
06a592c018
Fix SOE when recursive type argument is used with star projection
...
#KT-41043 Fixed
2020-08-26 19:23:21 +03:00
Mikhail Zarechenskiy
674e9e455f
Fold lower constraints like (T!!..T) and (T..T?) into the latter one
...
#KT-41149 Fixed
2020-08-26 19:23:20 +03:00
Mikhail Zarechenskiy
567e6ca9ca
Fix OOM when there are several lambdas with extension function types
...
#KT-41335 Fixed
2020-08-26 19:23:18 +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
1c1b1b4b0f
Initial version of RangeContainsLowering, which optimizes calls to
...
contains() on ClosedRanges.
2020-08-21 21:15:27 +02: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
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
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
00bf07fc41
Force boxing kotlin.Result return type of suspend functions
...
#KT-40843 Fixed
2020-08-11 22:10:47 +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
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
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
Steven Schäfer
ca6e430e89
JVM IR: Handle nested classes in DelegatedPropertyOptimizer
2020-08-06 21:01:59 +02: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
fa8c6deb18
Support restricted suspend lambdas in JVM_IR
...
#KT-40135 Fixed
2020-07-30 20:40:37 +02:00
Ilmir Usmanov
2c205410fa
Check whether the field is indeed being initialized
...
in checkFieldInExactlyOnceLambdaInitialization
#KT-40691 Fixed
2020-07-30 19:04:54 +02:00
Alexander Gorshenev
9a717e9ecf
Don't copy default value parameters for fake overrides
2020-07-29 22:15:10 +03:00
Dmitry Petrov
dae358c792
JVM: KT-40664 disable optimization for 'ULong in range of UInt' case
2020-07-29 20:33:17 +03:00
Dmitry Petrov
f2493d0950
JVM: KT-40665 more exact check for intrinsified range 'contains'
2020-07-29 20:33:17 +03:00
Ilmir Usmanov
70e91bd5db
Shrink and split LVT records of variables according to their liveness
...
Otherwise, debugger will show uninitialized values of dead variables
after resume.
#KT-16222
#KT-28016 Fixed
#KT-20571 Fixed
2020-07-29 00:01:10 +02:00
Ilmir Usmanov
60875f96b4
Do not take LVT into account when calculating liveness of variables
2020-07-29 00:01:09 +02:00
Dmitry Petrov
980b91d082
JVM: generate 'Deprecated' on method as runtime-visible annotation
...
We generate @java.lang.Deprecated annotation on methods of $DefaultImpls
classes in compatibility mode. This annotation has RUNTIME retention and
should be visible.
Also, get rid of representing annotations as Class'es (yes we know that
these annotations are in compiler CLASSPATH, but we should not rely on
such classes and associated information).
2020-07-28 18:19:20 +03:00
Dmitry Petrov
4fdccb3b35
JVM_IR: don't generate repeated ElementType values in @Target
2020-07-28 18:19:20 +03:00
Dmitry Petrov
1272162a7f
JVM_IR: generate "safe" names for functions in init blocks
2020-07-22 19:49:48 +03:00
Mikhail Zarechenskiy
fcf7a55ccc
Fix delegated property resolve on number literals and proper types
...
There is no need to update type of delegate expression if it's already
resolved correctly (doesn't include non-proper types). In almost all
cases it was fine except number literals as there we didn't box
expression in backend and got problems at bytecode verification stage
#KT-40057 Fixed
2020-07-17 14:27:20 +03:00
Mikhail Zarechenskiy
100a6f70ca
Relax rules about inferring to Nothing for special calls
...
#KT-37388 Fixed
#KT-38427 Fixed
#KT-39953 Fixed
#KT-38899 Fixed
2020-07-16 09:56:46 +03:00
Roman Artemev
cd9f59325e
[KLIB] Fix deserialization of anonymous classes
...
In case of initializing property or function with anonymous object the
object is being exposed outside its field/function's scope and
accessible on previous level. In this case in `declarations only` mode
we have unbound symbols. Fix is to force body/initializer loading in
such cases.
Make sure it is deserialized in `declarations'only` mode too.
- Fix KT-40216
- Add test
2020-07-15 18:23:29 +03:00
Victor Petukhov
514ac7dc8f
NI: introduce simple calls storage (which aren't gone through type inference) in coroutine inference session to further substitute postponed variable
...
^KT-40151 Fixed
2020-07-10 11:11:48 +03:00
Victor Petukhov
c588bc604d
NI: do substitution stub types during updating trace for lambda (these stub types can appear from the builder inference as postponed variables)
...
^KT-40060 Fixed
2020-07-07 11:17:06 +03:00
Mikhail Zarechenskiy
d8f701ee61
Add test for obsolete issue
...
#KT-39588 Obsolete
2020-07-05 18:17:44 +03:00
Steven Schäfer
5cdf053c8e
Coroutines: Fix RedundantLocalsEliminationMethodTransformer
...
- Take control flow into account when collecting usage information
- Don't remove stores to local variables
2020-07-02 00:49:28 +02:00
Ilmir Usmanov
28e6028af4
Minor. Add test
2020-06-29 20:13:40 +02:00