Tianyu Geng
fb1eac0985
FIR: report SMARTCAST_IMPOSSIBLE on inherited alien properties [KT-48101]
2021-08-18 12:02:02 +03:00
Denis.Zharkov
753ba99b04
FIR: Support enhanced types when checking if Java type is primitive
2021-08-17 21:38:01 +03:00
Andrey Zinovyev
1cdbbad367
[FIR] ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION diag
2021-08-17 16:05:42 +03:00
Tianyu Geng
b77dc4136b
FIR checker: fix JAVA_TYPE_MISMATCH again
2021-08-16 16:54:22 +03:00
Ivan Kochurkin
2c1c24c042
[FIR] Implement WRONG_MODIFIER_CONTAINING_DECLARATION, DEPRECATED_MODIFIER_CONTAINING_DECLARATION
2021-08-13 18:32:28 +03:00
Ivan Kochurkin
cd6384eb20
[FIR] Fix handling of WRONG_MODIFIER_TARGET
...
Implement DEPRECATED_MODIFIER, DEPRECATED_MODIFIER_FOR_TARGET, REDUNDANT_MODIFIER_FOR_TARGET
2021-08-13 18:32:27 +03:00
Mikhail Glukhikh
a21d281c19
FIR: fix capturing on intersection types #KT-48109 Fixed
2021-08-13 11:14:03 +03:00
Mikhail Glukhikh
a04913a197
FIR: use captureFromTypeParameterUpperBoundIfNeeded for argument types
...
#KT-48161 Fixed
2021-08-13 11:14:02 +03:00
Mikhail Glukhikh
73a8b4544a
FIR: don't report EQUALITY_NOT_APPLICABLE for classes from java.*
...
Workaround for KT-48113
2021-08-13 11:14:01 +03:00
Mikhail Glukhikh
b617aca8ee
FIR: fix scope order for super-type resolve #KT-48159 Fixed
2021-08-13 11:14:01 +03:00
Mikhail Glukhikh
ca98417a0c
FIR: add test for erroneous type inference in UAST (KT-48159)
2021-08-13 11:14:00 +03:00
Mikhail Glukhikh
b1bcbaf48f
FirConstChecks: support "Some string".length case properly
...
#KT-48165 Fixed
2021-08-13 11:13:59 +03:00
Mikhail Glukhikh
2e2edf398c
FIR: consider enum class overridden members non-final #KT-48164 Fixed
2021-08-13 11:13:57 +03:00
Andrey Zinovyev
1338675833
[FIR] Fix while's label, when condition has lambda
...
#KT-48116 Fixed
2021-08-12 10:20:45 +03:00
Andrey Zinovyev
3ec9599bc4
[FIR][CFG] Partial support of postponed Nothing calls
...
In try blocks, last call won't be completed when building node for it
This is workaround to partially reconstruct nothing stub node for such
calls. Should work for non-local returns in try only.
#KT-48160 Fixed
2021-08-11 21:57:14 +03:00
Tianyu Geng
06ee84f809
FIR checker: report AMBIGUOUS_SUPER
2021-08-10 19:36:44 +03:00
Tianyu Geng
280c445783
FIR checker: check super reference
...
This change touches the following diagnostics to make them behave closer
to FE1.0
* SUPER_NOT_AVAILABLE
* SUPER_IS_NOT_AN_EXPRESSION
* INSTANCE_ACCESS_BEFORE_SUPER_CALL
* NOT_A_SUPERTYPE
Other than tweaking the diagnostics, this change also alters resolution
by consider marking `super` with mismatched type parameter as
errorenous. As a result, the following code no longer resolves.
```
class A: B() {
fun test() {
super<String>.length
// ^^^^^^ FIR currently resolves this to `String.length`.
// With this change, `length` becomes unresolved
// instead
}
}
```
Also, now we report `UNRESOLVED_LABEL` on unresolved label on `super`
reference, though FE1.0 reports `UNRESOLVED_REFERENCE`.
All the errors above are reported as ConeDiagnostics and hence some
checkers are deleted.
In addition, it also suppresses more downstream (mostly unresolved)
errors if the receiver has errors. FE1.0 doesn't do it for all the cases
we have here. But it seems nicer to reduce these "redundant" unresolved
errors.
2021-08-10 19:36:43 +03:00
Tianyu Geng
bcf6202863
FIR checker: fix position strategy for UNRESOLVED_LABEL
2021-08-10 19:36:04 +03:00
Ivan Kochurkin
9736cc162b
[FIR] Throw REDECLARATION for duplicated value parameters in function
...
Add new test file
2021-08-10 15:09:26 +00:00
Ivan Kochurkin
fd92b851a2
[FIR] Implement PACKAGE_OR_CLASSIFIER_REDECLARATION
...
Fix REDECLARATION positioning
2021-08-10 15:09:25 +00:00
pyos
33251f6d50
Generate foreign annotation test data for FIR
2021-08-10 13:19:23 +03:00
Tianyu Geng
1607a8231a
FIR checker: ABSTRACT_PROPERTY_IN_PRIMARY_CONSTRUCTOR_PARAMETERS
2021-08-10 13:02:10 +03:00
Andrey Zinovyev
1b81018b69
[FIR] Fix overloading of renamed jvm methods
...
#KT-48102 Fixed
2021-08-09 15:22:06 +03:00
Tianyu Geng
cd99c35649
FIR: instantiate type argument to captured type if needed
2021-08-09 14:38:30 +03:00
Tianyu Geng
758859f198
FIR checker: report JAVA_TYPE_MISMATCH
2021-08-09 14:38:29 +03:00
Dmitriy Novozhilov
1d491fdce6
[FIR] Don't create union call node for lambda from one when branch and call from condition of another
2021-08-06 22:57:18 +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
Tianyu Geng
4726dcce40
FIR DFA: smartcast variable to Nothing? on null assignment
...
In order to make resolution still work for members not available from
`Nothing`, we track the type without `Nothing?` and use that for
resolution instead.
2021-08-06 22:57:15 +03:00
Tianyu Geng
7e2f15f532
FIR DFA: fix logic clear aliasing
...
The logic should clear back aliases as well. To ensure all back aliases
don't lose any information, statements on the original variable are
copied over to its aliases.
2021-08-06 22:57:15 +03:00
Tianyu Geng
f737d8002e
FIR: allow no else branch for when on Nothing(?)
2021-08-06 22:57:12 +03:00
Dmitriy Novozhilov
a9882a86c0
[FIR] Consider extension receiver type in conflicting members checker
2021-08-06 13:31:20 +03:00
Victor Petukhov
cd09c8ba51
Report CANNOT_INFER_PARAMETER_TYPE on any error value parameters of a lambda
...
^KT-48058 Fixed
2021-08-06 13:27:57 +03:00
Mikhail Glukhikh
22ccb7a943
FIR: discriminate generics during callable reference resolve
2021-08-05 19:24:04 +03:00
Mikhail Glukhikh
e924ee3150
FIR: add test with minOf ambiguity
2021-08-05 19:24:02 +03:00
Dmitriy Novozhilov
8578f0beea
[FE 1.0] Check for type mismatch for empty when statements
...
^KT-47922 Fixed
2021-08-04 19:33:45 +03:00
Dmitriy Novozhilov
60195114c1
[FIR] Properly create class scopes while resolving of annotations arguments
2021-08-04 18:23:06 +03:00
Victor Petukhov
93f9d9dacd
Check if the intersecting types aren't empty during finding the result type for variable fixation
...
^KT-47941 Fixed
2021-08-04 17:36:50 +03:00
Andrey Zinovyev
015c2d1875
[FIR] Add NOTHING_TO_INLINE diagnostic
2021-08-04 17:33:08 +03:00
Ivan Kochurkin
5291648d39
[FIR] Temporary change UPPER_BOUND_VIOLATED to warning to unblock bootstrap tests
2021-08-03 23:15:40 +03:00
Dmitriy Novozhilov
b584fed93d
[FIR] Migrate warning/error pairs to DiagnosticFactoryForDeprecation
2021-08-03 00:20:11 +03:00
Dmitriy Novozhilov
71def0666e
[FIR] Introduce special phase for resolve of enums and class literals
2021-08-02 20:29:05 +03:00
Simon Ogorodnik
8e890eba3e
[FIR] Hack-in indirectly nested locals resolution
2021-08-02 17:07:15 +03:00
Simon Ogorodnik
7422571c72
[FIR] Fix cycle when loading nested enum within java annotation
2021-08-02 17:07:15 +03:00
Dmitriy Novozhilov
fa1d09c778
[FE 1.0] Support java sealed classes
...
^KT-46778 Fixed
2021-08-01 22:23:45 +03:00
Mark Punzalan
504449f03e
FIR: Report UNSAFE_CALL instead of SMARTCAST_IMPOSSIBLE when smartcast
...
to null.
Currently the error message shows the expression is impossible to
smartcast to the nullable type, which is nonsensical since it's already
that type.
2021-07-30 21:49:50 +03:00
Alexander Udalov
847c58d574
Report error on class named Container inside repeatable annotation
...
#KT-12794
#KT-47971
2021-07-30 19:53:44 +02:00
Alexander Udalov
e20b354dbd
Check repeatable annotation container parameters, retention, target
...
#KT-12794
#KT-47928
2021-07-30 19:53:33 +02:00
Alexander Udalov
67128c022a
Report error if both repeatable annotation and its container are used
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
b2550f69bc
Report error if repeated annotation is used with JVM target 1.6
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
87130edfa2
Support using Java-repeatable annotations in Kotlin
...
#KT-12794
2021-07-30 19:53:32 +02:00