Svyatoslav Kuzmich
0abc798da9
[Wasm] Add JS interop tests
2021-09-16 14:20:35 +03:00
Igor Chevdar
e194a07358
[tests] Added some tests
2021-09-16 10:54:14 +00:00
pyos
8724bc9525
Add test for KT-48478
2021-09-15 13:23:11 +02:00
pyos
0864f9faf8
JVM_IR: mark inline lambda functions with a special origin
...
Keeping the origin as LOCAL_FUNCTION_FOR_LAMBDA was a mistake as this
tells codegen nothing. Changing the origin in allows, for example,
removing the hack that detaches inline lambdas from the IR tree before
verification and codegen, or treating inline lambdas and inline
anonymous functions the same way.
This includes fake functions created for inline callable references.
#KT-48319 Fixed
#KT-47279 Fixed?
2021-09-15 13:23:11 +02:00
Tianyu Geng
dfc36ec614
FIR checker: ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_(ANNOTATION|FUNCTION)
2021-09-15 12:11:41 +03:00
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
Alexander Udalov
3ef9649344
Minor, fix test data of localVariables/suspend/mergeLvt.kt
...
It was incorrectly adapted (by me) in d07070e184 .
2021-09-15 00:07:49 +02: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
Alexander Udalov
e857966edb
JVM: remove support for disabling NoConstantValueAttributeForNonConstVals
...
This feature is enabled by default since 1.4, which is the earliest
language version supported by Kotlin at this moment.
2021-09-14 22:29:12 +02:00
pyos
d07070e184
JVM_IR: avoid redundant accessors in private inline funs
...
Their call sites are all in the same file, so we can check whether the
declarations used in the inline function are accessible from all the
places where it will be inlined.
#KT-48736 Fixed
2021-09-14 22:17:10 +02: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
pyos
8ff79e002e
FIR: load parents of Java inner classes first, as before
2021-09-14 19:00:44 +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
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
d390f881c8
[FE 1.0] Record USED_AS_EXPRESSION for unreachable CFG nodes
...
^KT-48708 Fixed
2021-09-13 16:22:50 +03:00
Dmitriy Novozhilov
765b389875
[FIR] Mute failing test due to KT-48675
2021-09-13 13:53:14 +03:00
Dmitriy Novozhilov
5769d42248
[FIR] Fix all usages of annotations due to new FirAnnotation hierarchy
2021-09-13 13:53:12 +03:00
Roman Artemev
3b53c97c2c
[JS IR] Fix test data 'kt -> ir -> klib -> ir -> js' aka prod mode
...
- fix order in dts tests
- unmute fixed test in prod mode
- mute filing expect-actual link test in prod mode
2021-09-13 13:44:46 +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
Nikolay Lunyak
a0982341ee
[FIR] Update parser test data
2021-09-11 22:05:28 +03:00
pyos
23420ecf7a
IR: do not infer array element types for non-annotation constants
...
While annotations restrict the set of allowed types to a few final
built-ins, in arbitrary constants we can have array elements that are
some subtype of the array's element type.
#KT-48671 Fixed
2021-09-10 21:55:15 +02: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
Mikhail Glukhikh
f397553e94
PSI2IR: don't generate annotations on init block (related to KT-48687)
2021-09-09 22:14:48 +03:00
Mikhail Glukhikh
457a6f4e9d
IR: copy anonymous initializer annotations properly #KT-48687 Fixed
2021-09-09 22:14:48 +03:00