Commit Graph

90401 Commits

Author SHA1 Message Date
Dmitry Gridin f74f613bc1 [CHERRY PICKED FROM IJ] [jps] convert CompilerRunnerConstants to Kotlin
GitOrigin-RevId: 72575637ea72a14f25bdf9b25ae44255a9c40018
Original commit: https://github.com/JetBrains/intellij-community/commit/8ac14f4734d1c6d60f5b3874bacf54224abcf757
2022-01-12 15:10:38 +01:00
Dmitry Gridin f801bce8a9 [CHERRY PICKED FROM IJ] Rename .java to .kt
GitOrigin-RevId: 801635ed9cd9824365ee2b7969c6f822c7e37869
Original commit: https://github.com/JetBrains/intellij-community/commit/5f0b44bd74a8cc346f1536e310d84e3d70d2e73a
2022-01-12 15:10:37 +01:00
Nikita Bobko 5d91e54f41 Merge Kotlin JPS plugin
Kotlin JPS plugin existed in Kotlin repo before but was migrated to
intellij-community together with entire Kotlin plugin.
Now I return Kotlin JPS plugin back because it turned out that it's
easier to develop JPS in KT release cycle. Also I need to
unbundle Kotlin JPS plugin in scope of KTIJ-11633
2022-01-12 15:10:21 +01:00
Nikita Bobko db7472a376 Rename: jps-plugin -> jps/jps-plugin 2022-01-12 15:09:45 +01:00
Alexander Shabalin d8f99d8974 [K/N] Avoid global dtors in suspension and logging
^KT-50713

Merge-request: KT-MR-5426
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-12 13:28:43 +00:00
Sergey Igushkin eddf8c9e72 KT-50736: Fix the implementation of whenEvaluated
Re-implement `whenEvaluated` using a constant number of calls to
`withPlugin` per project.

The approach with `plugins.all { ... }` introduced by the fix
of KT-50509 had an issue with Android plugins applied last in the build:
in those cases that implementation didn't dispatch the actions after
Android and instead fired them earlier in `afterEvaluate`, because
`hasPlugin` doesn't return true in the callback when that exact plugin
is applied.

This change preserves the performance similar to that of the previous
implementation.

Issue #KT-50736

Merge-request: KT-MR-5418
2022-01-12 13:13:56 +00:00
Dmitriy Dolovov e6a2785118 Bump Kotlin/Native version to 1.7.0-dev-528
Related to #KT-50591
2022-01-12 16:05:32 +03:00
Victor Petukhov 1f1b5256b0 Postpone type enhancement improvements till 1.7 due to some found broken cases unmarked by warnings before
^KT-49378 Fixed
2022-01-12 15:58:50 +03:00
Andrey Uskov 2adc851f1b Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel
compilation might cause incorrect state of IC, what led to corruption
of kotlin_module files. Now IC state is stored via CompilerArguments
and CompilerConfiguration
#KT-46038 Fixed
2022-01-12 13:37:46 +03:00
Dmitriy Dolovov 99300bd885 [IR] IrModuleDeserializerKind API cleanup
Related to #KT-50591
2022-01-12 11:05:12 +03:00
Roman Golyshev 54cca88279 KT-50728 Enforce receiver type resolve
When stdlib is represented as a source dependency (which seems to be the
case in the `kotlin` project), it will be resolved lazily for the IDE.
Same thing can happen if someone decides to "extend" the stdlib
by declaring their declaration in the `kotlin` package

In both of those cases, we need to make sure that receiver type is fully
resolved before trying to get a `coneType` from it

N.B. To make resolve tests work, I've added a separate folder
`withAllowedKotlinPackage` to the `testData`, because in the default
test setup it is not allowed to extend the `kotlin` package by user's
definitions

^KT-50728 Fixed
2022-01-11 22:23:57 +00:00
Sergey Igushkin 3ac472ceb3 Fix Android unit test tasks not running in allTests
The Android unit test tasks were not created by the Kotlin Gradle
plugin, so the plugin didn't add the
tadk dependencies to its aggregating
`allTests` task.

Issue #KT-38456
Issue #KT-44227
2022-01-11 22:15:14 +00:00
Dmitriy Dolovov 8ea6221932 Minor: Update comment 2022-01-11 22:05:01 +03:00
Dmitriy Dolovov 716ca3c319 [IR] Do best effort explaining IR linker issue to the user if computation of the detailed IR linker error message failed due to unexpected error
Related to #KT-50591
2022-01-11 21:53:12 +03:00
Dmitriy Dolovov cb5a052227 [IR] Distinguish IrModuleDeserializers with and w/o underlying KLIBs
Fixes #KT-50591
2022-01-11 21:53:06 +03:00
Jinseong Jeon 7ff468d9e3 FIR LC: populate only const property on multi-file facade 2022-01-11 21:30:54 +03:00
Denis.Zharkov 0da24ff4e2 FIR: Fix smartcast case after equals on class from different module
^KT-50534 Relates
2022-01-11 20:45:56 +03:00
Denis.Zharkov a33d9df0cd NI: Support forking inference with heuristics
Mostly, it only affects FIR

It partially allows to consider several variance of constraints like
A<Int> & A<T> <: A<X_var> that are mostly brought by smart casts

^KT-49542 Fixed
^KT-50489 Relates
2022-01-11 20:45:55 +03:00
Denis.Zharkov 62673c7e1b NI: Do not use asConstraintSystemCompleterContext before completion 2022-01-11 20:45:54 +03:00
Denis.Zharkov 1d258635a2 NI: Get rid of confusing asConstraintSystemCompletionContext
NB: there is a different asConstraintSystemCompleterContext that might have side effects
2022-01-11 20:45:53 +03:00
Denis.Zharkov 47d74a16f2 NI: Get rid of redundant asPostponedArgumentsAnalyzerContext calls 2022-01-11 20:45:53 +03:00
Hung Nguyen 8d298bd25c Fixed possible hanging of metrics collection in KGP
#KT-50719 Fixed
2022-01-11 19:15:42 +03:00
Victor Petukhov 455b3143e7 [FE 1.0] Introduce builder inference stub types checker which may report more precise and clear errors due to resolution ambiguity
^KT-49828 Fixed
2022-01-11 18:34:47 +03:00
Victor Petukhov dcc42d66c3 [FE 1.0] Fix formatting in StubTypesBasedInferenceSession 2022-01-11 18:34:46 +03:00
Victor Petukhov 4dc9b291e5 [FE 1.0] Store builder inference session in the corresponding lambda argument 2022-01-11 18:34:46 +03:00
Victor Petukhov 74f294d849 [FE 1.0] Store constraint system in call resolution result instead of constraint storage 2022-01-11 18:34:45 +03:00
Victor Petukhov cedd98148c [FE 1.0] Rename the remaining coroutine inference stuff into builder inference 2022-01-11 18:34:45 +03:00
Victor Petukhov 27ed4a7dc2 [FE 1.0] Rename DelegatedPropertyInferenceSession to DelegateInferenceSession 2022-01-11 18:34:44 +03:00
Victor Petukhov ab207ca58f [FE 1.0] Rename ManyCandidatesResolver to StubTypesBasedInferenceSession 2022-01-11 18:34:43 +03:00
Victor Petukhov c1d3f7e5b4 [FE 1.0] Rename ambiguity's parameter from descriptors to resolvedCalls 2022-01-11 18:34:42 +03:00
Victor Petukhov 8e2b90b5db [FE 1.0] Don't report CAST_NEVER_SUCCEEDS on stub types
^KT-49829 Fixed
2022-01-11 18:34:41 +03:00
Victor Petukhov 37d163d417 [FE 1.0] Don't lose diagnostics during lambda analysis at the overload resolution by return type stage
^KT-49658 Fixed
2022-01-11 18:07:05 +03:00
vmishenev 7820b268fb KT-50111 Add a new analysis flag eagerResolveOfLightClasses 2022-01-11 17:33:47 +03:00
Roman Golyshev 5964d8c566 KTIJ-20618 FIR IDE: Enforce resolved type bounds in ConeTypeContext.kt
When lazy resolve is involved, type bounds can be in an unresolved
state (e.g. `FirUserTypeRef` instead of `FirResolvedTypeRef`). To
enforce the resolve, we use `resolvedTypeBounds` where it might be
important

^KTIJ-20618 Fixed
2022-01-11 13:56:17 +00:00
Denis.Zharkov a63351f5d1 FIR: Simplify ConeTypeContext.captureArguments 2022-01-11 16:27:06 +03:00
Denis.Zharkov 9be4f818f4 FIR: Weaken some UPPER_BOUND_VIOLATED restrictions
See test data at starProjectionInsteadOutCaptured.kt

^KT-49412 Fixed
^KT-50230 Relates
^KT-48044 Fixed
2022-01-11 16:27:06 +03:00
Denis.Zharkov 814f4803b7 FIR: Refactor extracting type arguments from FirTypeRef
Extract them all instead of re-iterating for each argument
2022-01-11 16:27:05 +03:00
Denis.Zharkov 1a9c389b0e FIR: Refactor ConeSubstitutorByMap
Add explicit equals and cached hashCode instead of implicit ones from data class
2022-01-11 16:27:04 +03:00
Denis.Zharkov b193e708d3 FIR: Refactor checkUpperBoundViolated
There just should be a different facades for cases
A<T1, T2> and foo<T1, T2>()

Test data has changed for type alias constructors since previously,
it was working by mistake because of assumption that type alias arguments
are linearly mapped to the type parameters of the corresponding constructors

^KT-50703 Open
2022-01-11 16:27:03 +03:00
Svyatoslav Scherbina c2f03b4d28 Deprecate freezing in kotlin-native/NEW_MM.md 2022-01-11 12:21:55 +00:00
Alexander Shabalin 65fdfffeb4 [K/N] Make GC.collect wait for finalizers being run
^KT-50713

Merge-request: KT-MR-5404
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-11 11:39:22 +00:00
Ilya Kirillov c80d9d8dfb Docs: introduce some basic docs and contribution guides for Analysis API 2022-01-11 14:33:24 +03:00
sebastian.sellmair 6c55e8cc58 [Gradle] GradleKotlinCompilerRunner: Be lenient to isolated classpaths
^KT-50592
2022-01-11 08:34:04 +00:00
sebastian.sellmair 56fa2655b7 [Gradle] Fixup testDetectingDifferentClassLoaders in respect of ^KT-50592 and KT-50598 2022-01-11 08:34:03 +00:00
sebastian.sellmair b1bb68c10f [Gradle] testProject/AndroidProject: Ensure non-isolated classpaths
^KT-50592
2022-01-11 08:34:03 +00:00
sebastian.sellmair 0b981a54bc [Gradle] NativeDistributionCommonizerTask: Use safe project extension
... to access `KotlinMultiplatformExtension` on subprojects.
This will prevent strange ClassCastExceptions and show users
a proper error message when the operation fails because of isolated
classpaths.

This will also be lenient if the isoalted Kotlin plugin is not
a multiplatform plugin.

^KT-50592 Verification Pending
2022-01-11 08:34:02 +00:00
sebastian.sellmair a355fefd05 [Gradle] KotlinProjectExtension: use castIsolatedKotlinPluginClassLoaderAware
Using this special cast function for accessing any Kotlin extension
will ensure that an isolated classpath will be reported to the user
when the casting fails because of it.

^KT-50592 WIP
2022-01-11 08:34:02 +00:00
sebastian.sellmair 32177b2cd2 [Gradle] Implement commonizer test with isolated jvm subproject
^KT-50592
2022-01-11 08:34:02 +00:00
Alexander Udalov 8b57675002 Revert "Remove obsolete check for language version and IR backends"
This check is no longer obsolete since language version 1.3 support is
restored for Kotlin/JVM, but JS and Native never supported LV 1.3.

This is a partial revert of 0213c25c9b,
without the diagnostic in K2JVMCompilerArguments (which is not needed
since the earliest supported LV is 1.3).

 #KT-50695 Fixed
2022-01-10 21:15:51 +01:00
pyos 8314b7d3c9 IR/Android: initialize the findViewById cache before super()
In general, calling open methods in open class constructors is unsafe
because their overrides will see an uninitialized instance. This change
makes it at least possible to use the view cache in such cases.

^KT-50627 Fixed
2022-01-10 21:08:43 +01:00