Commit Graph

91 Commits

Author SHA1 Message Date
Mikhail Glukhikh f20e2dec31 K2: generate Unit conversion for indexed assignment at raw FIR stage
#KT-59748 Fixed
2023-07-26 06:09:15 +00:00
Sergej Jaskiewicz 5e63f7627f [klib] Test signature descriptions in irText tests
KT-59486
2023-07-14 20:26:45 +00:00
Mikhail Glukhikh f8ca440e96 K2: resolve Java enum entries from the beginning (related to KT-59464) 2023-07-11 08:28:04 +00:00
Denis.Zharkov 3279313f2c K2: Fix priority for implicit receiver + extensionInvoke
See K1 counterpart at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.Task.processImplicitReceiver

^KT-58943 Fixed
^KT-59541 Fixed
2023-07-01 16:29:06 +00:00
Mikhail Glukhikh 0d8f3a6026 K2: generate Java synthetics for Kotlin get/sets w/out type parameters
This commit is a follow-up to d8a20f19 and
provides additional K1 compatibility.
#KT-59550 Fixed
2023-06-23 16:44:50 +02:00
Mikhail Glukhikh fcfee9384a K2: reproduce KT-59550 2023-06-23 16:44:49 +02:00
Alexander Udalov 1588b07472 Tests: unmute light analysis tests passing with JVM_IR 2023-06-22 17:10:51 +02:00
Alexander Udalov cab53361f3 Use JVM IR backend in light analysis mode tests
Add some more filters on private/synthetic stuff (which doesn't matter
in practice) to make full and light analysis mode dumps as similar as
possible, so that all existing tests will pass for JVM IR. Unmute some
tests which were failing with the old JVM backend.

Tests on repeatable annotations are muted because in full analysis,
annotations are wrapped into the container (e.g. `@A(1) @A(2)` ->
`@A$Container(A(1), A(2))`), but they are no in the light analysis mode.
So there's always going to be a difference for these tests between full
and light analysis, unless we're going to change behavior of kapt, which
would be a kind of a breaking change.

 #KT-58497 Fixed
2023-06-22 17:10:51 +02:00
Kirill Rakhman c867a4b52f [FIR] Don't expand typealiases when checking for DeprecatedSinceKotlin
During serialization, this can lead to a cycle resulting in a Stack
Overflow.

#KT-58356 Fixed
2023-06-21 14:35:43 +00:00
Dmitriy Novozhilov 2581139b82 [FIR2IR] Expand typealiases before inserting implicit casts
^KT-59461 Fixed
^KT-59464
2023-06-21 07:34:09 +00:00
Mikhail Glukhikh 8983e3a218 K2: correctly set importedFromObjectOrStaticData for fields
#KT-59140 Fixed
#KT-58980 Fixed
2023-06-20 14:13:21 +00:00
Mikhail Glukhikh d8a20f1975 K2: don't generate Java overridden synthetics for Kotlin get/sets
#KT-59038 Fixed
2023-06-20 07:07:10 +00:00
Mikhail Glukhikh 668157eb41 FirClassAnySynthesizedMemberScope.kt: make it a declared member scope
Related to KT-54844, KT-58926
2023-06-14 07:09:16 +00:00
Denis.Zharkov c474c54903 FIR2IR: Fix IAE for case of local override of a method with defaults
It was happening because for MyClass.foo we didn't set overriddenSymbols
properly because in ClassMemberGenerator.convertFunctionContent we
used incorrect containingFirClass that was pointing to anonymous class
instead of MyClass.

^KT-58902 Fixed
2023-06-08 08:04:03 +00:00
Sergej Jaskiewicz f2031ae642 [IR] Don't print multifile/synthetic facade class names in irText tests
This only applies to JVM and fq-names in declaration references
in IR dumps.

This enables us to run more irText tests on platforms other than JVM
(see KT-58605).
2023-06-05 10:40:17 +00:00
Sergej Jaskiewicz fd76a34277 [IR] Don't print flags in declaration references in irText tests
This doesn't reduce the quality of tests, because the flags are still
printed for declarations themselves. We only omit them in references.

However, this makes the tests more compatible with non-JVM backends
(see KT-58605), because flags of referenced stdlib declarations may
differ among target platforms.
2023-05-30 17:26:30 +00:00
Kirill Rakhman cf2ef443f4 [FIR] Introduce a feature flag for context-sensitive enum resolution
The feature was previously enabled unconditionally in K2 which
triggered a bug when an enum has an entry with the same name as itself.

#KT-58897 Fixed
#KT-52774
2023-05-30 11:59:56 +00:00
Vladimir Sukharev a534708900 [K2/N] Use FqName to mangle invisible class-like symbol in fake override
^KT-57484

Merge-request: KT-MR-10263
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-24 07:34:11 +00:00
Sergej Jaskiewicz 56f977f70c [IR] Don't render facade classes in JVM fq-names in irText tests
This makes the tests more compatible with non-JVM backends
(see KT-58605)
2023-05-17 12:43:35 +00:00
Mikhail Glukhikh 08c22c388c K2: change logic of result type search in ILT case
Related to KT-57487, KT-57703
2023-04-27 12:19:38 +00:00
Mikhail Glukhikh 27c4a7b7ef FE: add new tests around unresolved integer literals
Related to KT-57487, KT-57703
2023-04-27 12:19:38 +00:00
Mikhail Glukhikh 1c56a71b14 FirClassSubstitutionScope: don't recreate constructor type parameters w/out need
#KT-58008 Fixed
2023-04-25 16:42:59 +00:00
Mikhail Glukhikh 5daafd5ed5 FirNestedClassifierScope: don't give empty map substitutor to a processor
Optimization related to KT-58008 (hides the issue in some cases)
2023-04-25 16:42:59 +00:00
Mikhail Glukhikh 4172ce1018 K2: reproduce KT-58008 2023-04-25 16:42:59 +00:00
Mikhail Glukhikh bde0282fb1 K2: extract constant from Java enum entry properly
#KT-58002 Fixed
2023-04-17 21:05:04 +00:00
Mikhail Glukhikh 0a126a173e K2: reproduce KT-58002 2023-04-17 21:05:03 +00:00
Mikhail Glukhikh 5cff8c15ab K2: fix intrinsic analysis in FirToConstantValueChecker
#KT-57986 Fixed
2023-04-17 20:53:31 +00:00
Mikhail Glukhikh c826c7301c K2 JS/Native: reproduce KT-57986 2023-04-17 20:53:30 +00:00
Mikhail Glukhikh 45e78455b2 K2: repeat K1 behavior around multiple inheritance by delegation
#KT-56720 Fixed
2023-03-21 16:16:20 +00:00
Mikhail Glukhikh a3f0e429e3 K2: report empty intersection warnings from completion properly 2023-03-11 10:15:25 +00:00
Denis.Zharkov 0c9fad87c3 K2: Fix deserialization of upper bound of type parameter in nested class
Previously, containingDeclarationSymbol for V was set to the outer class
BaseRoot, so its upper bounds was computed to the ones from TNested
at org.jetbrains.kotlin.fir.resolve.calls.CreateFreshTypeVariableSubstitutorStageKt.getTypeParameterFromExpandedClass

^KT-56706 Fixed
2023-02-21 12:35:34 +00:00
Denis.Zharkov 33dcbaac16 K2: Change resolution rules of when/if expressions with expected type
When expected type is known, use it as expected type for branch bodies.
While it indeed becomes different from the usual select call resolution,
where expected type is applied only after completion starts,
it helps to support, e.g. callable references resolution just as powerful
as it was in K1.

Also, in some cases where diagnostics have been changed, they become
a bit more helpful since they are reported closer
to the problematic places

cannotCastToFunction.kt test has been removed because it relied
on the case erroneously supported by the hack removed from
the FirCallResolver in this commit.

^KT-45989 Fixed
^KT-55936 Fixed
^KT-56445 Fixed
^KT-54709 Related
^KT-55931 Related
2023-02-15 08:13:46 +00:00
Denis.Zharkov a38040680c K2: Do not use KFunctionN as representation type for adapted references
Beside some corner cases, it's already prohibited in K1 because
adaptation have a bit strange nature
(they don't represent any existing real function exactly)

^KT-55137 Fixed
2023-02-15 08:13:45 +00:00
Vladimir Sukharev e4d209cbde [K2] [KN-55977] Fix suspend type serialization
Merge-request: KT-MR-8328
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-17 13:07:21 +00:00
Mikhail Glukhikh a60eab7b47 FIR2IR: drop hacky computeFieldSymbolForCallableReference 2023-01-09 21:37:23 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
Mikhail Glukhikh 3a81174a4c FIR2IR: support static fake overrides (functions) #KT-53441 Fixed 2022-11-11 13:30:36 +00:00
Mikhail Glukhikh 1ad2ec302b FirOverrideChecker: don't report VIRTUAL_MEMBER_HIDDEN with invisible
#KT-53197 Fixed
2022-09-29 08:34:12 +00:00
Mikhail Glukhikh 036f9affd8 K2: link via signatures if -Xlink-via-signatures is set
Related to KT-53505
2022-09-14 10:15:22 +00:00
Mikhail Glukhikh 3ae75a5094 FIR2IR: generate annotations on fake override parameters #KT-53208 Fixed 2022-07-22 16:39:52 +00:00
Mikhail Glukhikh 5445f4043a K2: expand types during smartcasting to prevent redundant intersections
#KT-53184 Fixed
2022-07-22 16:39:52 +00:00
Mikhail Glukhikh 70e15b281c K2: fix exception in deserializer for external setter #KT-53031 Fixed 2022-07-13 17:06:14 +00:00
Mikhail Glukhikh c92d685415 FIR: postpone callable reference candidate in default argument case
#KT-53019 Fixed
2022-07-12 12:22:34 +00:00
Victor Petukhov 9f31f074da [FE 1.0] Take care callable reference candidates with recursive candidate return type
^KT-51844 Fixed
2022-05-09 19:23:43 +00:00
Victor Petukhov ec6ec20728 [FE 1.0] Fix subtyping for captured integer literal types
^KT-50877 Fixed
2022-05-09 19:23:42 +00:00
Mikhail Glukhikh 9bd6a9c069 FIR: handle 'SinceKotlin' as a special kind of deprecated
#KT-51850 Fixed
2022-04-06 12:51:20 +00:00
Pavel Kunyavskiy 7ba4d9e1f0 Rework nullability in IR 2022-03-30 06:27:59 +00:00
Mikhail Glukhikh 981f8b1871 FIR: implement resolve of unqualified enum references in when
See KT-16768
2022-02-22 22:13:06 +03:00
Mikhail Glukhikh febf336d23 IrConstTransformer: transform constants also inside call children 2021-12-13 16:24:59 +03:00