Commit Graph

5013 Commits

Author SHA1 Message Date
Victor Petukhov 559bedf5ae Continue processing not builder inference stub variables in the type checker during computing common super type
^KT-47148 Fixed
2021-06-15 17:40:56 +03:00
Victor Petukhov 85f4cec948 Don't ignore Java nullability annotations without target and unresolved when nullability qualifiers are extracted, with enabled type enhancement improvements
^KT-47276 Fixed
2021-06-15 17:28:25 +03:00
Victor Petukhov 1b82227308 Don't do new captured type specific checks for old ones in the type checker
^KT-47143 Fixed
2021-06-15 10:07:20 +03:00
Mikhail Glukhikh ceb527c5e4 FIR: add OptIn checkers draft + some annotation / SinceKotlin utilities 2021-06-11 22:03:32 +03:00
Mikhail Glukhikh 5a3f84c8fa Add forgotten test data file 2021-06-11 13:17:01 +03:00
Tianyu Geng 90a0c9bb25 FIR IDE: quickfix to add override keyword
Also enables more tests that covers previous quickfixes
2021-06-10 19:05:33 +02:00
Tianyu Geng 3c8693758b FIR: handle synthetic properties with unstable smartcast
Synthetic properties from Java getter/setters need to be specially
handled so that candidates from such symbols are marked with unstable.
2021-06-10 16:01:14 +03:00
Tianyu Geng ce767046eb FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-10 16:01:13 +03:00
Tianyu Geng 2bb7ef9747 FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more
places during DFA. Now mutable properties, property with custom getters,
delegated properties, etc are also treatd as a `RealVariable`. In
general this is needed in order to carry out smartcast computation in
order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side
effects that improves behavior of some test files.
2021-06-10 16:01:11 +03:00
Andrey Zinovyev 371452d49a [FIR] Fix CANNOT_BE_IMPORTED for java static methods/variables 2021-06-10 11:28:34 +03:00
Tianyu Geng 32f55a2269 FIR checker: report VIRTUAL_MEMBER_HIDDEN 2021-06-09 16:27:49 +03:00
Andrey Zinovyev ddc9c1bd1b [FIR] Fix extension property reference resolution
On type with star projection
#KT-44372 Fixed
2021-06-09 15:15:28 +03:00
Mikhail Glukhikh 2b4ea8e6e7 Add forgotten test data 2021-06-09 14:59:57 +03:00
Andrey Zinovyev 972cd9e9e7 [FIR] Fix PACKAGE_CANNOT_BE_IMPORTED diagnostic
Don't report it when there is a function/property with the same name as
package
2021-06-09 09:02:49 +03:00
Denis.Zharkov 2653565f56 FIR: Support exhaustive whens on subjects of intersection type 2021-06-08 18:59:48 +03:00
Mikhail Glukhikh 63bc3f9708 Forbid experimental markers on various targets #KT-45845 Fixed
In this commit we forbid experimental markers on:
- local variables
- value parameters
- fields, including delegate fields
- property getters
2021-06-08 11:37:34 +03:00
Mikhail Glukhikh eb9c658c1c OptIn: handle usages via type aliases properly 2021-06-08 11:37:33 +03:00
Mikhail Glukhikh 702d839c66 Forbid TYPE and TYPE_PARAMETER as possible OptIn targets 2021-06-08 11:37:31 +03:00
Mikhail Glukhikh 603afe89a2 Forbid using experimental markers on override declarations
#KT-45844 Fixed
2021-06-08 11:37:30 +03:00
Mikhail Glukhikh bb9efab3c4 Forbid experimental markers on getter #KT-45845 Fixed 2021-06-08 11:37:29 +03:00
Mikhail Glukhikh 0a670bf055 Report EXPERIMENTAL_API diagnostics on various implicit usages
#KT-32443 Fixed
#KT-22852 Fixed
2021-06-08 11:37:28 +03:00
Mikhail Glukhikh d8d38862d9 Introduce EXPERIMENTAL_ANNOTATION_WITH_WRONG_RETENTION diagnostic
#KT-22941 Fixed
2021-06-08 11:37:27 +03:00
Mikhail Glukhikh 7393465696 Don't report EXPERIMENTAL_OVERRIDE_ERROR on annotated local functions
#KT-31728 Fixed
2021-06-08 11:37:26 +03:00
Andrey Zinovyev c507d1c938 [FIR] Implement OPERATOR_RENAMED_ON_IMPORT diagnostic 2021-06-08 08:18:56 +00:00
Andrey Zinovyev 7c669b65c3 [FIR] Implement CONFLICTING_IMPORT diagnostic 2021-06-08 08:18:55 +00:00
Andrey Zinovyev 14789cb9e5 [FIR] Implement CANNOT_BE_IMPORTED diagnostic 2021-06-08 08:18:54 +00:00
Andrey Zinovyev bf153ab0f0 [FIR] Implement CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON diagnostic 2021-06-08 08:18:54 +00:00
Denis.Zharkov 592256976e FIR: Fix inference of builder-inference function from expect type
Previously, such calls were being completed with FULL mode and incorrect
INFERENCE_NO_INFORMATION_FOR_PARAMETER has been reported
2021-06-07 15:25:57 +03:00
Denis.Zharkov 18e93b50d9 FIR: Fix loading read-only collection Java types with incorrect variance 2021-06-07 15:25:56 +03:00
Denis.Zharkov 5ade831665 FIR: Fix INFERENCE_NO_INFORMATION_FOR_PARAMETER on type alias with generic expansion
^KT-46996 Fixed
2021-06-07 15:25:55 +03:00
Denis.Zharkov d932d5b0a5 FIR: Support adding expect type to calls in foo() as R position
See https://kotlinlang.org/docs/whatsnew12.html#support-for-foo-as-a-shorthand-for-this-foo
2021-06-07 15:25:51 +03:00
Denis.Zharkov 6136526a3a FIR: Avoid reporting inference errors from DelegatedPropertyConstraintPosition
All necessary diagnostics have already been reported through the checkers
2021-06-07 15:25:50 +03:00
Denis.Zharkov 0aca3a3737 FIR: Adjust test data after introduction of INFERENCE_NO_INFORMATION_FOR_PARAMETER
See previous commits for details
2021-06-07 15:25:47 +03:00
Denis.Zharkov c420957eac FIR: Report INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic 2021-06-07 15:25:45 +03:00
Victor Petukhov 2d3ed4b7da Update FIR test data 2021-06-04 13:25:10 +03:00
Ivan Kochurkin c4c2fbb5a0 [FIR] Implement RECURSIVE_TYPEALIAS_EXPANSION, CYCLIC_INHERITANCE_HIERARCHY diagnostics, fix stackoverlow exception in case if typealias points to type with type arguments 2021-06-03 20:41:58 +03:00
Mark Punzalan d1531f9cdd FIR: Choose a resolved candidate for augmented assignment when both
assign and operator candidates are unsuccessful.
2021-06-03 20:18:04 +03:00
Mark Punzalan 32bb64a225 FIR: Report UNSAFE_OPERATOR_CALL for augmented assignments (was
reporting UNSAFE_CALL).
2021-06-03 20:18:03 +03:00
Mark Punzalan 6de1000818 FIR: Report UNSAFE_INFIX_CALL for all infix-style calls, even if the
candidate is not an infix function.

This mirrors FE 1.0 (see
`AbstractTracingStrategy.reportUnsafeCallOnBinaryExpression()`) and
allows consistent handling for quickfixes on infix calls.
2021-06-03 20:18:01 +03:00
Victor Petukhov 1e5998e0ba Add constraints between two different stub variables instead of creating constraint error due to T1 isn't subtype of T2
^KT-44241 Fixed
2021-06-03 19:18:09 +03:00
Ivan Kochurkin da15f0ffe8 [FIR] Consider fullyExpandedType instead of original type in isSubtypeForTypeMismatch, consider lookupTag in isError method 2021-06-03 18:24:36 +03:00
Ivan Kochurkin 0b0a96a1d3 [FIR] Fix processing of nested type arguments, extract extractTypeRefAndSourceFromTypeArgument method to FirHelpers and use it from FirClassVarianceChecker and FirConflictingProjectionChecker 2021-06-03 18:24:35 +03:00
Ivan Kochurkin f081a6b4fa [FIR] Implement REDUNDANT_PROJECTION diagnostics, rename FirConflictingProjectionChecker -> FirProjectionRelationChecker, fix tests 2021-06-03 18:24:34 +03:00
Ivan Kochurkin 03e577bf98 [FIR] Implement CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION diagnostics, fix tests 2021-06-03 18:24:32 +03:00
Ivan Kochurkin b85846c0c0 [FIR] Fix location for CONFLICTING_PROJECTION diagnostics, extend conflictingProjection.kt with test sample 2021-06-03 18:24:29 +03:00
Victor Petukhov 19c07e048a Don't check suitability of a builder inference call if unrestricted builder inference is enabled
^KT-42139 Fixed
2021-06-03 17:28:40 +03:00
Dmitriy Novozhilov 0497f60af3 Revert "FIR DFA: store stability in RealVariable"
This reverts commit 62f7e8f7
2021-06-03 09:53:57 +03:00
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00
Tianyu Geng 84334b087c FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-02 13:19:12 +03:00
Tianyu Geng 62f7e8f71f FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more
places during DFA. Now mutable properties, property with custom getters,
delegated properties, etc are also treatd as a `RealVariable`. In
general this is needed in order to carry out smartcast computation in
order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side
effects that improves behavior of some test files.
2021-06-02 13:19:12 +03:00