Commit Graph

91 Commits

Author SHA1 Message Date
Nikolay Lunyak 0d19942d2c [FIR] Make reporting of local class diagnostics more consistent with K1
It would be nice to report more appropriate diagnostics at the
corresponding places, but right now it's more important to
fix greenness-redness problems. Plus, this is already how K1 works.

^KT-59900 Fixed
2023-08-31 13:07:00 +00:00
Kirill Rakhman 2a724787f0 K2: fix SUPERTYPE_NOT_INITIALIZED not being reported on object expressions ^KT-55597 Fixed 2023-01-04 15:09:26 +00:00
Kirill Rakhman 868fe913f1 reformat test data 2023-01-04 15:09:26 +00:00
Denis.Zharkov 2953e600ff K1: Deprecate incorrect callable references resolution behavior
^KT-54316 Related
^KT-54832 Fixed
2022-11-15 15:06:58 +00:00
Nikolay Lunyak fcd3e4f4c5 [FIR JS] KT-51740: Alter positioning of NO_VALUE_FOR_PARAMETER 2022-09-30 21:39:20 +03:00
Victor Petukhov 27fa632630 [FE 1.0] Update test data with new error type representation 2022-03-23 21:13:33 +00:00
Victor Petukhov ee728b6902 Use the new type inference for top-level callable reference resolution
^KT-47797 Fixed
^KT-47987 Fixed
^KT-45034 Fixed
^KT-48446 Fixed
^KT-13934 Fixed
2021-09-27 16:12:27 +03:00
Denis.Zharkov 6e6be7c953 FIR: Adjust test data
Currently, we've got two places where NO_COMPANION_OBJECT is reported
and they perform it kind of differently
2021-09-14 19:13:40 +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 5741374883 [FIR] Report UPPER_BOUND_VIOLATED only on checkers stage, fix detection of missing cases and testData 2021-06-25 20:57:45 +03:00
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00
Dmitriy Novozhilov 3fc7e0ed03 [FIR] Remove COMPARE_WITH_LIGHT_TREE from default directives of fir diagnostic tests 2021-05-20 20:20:40 +03:00
Mikhail Glukhikh 0f9f63400e FirSupertypesChecker: implement six more diagnostics 2021-05-13 16:13:43 +03:00
Andrey Zinovyev 0a68edf3bd [FIR][LightTree] More fixes in diagnostic positioning
Keep tree padding for modifiers
More REFERENCE_EXPRESSIONS kinds
Fix source for some call expressions
2021-04-20 18:13:01 +03:00
vldf 57d2eb5da2 Introduce FirFunctionReturnTypeMismatchChecker 2021-04-13 21:36:33 +03:00
vldf 24f1f1221e Introduce FirInitializerTypeMismatchChecker 2021-04-13 21:36:31 +03:00
Ivan Kochurkin ad9b962536 [FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE) 2021-04-12 23:49:55 +03:00
Tianyu Geng 761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +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
Tianyu Geng ae902e6fe5 FIR: fix source of callee reference in delegated constructor call
Previously the callee reference of a delegated constructor call is
always the same as the call itself. This violates the contract that no
two FIR elements can have identical sources.  In addition, this sets the
entire call expression as the source of the callee expression.

This change instead sets the proper constructor ref as the callee.

Also fixed EXPLICIT_DELEGATION_CALL_REQUIRED type. It should be an error
instead of a warning.
2021-03-29 12:45:27 +03:00
Tianyu Geng fb14b03824 FIR checker: skip error named reference if receiver is unresolved
Currently, FIR reports errors caused by previous resolution failure. For
example with unresolved `a` and `b` in code `a.b`, both `a` and `b` are
highlighted. FE1.0 only highlights `a` since it's the root cause. This
change applies this heuristics when reporting FirDiagnostics.
2021-03-29 12:45:27 +03:00
Jinseong Jeon bfc7eb7bab FIR checker: fix REFERENCE_BY_QUALIFIED positioning strategy to consider callable reference 2021-03-26 15:19:10 +03:00
Tianyu Geng 56bec6997c FIR checker: report SUPERTYPE_NOT_INITIALIZED
Combined this and the checker of
SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR together.

Also fixed SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR incorrectly
repoted as warning instead of error.
2021-03-24 17:48:39 +03:00
Mikhail Glukhikh 34c90aab3b FIR: introduce & use REFERENCE_BY_QUALIFIER positioning strategy 2021-02-19 18:24:46 +03:00
Tianyu Geng 6b453d9b23 FIR: implement checker for open members
Specifically,

1. NON_FINAL_MEMBER_IN_FINAL_CLASS
2. NON_FINAL_MEMBER_IN_OBJECT
2021-02-19 10:17:18 +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
Denis Zharkov a5545b96cb FIR: Fix ambiguity between current Companion and one from supertypes
Companion as qualifier should be found at static scope not a member one
2020-11-10 14:26:54 +03:00
Denis Zharkov a5a93d00a7 FIR: Rework delegation constructor calls resolution
Make it work independently of being called for inner class (as in FE 1.0)
2020-08-11 10:14:02 +03:00
Mikhail Glukhikh 8fd087a964 [FIR] Don't report duplicated UNRESOLVED_REFERENCE on annotation entries 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov 721b9b4d8c [FIR] Resolve annotations as calls 2020-08-04 08:59:14 +03:00
Nick 889324e972 [FIR] Ignore failing test, improve DiagnosticKind, fix UPPER_BOUND 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh ceaffb1e8b [FIR] Don't report duplicated errors in implicit primary constructors 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh 749346b73b [FIR] Don't report duplicated errors on default accessor error type refs 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh 0804c6a0f3 [FIR] Introduce TYPE_ARGUMENTS_NOT_ALLOWED & some other type errors
This commit introduces several different things, in particular:
- check type arguments in expressions
- new TypeArgumentList node to deal with diagnostic source
- ConeDiagnostic was moved to fir:cones
- ConeIntermediateDiagnostic to use in inference (?) without reporting
- detailed diagnostics on error type
2020-08-02 18:19:44 +03:00
Nick 26e3a111d6 [FIR] Add diagnostics for object related problems 2020-07-31 19:34:55 +03:00
Denis Zharkov f71a56e742 FIR: Fix test data after rewritten scope structure
Mostly, the semantics for statics/companions has been changed there
Fixed test data now is much closer to semantics of old FE
2020-05-15 16:04:44 +03:00
Dmitriy Novozhilov 7f02d57d88 [FIR] Correctly detect super type in delegated constructor call 2020-04-17 12:37:29 +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
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Mikhail Glukhikh 14204a842a Refactoring & clarification: implement new FIR tower resolver 2020-01-27 00:34:16 +03:00
Mikhail Glukhikh e644edfe84 [FIR] Handle unresolved callable references more correctly 2020-01-23 12:32:39 +03:00
Mikhail Glukhikh cef71b0349 [FIR] Add static / companion ambiguity to test data
This is temporary test data change until we prioritize this properly
2020-01-15 16:52:12 +03:00
Mikhail Glukhikh 9f1f743d55 FIR: fix test data after Make 'statics visible from nested classes' 2019-12-17 12:24:14 +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 bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
Dmitry Savvinov 76c651421b Deprecate visibility of static members inherited from Java
Now they are not visible by short name through companion objects, just
like classifiers in KT-21515

^KT-25333 In progress
2018-07-19 13:32:38 +03:00
Dmitry Savvinov d570b863ce Introduce deprecation of companion objects nested classes
Introdude deprecation as per KT-21515. Warning is reported on type
usage, that soon will became invisible. Quickfix by adding explicit
import is added.

Idea behind implementation is to mark scopes that are deprecated (see
ClassResolutionScopesSupport).

Then, during walk along hierarchy of scopes, look at deprecation status
of the scope that has provided this classifier.
Note that we also have to check if there are *some* non-deprecated
visibility paths (because we can see classifier by two paths, e.g. if
we've added explicit import) -- then this type reference shouldn't be
treated as deprecated.
2018-02-21 16:04:49 +03:00
Dmitry Savvinov ea72c76a37 [NI] Testdata changes after fixes in error types 2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy 328c67b9e8 Add separate diagnostic renderer results for tests with NI 2017-11-29 02:54:30 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00