Commit Graph

41 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 7917e511ed [FE 1.0] Disable INTEGER_OPERATOR_RESOLVE_WILL_CHANGE warning by default
Also remove sinceVersion parameter from
  ApproximateIntegerLiteralTypesInReceiverPosition language feature

^KT-48992 Fixed
2021-09-29 21:23:22 +03:00
Mark Punzalan b8ed46066e FIR: Change diagnostic for ConeHiddenCandidate to UNRESOLVED_REFERENCE.
The KDoc for @Deprecated states that DeprecationLevel.HIDDEN usages
should look like unresolved references.
2021-09-29 19:39:17 +03:00
Dmitriy Novozhilov 8117cd4c24 Postpone ApproximateIntegerLiteralTypesInReceiverPosition feature till 1.7
^KT-38895
2021-09-02 13:34:29 +03:00
Ivan Kochurkin 84c5f58cab [FIR] Implement UNRESOLVED_REFERENCE_WRONG_RECEIVER 2021-08-25 21:53:23 +00:00
Dmitriy Novozhilov 7250aed3b5 [FE 1.0] Fix some diagnostic tests 2021-07-29 19:45:55 +02: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
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 6afb905ad6 Add deprecation warning about new integer operators on literals resolution
#KT-38895
2021-04-14 18:30:51 +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 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
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 4374c06537 [FIR] Approximate all integer literals which resolved in independent mode
#KT-42016
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov 535898c8a4 [FIR] Fix processing integer operator calls for not integer types 2020-09-14 10:57:10 +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 b27152f903 Replace some FIR syntax errors with more proper diagnostics 2020-03-27 16:46:59 +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 5ceb68f19f [FIR-TEST] Update some testdata 2020-02-10 10:54:04 +03:00
Ilya Gorbunov 39078342ee Remove mod function deprecation tests
#KT-26654
2020-01-23 19:28:23 +03:00
Ilya Gorbunov b1766b167f Remove mod function usage from tests
#KT-26654
2020-01-23 19:28:23 +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 787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitriy Novozhilov 7c4101e21c [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI 2019-05-29 10:35:46 +03:00
Mikhail Zarechenskiy 848640253a Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit f20ec3e0a6.
2019-05-29 01:31:28 +03:00
Dmitriy Novozhilov f20ec3e0a6 [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
There is added a new service named `SubstitutingScopeProvider`, that
  provides factory that creates captured types and approximator for them.
  In OI they are the same as before commit, for NI they are empty, because
  that approximation interferes with NI algorithm

That service is injected into function descriptors and property descriptors
  and used for creating `SubstitutingScope` with correct services

Also there is changed time when we approximate captured types in NI
  (after all call checkers)

#KT-25290 Fixed
2019-05-28 11:18:33 +03:00
Mikhail Zarechenskiy dee3617dd8 Refine deprecation diagnostics for mod depending on api version
#KT-25217 Fixed
 #KT-26654 Open
2018-09-09 23:55:38 +03:00
Mikhail Zarechenskiy 7595cb23ab Raise deprecation level for mod operators to ERROR in stdlib
#KT-25217 In Progress
2018-09-09 23:55:36 +03:00
Mikhail Zarechenskiy e2c287c77e Fix language feature for mod/rem tests for migration to 1.3 version
After 2e88f5c47d
2018-07-03 16:10:37 +03:00
Mikhail Zarechenskiy 2e88f5c47d Prohibit operator mod as declaration and calls that resolved via it
#KT-24197 Fixed
2018-07-02 16:12:36 +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
Mikhail Zarechenskiy 1a4b9cb228 Show warning for mod from built-ins since API=1.1 2017-03-20 00:45:18 +03:00
Mikhail Zarechenskiy e4188f889e Do not show warning for mod from built-ins when LV=1.0
#KT-16372 Fixed
2017-03-20 00:41:58 +03:00
Mikhail Zarechenskiy 68b223211c Fix bogus integer overflow warning for 'mod' operator
#KT-15875 Fixed
2017-01-25 02:24:28 +03:00
Dmitry Petrov 954204da82 KT-1560
Report warning on extensions shadowed by members.
2017-01-16 17:25:13 +03:00
Mikhail Zarechenskiy 42d867b3bf Support number conversion for binary 'rem' operator 2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy 7a0e44b8f9 Resolve '%' as 'mod' when LV=1.0 2016-12-09 17:01:41 +03:00
Mikhail Zarechenskiy bc4a492f4d Resolve for rem/modAssign and mod/remAssign
rem/remAssign always wins if it is possible
2016-12-09 17:00:27 +03:00
Mikhail Zarechenskiy 8e73a902e4 Additional tests on mod/rem migration 2016-12-09 16:59:26 +03:00
Mikhail Zarechenskiy 5f71f1bcad Add warnings at declaration and call sites of operator 'mod' 2016-12-09 16:59:24 +03:00
Mikhail Zarechenskiy 97ca51381a Gradual migration of operator 'mod' to 'rem'
- Introduce new 'rem' operator convention
 - Prefer 'rem()' to 'mod()' when both are available, even if mod() is a
   member, and rem() -- an extension
 - Place operator 'rem' under the language feature
2016-12-09 16:43:35 +03:00