Commit Graph

100914 Commits

Author SHA1 Message Date
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
Pavel Punegov 3d65907b8c [K/N][test] Ignore test in Native K1
This test doesn't work with K1 in Native

Merge-request: KT-MR-9934
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-05-04 08:50:42 +00:00
Pavel Punegov 68ffa46187 [K/N][test] Increase default test timeout to 30 seconds
Sometimes on slower hosts longer running test may time out.

Merge-request: KT-MR-9935
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-05-04 08:50:14 +00:00
Ilya Gorbunov 568d4b11af Use 'run' function instead of 'synchronized' in KT-51036 test
It should be enough to reproduce the issue and makes the test runnable on all backends
2023-05-04 02:44:26 +00:00
Nikolay Krasko 92a7a74382 [213] Fix proguard rule for ExtensionsArea.registerExtensionPoint
Fix for 6e18b75c73

KTI-1114
2023-05-03 20:46:58 +00:00
Mikhail Glukhikh 2e69c643cb K2: add test for KT-57649 2023-05-03 17:02:18 +00:00
Roman Golyshev 0dbf218f0b [FIR LC] KT-58330 Introduce SymbolPsiClassObjectAccessExpression
A PSI expression created with `createExpressionFromText` has dummy
parent, which might break some inspections (for example, it breaks
`JamAttributeElement` class in Spring Framework Plugin in intellij)

Modify `AbstractSymbolLightClassesParentingTestBase` to check values of
annotations in light classes; implement `accept` in some of them

^KT-58330 Fixed

Merge-request: KT-MR-9903
Merged-by: Roman Golyshev <roman.golyshev@jetbrains.com>
2023-05-03 15:21:18 +00:00
Ilya Goncharov 957d8ee3d2 [Gradle, JS] Print visited-gradle content in composite build test 2023-05-03 15:03:27 +00:00
Simon Ogorodnik 3b979fb60e Tests. Add defineJDKEnvVariables to tests of FIR2IR
Some tests use environment variables JDK_8, JDK_11, and JDK_17.
To ensure that the tests work out of the box,
we should set these variables in the tests.
2023-05-03 14:07:51 +00:00
Ivan Kylchik 568b593da7 [IR] Switch forbidden list in ONLY_BUILTINS mode onto allowed one 2023-05-03 12:47:35 +00:00
Ivan Kylchik 7747643945 [IR] Filter chars and codePoints from allowed to interpret function
These two functions apparently are represented in Kotlin as methods
of `kotlin.String`. Because of that we accidentally treated them as
builtins.

To also minimize such cases, added filtration by return type. We are
allowing to interpret only these functions that have primitive or
unsigned return type.

#KT-57028 Fixed
2023-05-03 12:47:35 +00:00
Ivan Kylchik 81fe411ef6 [IR] Extract some common code in EvaluationMode into extension val 2023-05-03 12:47:34 +00:00
Anton Lakotka 462a39d591 [Gradle] Fix testCustomAttributesInAndroidTargets for AGP 7.0.4
^KT-58305 Verification Pending
2023-05-03 12:18:34 +00:00
Anton Lakotka 39fc1ba81d [Gradle] Fix testMppAndroidLibFlavorsPublication for AGP 7.0.4
^KT-58305 Verification Pending
2023-05-03 12:18:34 +00:00
Pavel Kunyavskiy af318fdfb0 [K/N] Fix default arguments in suspend functions
AddContinuationToFunctionsLowering was rewritten in way the order
of this lowering and defaults lowering doesn't matter.

^KT-58214
2023-05-03 12:14:53 +00:00
Pavel Kunyavskiy fa1b22cf31 [K/N] Make klib manifest saving platform-independent
^KT-57126
2023-05-03 12:12:58 +00:00
Dmitriy Dolovov 0de06757ca [K/N][tests] Rework tags for K/N tests
Use plain combinations of tags, examples:
* codegen/box w/o FIR: 'codegen & !frontend-fir'
* codegen/box with FIR: 'codegen & frontend-fir'

Avoid using tags with multiple aspects in their names, examples:
* 'codegenK1'
* 'firCodegen'

The obsolete tags to be removed but still used in TeamCity configurations:
* 'stdlibK2'
* 'kotlin-testK2'
* 'codegenK2'
* 'k2libContents'
* 'firInfrastructure'
2023-05-03 11:49:43 +00:00
Dmitriy Dolovov f2b6cbeee8 [K/N][tests] Merge tags: noPartialLinkage() + noPartialLinkageMayBeSkipped() 2023-05-03 11:49:43 +00:00