151 Commits

Author SHA1 Message Date
Mikhail Pyltsin
9058e87a79 [java-highlighting] IDEA-302714. 'switch' statement does not cover all possible input values: false positive with super
GitOrigin-RevId: 2582f6b318357bd44f154bc91e8b837c88f87cd8
2023-03-02 18:08:10 +00:00
Mikhail Pyltsin
632183ab2a [java-highlighting] IDEA-302721. an empty 'switch' statement with records is not highlighted
GitOrigin-RevId: 900da600f9e207a5bc8f13542909be495ed3c183
2023-03-01 17:51:33 +00:00
Andrey Cherkasov
5fbc9b814a [java-highlighting] IDEA-313989 'switch' expression does not cover all possible input values: false positive
GitOrigin-RevId: 8292fda6965d42e4034c2f6a8c2ee8d185133654
2023-02-24 13:26:54 +00:00
Tagir Valeev
9b9e75531c [java-highlighting] Fix pattern type inference for wildcard-parameterized patterns
Also: fix and unify unchecked warnings for patterns
#IDEA-312000 fixed

GitOrigin-RevId: 8f47b72ec308cc9b089571ddc486d275d5d8ff4e
2023-02-07 12:02:04 +00:00
Andrey Cherkasov
48c32d8c10 [java-highlighting] Cannot resolve symbol: false negative in 'switch' statements and expressions
IDEA-311341

GitOrigin-RevId: f3010ae23ade75f3a6ab4dcf31ae27b9c539f3f1
2023-01-26 10:14:57 +00:00
Andrey Cherkasov
59d7b0c4c5 [java-highlighting] switch has both an unconditional pattern and a default label: false negative
IDEA-310722

GitOrigin-RevId: 1dfaeb0a35715757272dfaa4f10dc0e7ed628101
2023-01-17 18:02:27 +00:00
Andrey Cherkasov
12c6c8f2c5 [java] Highlight "Duplicate unconditional pattern" instead of "Label is dominated by a preceding case label"
IDEA-310687

GitOrigin-RevId: edc302b7042dd5cfc79903644dadcf3238bc97c2
2023-01-17 18:02:24 +00:00
Andrey Cherkasov
62ebc2616f IDEA-310575 A total pattern is now called an unconditional pattern
GitOrigin-RevId: 306b7b66d45e6f92bc2629db93241630156e5164
2023-01-15 05:39:37 +00:00
Tagir Valeev
4b5400beb3 [java-highlighting] Report ':' or '->' expected instead of ':' expected when parsing switch case (IDEA-309553)
GitOrigin-RevId: 1820e2fc1045450cee2abe0064b6a12576bd5abc
2023-01-11 16:33:07 +00:00
Andrey Cherkasov
b9c8ca5b1f [java-highlighting] Move tests
GitOrigin-RevId: d2a25443ec1006f7f4381695fc22feeaf4c644d3
2023-01-06 19:26:56 +00:00
Andrey Cherkasov
f884fcde64 [java-highlighting] foreach patterns: applicability and exhaustiveness
GitOrigin-RevId: f136201891af221d3ffa9065363da9894bf56e55
2023-01-06 19:26:51 +00:00
Andrey Cherkasov
4c2d17acba [java-highlighting] Pattern matching for switch (fourth preview): illegal falling-through
IDEA-309572

GitOrigin-RevId: 2dbf9102e0302fa84ad358c9afb0b21df7a877eb
2023-01-04 18:41:04 +00:00
Andrey Cherkasov
b56985873a [java-highlighting] JEP 432: A 'case null, default' label dominates all other switch labels
A 'default' label dominates a case label with a case pattern, and it also dominates a case label with a 'null' case constant.

IDEA-309549

GitOrigin-RevId: 6877992c530e41a1200ea7c20d6405da4be0324b
2022-12-29 00:57:49 +00:00
Andrey Cherkasov
608c99ed4d [java-highlighting] Display error if record patterns in for-each loops aren't available (IDEA-309351)
GitOrigin-RevId: 0919de47769682aff2c016920175a74d89c9f7b6
2022-12-26 13:39:22 +00:00
Andrey Cherkasov
d9087ea8cb [java-highlighting] Update error message in accordance to that parenthesized patterns are present in Java 19 preview
IDEA-304626

GitOrigin-RevId: d5fef52aa028be12b13db2166014b51b77291352
2022-11-15 19:34:41 +00:00
Andrey Cherkasov
3631003713 [java] Fix highlighting for generic record patterns
IDEA-304626

GitOrigin-RevId: 178a56e1c9b57b0d19b407170ce891ba9c1f9a3f
2022-11-15 16:50:58 +00:00
Andrey Cherkasov
2f7a5590b8 [java-highlighting] Variable might not have been initialized: false negative on 'when' expression
IDEA-305354

GitOrigin-RevId: 0ad393dbe7f9245cb287320581ab4fe1fefaa273
2022-11-07 03:40:25 +00:00
Andrey Cherkasov
4bbfaee267 [java] more tests
GitOrigin-RevId: cadfc50eb18ecb5db9f1a7c7622e76b7ea220b8c
2022-10-28 22:42:20 +00:00
Alexandr Suhinin
eb23765538 IDEA-302550 [java highlighting] switch exhaustiveness: consider permitted classes inside pattern check
GitOrigin-RevId: 14c74921fb72a7915ad0c017cc1cafbab1ee5534
2022-10-28 13:33:18 +00:00
Andrey Cherkasov
e8601d38c9 [java-highlighting] Fix 'com.intellij.util.IncorrectOperationException' for unresolved record patterns with wildcards
GitOrigin-RevId: 38275822a28cd1b11f8f87165245d16aba8785cc
2022-10-28 12:22:04 +00:00
Tagir Valeev
55584525ea [java-inspections] IDEA-304462 Nested total pattern is reported as always true, despite component might be null
GitOrigin-RevId: 0dcd2be4710c6d7f6ed87b7b05ae7ddf2fca14f7
2022-10-25 15:51:57 +00:00
Andrey.Cherkasov
d572da2539 [java-highlighting] the variable declared inside the guard can be non-final
IJ-CR-95276
IDEA-301356

GitOrigin-RevId: 627f6a4cc7c6c780931f6c99a3858bdced054d28
2022-10-13 13:08:43 +00:00
Andrey.Cherkasov
e3ef393494 [java-highlighting] Parenthesized patterns are present in Java 19 preview
IDEA-303229

GitOrigin-RevId: a195e7fd3657a94f1dbd4d7868b2508878448983
2022-10-06 16:21:45 +00:00
Andrey.Cherkasov
c66a135e25 [java-highlighting] "'switch' has both a total pattern and a default label": false positive
IDEA-302945

GitOrigin-RevId: c88e5071b36c3a132b4bf15c5c3710677bae8d5d
2022-10-03 11:02:14 +00:00
Andrey.Cherkasov
e07cf816af [java-highlighting] pattern of any type is not applicable at primitive types (JEP 427)
IDEA-302943

GitOrigin-RevId: a47bb507a501be23d03f84cb4891a66fec13fb0f
2022-10-03 11:02:10 +00:00
Andrey.Cherkasov
3a072cc6a2 [java-highlighting] Check if 'when' expression have type boolean or Boolean
GitOrigin-RevId: 81692debf6a10d70406065967ceaeebf6a2cc31d
2022-09-28 21:21:16 +00:00
Alexandr Suhinin
1f1eead389 IDEA-301787 [java-19 highlighting]: fix exhaustiveness for typed parameters
GitOrigin-RevId: a4c266bd37d1af63c9650e7ef402907f9c30b26e
2022-09-23 12:26:36 +00:00
Andrey.Cherkasov
bb71856ac0 [java-highlighting] It is a compile-time error if a when expression is a constant expression with the value 'false'
IDEA-301355

GitOrigin-RevId: a67f6921d44d0acf8c8bdf1d42927d7c8ff42e1e
2022-09-08 14:33:42 +00:00
Andrey.Cherkasov
1c11e442b0 [java-highlighting] Check if variable within pattern guard is effectively final
IDEA-301356

GitOrigin-RevId: 0b8146783be915b5a05a48801151bf64176e39d8
2022-09-08 14:33:39 +00:00
Alexandr Suhinin
67998a0600 [java error highlighting] fix: highlight illegal fall-through when default case exists
GitOrigin-RevId: 686b3613a6fdf05d7e4d9af5e94fe977653ed9bd
2022-09-01 09:46:20 +00:00
Andrey.Cherkasov
aeecaa845d [java-highlighting] Fix 'com.intellij.util.IncorrectOperationException' for unresolved record patterns
IDEA-301036

GitOrigin-RevId: 476813a2f4f1f488087c21ce926850a19b504cfc
2022-08-31 23:05:37 +00:00
Alexandr Suhinin
5506746a24 IDEA-297405: don't check not applicable types for exhaustiveness
GitOrigin-RevId: 4a5f15a68805070c1d7609eb47ba5d7e9f57dcf6
2022-08-31 09:33:58 +00:00
Alexandr Suhinin
db97df0ad1 IDEA-300124: highlight raw deconstruction patterns
GitOrigin-RevId: 8c5c34e21d9952a67b880868fe3ac600f058c582
2022-08-24 11:36:18 +00:00
Alexandr Suhinin
c405ff9f52 IDEA-298345: check exhaustiveness for nested deconstructions
GitOrigin-RevId: a954cac5973ed9df086246eba980524f8e483cb0
2022-07-28 08:26:20 +00:00
Alexandr Suhinin
305a4a4c95 IDEA-298317: don't highlight null as dominated
GitOrigin-RevId: e1bd7a6fdaa683b652295866bfd68fa305748d8c
2022-07-28 08:26:17 +00:00
Alexandr Suhinin
3a63092336 IDEA-298324: report mismatch errors in recursive deconstruction patterns
GitOrigin-RevId: 31271e8a4020c9e3d2fed77f1f32f4a69e3b07cb
2022-07-21 11:01:18 +00:00
Alexandr Suhinin
32f72c122c fix: broken recursive call
GitOrigin-RevId: 15ed2adedae203bf2c1dbb2170f45b49c361a2ce
2022-07-21 11:01:14 +00:00
Alexandr Suhinin
c68519d5f1 IDEA-297396: fix illegal fallthrough for pattern guards
GitOrigin-RevId: 41a247c8a52df15c86fcd0acc934308034a2da65
2022-07-20 19:59:35 +00:00
Alexandr Suhinin
c7d05b20a8 IDEA-297405: check exhaustiveness in switches with deconstruction pattern
GitOrigin-RevId: 1a1724a0842f7c387524989d6178283891dfc7cb
2022-07-20 19:59:32 +00:00
Alexandr Suhinin
c1c07294bd IDEA-298282: report error if switch has default case element and unconditional deconstruction
GitOrigin-RevId: a4ee7da8085f322c4211ffb3bb7e4898a0b73f36
2022-07-20 19:59:30 +00:00
Alexandr Suhinin
10e2fcda21 IDEA-297389: highlight mismatched deconstruction patterns
GitOrigin-RevId: 0a53c42751596aad5298520a0f23c731d7449fd5
2022-07-20 19:59:27 +00:00
Alexandr Suhinin
544ebb9855 IDEA-297404: fix domination highlighting for DeconstructionPattern
GitOrigin-RevId: 67bebc00df3c4d6864d835c30865e1384ae5be62
2022-07-20 19:59:24 +00:00
Roman Ivanov
c99e74d9b4 [java] change wording in the error for outdated patterns
GitOrigin-RevId: 5a0107985349b49236cae90c1ed82bda1aa43651
2022-06-30 10:08:46 +00:00
Roman Ivanov
a124d59a71 [java] highlight outdated patterns in java 19 preview
GitOrigin-RevId: 4c574402576701c81a1212619267c18e05233ff0
2022-06-28 16:44:54 +00:00
Roman Ivanov
4c02fc85a9 [java] check pattern guards and record patterns feature in HighlightVisitorImpl
GitOrigin-RevId: 691663582652efe8e54bcc50a5f99ae51da81a72
2022-06-28 15:41:21 +00:00
Vladimir.Petrenko
d7792746d6 IDEA-290334 - fix red code warnings regarding patterns in switch/instanceof for older java versions
GitOrigin-RevId: 9656a5b1db7f35788b8acaad4659804fe2305660
2022-03-15 07:28:26 +00:00
Ilyas Selimov
f47870ae8a EA-447738 [patterns for switch] - handle the case when permits list contains unresolved reference type
GitOrigin-RevId: 5a0adb3d51d548f40771a336d3fcbe76305be524
2022-02-07 07:09:53 +00:00
Ilyas Selimov
3d5bbea95f IDEA-283367 - [Patterns for switch] - fixed completeness for parameterized sealed hierarchies
GitOrigin-RevId: 4f5c59fe1e38b08f86974682b8adf7d70f0274b5
2022-01-24 12:28:36 +00:00
Ilyas Selimov
4011c84778 IDEA-283367 - [Patterns for switch] - implemented "any pattern is dominated over const label element"
GitOrigin-RevId: f6e6c9214ad854fa0506e587f43075fabaf8e979
2022-01-24 12:28:33 +00:00
Anna Kozlova
2aa9ed116e [java] switch expressions: allow null label with any non-primitive type (IDEA-282339)
GitOrigin-RevId: d6438daeba88dc37ec34509e331394a87cf1cd8d
2021-11-14 18:48:39 +00:00