Commit Graph

95401 Commits

Author SHA1 Message Date
Ivan Kochurkin a4ad8d59b6 [FIR] Move createSessionForTests, createSessionForTests into FirTestSessionFactoryHelper 2022-10-13 18:11:49 +00:00
Ivan Kochurkin 1deb253bac [FIR] Run FirSupertypesChecker for anonymous objects, ^KT-54300 Fixed 2022-10-13 18:11:49 +00:00
Ivan Kochurkin 69ee40325b [FIR] Fix dependencyProviders generation in FirDependenciesSymbolProviderImpl
Get rid of unnecessary creating of FirCompositeSymbolProvider
2022-10-13 18:11:49 +00:00
Ivan Kochurkin fe670d98a9 [FIR] Rename FirSessionFactory to FirJvmSessionFactory 2022-10-13 18:11:48 +00:00
Ivan Kochurkin 40a01180ff [FIR] Move createSessionWithDependencies and createEmptySession into FirSessionFactoryHelper 2022-10-13 18:11:48 +00:00
Ivan Kochurkin 281c79e21e [FIR] Inline createModuleDataForBuiltins method since it doesn't look useful 2022-10-13 18:11:48 +00:00
Ivan Kochurkin 4d89eddbe8 [FIR] Don't create FirDependenciesSymbolProvider without need 2022-10-13 18:11:47 +00:00
Ivan Kochurkin 9c6df5313a [FIR] Fix substitution of anonymous type's supertypes, ^KT-51418 Fixed 2022-10-13 18:11:47 +00:00
Ilya Goncharov c5732b6f4d [Gradle, JS] Make targetPbserver public in kotlinJsExtension 2022-10-13 17:53:40 +00:00
Sergey.Shanshin 5a1c2c56bd Added support of external serializers to the FIR
Co-authored-by: Leonid Startsev <leonid.startsev@jetbrains.com>
Merge-request: KT-MR-7334
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2022-10-13 15:25:39 +00:00
vladislav.grechko 817afcd4af KT-MR-7307 review fixes 2022-10-13 15:19:10 +00:00
Anton Lakotka 4348878aab !fixup test typo 2022-10-13 14:56:51 +00:00
Anton Lakotka 728bd95aea [Gradle] Update tests after changes in sources publication
^KT-48839
2022-10-13 14:56:51 +00:00
Anton Lakotka 5e929bbd7b [Gradle] Don't publish test source sets in common module
Publish only shared source sets, including host-specific ones.

^KT-48839 Verification Pending
2022-10-13 14:56:51 +00:00
Anton Lakotka 5f26649246 [Gradle] Introduce getHostSpecificMainSharedSourceSets
^KT-48839
2022-10-13 14:56:50 +00:00
Anton Lakotka 42cda2633d [Gradle] Add/update tests about Sources Publication in MPP
^KT-48839
2022-10-13 14:56:50 +00:00
Bogdan Mukvich 1fd779e7f4 Fix dependencies in verification metadata after test 2022-10-13 14:31:32 +00:00
Bogdan Mukvich 67576b02c4 Add test for dependencies verification metadata
Every dependency used in project should have MD5 and SHA-256 hash
^KTI-943
2022-10-13 14:31:32 +00:00
Bogdan Mukvich e4e15f36ce Update dependencies verification metadata 2022-10-13 14:31:32 +00:00
Yahor Berdnikau 023b9bf284 Align new compiler options names with api naming
Use Kotlin*CompilerOptions or Kotlin*CompilerToolOptions naming approach.

^KT-54306 Fixed
2022-10-13 12:19:08 +00:00
Mikhail Glukhikh 31b3d8f859 Update info about K/N modules which do not pass FIR bootstrap
After we have advanced bootstrap to 1.8.20-dev-649,
some K2 problems inside K/N were fixed.
However, some other are still alive.

Related to KT-54123
2022-10-13 09:45:06 +00:00
Sergey Bogolepov 6a4722188f Extract SameTypeNamedCompilerPhase from NamedCompilerPhase
Currently, compiler pipelines are heavily couples with
NamedCompilerPhase. Unfortunately, NamedCompilerPhase uses the same
type for Input and Output, thus it is not applicable to phases that
try to transform some data purely.
Thus, we separate this class into two, allowing to have a new
inheritor of NamedCompilerPhase with different Input and Output types.
2022-10-13 08:25:26 +00:00
Sergey Bogolepov 3a500e536a Lift restrictions on Context in CompilerPhase
CommonBackendContext is a complex interface that
actually requires many things to be instantiated.
We don't need it for many parts of compilation pipeline:
frontend or object files phases in native backend would
work just fine without CommonBackendContext.
2022-10-13 08:25:26 +00:00
Sergey Bogolepov e1f2b89875 Untie Symbols class from CommonBackendContext
`Symbols.context` property is actually unused. Let's drop
it as it makes harder to create an instance of this class.
2022-10-13 08:24:11 +00:00
Artem Kobzar de880ce9aa [K/JS] Move ES modules logic to a new transformer with IC 2022-10-13 07:32:44 +00:00
Sergey Bogolepov 54deba63a1 Use PhaseConfigurationService in CompilerPhase instead of PhaseConfig 2022-10-13 06:39:39 +00:00
Sergey Bogolepov 06182fe547 Introduce abstraction layer atop of PhaseConfig.
PhaseConfig is tied to some root `compoundPhase` that
defines the whole compilation pipeline. To lift this restriction
and allow dynamically-defined compilation pipelines, let's move
parts of PhaseConfig interface that do not depend on `compoundPhase`
to an interface.
2022-10-13 06:39:38 +00:00
Alexander Korepanov 7b2c125754 [JS IR] Update IC depends graph after intrinsics loading
- Remove unused params from compilerWithIC wrapper.
- Move JsIrBackendContext creation logic into separate function
- Introduce and use compiler interface for IC infrastructure

On dirty rebuild we may reload IR from stdlib,
such reloading may affect files with intrinsics and builtins.
As soon as we load only exported symbols, we must track dependencies
for files with intrinsics or builtins as for others.
This patch implements the logic which updates dependencies for
the stdlib files after loading of intrinsics and builtins.

^KT-54323 Fixed
2022-10-12 22:14:15 +00:00
Denis.Zharkov 31ba1f1534 Add deprecation warning for false-negative TYPE_MISMATCH
See KT-49404 for details

In K1, within SubstitutingScope we approximate almost all the types
containing captured types are being approximated to either a lower or
an upper bound.

While mostly, it's being done correctly there are some problems with
approximations for flexible types

So, the parameter's type of A<in Any>::foo is approximated to Inv<in Any!>,
thus allowing to use Inv<*>, while it's obviously unsound.

NB: For the similar example, in B, there are regular TYPE_MISMATCH
because parameter for B<in Any>::foo is approximated to Nothing

Also, it's important to say that
- in K2 everything works because we don't use type approximation there
- approximation algorithm that works incorrectly is only being used in K1

^KT-54332 Fixed
2022-10-12 20:53:02 +00:00
Denis.Zharkov 4b455c0e51 Minor. Inject CallComponents to CallCheckerContext 2022-10-12 20:53:02 +00:00
Sergey.Shanshin 503f4d924d Added support of MetaSerializable to the FIR 2022-10-12 20:10:58 +00:00
Svyatoslav Scherbina 28340459b0 Bump Kotlin/Native version to 1.8.20-dev-980 2022-10-12 19:12:28 +00:00
Ilya Goncharov 866dee083e [Gradle, JS] Compilation after rebase 2022-10-12 17:59:10 +00:00
Ilya Goncharov 6d7b7724bd [Gradle, JS] Fix filtered arguments for relocated build cache 2022-10-12 17:59:09 +00:00
Ilya Goncharov 715ba5c59f [Gradle, JS] Fix tests 2022-10-12 17:59:09 +00:00
Ilya Goncharov 462c53d566 [JS, IR] Fix creating targets in both mode 2022-10-12 17:59:09 +00:00
Ilya Goncharov 93be8317fa [JS, IR] Fix wasm tests and presets 2022-10-12 17:59:08 +00:00
Ilya Goncharov a3be2c893b [JS, IR] Make IR default for both mode 2022-10-12 17:59:08 +00:00
Anton Bannykh 9342356c38 JS IR: fix type checks for suspend function descendants (^KT-54382 fixed)
Consider `class A : suspend () -> Unit {}`. Type checks such as `is A`
are now performed via a regular `instanceof` check instead of the special
checks for suspend lambdas.
2022-10-12 17:38:23 +00:00
Johan Bay bc13173ea9 [K/N] cinterop: Do not expand non-constant macros
Expanding macros such as __FILE__ or __TIME__ exposes
arbitrary generated filenames and timestamps from the compiler
pipeline which are not useful for interop and makes the klib
generation non-deterministic. This patch instead redefines
the macros to just map to their name in the properties
available from Kotlin.

Co-authored-by: Johan Bay <jobay@google.com>
2022-10-12 16:54:00 +00:00
Anastasiia Spaseeva 49e343e08e Fix condition for execution of prepareSonatypeStaging script.
This fixes a publication to maven central problem after commit cf2d03b9
2022-10-12 18:05:42 +02:00
Yahor Berdnikau ff271a7908 Set maximum supported AGP version in tests to 7.2.1
^KT-53013 Fixed
2022-10-12 15:27:46 +00:00
Yahor Berdnikau faf3638c58 Bump minimal supported AGP to 4.1.3
^KT-53013 In Progress
2022-10-12 15:27:45 +00:00
Ilya Goncharov b01411544a [Gradle, JS] Improvements of kotlin test adapters
- divide adapter.js into different files, which frameworks could load separately
- possibility to inject something to kotlin-test adapter by user

^KT-54418 fixed
2022-10-12 14:14:50 +00:00
Dmitriy Novozhilov d423782fac [FE 1.0] Remove usages of safeAs and cast from most of FE 1.0 modules:
- :core:descriptors
- :core:descriptors.jvm
- :core:deserialization
- :compiler:cli
- :compiler:frontend
- :compiler:frontend:cfg
- :compiler:frontend.java
- :compiler:frontend.common.jvm
- :compiler:psi
- :compiler:resolution
- :compiler:resolution.common
- :compiler:resolution.common.jvm
- :kotlin-reflect-api
2022-10-12 13:58:56 +00:00
Nikolay Krasko 6afceb1e84 Remove more usages for embedded with isTransitive = true
It's a refactoring because the list of dependencies shouldn't change

Follow up for KTI-942
2022-10-12 13:44:30 +00:00
Nikolay Krasko f43ad1cb7a Remove packed stdlib from Kotlin compiler plugin artefacts
Remove annotations, kotlin-stdlib-common, kotlin-stdlib.

Packing those libraries is wrong and probably unexpected. It leads to
artifacts size increase. Can be dangerous because of bad classpath.
And also have a reproducibility issue because of caching tricks around
KotlinVersionCurrentValue class.

KTI-942
2022-10-12 13:44:30 +00:00
pyos 2ec264cfa2 FIR CFG: filter out variables declared inside lambdas more eagerly 2022-10-12 11:56:02 +00:00
Leonid Startsev 090aec6b3b Prohibit Array<T> in @Serializable classes
because it's impossible to correctly create array reflectively without
knowing correct KClass.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1243
2022-10-12 11:48:21 +00:00
Leonid Startsev 596949a501 Correctly handle star projections according to logic of the old FE.
#KT-54297 Fixed

Properly substitute surrogate UnitSerializer in the Companion.serializer()
function generated on classes that use polymorphic or sealed serializer
by default. (Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1692)
2022-10-12 10:36:26 +00:00