Commit Graph

99 Commits

Author SHA1 Message Date
Anastasia.Nekrasova 00119c6a97 [K2] Disappeared UNSUPPORTED
Prohibit named parameters in function types in supertype position

^KT-59881
2023-11-28 07:55:15 +00:00
Kirill Rakhman fbf68a5bcc [FIR] Narrow down range of NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER
This uses the same approach as
INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION where we use a visitor
to find a call to a symbol that contains the type variable in question.

#KT-56140 Fixed
2023-09-22 13:49:59 +00:00
Kirill Rakhman e7c213e06e [FIR] Report separate error for delegated constructor call to interface
#KT-59216 Fixed
2023-07-04 16:00:45 +00:00
Kirill Rakhman 3c66ae0f8b [FIR, LT] Report syntax error by traversing LT after parsing
#KT-57756 Fixed
2023-05-05 09:34:24 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Ilya Kirillov b6481ed891 [FIR] do not use FirValueParameter for function type parameter
As it is a different abstraction, introduced FirFunctionTypeParameter instead

Also, fix syntax checkers for function type parameter

^KT-55035 fixed
2022-11-21 16:17:51 +00:00
Ivan Kylchik 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03:00
Roman Golyshev 32fa2fc476 [FIR] Resolve receiver in qualified expressions with no selector
In qualified expression like `foo().`, selector expression is null.
Because of that the whole expression was marked as an error FIR
expression, and `foo()` part was not resolved at all (including
arguments and everything else).

This commit fixes the problem by providing receiver's FIR expression
as an underlying expression for error FIR expression. That way
it will be seen by all resolve transformers and will be successfully
resolved.

^KTIJ-21484 Fixed
2022-04-12 10:55:12 +00:00
Victor Petukhov 27fa632630 [FE 1.0] Update test data with new error type representation 2022-03-23 21:13:33 +00:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Dmitriy Novozhilov ff7eb79bb1 [FE 1.0] Prohibit call of constructor of functional supertype
^KT-46344
^KT-50730 Fixed
2022-01-14 14:26:50 +03:00
Ivan Kochurkin 9f7a8c3948 [FIR] Implement ILLEGAL_SELECTOR 2021-06-29 22:39:23 +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 ddbdfafa79 Remove OI/NI attributes from test data 2021-05-25 13:28:27 +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
Andrey Zinovyev b9ae22207e [FIR] Fix tests data for diagnostic tests
For tests failed after light tree changes
2021-04-20 18:13:03 +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
Mikhail Glukhikh 818c54e3a6 FIR: report ABSTRACT_*_NOT_IMPLEMENTED on appropriate intersections 2021-04-09 14:52:34 +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 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
Tianyu Geng d6907222cd FIR: pass the qualified access source when reporting ErrorNamedReference
Currently if there is an error in a function call, FIR would report the
entire expression if this call is qualified, but *only* the name if it's
not qualified. For example, assume the following two calls are all
contains some errors.

```
a.foo(1,2,3)
^^^^^^^^^^^^
bar(1,2,3)
^^^
```

The entire call of `foo` is reported since it's qualified. But only the
reference `bar` is reported since it's not qualified. This limits the
usage of position strategies because the IDE does not allow position
strategies to go outside of the initially reported PSI element
(org.jetbrains.kotlin.idea.fir.highlighter.KotlinHighLevelDiagnosticHighlightingPass#addDiagnostic).

This change passes both the original error named reference and the
surrounding qualified access expression and defer the decision of which
to use to the reporting logic.

For unresolved reference and checks on `super` keyword, the position
strategy should not highlight the surrounding parentheses. Hence a new
position strategy `REFERENCED_NAME_BY_QUALIFIED` is added.

In addition, this change also has the following side effect

* some diagnostics are no longer reported when there is a syntax error
  since the higher level structure does not exist when there is a syntax
  error
2021-03-29 12:45:27 +03:00
Tianyu Geng e1c80ac75c FIR checker: introduce NO_(GET|SET)_METHOD
Besides introducing new diagnostics, this commit unifies source usages
for array accesses in PSI & LT.
2021-03-24 16:25:01 +03:00
Jinseong Jeon e009b71f88 FIR checker: report uninitialized member/extension properties 2021-03-04 17:56:29 +03:00
Mikhail Glukhikh 34c90aab3b FIR: introduce & use REFERENCE_BY_QUALIFIER positioning strategy 2021-02-19 18:24:46 +03:00
Jinseong Jeon 9341ca3004 FIR checker: introduce top-level function checker 2021-01-27 19:46:05 +03:00
Jinseong Jeon fa0b933bc8 FIR checker: add diagnostics for missing/ambiguous component calls 2021-01-21 16:06:10 +03:00
Ilya Kirillov 16cd2f08fe FIR: preserve delegatedTypeRef when transforming FirFunctionTypeRef 2021-01-15 17:23:11 +01: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
Dmitriy Novozhilov d4891cb464 [FIR] Move Jsr305State from FirSession to separate component 2020-09-17 17:23:25 +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 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
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
Mikhail Glukhikh 036b6c63f6 [FIR] During resolve, set correctly property reference type in delegate 2020-04-03 13:18:47 +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
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Mikhail Zarechenskiy 1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Dmitriy Novozhilov 9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Mikhail Glukhikh f3555daa60 Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed 2018-10-25 19:10:39 +03:00
Dmitry Savvinov ea72c76a37 [NI] Testdata changes after fixes in error types 2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
Valentin Kipyatkov 7f0063013c Corrected test data 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov 6b94e5fd34 Use parameter names from function type for invoke() function
#KT-435 Fixed
 #KT-9016 Fixed
2016-10-11 23:38:49 +03:00
Valentin Kipyatkov 41ee06ec96 Use parameter names in DescriptorRenderer 2016-10-11 23:38:49 +03:00
Denis Zharkov 4725dd3028 Implement recovery for incomplete expression before declaration
It's needed when declarations are parsed as a part of previous expression
(see tests)

Currently we apply this kind of recovery in a conservative way,
only when declaration starts at the next line, and while
the condition could be relaxed, there's no need to do this

 #KT-4948 Fixed
 #KT-7118 Fixed
2016-07-15 18:59:31 +03:00