Commit Graph

40737 Commits

Author SHA1 Message Date
Nikolay Lunyak 24dfb14654 [FIR] KT-53493: Turn VAL_OR_VAR_ON_*_PARAMETER warnings into errors
Merge-request: KT-MR-7032
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-06 08:40:48 +00:00
Pavel Mikhailovskii 6a14400342 KT-53804 Restore old and incorrect logic of generating InnerClasses attributes for kotlin-stdlib 2022-09-05 14:02:52 +00:00
Pavel Kunyavskiy 4d64f3a422 Ignore added test for JS backend 2022-09-05 12:20:21 +00:00
Alexander Korepanov 453faeaa45 [JS IR] Memory consumption optimization
- Remove IR after JS AST generation
 - Remove JS AST after/during JS code generation
2022-09-05 11:15:55 +00:00
Alexander Korepanov c747d0e742 [JS IR] Optimize JS AST blocks memory consumption 2022-09-05 11:15:54 +00:00
Alexander Korepanov ea34e10b67 [JS IR] Optimize JS AST scopes memory consumption 2022-09-05 11:15:54 +00:00
Alexander Korepanov bf53273b84 [JS IR] Cache JsLocation objects and js function signatures
Memory consumption optimization
2022-09-05 11:15:53 +00:00
Alexander Korepanov ff2f16190d [JS IR] Minor: eliminate unused vals 2022-09-05 11:15:53 +00:00
Dmitriy Novozhilov a6d3c6e5c6 [Serialization] Suppress OPT_IN errors in all diagnostic tests 2022-09-05 10:20:06 +00:00
Dmitriy Novozhilov 21aec49709 [Tests] Add ability to have separate asm instructions dump for fir + ir setup 2022-09-05 10:20:05 +00:00
Simon Ogorodnik 4dd7437df1 Fix kind of NoBuilderInferenceWithoutAnnotationRestriction
BUG_FIX kind causes feature to enable in progressive mode, which
wasn't intended
2022-09-05 10:07:42 +00:00
Simon Ogorodnik 05d486d55a Fix receiver inconsistency when builder inference restriction disabled
In 154e53c701 update of
extensionReceiverArgument in resolvedCall was accidentally moved into
language feature dependant block
2022-09-05 10:07:41 +00:00
Alexander Korepanov 01507281a2 [Common IR] Forward the extension receiver in the reified wrapper
^KT-53672 Fixed
2022-09-05 07:40:30 +00:00
Pavel Kunyavskiy d822d3e7c6 [K/N] Reenable constant inlining except for Double nan constants
^KT-52970
2022-09-05 06:06:44 +00:00
Artem Kobzar 0bb0be8703 feat(KT-48814): represent all of the external declarations nullable properties as an optional fields inside d.ts. 2022-09-02 10:50:20 +00:00
Nikolay Lunyak 3d9c77efa8 [FIR] Add DNN checks
Merge-request: KT-MR-7000
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-01 14:25:07 +00:00
Alexander Udalov 13ca189825 Support -Xjdk-release=8 as alias for -Xjdk-release=1.8
#KT-53278 Fixed
2022-09-01 12:15:47 +02:00
Alexander Udalov 19bbcc5869 Do not generate metadata for callable reference classes
After an accidental change in 846537b367, we started generating metadata
into anonymous classes for callable references. This metadata contained
the Kotlin representation of the referenced function. In KT-53794, this
led to a problem where Java's protected visibility could not be
represented in Kotlin terms, which crashed the backend.

But also, this metadata is useless because there's no real use case for
interpreting it (since you already have a function reference object at
runtime with all the needed information), so it would take some extra
space in the bytecode.

 #KT-53794 Fixed
2022-09-01 12:15:25 +02:00
Pavel Kirpichenkov 24dcad0d9c [MPP] Use module's type checker for upper bound checks
The default type checker doesn't have a correct type refinement setup.
This can cause false positives in subtyping of upper bounds in edge
cases with expect type arguments.

See the tests in the intellij repo.

KTIJ-22295
2022-09-01 09:51:11 +00:00
Svyatoslav Scherbina f8462f1b0c Native: allow virtual calls in CoroutineLaunchpad intrinsic
This intrinsic was always calling the supplied suspend function
non-virtually, and this was hardcoded in the intrinsic generator.
Now this can be configured with `superQualifierSymbol` in the respective
IrCall, just the way this works with any other calls.

As a side effect, global optimizations now process this intrinsic more
correctly (before that, they didn't take the intrinsic generator into
account, and treated the call as virtual).
2022-09-01 09:35:23 +00:00
Alexander Udalov a76de14026 Remove obsolete compiler argument -Xsingle-module
#KT-51622
2022-08-31 20:54:50 +02:00
Alexander Udalov abaffeddab Remove LocalClassProtoTestGenerated, replace with kotlinp tests
This test uses a hacky mode of the compiler which is not worth it to
support further (especially in K2), `USE_SINGLE_MODULE`, where
everything is compiled in one module. The purpose of the test is just to
check that metadata for local/anonymous classes is written correctly.
So we can replace it with the tests on kotlinp, which uses
kotlinx-metadata-jvm and dumps all loaded metadata to text.

This replacement is not perfect, in particular because it won't check
that the reflection machinery is able to load this metadata, and because
it won't check that annotations are loaded correctly from the bytecode.
But IMHO it's good enough, there are box tests on reflection on local
classes (e.g. `reflection/annotations/localClassLiteral.kt`), so this
way is better than having to support the weird compiler mode for just
one test.
2022-08-31 20:54:50 +02:00
Roman Golyshev 35116696b2 Add missing @Override annotation to KtParameter 2022-08-31 12:41:44 +00:00
Denis.Zharkov 490382b77f Add test for KT-52782
It just demonstrates/fixate the current "broken" behavior in K1
that we unfortunately have and that is fixed in K2
2022-08-31 09:45:54 +00:00
Denis.Zharkov db1bd4f232 Add test for KT-53124
The issue itself is supposed to be fixed after eb19d39cbf reverted

^KT-53124 Fixed
2022-08-30 15:56:31 +00:00
Denis.Zharkov 42c41a1916 Revert "[FE 1.0] Build captured type's supertypes in an alternative way: use own projection type as a first supertype, then supertypes from the corresponding type parameter's upper bounds"
This reverts commit eb19d39cbf.
2022-08-30 15:56:30 +00:00
Roman Golyshev 16cb3064c8 [FIR] Resolve value class constructor to TYPES before using its params
Right now it is the easiest way to ensure that all the parameters are
resolved. After KT-53573 is fixed, we might use `resolvedReturnTypeRef`
on each parameter individually instead

Also, add `toString` implementation to `ValueClassRepresentation`
classes, so they are properly rendered in testdata

^KTIJ-22630 Fixed
2022-08-30 13:49:40 +00:00
Sergej Jaskiewicz 17f22c7204 [JS IR] Use a special executor for stepping tests
This will hopefully fix flakiness for some tests
2022-08-30 13:38:47 +00:00
Denis.Zharkov f4a3ab877f Add test for parsing issue KT-53719
^KT-53719 Related
2022-08-30 11:21:51 +00:00
Denis.Zharkov 3d7969ec8f Revert "KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing"
This reverts commit 2053363def.

^KT-35811 Open
2022-08-30 11:21:50 +00:00
Denis.Zharkov 211d662708 Revert "KT-8263: Conditional operators are not parsed correctly"
This reverts commit ec8da2033c.

For the reason for the revert see KT-53719

^KT-8263 Open
^KT-53719 Fixed
2022-08-30 11:21:50 +00:00
Simon Ogorodnik 154e53c701 K1: add diagnostic BUILDER_INFERENCE_STUB_RECEIVER
It's reported on receivers in extension function calls with stub type,
as such calls can shadow members of finalized stub types causing
change of resolve when corresponding type argument specified explicitly

It works by checking extension receiver during call resolution parts run
That way we can easily detect if we found an extension applicable to
stub receiver and report call diagnostic for it

KT-53739
2022-08-30 10:19:26 +00:00
Simon Ogorodnik 105358dcf6 K1: add diagnostic BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION
Let's call builder lambdas (BL) a lambda that has non-fixed input type
projection at the moment of lambda arguments analysis, such lambdas
is a subject to be analyzed with builder inference
Due to bug in constraint system joining algorithm, currently system
of two or more such lambdas may lead to unsound type inference

Diagnostic added here should be reported in case when there are two
BL that shares a common constraint system, while not annotated with
@BuilderInference, as a protection against aforementioned bug

It's reported by ConstraintSystemCompleter when such situation has
occurred during builder inference phase, it is the same place that
decides wherever lambdas is subject to builder inference or not

KT-53740
2022-08-30 10:19:25 +00:00
Simon Ogorodnik db0d8d9f57 Add language feature for diagnostics in builder inference restriction 2022-08-30 10:19:25 +00:00
Simon Ogorodnik 4227fd012f Fix test for two builder inference lambdas 2022-08-30 10:19:24 +00:00
Mikhail Glukhikh f6ad6fb816 Add test for stub type receiver and for KT-53639 2022-08-30 10:19:24 +00:00
Mikhail Glukhikh 5cbecd276c FE: add test reproducing builder inference problem from KT-53422 2022-08-30 10:19:23 +00:00
Dmitriy Dolovov 444cdaa2d8 [Native][tests] Re-enable internalFromFriendModule codegen box test
^KT-53723

This reverts commit 6594ebe487f0758e0fab880e2902d3d28eca7f44.
2022-08-30 07:56:18 +00:00
Igor Chevdar ea4a841056 [box-tests] Ignored a test for K/N for now
The test checks internal declarations visibility from friend module,
the K/N test system is broken for now if uses caches
2022-08-30 07:29:07 +00:00
Igor Chevdar ced974fcb7 [IR] Fixed non-friend module visibility for LazyIR caches
K/N builds Lazy IR for cached libraries - so no IrModule for them,
have to use descriptors to find the module's name for the friend module predicate
2022-08-30 07:29:07 +00:00
Nikolay Krasko cfc013137e Fix compile error
Introduced in 43ce805499
2022-08-29 21:58:57 +02:00
Artem Kobzar 43ce805499 chore: fix typo in a method name. 2022-08-29 18:05:45 +00:00
Artem Kobzar 8b826a865b [K/JS, K/WASM] feat(Enum.entries): add support of new enum static field for JS and WASM. 2022-08-29 16:04:12 +00:00
Mikhael Bogdanov bd6aff7f6a Xjdk-release: avoid folder duplication 2022-08-29 12:26:27 +00:00
Dmitry Gridin 924dd38144 [lc] introduce KotlinAsJavaSupportBase with new common facade logic
^KT-53543
2022-08-29 11:51:42 +00:00
Dmitry Gridin 5be31e575c [lc] extract common code to KtLightClassForFacadeBase
^KT-53543
2022-08-29 11:51:41 +00:00
Dmitry Gridin acfbe30f7c [lc] drop redundant PsiManager argument from KtLightClassForFacadeBase
^KT-53543
2022-08-29 11:51:40 +00:00
Alexander Udalov 690322b203 Add flag -Xno-new-java-annotation-targets
Do not generate TYPE_USE/TYPE_PARAMETER Java annotation targets when
this flag is specified.

 #KT-53712 Fixed
2022-08-29 13:43:49 +02:00
Alexander Udalov a09fd45ade Do not generate TYPE_USE/TYPE_PARAMETER when compiling against JDK 1.6
#KT-53712
2022-08-29 13:43:32 +02:00
Simon Ogorodnik 8f51c51eee FIR. Fix smart-cast expression unwrapping in plus with assign resolve 2022-08-26 14:57:06 +00:00