Tianyu Geng
e95de0a778
FIR checker: report type mismatch for named vararg arguement
...
ProhibitAssigningSingleElementsToVarargsInNamedForm is enabled from 1.3
so there is no need to make FIR accepting single element passed through
named arguments.
In addition, we may want to report only
ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION and not arg
type mismatch. But FE1.0 is reporting both so I am following it. If we
want to remove the redundant report, we will probably want to remove
FirNamedVarargChecker and report during resolution as a cone diagnostic.
2021-09-15 12:11:36 +03:00
Tianyu Geng
3708290ca3
FIR checker: fix NON_VARARG_SPREAD
2021-09-15 12:11:35 +03:00
Tianyu Geng
b8b9502db4
FIR checker: fix ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_ANNOTATION
...
Currently this checker is missing `arrayOf` calls inside annotation.
2021-09-15 12:11:28 +03:00
Tianyu Geng
3c84fbcab1
IR: make calls with explicit singleton receiver tailrec [KT-48602]
2021-09-14 23:48:52 +03:00
Tianyu Geng
8525b4932b
FIR Checker: check tailrec
...
Difference from FE1.0
* KT-4285: calls to virtual method with default argument should be
reported as not tailrec. FE1.0 is missing such cases.
* KT-48600: calls inside lambda should be reported as not tailrec. FE1.0
also misses such cases.
2021-09-14 23:48:50 +03:00
Denis.Zharkov
ef684c0dff
FIR: Improve error reporting for EXPRESSION_EXPECTED_PACKAGE_FOUND
2021-09-14 19:13:47 +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
Denis.Zharkov
9ca96ebbd2
FIR: Add FirVisibilityQualifierChecker
2021-09-14 19:13:39 +03:00
Denis.Zharkov
9575d4d242
FIR: Rework qualifier-in-expression resolution
...
Get rid of stateful FirQualifiedNameResolver
Resolve a.b.c-like calls step-by-step using just recursion
^KT-48363 Fixed
2021-09-14 19:13:38 +03:00
Ivan Kochurkin
a816bd9a33
[FIR] Add JVM_INLINE_WITHOUT_VALUE_CLASS, VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION
2021-09-13 20:49:00 +03:00
Ivan Kochurkin
7e7066d75e
[FIR] Add FUNCTION_DELEGATE_MEMBER_NAME_CLASH
2021-09-13 20:48:59 +03:00
Ivan Kochurkin
a5caa14255
[FIR] Add SPREAD_ON_SIGNATURE_POLYMORPHIC_CALL
2021-09-13 20:48:59 +03:00
Ivan Kochurkin
dd46c36b24
[FIR] Add SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC
2021-09-13 20:48:54 +03:00
Ivan Kochurkin
07edb15138
[FIR] Expand typealias for correct approximation of types (particularly Int and Long)
2021-09-13 14:28:26 +00:00
Dmitriy Novozhilov
7a7672b0de
[FE 1.0] Fix reporting of non exhaustive when statement for whens with subject
...
^KT-48653 Fixed
2021-09-12 16:04:18 +03:00
Nikolay Lunyak
f6ae6af741
[FIR] Add test data
2021-09-11 22:05:43 +03:00
Mikhail Glukhikh
fc6403679a
Rename !USE_EXPERIMENTAL test directive to !OPT_IN
2021-09-10 16:29:16 +03:00
Mikhail Glukhikh
3febabe977
Use OPT_IN instead of EXPERIMENTAL in diagnostic names
2021-09-10 16:29:13 +03:00
Tianyu Geng
05fbed68e2
FIR checker: report PROPERTY_AS_OPERATOR
2021-09-10 07:07:43 +03:00
Tianyu Geng
4915d8dda3
FIR checker: support DUPLICATE_LABEL_IN_WHEN
...
Changes from FE1.0:
1. As discussed previously, no expression evaluation happens during this
check.
2. FE1.0 doesn't check redundant object comparisons.
2021-09-10 07:07:42 +03:00
Ivan Kochurkin
55f33999f1
[FIR] Add REPEATED_ANNOTATION, REPEATED_ANNOTATION_WARNING
2021-09-10 00:49:07 +03:00
Ivan Kochurkin
fa12e72551
[FIR] Add REPEATABLE_CONTAINER_* diagnostics
...
REPEATABLE_CONTAINER_MUST_HAVE_VALUE_ARRAY
REPEATABLE_CONTAINER_HAS_NON_DEFAULT_PARAMETER
REPEATABLE_CONTAINER_HAS_SHORTER_RETENTION
REPEATABLE_CONTAINER_TARGET_SET_NOT_A_SUBSET
REPEATABLE_ANNOTATION_HAS_NESTED_CLASS_NAMED_CONTAINER
2021-09-10 00:49:07 +03:00
Ivan Kochurkin
6fa1c0353c
Use deprecation type for some REPEATABLE_* diagnostics
2021-09-10 00:49:06 +03:00
Ivan Kochurkin
f414a91c66
[FIR] Implement FirInterfaceDefaultMethodCallChecker
...
Add diagnostics: INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET,
INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER,
DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET
2021-09-10 00:49:04 +03:00
Ivan Kochurkin
97bc079634
[FIR] Add REPEATED_ANNOTATION_WITH_CONTAINER, NON_SOURCE_REPEATED_ANNOTATION
...
REPEATED_ANNOTATION_TARGET6
2021-09-10 00:49:03 +03:00
Ivan Kochurkin
d4746903c8
[FIR] Rename getOuterClass to getContainingDeclaration, fix if for local classes
...
Simplify checking of WRONG_NUMBER_OF_TYPE_ARGUMENTS
2021-09-10 00:49:01 +03:00
Ivan Kochurkin
816e8f487c
[FIR] Add JVM diagnostics about external declaration
2021-09-10 00:49:00 +03:00
Dmitriy Novozhilov
661d89c67f
[FIR] Fix diagnostic message rendering for OVERRIDE_DEPRECATION
2021-09-07 14:11:46 +03:00
Dmitriy Novozhilov
9f4abd8ff7
[FE 1.0] Fix diagnostic message rendering for OVERRIDE_DEPRECATION
2021-09-07 14:11:45 +03:00
pyos
03304bce96
FIR: enhance Java type parameter bounds
...
This also fixes handling of self-recursive types.
TODO: fix jspecify/{strict,warn}Mode/Captured.fir.kt
2021-09-06 13:11:08 +03:00
pyos
e385484994
FIR: when translating raw types, reuse computed upper bounds
...
Also, don't bother ensuring that the upper bound has the same tree size
as the lower bound; the new index computation can handle it when some
subtrees of the lower bound are replaced by star projections in the
upper bound.
2021-09-06 13:11:06 +03:00
pyos
5355d04553
FIR: enhance in/out-variant type arguments
2021-09-06 13:11:03 +03:00
pyos
8e122397b0
FIR: fix type index computation during enhancement
...
1. in/out type parameters count;
2. star projections take up 1 space in the tree.
2021-09-06 13:11:02 +03:00
pyos
5fec9f34b1
FIR: revert a hack that allows overriding T!! with T
...
1. this should've been only done if the language feature for validating
that is disabled;
2. that feature probably won't matter by the time FIR is stable;
3. it only worked because type enhancement of type arguments is broken
anyway - a more correct hack would be to provide a custom
ConeTypePreparator.
2021-09-06 13:11:01 +03:00
Dmitriy Novozhilov
88913aa2a3
[FIR] Report warning on non-deprecated overrides of deprecated members
...
^KT-47902
2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov
ef9ad5af51
[FE 1.0] Report warning on non-deprecated overrides of deprecated members
...
Also don't propagate deprecation status to overrides after 1.7
^KT-47902 Fixed
2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov
8117cd4c24
Postpone ApproximateIntegerLiteralTypesInReceiverPosition feature till 1.7
...
^KT-38895
2021-09-02 13:34:29 +03:00
Dmitriy Novozhilov
1e0878cde0
[FE 1.0] Postpone SafeCallsAreAlwaysNullable till 1.7
...
^KT-46860 Fixed
2021-09-02 13:34:27 +03:00
Mikhail Glukhikh
c175039afb
Add test for JVM_RECORD_NOT_LAST_VARARG_PARAMETER
2021-08-31 18:28:59 +03:00
Mikhail Glukhikh
881b15a677
FIR: use typeWithStarProjections for protected visibility check
2021-08-31 17:32:02 +03:00
Mikhail Glukhikh
08e498f1f2
FIR: add proper receiver check for protected visibility #KT-48378 Fixed
2021-08-31 17:31:57 +03:00
Denis.Zharkov
4a9d4ed9fe
Enable ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated since 1.7
...
^KT-36770 Fixed
2021-08-31 15:41:17 +03:00
Denis.Zharkov
d91155558b
Rename LF: DefinitelyNotNullTypeParameters -> DefinitelyNonNullableTypes
2021-08-31 15:41:17 +03:00
Denis.Zharkov
0e7d51b04d
Prohibit using definitely-non-nullable types as arguments for reified parameters
...
^KT-26245 In Progress
2021-08-31 15:41:16 +03:00
Denis.Zharkov
62bef48f9d
Adjust test data to changed rendering: T!! -> T & Any
...
^KT-26245 In Progress
2021-08-31 15:41:15 +03:00
Denis.Zharkov
9e6af52e1f
Enable DefinitelyNotNullTypeParameters since 1.7
...
^KT-26245 In Progress
2021-08-31 15:41:13 +03:00
Denis.Zharkov
c1b5d5551f
Drop support for T!! syntactic structure
...
^KT-26245 In Progress
2021-08-31 15:41:13 +03:00
Denis.Zharkov
302eacbf59
Support new form of definitely non-nullable types: T & Any
...
^KT-26245 In Progress
2021-08-31 15:41:11 +03:00
Mark Punzalan
34e6459014
FIR: Ensure that the array set argument (on RHS of =) is always mapped
...
to the last parameter of the set operator function, even if there are
missing or too many index arguments.
2021-08-31 14:52:28 +03:00
Denis.Zharkov
112af9b145
FIR: Rework bare types support
...
^KT-48305 Fixed
2021-08-30 16:24:44 +03:00