Ivan Kochurkin
00bc04b3df
[FIR] Implement ELSE_MISPLACED_IN_WHEN diagnostics, fix tests
2021-04-19 15:46:38 +03:00
Dmitry Petrov
7f4da93cc3
JVM_IR KT-45998 protected companion object member accessors with indy
2021-04-19 15:41:21 +03:00
Dmitry Petrov
9a4a39e680
JVM_IR KT-45998 fix protected companion object member accessors
...
Also, make sure it works with indy-based SAM conversions.
2021-04-19 15:41:19 +03:00
Mikhail Glukhikh
b1fb0ba9e1
Fix FirDiagnosticsList (remove earlier dropped FirSourceElements)
2021-04-19 15:29:07 +03:00
Tianyu Geng
b5caa658d6
FIR: introduce delegate diagnostics
...
This commit adds diagnostics for the following
* DELEGATE_SPECIAL_FUNCTION_MISSING
* DELEGATE_SPECIAL_FUNCTION_AMBIGUITY
* DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE
2021-04-19 15:11:16 +03:00
Tianyu Geng
454ae3b17a
FIR checker: report UNSAFE_CALL for overloaded function calls
...
Previously if an unsafe call is to an overloaded function, FIR checkers
report NONE_APPLICABLE. This change instead report them as UNSAFE_CALL
or its variants.
2021-04-19 15:11:13 +03:00
Mikhail Glukhikh
92df1f575a
Fir2IrVisitor: simplify creating for-loop blocks due to changed FIR side
2021-04-19 15:11:13 +03:00
Tianyu Geng
6a03f31e50
FIR: add UnsafeCall resolution diagnostics
...
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00
Mikhail Glukhikh
43a2ad0467
FIR: don't flatten for loop blocks in raw FIR builder
2021-04-19 15:11:12 +03:00
Mikhail Glukhikh
a736d62edd
FirForLoopChecker: report also OPERATOR_MODIFIER if appropriate + minor
...
This commits checks iterator/hasNext/next functions whether they are
declared as operator or not. Also, it changes logic of hasNext/next
error reporting, now we're able to report errors about both these
functions.
2021-04-19 15:11:10 +03:00
Mikhail Glukhikh
2e14b65644
Introduce FirForLoopChecker
2021-04-19 15:10:58 +03:00
Mikhail Glukhikh
4ddc0ed3fe
FIR: introduce block checkers
2021-04-19 15:10:39 +03:00
Mikhail Glukhikh
eb831b9afc
FIR: support separate ANONYMOUS_FUNCTION_WITH_NAME
2021-04-19 15:10:38 +03:00
Mikhail Glukhikh
6b95bcdbdb
FIR: support separate ASSIGNMENT_IN_EXPRESSION_CONTEXT
2021-04-19 15:10:18 +03:00
Mikhail Glukhikh
9894b97058
FIR: rename EXPRESSION_REQUIRED to EXPRESSION_EXPECTED
2021-04-19 15:09:50 +03:00
Ilya Kirillov
f40f506852
FIR: move components from AbstractDiagnosticCollectorVisitor to CheckerRunningDiagnosticCollectorVisitor
2021-04-19 13:52:46 +02:00
Ilya Kirillov
ea233cddf8
FIR: rename goToNestedDeclarations -> visitNestedElements
2021-04-19 13:52:46 +02:00
Ilya Kirillov
eed143d17b
FIR: remove beforeRunningAllComponentsOnElement/beforeRunningSingleComponentOnElement from AbstractDiagnosticCollectorVisitor
2021-04-19 13:52:45 +02:00
Ilya Kirillov
41e822e8cb
FIR IDE: fix duplicated diagnostic collection
2021-04-19 13:52:44 +02:00
Ilya Kirillov
ce62348709
FIR IDE: do not report suppressed diagnostics
2021-04-19 13:52:41 +02:00
Ilya Kirillov
fd082b1574
FIR IDE: get rid of DiagnosticCollectorDeclarationAction
2021-04-19 13:52:40 +02:00
Ilya Kirillov
e79c133331
FIR IDE: separate diagnostics collection and checker context collection
2021-04-19 13:52:39 +02:00
Ilya Kirillov
023f4e9f46
FIR: extract DiagnosticCollectingVisitor to separate file
2021-04-19 13:52:38 +02:00
Ilya Kirillov
f9d415eda6
FIR: make AbstractDiagnosticCollector.Visitor non-inner
2021-04-19 13:52:37 +02:00
Ilya Kirillov
284e828cd6
FIR: extract context related functions from AbstractDiagnosticCollector.Visitor to super class
2021-04-19 13:52:36 +02:00
Dmitriy Novozhilov
e3b5cc491d
[Test] Throw exception from compiler at a first place
2021-04-19 14:32:37 +03:00
Dmitriy Novozhilov
7fb2bf00c5
Force resolve annotations in annotation checker
...
#KT-46173 Fixed
2021-04-19 14:32:36 +03:00
Dmitriy Novozhilov
83bae89ed8
[Test] Show diff between fir file and testdata text if FE 1.0 and FIR test files don't match
2021-04-19 14:32:35 +03:00
Ivan Kochurkin
4353365968
[FIR] Implement NULL_FOR_NONNULL_TYPE diagnostics, fix tests
2021-04-19 12:46:08 +03:00
Aleksei.Cherepanov
b5ef6c9316
Add tests for SAM conversions
...
Add tests for KT-45191 [JPS] Marking method as "default" in Java SAM interface doesn't affect dependencies, which was fixed in intlellij(212): cbad0d91 support kotlin-generated lambda usage
#KT-45191 Fixed
2021-04-17 03:36:17 +03:00
Ilmir Usmanov
7b14975740
Add 'value' modifier to modifier order
...
Otherwise, there will be unfixable 'non-canonical modifier order'
warning
#KT-46088
#KTIJ-5636 Fixed
2021-04-16 18:51:44 +03:00
sebastian.sellmair
bbcfde7231
[Commonizer] Add 'commonizer_target' and 'commonizer_native_targets' to commonized klib's manifest
...
^KT-46077 Fixed
2021-04-16 14:56:31 +00:00
Dmitriy Novozhilov
b530427bb2
Fix substitution of generic types in contracts
...
#KT-41078 Fixed
2021-04-16 17:23:24 +03:00
Dmitriy Novozhilov
91fedd6a12
[FIR] Substitute types from arguments in evaluating of contract
...
#KT-41078
2021-04-16 17:23:22 +03:00
Dmitriy Novozhilov
c65553bb8a
[FIR] Get rid of source element type parameter from diagnostic factories
2021-04-16 14:08:11 +03:00
Dmitriy Novozhilov
4133f38c8c
[FIR] Transform annotations of property receiver type
2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
564de2790f
[FIR] Resolve array literals in independent context
2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
cc0f28b698
[FIR] Store type of function call and qualified access from error reference
2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
e869f8091a
[FIR] Properly handle callable references which were resolved with error
2021-04-16 11:12:55 +03:00
Dmitriy Novozhilov
450fb5e915
[Test] Add handler to detect implicit types which were left in resolved FIR
2021-04-16 10:52:58 +03:00
Ilya Gorbunov
8041c3aa1d
Support Char.code in constant evaluator, KT-46036
...
But do not consider Char.code a pure integer constant.
2021-04-16 03:58:34 +03:00
Alexander Udalov
0a446230f7
Reorder LanguageFeature entries according to sinceVersion
2021-04-15 21:41:17 +02:00
Alexander Udalov
168d8b07a8
Minor, fix warnings on new stdlib API
...
In modules where allWarningsAsErrors is not yet enabled.
2021-04-15 18:39:06 +02:00
Dmitry Petrov
e89ab71bf8
JVM_IR KT-45934 don't generate declaration stubs for delegates
2021-04-15 17:59:19 +03:00
Dmitry Petrov
cc415f62b5
JVM_IR KT-46092 fix array spread operator in Kotlin->Java call
2021-04-15 17:11:21 +03:00
Mikhail Glukhikh
9b3f1b9b8a
Inference: handle Exact constraints with captured types properly
...
#KT-41818 Fixed
2021-04-15 15:55:41 +03:00
Mikhail Glukhikh
51d348d5fa
FIR: report FUN_INTERFACE_CONSTRUCTOR_REFERENCE on deserialized properly
...
This fixes KT-46100 for FIR
2021-04-15 15:54:18 +03:00
Ilya Kirillov
d7e3c65c45
FIR: add renderDeclarationOrigin to FirRender
2021-04-15 15:24:02 +03:00
Ilya Kirillov
0e98480be3
FIR: update resolve phase for declaration when visiting with FirContractResolveTransformer
2021-04-15 15:24:01 +03:00
Ilya Kirillov
5de4c5fc28
FIR: allow declaring specific set of parameters for FirRenderer
2021-04-15 15:24:00 +03:00