Commit Graph

313 Commits

Author SHA1 Message Date
Artem Kobzar 3429cbd321 [K/JS] Support companion objects in external and exported declarations 2024-02-27 16:30:13 +00:00
Alexander Korepanov 9ff6dcbe0a [JS FIR] Add a test for generic interface inheritance
^KT-65216
2024-02-13 12:19:29 +00:00
Nikolay Lunyak 183c263c55 [FIR] Create proper error name references for invoke receivers
In this example, when processing
the `jso` property candidate form
the `dynamic` scope we get
`DslScopeViolation`.
When we later create the
receiver for the invoke call
(since we still call `jso {}` as
a function), we create a non-error
named reference which fails at
`toResolvedReference()`.

The included test should not fail
with exception.

^KT-65255 Fixed
2024-02-06 09:12:46 +00:00
Artem Kobzar 8d1a90c23c [K/JS] Support essential Kotlin collections (List, MutableList, Set, MutableSet, Map, MutableMap) for exporting into JS
^KT-34995 Fixed
^KT-44871 Fixed
2024-01-24 11:14:46 +00:00
Alexander Korepanov 0d06efb488 [JS FIR] Fix REIFIED_TYPE_FORBIDDEN_SUBSTITUTION for dynamic types
^KT-59987 Fixed
2024-01-23 17:52:03 +00:00
Alexander Korepanov 3dd4a0d868 [JS FIR] Add JS_NAME_CLASH tests for constructors
^KT-64867 Related
2024-01-23 10:30:10 +00:00
Alexander Korepanov 5da4d31d37 [JS FIR] Rework JS_NAME_CLASH diagnostic for constructors
- Fix a false positive JS_NAME_CLASH report on constructors
   from different classes but with the same JsName.
 - Allow the same JsName for class constructors and other top-level
   declarations. This behavior differs from K1, but it is correct
   since there is no real name clash in the generated JS code.

^KT-64867 Fixed
2024-01-23 10:30:10 +00:00
Alexander Korepanov fc584b7c33 [JS FIR] Add non-ASCII JsName tests
^KT-64463 Related
2024-01-23 10:00:18 +00:00
Nikolay Lunyak f52648af5f [FIR] Support CHECK_TYPE in K2 JS tests
^KT-60056
2024-01-09 10:47:13 +00:00
Alexander Korepanov d5aaa29a7f [JS FIR] Implement FirJsReflectionAPICallChecker diagnostic
^KT-60899 Fixed
2024-01-02 16:45:12 +00:00
Kirill Rakhman 8aa32d9f45 [FIR] Rename DUPLICATE_LABEL_IN_WHEN to DUPLICATE_BRANCH_CONDITION_IN_WHEN
... and fix the message

#KT-35289 Fixed
2024-01-02 15:17:02 +00:00
Alexander Korepanov 4609b11102 [JS FIR] Add JsName clash test
^KT-64364
2024-01-02 10:15:02 +00:00
Alexander Korepanov 89e2af2047 [JS FIR] Fix the JsExport diagnostic for nullable primitive types
- Correctly handle nullable primitive types.
- Unsigned primitive arrays are not exportable.

^KT-64366 Fixed
2024-01-02 10:14:46 +00:00
Artem Kobzar eb790732fd [K/JS] Enable identifiers escaping by default in 2.1 version ^KT-31799 Fixed 2023-12-20 16:39:19 +00:00
Nikolay Lunyak d5fa755e63 [FIR] Disable not null checks on dynamics
It looks like K1 doesn't do them.
And it's not particularly bad because
in the ideal world we'd have dynamics
with variable upper bound so that
in `dynamic?.let { it }` `it` would
be `Nothing..Any` (smartcasting to
`Any` is not correct because `dynamic`
can be passed into anything, but `Any`
can not).

^KT-63071
2023-11-28 15:37:09 +00:00
Nikolay Lunyak 875e2b0cd6 [FIR] Prohibit calling functions with dynamic receiver over non-dynamics
^KT-63071 Fixed
2023-11-28 15:37:09 +00:00
Alexander Korepanov b1465fbfb8 [JS FIR] Enable warnings and infos for JS FIR tests 2023-11-27 14:31:31 +00:00
Evgeniy.Zhelenskiy 67b1bb448a [FIR] Report repeating parameters in dynamic functions in Kotlin/JS
^KT-59988
2023-11-21 13:12:46 +00:00
Nikolay Lunyak 425d5e808b [FIR] Link some tests with issues
Just in case.

^KT-59874
2023-11-14 15:19:33 +00:00
Vladimir Sukharev 8e4a6759a4 [FIR] Fix Disappeared INVALID_CHARACTERS
^KT-59996 Fixed
2023-10-31 22:04:06 +00:00
Alexander Korepanov 04809a6b3b [JS IR] Move tests for JS code diagnostics
^KT-62425
2023-10-26 19:22:14 +00:00
Mikhail Glukhikh 4ed7504d87 FIR deserializer: apply attributes on type parameter-based types
#KT-62578 Fixed
2023-10-18 10:30:31 +00:00
Vladimir Sukharev 242c1cf5f0 [FIR] Fix disappeared REPEATED_ANNOTATION for dynamic types
https://youtrack.jetbrains.com/issue/KT-59916/K2-Disappeared-REPEATEDANNOTATION
FirAnnotationChecker does not detect repeated annotation on dynamic type, since FirTypeResolverImpl wrongly did not convert source annotations to attributes of ConeDynamicType.
This MR improves FirTypeResolverImpl to convert attributes of FirDynamicTypeRef to annotations and attach them to ConeDynamicType.

Merge-request: KT-MR-12551
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-10-17 10:18:36 +00:00
Nikolay Lunyak cca04bbcc2 [FIR] Check test text for all alongside tests
For some reason the practice is to configure the K2
diagnostics tests as "alongside" and instruct K1
tests to ensure there are no unexpected differences
in the sources. But someone may still forget there is
something that they need to configure in the K1 runners.
2023-10-05 08:46:54 +00:00
Vladimir Sukharev 9ab6353032 [FIR] Fix some Disappeared CLASS_LITERAL_LHS_NOT_A_CLASS
^KT-59931
2023-10-04 14:45:23 +00:00
Ivan Kochurkin 3cd4f7c3aa [FIR] Consider @PlatformDependent annotation everywhere (including JS and Native)
^KT-57858 Fixed

Remove FirEmptyOverridesBackwardCompatibilityHelper since it's not used anymore

Remove overridesMemberWithPlatformDependent.kt test file since it becomes redundant
2023-09-20 17:12:52 +00:00
Kirill Rakhman dda6d20520 [FIR] Add test for WRONG_MULTIPLE_INHERITANCE with typealias
#KT-61921
2023-09-18 12:13:02 +00:00
Vladimir Sukharev 024fd9e21a [FIR JS] Don't raise diagnostic PROPERTY_AS_OPERATOR for dynamic types.
^KT-60043 Fixed


Merge-request: KT-MR-12161
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 12:58:15 +00:00
Alexander Korepanov f07028959d [FIR JS] Add more tests for JS_NAME_CLASH diagnostic
^KT-61862 Related
2023-09-13 10:54:57 +00:00
Alexander Korepanov ea9e2eb41a [FIR JS] Add more tests for JS_NAME_CLASH and JS_FAKE_NAME_CLASH
^KT-59425 Related
^KT-59370 Related
2023-09-08 09:55:25 +00:00
Alexander Korepanov 6bb939c6cb [FIR JS] Support JS_NAME_CLASH and JS_FAKE_NAME_CLASH diagnostics
^KT-59425 Fixed
^KT-59370 Fixed
2023-09-08 09:55:25 +00:00
Mikhail Glukhikh f20e2dec31 K2: generate Unit conversion for indexed assignment at raw FIR stage
#KT-59748 Fixed
2023-07-26 06:09:15 +00:00
Artem Kobzar 53aa8eddfe [K/JS] Generate unstable names on Frontend-checks for declarations with the JsExport.Ignore annotation ^KT-60202 Fixed 2023-07-24 09:52:58 +00:00
Alexander Korepanov 89c3781c8e [JS FIR] Support NAME_CONTAINS_ILLEGAL_CHARS diagnostic
^KT-59392 Fixed
2023-07-21 13:54:34 +00:00
Alexander Korepanov 37c8ec1e51 [JS FIR] Support JS_BUILTIN_NAME_CLASH diagnostic
^KT-59391 Fixed
2023-07-21 13:54:34 +00:00
Alexander Korepanov 08d158f901 [JS FIR] Support JS module system FE diagnostics
Support CALL_TO_JS_MODULE_WITHOUT_MODULE_SYSTEM diagnostic
^KT-59377 Fixed

Support CALL_TO_JS_NON_MODULE_WITH_MODULE_SYSTEM diagnostic
^KT-59381 Fixed

Support CALL_FROM_UMD_MUST_BE_JS_MODULE_AND_JS_NON_MODULE diagnostic
^KT-59417 Fixed
2023-07-18 14:02:30 +00:00
Alexander Korepanov 6034d32d7c [JS FIR] Support DYNAMIC_NOT_ALLOWED diagnostic
^KT-59384 Fixed
2023-07-18 14:02:30 +00:00
Alexander Korepanov 39fba56de9 [JS FIR] Support PROPERTY_DELEGATION_BY_DYNAMIC diagnostic
^KT-59406 Fixed
2023-07-18 14:02:30 +00:00
Alexander Korepanov f6b7a07efe [JS FIR] Support EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT diagnostic
^KT-59416 Fixed
2023-07-18 14:02:30 +00:00
Ilya Goncharov cb5b26d2e7 [JS] Fix diagnostics test data with IR compiler 2023-07-04 18:04:14 +00:00
Nikolay Lunyak 360d236b7e [FIR JS] KT-57601: Get rid of the builtin provider
In this example we get 2 variants of `kotlin/toString()`:
one coming from the KLib provider, and the
other coming from the builtins provider.
These are identical deserialized functions.

^KT-57601 Fixed
2023-04-25 11:29:34 +00:00
Kirill Rakhman d96c33e080 [FIR] Add dynamic stages to callable reference resolution
This fixes an overload resolution ambiguity on callable references
in the presence of a dynamic extension receiver.

#KT-58143 Fixed
2023-04-25 10:03:40 +00:00
Kirill Rakhman 6972391185 [FE] Make dynamic a suitable resulted type
This fixes a FIR-specific issue where a type variable is inferred to
Any instead of dynamic. K1 wasn't affected because of a FIR-specific
condition in ResultTypeResolver.

#KT-57962 Fixed
2023-04-20 08:45:42 +00:00
Kirill Rakhman 8b47a4fa48 [FIR] Fix resolution of objects in presence of low-priority candidates
For CallKind.VariableAccess, the condition when to *skip* resolution of
objects was previously collector.isSuccess. This wasn't strict enough
because collector.isSuccess could be true when the best found candidate
has an applicability like RESOLVED_WITH_LOW_PRIORITY (e.g. from dynamic
scope or annotated with @LowPriorityInOverloadResolution). In these
cases, we do want to resolve objects. To fix this, the condition is
changed to collector.shouldStopResolve which is stricter.

#KT-57960 Fixed
2023-04-20 08:04:07 +00:00
Kirill Rakhman ff7072830f [FIR] Make lambda parameters of dynamic function calls dynamic
#KT-57961 Fixed
2023-04-18 13:43:45 +00:00
Kirill Rakhman a3bf61c3f7 [FIR] Fix false positive error for trailing lambda on dynamic call
#KT-57961
2023-04-18 13:43:44 +00:00
Alexander Korepanov e8be3043cc [JS IR] Allow restriction of function argument by external type
Add a special annotation @JsExternalTypeArgument for
 marking function parameters. The marked parameter
 accepts an argument with an external type only.

^KT-57479 Fixed
2023-04-17 08:21:10 +00:00
Nikolay Lunyak 077f49f33b [FIR JS] KT-57822: Don't report the diagnostic for non-qualifiers
^KT-57822 Fixed
2023-04-11 13:20:42 +00:00
Nikolay Lunyak 247f5529d2 [FIR] KT-57809: Allow external constructors without arguments
The constructor with the required parameters may
not have been defined, and since JS/IR box tests
pass, it seems, we don't have to resolve
into anything meaningful. We could generate
the appropriate constructor like dynamic type
members are generated, but, again, K1 IR doesn't
even contain a delegating constructor call.

^KT-57809 Fixed
2023-04-11 08:15:44 +00:00
Ivan Kochurkin 9a5cc39588 [FIR] Use FirDefaultOverridesBackwardCompatibilityHelper with common metadata compilation
Also, use it with JS compilation

^KT-57735 Fixed
2023-04-06 22:27:24 +02:00