Commit Graph

3168 Commits

Author SHA1 Message Date
Ilmir Usmanov 52f9569d33 Generate CHECKCAST Object inside the markers
otherwise, the unboxing interferes with bytecode analysis.
2020-09-09 17:43:42 +02:00
Ilmir Usmanov e8a451072e Minor. Add tests with same JvmType in covariant override 2020-09-09 17:43:41 +02:00
Ilmir Usmanov 7cbd067460 Add tests with resume path 2020-09-09 17:43:39 +02:00
Ilmir Usmanov 1c97eafea8 Check for COROUTINE_SUSPENDED inside callable reference
#KT-41429 Fixed
2020-09-09 17:43:37 +02:00
Ilmir Usmanov ccc5b7afe0 Box inline class in resume path of suspend call
#KT-41429
2020-09-09 17:43:35 +02:00
Alexander Udalov 3d7619421f JVM IR: fix exception on star projection in type parameter upper bound
#KT-41761 Fixed
2020-09-09 17:07:52 +02:00
Victor Petukhov c1ebd33833 Capture flexible intersection types properly: take into account both bounds and use the same captured arguments for them
^KT-41693 Fixed
2020-09-09 14:52:12 +03:00
Mikhail Glukhikh db2e3f219f [FIR] Keep bare type for type alias case 2020-09-09 12:16:09 +03:00
Alexander Udalov 3a5d0ab427 JVM IR: fix HashCode intrinsic for generics substituted with primitives
The problem here was that although the IR type of the expression was
primitive, the type of the actual expression in the bytecode generated
after type erasure was `Ljava/lang/Object;`, and we were trying to call
a non-existing method `Object.hashCode(Object)`.

 #KT-41669 Fixed
2020-09-08 23:37:00 +02:00
Steven Schäfer 44ffb1fb3e Psi2Ir: Fix SAM conversion with new inference 2020-09-08 11:14:14 +03:00
pyos f198a19ab0 FIR2IR: add local delegated property generation 2020-09-08 08:40:07 +03:00
Dmitry Petrov b00ce872ea JVM: record JVM signature for equals/hashCode/toString in inline classes 2020-09-07 12:25:50 +03:00
Mark Punzalan 16ab11289c [JS_IR] Enable RangeContainsLowering optimizations. 2020-09-03 18:42:35 +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
Mikhail Glukhikh a7da0d5080 [FIR] Approximate exotic return types for public declarations 2020-09-03 14:24:31 +03:00
Jinseong Jeon bf918e6184 FIR: hide local types if needed 2020-09-03 14:24:31 +03:00
Mikhail Glukhikh 23e83e8933 FirClassSubstitutionScope: don't recreate type parameters for unbound f/o 2020-09-03 14:24:30 +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
Alexander Udalov b8d16f3d46 Add EnclosingMethod information to bytecode listing tests 2020-09-02 16:46:05 +02:00
Mikhail Zarechenskiy 9c217e3d99 Reuse revised variables during lambda analysis against type variables
#KT-41400 Fixed
2020-09-01 13:04:53 +03: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
Jinseong Jeon 04af6846a7 FIR2IR: handle more vararg spreads for adapted callable references 2020-08-31 14:31:58 +03:00
Mikhail Glukhikh 5efabe063e [FIR] Fix JVM mapped function callable id 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 458f89ef33 [FIR] Signature composer: return null signature for local declarations 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 02b6f34067 [FIR2IR] Add extension receiver parameter to delegated members 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 3f5beb77e8 [FIR2IR] Cache delegatable members properly 2020-08-31 14:31:55 +03:00
Alexander Udalov 5e48be3d11 Add a fallback flag -Xno-unified-null-checks for KT-22275
#KT-41482 Fixed
2020-08-31 12:43:28 +02:00
Igor Chevdar 527de030fc [box-tests] Turned on some tests for K/N 2020-08-31 12:01:31 +05: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
Zalim Bashorov 9097d0918c [JS BE] Support passing an array as argument of vararg in named form
#KT-38059 fixed
2020-08-28 13:14:23 +03:00
Dmitriy Novozhilov b21a0213df [NI] Get rid of FE 1.0 types in AbstractTypeApproximator 2020-08-28 10:59:51 +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
Jinseong Jeon 085e0dc1de FIR2IR: allow array expression as named argument for vararg 2020-08-26 18:01:21 +03:00
Jinseong Jeon 553ae68c96 FIR2IR: convert adapted callable reference with vararg 2020-08-26 14:26:19 +03:00
Jinseong Jeon 99286a6ce3 FIR2IR: introduce & use ClassId-based lookup for local class as IrParent 2020-08-26 10:08:16 +03:00
Jinseong Jeon 3e9ac75cfc FIR: record use of backing field symbol to indeed add a backing field 2020-08-25 19:29:58 +03:00
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
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 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