Commit Graph

5049 Commits

Author SHA1 Message Date
Dmitry Khalanskiy 4cbee3cde7 Fix KT-51478
The issue was that, when various context elements were available
to fulfill a need for an extension receiver, but none of them were
applicable to it, the compiler behaved the same way as if there
was no extension receiver at all.

https://youtrack.jetbrains.com/issue/KT-51478/Inapplicable-receiver-diagnostic-expected-when-there-are-two-context-receiver-candidates
2022-09-20 10:32:32 +00:00
Mikhail Glukhikh a4b2a8c4ea AbstractTypeChecker: fix special case with CapturedType as self type argument
#KT-53908 Fixed
May fix also KT-53271
2022-09-19 19:12:21 +00:00
Mikhail Glukhikh a70c4f15d6 K2: make not implemented checker more close to K1 logic
#KT-54049 Fixed
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh fe38089205 FE: add test reproducing KT-54049 2022-09-16 07:15:43 +00:00
Mikhail Glukhikh c4a48927d2 K1: report ABSTRACT_SUPER_CALL(_WARNING) also for 2+ steps to intersection
#KT-53953 Fixed
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh 3e5d5bcaa7 FE: add test reproducing KT-53953 2022-09-16 07:15:42 +00:00
Dmitriy Novozhilov 09429ff432 [FIR] Fix reporting of UNINITIALIZED_ENUM_COMPANION in all places 2022-09-16 07:12:20 +00:00
Dmitriy Novozhilov a2c12aa711 [FE] Always report UNINITIALIZED_ENUM_COMPANION_WARNING
^KT-54055
2022-09-16 07:12:19 +00:00
Dmitriy Novozhilov 3a5a6e5587 [FE] Add test for KT-54055 2022-09-16 07:12:19 +00:00
Dmitriy Novozhilov b86d5cf21a [FE] Postpone ProhibitAccessToEnumCompanionMembersInEnumConstructorCall till 1.9
^KT-49110
2022-09-16 07:12:19 +00:00
Pavel Mikhailovskii f643cdf90b Target KT-4107 (data objects) to Kotlin 1.9 2022-09-15 12:23:40 +02:00
Mikhail Glukhikh fb9b1ad0dc K1: implement warning for upper bound violated in type alias constructors
Partially implements KT-47473
2022-09-15 08:51:46 +00:00
pyos a0fa2cc275 FIR: regenerate LL API tests 2022-09-14 08:11:05 +00:00
pyos be5c4a91a4 FIR/FE1.0: keep flexibility when approximating local types 2022-09-14 08:11:04 +00:00
pyos adcbc5ec99 FE1.0: keep nullability when approximating local types (in 1.9)
Report an error that inference will change and type has to be provided
manually in other language versions, since the current behavior is an
unsoundness that can cause runtime NPEs while the new behavior may
silently change overload resolution.

^KT-30054 Fixed
2022-09-14 08:11:04 +00:00
pyos 062308c7c1 FIR: keep nullability when approximating local types
^KT-30054 Open
2022-09-14 08:11:04 +00:00
Ivan Kochurkin 6c4dafc23c Disable IgnoreNullabilityForErasedValueParameters for indefinite time, ^KT-53751 Fixed 2022-09-13 16:45:06 +00:00
Mikhail Glukhikh 5fcb18ac2b Revert "[FE 1.0] Resolve this and super calls through the new type inference infra"
This reverts commit bab8047bb3.
2022-09-13 09:09:01 +00:00
Mikhail Glukhikh f35cebbc25 Revert "[FE 1.0] Resolve special construct calls through the new type inference infra"
This reverts commit e66cc9a639.
2022-09-13 09:09:01 +00:00
Mikhail Glukhikh fc0058d471 Revert "[FE 1.0] Resolve constructor calls through the new type inference infra"
This reverts commit 0070c234ce.
2022-09-13 09:09:00 +00:00
Mikhail Glukhikh a9b8f6715b Revert "[FE 1.0] Resolve setters through the new type inference infra"
This reverts commit 6e191147b9.
2022-09-13 09:09:00 +00:00
Mikhail Glukhikh 8be08d903b Revert "K1: don't report UNRESOLVED_WITH_TARGET on hidden setters"
This reverts commit e20efc1398.
2022-09-13 09:08:59 +00:00
Pavel Mikhailovskii fe5a6fd511 Disallow non-local break/continue in crossinline lambdas 2022-09-12 13:26:19 +00:00
Mikhail Glukhikh 769a2ca9b1 K1: report ENUM_DECLARING_CLASS_DEPRECATED on enum entry properly
#KT-53807 Fixed
2022-09-12 10:45:23 +00:00
Alexander Udalov 686cd82327 Serialize OptIn to builtins, improve tests
Skip SOURCE-retention annotations in builtins serialization tests,
because otherwise the source analysis result can't be equal to the
metadata deserialization result.

 #KT-53073 Fixed
2022-09-09 21:31:39 +02:00
Mikhail Glukhikh e02fd8f4a8 FE: don't run builder inference in UNTIL_FIRST_LAMBDA mode
#KT-52927 Fixed
2022-09-09 12:44:39 +00:00
Pavel Mikhailovskii 85ab8b4ce1 KT-53783 Prohibit "expect data object" syntax 2022-09-07 12:53:24 +00:00
Dmitriy Novozhilov e048ffcf6d [FIR] Update tests due to KT-53873 2022-09-07 07:57:38 +00:00
Mikhail Glukhikh d8522a8967 FE: Add test for KT-53656 2022-09-06 17:57:02 +00:00
Simon Ogorodnik 05d486d55a Fix receiver inconsistency when builder inference restriction disabled
In 154e53c701 update of
extensionReceiverArgument in resolvedCall was accidentally moved into
language feature dependant block
2022-09-05 10:07:41 +00:00
Nikolay Lunyak 3d9c77efa8 [FIR] Add DNN checks
Merge-request: KT-MR-7000
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-01 14:25:07 +00:00
Denis.Zharkov 490382b77f Add test for KT-52782
It just demonstrates/fixate the current "broken" behavior in K1
that we unfortunately have and that is fixed in K2
2022-08-31 09:45:54 +00:00
Denis.Zharkov db1bd4f232 Add test for KT-53124
The issue itself is supposed to be fixed after eb19d39cbf reverted

^KT-53124 Fixed
2022-08-30 15:56:31 +00:00
Denis.Zharkov 42c41a1916 Revert "[FE 1.0] Build captured type's supertypes in an alternative way: use own projection type as a first supertype, then supertypes from the corresponding type parameter's upper bounds"
This reverts commit eb19d39cbf.
2022-08-30 15:56:30 +00:00
Denis.Zharkov f4a3ab877f Add test for parsing issue KT-53719
^KT-53719 Related
2022-08-30 11:21:51 +00:00
Denis.Zharkov 3d7969ec8f Revert "KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing"
This reverts commit 2053363def.

^KT-35811 Open
2022-08-30 11:21:50 +00:00
Denis.Zharkov 211d662708 Revert "KT-8263: Conditional operators are not parsed correctly"
This reverts commit ec8da2033c.

For the reason for the revert see KT-53719

^KT-8263 Open
^KT-53719 Fixed
2022-08-30 11:21:50 +00:00
Simon Ogorodnik 154e53c701 K1: add diagnostic BUILDER_INFERENCE_STUB_RECEIVER
It's reported on receivers in extension function calls with stub type,
as such calls can shadow members of finalized stub types causing
change of resolve when corresponding type argument specified explicitly

It works by checking extension receiver during call resolution parts run
That way we can easily detect if we found an extension applicable to
stub receiver and report call diagnostic for it

KT-53739
2022-08-30 10:19:26 +00:00
Simon Ogorodnik 105358dcf6 K1: add diagnostic BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION
Let's call builder lambdas (BL) a lambda that has non-fixed input type
projection at the moment of lambda arguments analysis, such lambdas
is a subject to be analyzed with builder inference
Due to bug in constraint system joining algorithm, currently system
of two or more such lambdas may lead to unsound type inference

Diagnostic added here should be reported in case when there are two
BL that shares a common constraint system, while not annotated with
@BuilderInference, as a protection against aforementioned bug

It's reported by ConstraintSystemCompleter when such situation has
occurred during builder inference phase, it is the same place that
decides wherever lambdas is subject to builder inference or not

KT-53740
2022-08-30 10:19:25 +00:00
Mikhail Glukhikh f6ad6fb816 Add test for stub type receiver and for KT-53639 2022-08-30 10:19:24 +00:00
Mikhail Glukhikh 5cbecd276c FE: add test reproducing builder inference problem from KT-53422 2022-08-30 10:19:23 +00:00
Ilya Gorbunov 6aff3c6d07 Update misc test data after introducing rangeUntil member #KT-52933 2022-08-24 22:22:54 +00:00
Mikhail Glukhikh b78106e437 Don't report INFERRED_..._INTO_EMPTY_INTERSECTION with explicit arguments 2022-08-19 14:01:38 +00:00
Mikhail Glukhikh a6b90fcb8e Add a test with false positive "inferred into empty intersection"
Related to KT-50232
2022-08-19 14:01:37 +00:00
Mikhail Glukhikh fb1c80a7c9 K2: discriminate synthetic 'Enum.entries' during resolve 2022-08-19 10:08:11 +00:00
Mikhail Glukhikh 68ca453467 K2: don't report REDECLARATION on Enum.entries 2022-08-19 10:08:10 +00:00
Mikhail Glukhikh 730de8fd7c K1/K2: add test for enum class with 'entries' entry 2022-08-19 10:08:09 +00:00
Iven Krall ec8da2033c KT-8263: Conditional operators are not parsed correctly 2022-08-16 10:00:54 +00:00
Iven Krall 2053363def KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing 2022-08-16 10:00:53 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00