Commit Graph

100931 Commits

Author SHA1 Message Date
Kirill Rakhman bdf0b41026 [FIR] Consolidate SYNTAX and SYNTAX_WITH_MESSAGE diagnostics 2023-05-05 09:34:23 +00:00
Kirill Rakhman 871a148529 [FIR] Prevent duplicate SYNTAX diagnostic for top-level destructuring 2023-05-05 09:34:23 +00:00
Kirill Rakhman 9918526556 [FIR] Visit error properties in ErrorNodeDiagnosticCollectorComponent 2023-05-05 09:34:23 +00:00
Kirill Rakhman 9e34a5ad82 [FIR] Ignore error declarations in conflict checking 2023-05-05 09:34:23 +00:00
Kirill Rakhman 4c6b6dd700 [FIR] Render error properties and function in FirRenderer 2023-05-05 09:34:23 +00:00
Dmitriy Dolovov 5beec6b543 [Native][tests] Avoid failing with IO exceptions when the process under test is intentionally killed 2023-05-04 23:17:58 +00:00
Anna Kozlova 799210262d [decompiler] skip return type check for src functions without return type 2023-05-04 21:31:43 +00:00
Xin Wang 7b4e6bae0e JVM: ensure the $ENTRIES field is initialized before use
#KT-57784 Fixed
2023-05-04 23:11:39 +02:00
Vladimir Sukharev 79599ab69e [K2/N] Add ObjCExport test for kdoc strings
^KT-56090

Merge-request: KT-MR-9926
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-04 19:17:00 +00:00
Evgeniy.Zhelenskiy d24eaf13b5 [FIR] Fix value parameter indexes when using context receivers
#KT-1179 #KT-10468
2023-05-04 16:44:18 +00:00
Evgeniy.Zhelenskiy bf5fa61ffb [IR] Unify MFVC bridge redirection, fix related bugs, support MFVC overriding functions with default parameters
#KT-1179
2023-05-04 16:44:18 +00:00
Jinseong Jeon 384ed9cc9e AA: regression test for default value that calls previous params 2023-05-04 18:26:32 +02:00
Anton Lakotka 6e6659fc2a [Gradle] Remove workarounds for KT-57483 from tests
^KT-57483
^KT-58316 Verification Pending
2023-05-04 15:35:34 +00:00
Anton Lakotka a1eff2cd85 [Gradle] Test kotlinNativeFrameworkNameAttribute on fat frameworks
^KT-58316 Verification Pending
2023-05-04 15:35:34 +00:00
Anton Lakotka 7c5d1b4030 [Gradle] Add kotlinNativeFrameworkNameAttribute to fat frameworks as well
^KT-58316 Verification Pending
2023-05-04 15:35:34 +00:00
Ilya Kirillov ba3a3915c7 [Analysis API] tests: use tagged caret to find declaration to analyze in the air against
We cannot use a KtFile as analysis context.

^KT-55527
2023-05-04 15:26:50 +00:00
Ilya Kirillov 66de893963 [LL FIR] refactoring: rename LowLevelFirApiFacadeForResolveOnAir.onAirGetTowerContextProvider -> getOnAirGetTowerContextProvider
so it matches its counterpart getOnAirTowerDataContextProviderForTheWholeFile
2023-05-04 15:26:50 +00:00
Ilya Kirillov eeac3f53b4 [Analysis API] add tests for getImportingScopeContext
^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov 20f921c0bf [Analysis API] fix getScopeContextForFile and clarify its semantic
It was used to get importing scope, so it was renamed to getImportingScopeContext.

It was broken after changing the behaviour of `LowLevelFirApiFacadeForResolveOnAir.onAirGetTowerContextProvider` for the whole file

^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov 254092a267 [Analysis API FIR] tests: add ability to ignore specific scope kind in TestScopeRenderer
^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov 349e55cb00 [Analysis API FIR] refactor, extract createScopesWithKind to a separate function
it will be reused in the following commits

^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov 67041851fc [LL FIR] tests: extract scope rendering utilities to a separate object
For further reuse

^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov e9f75b1350 [LL FIR] add test which checks reference shortening for the whole file
^KT-57966
2023-05-04 15:26:50 +00:00
Ilya Kirillov bb7037aa8e [LL FIR] extract shortening rendering for tests to a separate file
So it can be reused from other tests

^KT-57966 fixed
2023-05-04 15:26:50 +00:00
Ilya Kirillov 3b85715f0f [LL FIR] fix KtFirReferenceShortener collection for the whole file
previously it worked only for separate declarations

^KT-57966 fixed
2023-05-04 15:26:49 +00:00
Ilya Kirillov 793cb02c7d [LL FIR] allow collecting tower data context for entire FirFile
Before, it was done only for import statements

^KT-57966
2023-05-04 15:26:49 +00:00
Ilya Kirillov 8073e65162 [LL FIR] allow passing FirTowerDataContextCollector to
`LLFirModuleLazyDeclarationResolver.lazyResolveTarget`

so we can collect tower data context for any LLFirResolveTarget

^KT-57966
2023-05-04 15:26:49 +00:00
Sergej Jaskiewicz 89ecd1e0e2 [FIR] Respect exception suppression in Fir2IrResultsConverter
Only Fir2IrJvmResultsConverter respected
the IGNORE_FIR2IR_EXCEPTIONS_IF_FIR_CONTAINS_ERRORS test directive.
Fir2IrJsResultConverter didn't.

This is fixed here.
2023-05-04 14:58:06 +00:00
Sergej Jaskiewicz a74df3b4b4 [IR] Store manglers used for signature computation in IrBackendInput
We will need them in signature dump tests later.
2023-05-04 14:58:06 +00:00
Sergey Bogolepov a8b7306342 [K/N] KT-58422: Mute obsolete tests 2023-05-04 14:14:55 +00:00
Sergej Jaskiewicz 89ff7bd0db [IR] Add body printing strategy to Kotlin-like dumper 2023-05-04 14:11:19 +00:00
Sebastian Sellmair ca8af7786e [Gradle] Kotlin2JsCompile: convert enhancedFreeCompilerArgs to ArrayList
... using .toList():
Using ListProperty.get() can return List implementations
that do not play well with CompilerArguments.
In this particular case RegularImmutableList from guava was returned
which later failed in the copyBeanTo function

^KT-58427 Verification Pending
2023-05-04 14:06:15 +00:00
Sebastian Sellmair 736cbfc38e [Gradle] Implement KT58427ResolveJSCompilerArguments regression test
KT-58427
2023-05-04 14:06:15 +00:00
Sebastian Sellmair 4fe60a4149 [Gradle] Add test - setting languagesVersion and apiVersion in languageSettings
KT-58427
2023-05-04 14:06:15 +00:00
Vsevolod Tolstopyatov f4e8ae5191 Explicitly declare stability levels of declarations in kotlinx.cinterop package
* @ExperimentalForeignApi for all declarations that operate on
    unmanaged memory (i.e. pointers and references)
* @BetaInteropApi for the rest of the interoperability declarations,
    namely Swift/CInterop-specific interfaces and convenience-functions

### Implementation details

* Some typealiases are not marked explicitly because it crashes the compiler,
    yet their experimentality is properly propagated
* License header is adjusted where it previously had been existing
* Deprecated with ERROR interop declarations that are deprecated for more than
    two years are removed
* WASM target interop declarations are deprecated
* Deliberately make Boolean.toByte and Byte.toBoolean foreign-experimental to scare
    people away

^KT-57728 fixed

Merge-request: KT-MR-9788
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-05-04 13:52:21 +00:00
Simon Ogorodnik 82611ad124 FIR. BI: Fix stub type leakage in builder inference
Previously, updateTypeInBuilderInference was calling
updateTypeFromSmartcast to actually perform type update in
implicit receiver after stub types was inferred
Such action results in creation of following FIR:

FirSmartCastExpression(
    original=FQAE(FirImplicitThisReference, typeRef=R|Inv<Stub>|)
    typeRef=R|Inv<String>|
)

in receiver position during completion of calls

However, it wasn't the case in general situation due to
action of FirStubTypeTransformer, which, in turn visits and updates
type ref inside original expression, but only if there was at
least one call (that was completed) using that implicit receiver
As after such type update updateTypeFromSmartcast function does
nothing

Yet in situation, when there was only partially resolved calls
referencing that implicit receiver we actually create smart-cast
expression and don't update type

The change just removes usage of updateTypeFromSmartcast and
replaces is with direct type update
We still mutate state of implicit receiver, potentially
improperly, it should be addressed in future

^KT-54708
^KT-58365 Fixed
2023-05-04 12:46:28 +00:00
Mikhail Glukhikh af7d6b1bb3 K2: drop nullable results for generated synthetic callees 2023-05-04 11:48:37 +00:00
Mikhail Glukhikh 3964ee38be K2: fix handling of synthetic calls in delegate inference
This commit is intended to avoid the second resolve of delegate when
we need to consider provideDelegate() possibility in inference.
Also here we provide correct completion of synthetic calls during
delegate inference.

#KT-58013 Fixed
2023-05-04 11:48:37 +00:00
Ilya Chernikov 8c8ca7bb70 Remove examples/tests based on obsolete script-util
also mark the rest of the API as Obsolete
related to #KT-58367
2023-05-04 11:35:08 +00:00
Ilya Chernikov 2e393e8fb7 Stop publishing obsolete kotlin-script-util
#KT-58366 fixed
2023-05-04 11:35:08 +00:00
Yahor Berdnikau 17dded2f2a Update 'kotlin-dist-for-jps-meta' to use unbundled compiler plugins.
^KTIJ-25384
2023-05-04 10:52:12 +00:00
Bogdan Mukvich 0188e79df7 Run maven tests on JDK 8 by default 2023-05-04 10:51:52 +00:00
Bogdan Mukvich 1fcc843056 Create Nashorn in maven integration tests JS compatible with JDK 11 2023-05-04 10:51:52 +00:00
Bogdan Mukvich d95e3dbf17 Run maven plugin tests using kapt with dagger with JDK 8 2023-05-04 10:51:52 +00:00
Bogdan Mukvich 74cb25c3eb Create configuration for maven integration tests with JDK 8 2023-05-04 10:51:52 +00:00
Bogdan Mukvich c4f4249e83 Update maven invoker plugin 2023-05-04 10:51:52 +00:00
Dmitriy Dolovov 57ba28ae3d [K/N][tests] Drop obsolete test tags
The obsolete tags that are no more used and are dropped by this commit:
* 'stdlibK2'
* 'kotlin-testK2'
* 'codegenK2'
* 'k2libContents'
* 'firInfrastructure'
2023-05-04 10:35:08 +00:00
Dmitrii Gridin fce8172b0d [FIR] mark value parameter for "it" as resolved
^KT-56550
2023-05-04 10:03:45 +00:00
Dmitrii Gridin d29da18b60 [LL FIR] add more tests on specific members resolve
^KT-56550
2023-05-04 10:03:45 +00:00
Dmitrii Gridin 228b1852b1 [LL FIR] add isResolved check for delegated constructor call
^KT-56550
2023-05-04 10:03:45 +00:00