Commit Graph

47 Commits

Author SHA1 Message Date
Denis.Zharkov 0bdea4f20a FIR: Do not create incorrect synthetic property 2021-10-26 18:45:59 +03:00
Denis.Zharkov 52c2908bb7 FIR: Fix another inconsistency with FE1.0 in synthetic properties resolution 2021-10-26 18:45:59 +03:00
Ivan Kochurkin 75b40e4b75 [FIR] Add INVISIBLE_SETTER 2021-10-03 17:10:06 +03:00
Mark Punzalan 42abc4a3af FIR: Don't use AnnotationUseSiteTarget.PROPERTY_GETTER when computing
deprecation from a callable reference use site.

Also fixed positioning of DEPRECATION(_ERROR) diagnostics on variable
assignments.
2021-09-29 19:39:17 +03:00
Tianyu Geng f35680f0a4 FIR checker: resolve property with protected getter and public setter
Assuming Java class `Super` has a protected `getName` method and a
public `setName` method.

Then, in a subclass of `Super`, FE1.0 allows calls to `setName` via the
property syntax if the property is protected and invisible due to
dispatch receiver is not `this` or `super`.
2021-09-29 19:39:12 +03:00
Tianyu Geng c7272f6986 FIR checker: SENSELESS_(COMPARISON|NULL_IN_WHEN)
Currently DFA does not set "definitely equal to null" for access to variables that got assigned `null`. For example, FIR should mark the following line as SENSELESS_COMPARISON due to `s = null` above.
 https://github.com/JetBrains/kotlin/blob/d1531f9cdd5852352c0133198706125dc63b6007/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt#L6

The problem is at https://github.com/JetBrains/kotlin/blob/7e9f27436a77de1c76e3705da7aa1fbe8938336b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt#L1104

For null assignment, ideally the type should be `Nothing?`. This is
addressed in a followup commit instead.
2021-08-06 22:57:16 +03:00
Ivan Kochurkin afb85026c4 Revert "[FIR] Implement INVISIBLE_SETTER"
This reverts commit b3d7ed56
2021-08-02 20:10:22 +03:00
Ivan Kochurkin b3d7ed569d [FIR] Implement INVISIBLE_SETTER 2021-07-30 18:07:34 +03:00
Andrey Zinovyev de3f31cf78 [FIR] Partial implementation of DEPRECATION(_ERROR) diagnostics
No support for inheritance deprecations
and deprecations in qualifier's parts
2021-07-07 16:19:28 +03:00
Ivan Kochurkin 59257e47c9 [FIR] Implement FUNCTION_CALL_EXPECTED 2021-06-29 22:39:22 +03:00
Ivan Kochurkin e57108d4e8 [FIR] Implement ASSIGNMENT_TYPE_MISMATCH, RESULT_TYPE_MISMATCH diagnostics, fix tests 2021-05-17 22:33:16 +03:00
pyos e6d923f65c FIR: rename HIDDEN to INVISIBLE_REFERENCE
Some of them should be INVISIBLE_MEMBER though
2021-04-21 16:18:21 +03:00
Ivan Kochurkin 4353365968 [FIR] Implement NULL_FOR_NONNULL_TYPE diagnostics, fix tests 2021-04-19 12:46:08 +03:00
Ivan Kochurkin ad9b962536 [FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE) 2021-04-12 23:49:55 +03:00
Dmitriy Novozhilov cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Mikhail Glukhikh 7d4eaefd36 FIR: report UNSAFE_CALL on dot when possible 2021-01-29 16:55:26 +03:00
Jinseong Jeon e72ddbcbfe FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE
To do so, inside the root cause of inapplicable candidate errors,
we will record expected/actual type of receiver, if any.
That will help identifying inapplicable calls on nullable receiver.
2021-01-29 16:54:23 +03:00
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00
Mikhail Glukhikh babc7845af FirSyntheticPropertiesScope: support case with derived getter
#KT-42496 Fixed
2020-10-14 16:33:44 +03:00
Victor Petukhov fcfabb70d5 Report invisible setter error if it's resolved to synthetic property of base class with public getter and protected setter
^KT-11713 Fixed
2020-09-30 14:35:43 +03:00
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00
Denis Zharkov 72b09ff323 FIR: Rename FirSuperTypeScope and reuse it for type parameter type
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Denis Zharkov 38922a84f1 FIR: Do not create synthetic properties for non-Java accessors
^KT-35495 Fixed
2020-06-11 11:01:43 +03:00
Mikhail Glukhikh 8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00
Mikhail Glukhikh cc0e39ebca [FIR] Support synthetic property setters 2020-02-10 18:51:34 +03:00
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00
Mikhail Glukhikh 84c8697720 [FIR] Do not build synthetics for static or Unit returning get 2020-01-23 12:32:40 +03:00
Mikhail Zarechenskiy 588259a034 Add feature that allows references to synthetic properties with warning
See KT-35933 for details
2020-01-16 09:37:34 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Mikhail Zarechenskiy 7541a3754d Move SAM constructors to synthetic scope 2017-05-05 21:30:35 +03:00
Valentin Kipyatkov ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov 41ee06ec96 Use parameter names in DescriptorRenderer 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov a1d760fc36 KT-10631 Consider creating a synthetic property even when the setter returns 'this'
#KT-10631 Fixed
2016-01-19 15:57:20 +03:00
Alexander Udalov 0ba0ea5e1f Report 'unsupported' on synthetic Java property references
#KT-8575 Open
2015-12-16 19:50:15 +03:00
Dmitry Petrov ef72c594c4 KT-1934 & KT-10197:
Naive approximation for fake overriding signature:
use upper bound for flexible types.
Check delegation errors.
2015-12-09 17:43:47 +03:00
Mikhail Glukhikh 811ba8110f Implicit receiver smart casts implementation and highlighting 2015-11-17 10:26:42 +03:00
Valentin Kipyatkov 8e6b0a26bb Synthetic extensions to take all annotations from original declarations
#KT-9387 Fixed
2015-10-20 10:12:34 +03:00
Denis Zharkov f0e3fd617d Adjust testData to CharSequence.length transformation 2015-10-14 20:39:35 +03:00
Valentin Kipyatkov 94d8e3f4b6 "is" getter naming allowed for non-booleans too 2015-09-29 18:32:25 +03:00
Valentin Kipyatkov 20bddce18d No synthetic property for false get-method like "issue()" 2015-09-29 18:32:25 +03:00
Valentin Kipyatkov 8f1a3043de Synthetic properties made locale-independant too 2015-09-29 18:32:25 +03:00
Denis Zharkov 4850fd10f0 Regenerate test data containing rendered descriptors
Introduced '@' after each annotation
2015-09-18 10:14:39 +03:00
Michael Nedzelsky bc5c9065d2 fix tests in org.jetbrains.kotlin.checkers 2015-09-08 02:04:32 +03:00
Valentin Kipyatkov d41e01c0e4 Added a test 2015-09-03 15:55:54 +03:00
Valentin Kipyatkov c3064e2b0f Synthetic extensions for non-public get/set java methods 2015-08-04 18:05:56 +03:00
Valentin Kipyatkov cb9ef9e1f0 Fixed nullability for return and parameter types in SAM-adapters 2015-08-04 18:05:56 +03:00
Valentin Kipyatkov 729085ec9a Iniital implementation of synthetic extensions for SAM-adapter functions (non-static only) 2015-08-04 18:05:55 +03:00