Commit Graph

273 Commits

Author SHA1 Message Date
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
Nikolay Lunyak 03e2152957 [FIR JS] Support 2 JS diagnostics
The change in `FirDiagnosticsHandler` ensures
`DEBUG_INFO_DYNAMIC` is still reported in
`FirPsiJsOldFrontendDiagnosticsTestGenerated.testConventions`.

Support `SPREAD_OPERATOR_IN_DYNAMIC_CALL` and
`WRONG_OPERATION_WITH_DYNAMIC`
2023-04-05 16:51:51 +00:00
Nikolay Lunyak 3b0a923210 [FIR] KT-57665: Make dynamic members' parameters dynamic
Parameter types are not only used "to accept" some data,
but they also are used as inputs for inference
(expected types)

^KT-57665 Fixed
2023-04-05 16:51:50 +00:00
Nikolay Lunyak 18f80b1ab5 [FIR] KT-57665: Ensure the current K2 behavior differs from K1 2023-04-05 16:51:50 +00:00
Alexander Korepanov 4813b659ab [JS IR] Control an inheritance of non-external entity from external
Add a special annotation @JsExternalInheritorsOnly for marking
 external interfaces and classes. The marked interface or class
 can’t be a parent for non external interfaces, classes or objects.

^KT-57423 Fixed
2023-04-05 09:00:45 +00:00
Nikolay Lunyak f644eb7988 [FIR JS] Implement FirJsExportDeclarationChecker 2023-03-29 08:51:48 +03:00
Nikolay Lunyak 624162dc07 [FIR JS] Report NESTED_JS_EXPORT 2023-03-29 08:51:48 +03:00
Nikolay Lunyak 8f94899187 [FIR JS] Fix a typo in the dynamic upper bound check
`FirDynamicTypeRef` is the unresolved version, and after resolution it
becomes `FirResolvedTypeRef` with `ConeDynamicType`.
2023-03-29 08:51:48 +03:00
Nikolay Lunyak 2b5d2dc539 [FIR JS] Report rtti-related diagnostics 2023-03-29 08:51:48 +03:00
Nikolay Lunyak b385d787cc [FIR JS] KT-57200: Allow dynamic varargs
^KT-57200 Fixed
2023-03-13 15:54:52 +00:00
Artem Kobzar 633d840c88 [K/JS] Deprecate external enum declarations
^KT-57254 Fixed
2023-03-10 12:55:43 +00:00
Nikolay Lunyak 2e8b177262 [FIR] Support typealiases in FirJsRuntimeAnnotationChecker 2023-01-17 06:26:37 +00:00
Nikolay Lunyak fc285c079e [FIR] Support typealiases in FirJsAbstractNativeAnnotationChecker 2023-01-17 06:26:37 +00:00
Nikolay Lunyak 5817155616 [FIR JS] Implement FirJsNameChecker 2023-01-09 08:57:12 +00:00
Nikolay Lunyak 2f9831ed99 [FIR JS] Stop reporting NON_MEMBER_FUNCTION_NO_BODY for js natives 2023-01-09 08:57:12 +00:00
Nikolay Lunyak 85bcef537c [FIR JS] Support NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE 2023-01-09 08:57:12 +00:00
Nikolay Lunyak 5b3a73f7cd [FIR JS] Implement FirJsNativeAnnotationChecker 2023-01-09 08:57:12 +00:00
Nikolay Lunyak a20e29e8b7 [FIR JS] Implement FirJsExternalChecker
The JsAllowValueClassesInExternals feature is enabled explicitly,
because otherwise it's enabled
implicitly depending on the backend. See:
org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt:90

A property may have a fake source return kind, while its accessor
has a real source kind. In this case we can't "just copy"
the property return type down to the accessor.
2023-01-09 08:57:11 +00:00
Nikolay Lunyak 7b8f5f9980 [FIR JS] Implement FirJsRuntimeAnnotationChecker 2023-01-09 08:57:11 +00:00
Nikolay Lunyak 56285bb2d6 [FIR JS] Report CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION 2023-01-09 08:57:11 +00:00
Nikolay Lunyak 4cf8d9ffb9 [FIR JS] Implement FirJsInheritanceChecker 2023-01-09 08:57:10 +00:00
Nikolay Lunyak 9e1c6f2f61 [FIR JS] Support DYNAMIC_SUPERTYPE 2023-01-09 08:57:10 +00:00
Nikolay Lunyak 227969d787 [FIR JS] Support DYNAMIC_RECEIVER_NOT_ALLOWED 2023-01-09 08:57:10 +00:00
Nikolay Lunyak 0f876f665a [FIR JS] Support DELEGATION_BY_DYNAMIC 2023-01-09 08:57:09 +00:00
Nikolay Lunyak 95b589fd94 [FIR JS] Support DEBUG_INFO_DYNAMIC 2023-01-09 08:57:09 +00:00
Nikolay Lunyak eed2fada1f [FIR JS] Support WRONG_MULTIPLE_INHERITANCE 2023-01-09 08:57:09 +00:00
Nikolay Lunyak 0426f35684 [FIR JS] Report JS_MODULE-related diagnostics 2023-01-09 08:57:08 +00:00
Nikolay Lunyak f422a3a4e8 [FIR JS] Report WRONG_JS_QUALIFIER for the argument of JsQualifier 2023-01-09 08:57:08 +00:00
Nikolay Lunyak 73c89a5d9d [FIR JS] Prepare the test data for FIR 2023-01-09 08:57:08 +00:00
Artem Kobzar 7d881842b4 [K/JS] Include protected member declarations into checked by JsExportDeclarationChecker declarations ^Fixed KT-55786 2023-01-05 16:30:23 +00:00
Artem Kobzar 14e4febb05 [K/JS] Exclude default from the regular reserved keywords to give ability to export declarations with default export ^KT-54480 Fixed
fix(KT-54480): exclude default from the regular reserved keywords to give ability to export intities with default export.

Merge-request: KT-MR-7459
Merged-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>
2022-10-24 10:12:30 +00:00
Nikolay Lunyak fcd3e4f4c5 [FIR JS] KT-51740: Alter positioning of NO_VALUE_FOR_PARAMETER 2022-09-30 21:39:20 +03:00
Artem Kobzar dbda8dcad1 [K/JS] test: add @file:JsExport tests for each @JsExport test + auto-generate TypeScript export tests. 2022-08-26 09:51:59 +00:00
Ilya Goncharov 2f75ea585e [JS, Frontend] Not report warning with non-exportable super type
^KT-53539 fixed
2022-08-18 12:46:40 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00
Victor Petukhov 42e71f8c53 Remove explicit enabling the new type inference from test data 2022-07-22 16:03:52 +00:00
Victor Petukhov 2378979a99 [FE JS] Support until operator in WRONG_OPERATION_WITH_DYNAMIC error 2022-05-31 08:42:55 +00:00
Ivan Kylchik 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03:00
Artem Kobzar 6da3b3b274 fix: remove unnecessary warnings for export declarations. 2022-05-13 11:10:17 +00:00
Artem Kobzar a2b40acc98 feat: add WARNING on usage top-level exportable declarations with non-consumable identifiers. 2022-05-04 11:22:57 +00:00
Victor Petukhov 27fa632630 [FE 1.0] Update test data with new error type representation 2022-03-23 21:13:33 +00:00