Marco Pennekamp
c63dde4f7e
[AA] Add abstraction for composite provider creation and merging
...
- Composite declaration providers and declaration provider mergers are
extremely similar to the composite package providers and (newly to be
implemented) package provider mergers. This commit extracts the common
parts into a `KotlinCompositeProviderFactory`.
^KT-61791
2023-10-12 16:10:32 +00:00
Marco Pennekamp
0e6cc92958
[LL FIR] Optimize getPackage in combined Kotlin symbol providers
...
- `getPackage` can also benefit from a combined index access.
- Care has to be taken with allowed/disallowed `kotlin` packages. Since
we're not delegating to individual symbol providers after the index
access, `allowKotlinPackage` has to be taken into account in the
combined symbol provider explicitly.
^KT-61791 fixed
2023-10-12 16:10:32 +00:00
Jaebaek Seo
a6c432587f
K2: Add extension point for additional KDoc resolution
...
Similar to K1 KDocLinkResolutionService used by Fe10KDocReference (to
support additional KDoc resolution), this commit adds K2 counterpart
AdditionalKDocResolutionProvider and uses it for KDocReferenceResolver.
^KT-62187
2023-10-12 15:17:31 +00:00
Ilya Kirillov
34ea0678ae
[Analysis API Standalone] refactoring, use predefined paths to libraries in StandaloneSessionBuilderTest wher it's possible
2023-10-12 15:15:05 +00:00
Ilya Kirillov
4d38cc4548
[Analysis API Standalone] fix exception on invalid KLib from symbol provider
...
^KT-62244 fixed
2023-10-12 15:15:05 +00:00
Mikhail Glukhikh
d005d1cd68
Add accidentally forgotten IrSourceRangesDumpHandler to IR text tests
2023-10-12 15:06:47 +00:00
strangepleasures
2319e11ff1
[KAPT] KT-62059 Disable incremental stub generation in K2
2023-10-12 13:37:23 +00:00
Igor Chevdar
a8c6074c45
[IR] Use InlineFunctionResolver for inlinable function references
...
#KT-62313 Fixed
2023-10-12 13:34:13 +00:00
Igor Chevdar
c6470a684d
[box-tests] Added a reproducer for #KT-62313
2023-10-12 13:34:13 +00:00
Svyatoslav Kuzmich
d9cb41d242
Refactor: remove empty overrides in K2 checkers
2023-10-12 13:26:58 +00:00
Svyatoslav Kuzmich
c73e1f678e
Fix copyright year in Wasm K2 checkers
2023-10-12 13:26:58 +00:00
Svyatoslav Kuzmich
0295057520
Refactor: extract test generation regexp into a common util object
2023-10-12 13:26:58 +00:00
Svyatoslav Kuzmich
881997585a
[Wasm] Add K2 checkers.web.common module (KT-56849)
...
This module is created to share JS and Wasm checker logic
Extract isEffectivelyExternal util fun from K/JS in order to
reuse it in Wasm checkers
2023-10-12 13:26:58 +00:00
Svyatoslav Kuzmich
a10042f909
[Wasm] Add K2 checkers.wasm module (KT-56849)
...
Add first K2 checker ExternalInheritanceChecker to test the infra
2023-10-12 13:26:58 +00:00
Svyatoslav Kuzmich
0da9cf8159
[Wasm] Add K2 diagnostic tests (KT-56849)
2023-10-12 13:26:58 +00:00
Svyatoslav Kuzmich
1ddcdb95bd
[Wasm] Add compiler.common.wasm module
...
This module is introduced to mirror K/JS code layout
Add WasmStandardClassIds to use in checkers
2023-10-12 13:26:58 +00:00
Ivan Kylchik
96a2da4906
[JVM] Split mergeControlFlowEdge into full and fast versions
...
This is needed because for `FastStackAnalyzer` we actually
will use only `fast` version, that can potentially improve overall
performance.
2023-10-12 13:04:43 +00:00
Ivan Kylchik
07c7792693
[JVM] Drop toArray call where iterator can be used
2023-10-12 13:04:43 +00:00
Ivan Kylchik
2387fe302c
[JVM] Use reference comparison for objects defined in StrictBasicValue
2023-10-12 13:04:43 +00:00
Ivan Kylchik
c1c04376cf
[JVM] Replace open functions in FastAnalyzer with constructor args
2023-10-12 13:04:43 +00:00
Ivan Kylchik
99655cfa15
[JVM] Make newFrame constructor's parameter for FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
cfe38470af
[JVM] Use composition instead of inheritance in FixStackAnalyzer
...
This way we will be able to pass `createFrame` argument
directly to `FastAnalyzer`.
2023-10-12 13:04:43 +00:00
Ivan Kylchik
2327800a95
[JVM] Make BoxingInterpreter an abstract class instead of open
...
This way, it is a little bit easier to fit the semantics of this
class in the head.
2023-10-12 13:04:43 +00:00
Ivan Kylchik
38dd75c6c8
[JVM] Drop boxingInterpreter constructor parameter from BoxingFrame
2023-10-12 13:04:43 +00:00
Ivan Kylchik
6d57cbe23c
[JVM] Reorganize positions of methods in FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
895afc736d
[JVM] Drop I : Interpreter<V> type parameter from FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
87c46db3d5
[JVM] Drop getFrame and setFrame methods from FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
f7f253d2bf
[JVM] Move isTcbStart computation in FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
53d9b3c54f
[JVM] Combine all mergeControlFlowEdge methods
...
This is just a refactoring commit. All fast analyzers are doing the
same thing in `mergeControlFlowEdge`, so we extract it in common
`FastAnalyzer`. The only exception is `FastStackAnalyzer`.
There was no `isMergeNode` check, but this is an optimization
that allows us to reuse a frame and not copy it.
2023-10-12 13:04:42 +00:00
Ivan Kylchik
68e4a7a318
[JVM] Combine all analyzeInstruction methods
2023-10-12 13:04:42 +00:00
Ivan Kylchik
58473b94a7
[JVM] Reuse visitNopInsn method in all Fast...Analyzer classes
2023-10-12 13:04:42 +00:00
Ivan Kylchik
ed95ebc585
[JVM] Move visit...Insn methods in FastAnalyzer
...
They are actually the same.
2023-10-12 13:04:42 +00:00
Ivan Kylchik
7845e6bb0a
[JVM] Drop visitControlFlowExceptionEdge method from FastStackAnalyzer
...
There is no class that overrides this method.
Also replaced `newValue` call with `newExceptionValue`. Under the hood,
`newExceptionValue` still calls `newValue` if the interpreter doesn't
redefine it. And it kind of makes sense to call `newExceptionValue`
here because we are handling try-catch block.
2023-10-12 13:04:42 +00:00
Ivan Kylchik
e9019e9fb3
[JVM] Drop StoreLoadInterpreter class
2023-10-12 13:04:42 +00:00
Ivan Kylchik
364faa9506
[JVM] Drop StoreLoadValue interface
2023-10-12 13:04:42 +00:00
Roman Efremov
a05b37c652
[K2] Support reporting of SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS
...
...on regular classes and enum entries.
^KT-59979 Fixed
2023-10-12 13:01:40 +00:00
Roman Efremov
32a87836c2
[Test] Improve test of SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS diagnostic
...
Add case where explicit primary constructor is present in expect,
so that SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR is not
reported.
^KT-59979
2023-10-12 13:01:40 +00:00
Simon Ogorodnik
13b6653899
[FIR] Add todo to remove violation of lookup tag contract
2023-10-12 12:27:54 +00:00
Simon Ogorodnik
024e94a479
[K2] Document KMP implementation in the K2 Compiler
...
Add comprehensive documentation explaining the implementation and
functions of the Kotlin multiplatform (KMP) support in the K2 Compiler.
2023-10-12 12:27:54 +00:00
Sergej Jaskiewicz
04c0cc5a5c
[FIR generator] In properties always print get() ... on new line
...
This is to unify the code formatting with IR classes.
2023-10-12 11:45:55 +00:00
Sergej Jaskiewicz
4507615c69
[FIR generator] Print accept method's body on new line
...
This is to unify the code formatting with IR classes
2023-10-12 11:45:55 +00:00
Sergej Jaskiewicz
04ac4b71a3
[FIR generator] Replace AbstractElement with ElemenOrRef
...
In the FIR generator, the `AbstractElement` class was used to
represent either an element type without type arguments applied
(using the `Element` subclass), or an element type with applied type
arguments (using the `ElementWithArguments` subclass).
Instead, it is more logical to use the `Element` class to always
represent a non-parameterized element type, and for a parameterized
element type use the `ElementRef` class, just like we do
in the IR generator.
2023-10-12 11:36:20 +00:00
Ilya Kirillov
86c8f3cc35
Remove obsolete @OptIn(ExperimentalUnsignedTypes::class) annotations
...
^KT-62510
2023-10-12 10:41:00 +00:00
Ilya Kirillov
f11cb277cd
Remove obsolete @OptIn(ExperimentalStdlibApi::class) annotations
...
They were added when `buildList`, `buildMap` and `buildSet` were experimental.
^KT-62510
2023-10-12 10:41:00 +00:00
Ilya Goncharov
376d27dc6a
[Gradle, Wasm] Fix proxy for karma wasm tests on windows
...
^KT-62128 fixed
2023-10-12 09:27:34 +00:00
Anastasia.Nekrasova
4c9ad970ff
[K2] Violation of OPT_IN_USAGE_ERROR non-propagating opt-in rules for typealias
...
^KT-62451
2023-10-12 09:03:39 +00:00
Anastasia.Nekrasova
6d446abe12
[K2] Disappeared OPT_IN_USAGE_ERROR for typealias
...
^KT-62451
2023-10-12 09:03:39 +00:00
Nikolay Lunyak
54285736d0
[FIR] Don't miss diagnostics passed to @Suppress as names = []
...
In these cases we have a `FirVarargArgumentsExpression`
with a `FirNamedArgumentExpression` inside as its first
argument, which, in turn, has a `FirArrayLiteral`
argument.
^KT-62146 Fixed
2023-10-12 08:56:12 +00:00
Nikolay Lunyak
598b5dbdf4
[FIR] Reproduce KT-62146
2023-10-12 08:56:12 +00:00
Alejandro Serrano Mena
166b99181b
[Test] Ensure that properties cannot be used as operators
...
In some cases the combination of property + invoke was incorrectly allowed
^KT-62349
2023-10-12 08:32:17 +00:00