Commit Graph

5363 Commits

Author SHA1 Message Date
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 5760a94ab4 [FIR] Add CONCURRENT_HASH_MAP_CONTAINS_OPERATOR 2021-09-13 20:48:58 +03:00
Ivan Kochurkin 0ffd6ccb34 [FIR] Add SUSPENSION_POINT_INSIDE_CRITICAL_SECTION 2021-09-13 20:48:57 +03:00
Ivan Kochurkin e97933a9e5 [FIR] Add POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION 2021-09-13 20:48:55 +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 5769d42248 [FIR] Fix all usages of annotations due to new FirAnnotation hierarchy 2021-09-13 13:53:12 +03: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 2baed77598 [FIR] Add JVM_SYNTHETIC_ON_DELEGATE diagnostic
Extract JVM names to common JvmNames
2021-09-10 00:49:03 +03:00
Ivan Kochurkin 3725c58794 [FIR] Add INAPPLICABLE_JVM_FIELD, INAPPLICABLE_JVM_FIELD_WARNING 2021-09-10 00:49:02 +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
Ivan Kochurkin cfd2835254 [FIR] Add JVM Default diagnostics 2021-09-10 00:48:59 +03:00
Nikolay Lunyak 1a3f47badd [FIR] Make FirJvmStaticChecker more consistent with the legacy version 2021-09-09 20:18:49 +03:00
Nikolay Lunyak 2a2c92d8b3 [FIR] Add support for JVM_STATIC_ON_EXTERNAL_IN_INTERFACE diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak 7006426304 [FIR] Add support for JVM_STATIC_ON_CONST_OR_JVM_FIELD diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak f3d61c199b [FIR] Add support for JVM_STATIC_ON_NON_PUBLIC_MEMBER diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak c2e5583780 [FIR] Add support for JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak 276bfd9305 [FIR] Add support for OVERRIDE_CANNOT_BE_STATIC diagnostic 2021-09-09 20:00:38 +03:00
Nikolay Lunyak 5607be3920 [FIR] Add support for INAPPLICABLE_JVM_NAME diagnostic 2021-09-09 20:00:36 +03:00
Nikolay Lunyak 5ebad97cd5 [FIR] Add support for ILLEGAL_JVM_NAME diagnostic 2021-09-09 19:58:16 +03:00
pyos 94402ba488 FE: prefer enhancements for errors over enhancements for warnings 2021-09-08 16:54:17 +03:00
pyos 8f699248f1 FE: force flexibility on unannotated ?
TODO: unify this code with FIR

 #KT-48515 Fixed
2021-09-08 16:54:17 +03:00
pyos afa1d18cc2 FE: in NullMarked scope, enhance T! to at least T
#KT-44436 Fixed
2021-09-08 16:54:17 +03:00
pyos f793afbfea FE: do not enhance ? into ? extends @NotNull Object in JSR-305
This is already done in jspecify and makes more sense anyway.
2021-09-08 16:54:17 +03:00
Alexander Udalov 7e43000d9b JVM: do not lose default parameter values during enhancement
The change in signatureEnhancement.kt in 432f581cb2 was incorrect.
Contrary to its name, the removed method `hasDefaultValueInAnnotation`
checked not only if the enhancement annotation has default value (which
is what the removed feature was about), but also if the parameter itself
declares default value. This was mistakenly substituted by just `false`
on line 234. The correct change is to use the `declaresDefaultValue`
flag of the original parameter.

It's kind of weird though that in case there's a nullability annotation
on the whole package (like in KT-48316) type enhancement is being done
on everything, including annotation constructors, whose parameter types
can't have any enhancement information. Maybe this should be improved
independently.

 #KT-48316 Fixed
2021-09-07 19:05:48 +02: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
Sergej Jaskiewicz f62ffeaa0a [JS, Frontend] Forbid @JsExporting inline/value classes
Previously the compiler would just crash.

#KT-46202 Fixed
2021-09-06 16:13:00 +03:00
pyos 9bb7a29baa FIR: disregard enhancements for warnings
Warnings are not implemented yet, so don't produce errors either.
2021-09-06 13:11:16 +03:00
pyos 090b90f62e FIR: load type qualifiers from module, package, and parent classes 2021-09-06 13:11:13 +03:00
pyos 24210aacc8 FIR: use JSR-305 state from command line flags 2021-09-06 13:11:13 +03:00
pyos 2847de10ac FIR: enhance Java super types 2021-09-06 13:11:09 +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 e2a48d3945 FIR: use frontend-independent Java type qualifier computation 2021-09-06 13:11:07 +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 5704dffdbe FIR: attach annotations to Java-converted cone types 2021-09-06 13:11:03 +03:00
pyos 5355d04553 FIR: enhance in/out-variant type arguments 2021-09-06 13:11:03 +03:00