Commit Graph

23 Commits

Author SHA1 Message Date
Roman Efremov 23ae617ea0 Fix inaccurate report of DEPRECATED_ACCESS_TO_ENTRY_PROPERTY_FROM_ENUM
Add separate diagnostic for the case when it is reported on qualifiers.

^KT-64488
2024-02-27 11:22:35 +00:00
Roman Efremov 02b5fed389 Fix inaccurate report of DEPRECATED_ACCESS_TO_ENTRY_PROPERTY_FROM_ENUM
It can be reported not only from within the enum, but also from
top-level functions. Add separate diagnostic for such cases.

^KT-64488
2024-02-27 11:22:35 +00:00
Roman Efremov 34d87465ac [Test] Add test for Enum.entries shadowing when property is imported
This is similar to KT-64488 but without context receivers.
Warning message "access ... from within the enum" is also incorrect
here.

^KT-64488
2024-02-27 11:22:35 +00:00
Mikhail Glukhikh 3ff2c7d6f7 K2: introduce custom Enum.entries migration checkers
Related to KT-56623, KT-56587
#KT-59344 Fixed
2023-08-31 13:29:02 +00:00
Mikhail Glukhikh e0d68fc93e K2: introduce FirEnumEntriesRedeclarationChecker (KT-59344) 2023-08-31 13:29:01 +00:00
Mikhail Glukhikh 4b7ab54d95 FE: fix test data after commit clash 2023-06-21 19:25:14 +02:00
Mikhail Glukhikh 78f4d399d4 FE: add test to ensure Java entries static field is resolved normally 2023-06-21 13:08:01 +00:00
Mikhail Glukhikh 905e1dcd3b K2: introduce prioritized enum entries resolve by a 2.1 feature
Related to KT-48872
2023-06-21 13:08:01 +00:00
Mikhail Glukhikh b92f1e2036 K2: de-prioritize access to Enum.entries properly #KT-57954 Fixed 2023-06-21 13:08:00 +00:00
Mikhail Glukhikh 978d52d05b K2: render additionally *s for static references
This commit allows to distinguish static VS non-static things
inside FIR_DUMP, e.g. static synthetic Enum.entries with
enum entry Enum.entries
2023-06-21 13:08:00 +00:00
Mikhail Glukhikh 70899d492d K2: reproduce KT-57954 and reorganize tests around enum entries warnings
In particular, here we add FIR_DUMP to all enum entries tests with
some deprecation diagnostics and the feature on, and remove all txt-files
2023-06-21 13:08:00 +00:00
Vsevolod Tolstopyatov 5b474bc5d3 Stabilize EnumEntries stdlib signature
* Also, mention implementation details of EnumEntries to enable safe uses of a 'EnumEntries' as a set
* Fix testdata for opt-in marker in enum entries

^KT-58548 fixed

Merge-request: KT-MR-10037
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-05-11 09:18:44 +00:00
Denis.Zharkov fe5adab652 K2: Avoid inference diagnostics when arguments are already error typed
For example, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER

It became especially relevant after 0e84bf2053
that together with later commits bring a lot of unnecessary
NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic
2023-02-15 08:13:41 +00:00
Mikhail Glukhikh 41966a745e Enum entries: add new tests with language feature ON & fix checker 2023-01-24 12:46:00 +00:00
Mikhail Glukhikh c534c54a1c FE: use WITH_STDLIB directive for Enum.entries tests 2023-01-24 12:46:00 +00:00
Mikhail Glukhikh 565adf3075 K1: don't filter Enum.entries in tower to report error later
After this commit we:
- preserve Enum.entries synthetic property in tower even in case the bound feature is OFF
- report an error on Enum.entries call in specific checker if the feature is OFF
- give this synthetic property lower priority, no matter feature ON or OFF

#KT-55251 Fixed
2023-01-24 12:45:59 +00:00
Mikhail Glukhikh 793df6234e FE: add test for KT-55251 2023-01-24 12:45:59 +00:00
Mikhail Zarechenskiy dc9193893e Add a test to check Java behavior with entries members
Note that there is a questionable behavior that will be fixed later.

 Right now it's not fully clear because for the same situation in Kotlin, the compiler reports warnings at declaration-site and it's not possible to do so for Java

 ^KT-53153
2023-01-04 13:17:11 +00:00
Mikhail Zarechenskiy 3cdbb4876f Add a warning for conflicting entries member
^KT-53153
2023-01-04 13:17:11 +00:00
Mikhail Zarechenskiy cf4b415a20 Add a warning for name shadowing case with Enum.entries
^KT-53153
2023-01-04 13:17:11 +00:00
Mikhail Zarechenskiy c70a1b1884 Add a warning for a custom Enum.entries entry
^KT-53153
2023-01-04 13:17:10 +00:00
Mikhail Zarechenskiy 989fc886e1 Add a warning for a user-defined entries property call
^KT-53153
2023-01-04 13:17:10 +00:00
Mikhail Zarechenskiy 695a538529 Move test about Enum.entries to a more specific folder 2023-01-04 13:17:10 +00:00