Commit Graph

255 Commits

Author SHA1 Message Date
Dmitriy Novozhilov d7ee168dff [FIR] Create error candidate for completion instead of simple error reference 2020-06-15 15:32:25 +03:00
Ilya Kirillov 418903e9ef FIR IDE: Make KtReference class descriptors frontend independent
* The new idea-frontend-independent module created
* Moved KtReference and it inheritors to that module & implement them in idea-analysis module by using descriptors frontend
2020-06-09 16:19:12 +03:00
Dmitriy Novozhilov 865ddac07a [NI] Add feature for choosing candidate by lambda return type 2020-05-29 09:36:31 +03:00
Sergey Rostov cf4ad1908b Fix lastIndexOfOrNull 2020-05-26 19:22:05 +03:00
Sergey Rostov 4daac14008 Revert due to massive flaky tests 2020-05-12 23:01:01 +03:00
Sergey Rostov fc59e28610 Fix lastIndexOfOrNull 2020-05-12 16:20:47 +03:00
Sergey Rostov 14edc26cf1 Revert due to test failing in 201 2020-05-08 10:13:07 +03:00
Sergey Rostov e099ee3af8 Fix lastIndexOfOrNull 2020-05-07 21:48:50 +03:00
Vladimir Dolzhenko b0483a67c2 Perform tryLock-and-checkCanceled on waiting lock in LockBasedStorageManager
Relates to #KT-38012
2020-04-14 13:11:30 +02:00
Vladimir Dolzhenko 3c26d38804 Revert Clear computable when value is calculated in LockBasedStorageManager
Relates to #KT-35256
2020-03-10 09:10:46 +01:00
Vyacheslav Gerasimov bab87c9837 Build: Extract compiler version to separate module to improve caching
Compiler version changes every build and makes impossible to reuse
caches for heavy tasks such as compiler proguard. We may fix that by
adding version module directly to the final jar.
2020-03-05 18:05:53 +03:00
Vyacheslav Gerasimov c2457cae60 Read KotlinCompilerVersion from resource file
Writing build number into a public constant field leads to poor gradle
cache reuse between different builds. Public constant value is a part of
public api and its changes affect inputs of dependent modules.
Extracting build number to resource file allows to ignore it from
runtime classpath which fixes same problem for KotlinCompile tasks
2020-03-05 18:05:53 +03:00
Dmitriy Novozhilov e696d1d06a [FIR] Improve mapping arguments to parameters 2020-02-14 17:53:28 +03:00
Vladimir Dolzhenko 00c71dd098 Clear computable when value is calculated and CallOnceFunction is added
Relates to #KT-35256
2020-01-28 10:50:46 +01:00
Alexander Udalov f7321b497b Set KotlinCompilerVersion.IS_PRE_RELEASE = true
Since master is now 1.4-M1, and 1.4 is a pre-release version.
2020-01-24 14:18:51 +01:00
Nikolay Krasko 620898c73e Use local single-thread cached value instead of thread locals (KT-28940)
It looks like thread locals are not needed here as their global state
is not utilized but creates troubles with memory management.
2019-10-29 13:40:34 +03:00
Nikolay Krasko 02f9b255e6 Clean using thread local in all threads (KT-28940) 2019-10-29 13:40:34 +03:00
Nikolay Krasko 1b96e14b1e Remove reference to temporary thread local explicitly (KT-28940)
There're issue with storing variables in memory longer than needed.
2019-10-25 17:01:52 +03:00
Nikolay Krasko 728ccdee63 Don't publish computed value to other threads till post compute is finished (KT-28940)
This fixes a race condition with counting supertypes (the only client
of createLazyValueWithPostCompute left at the moment).

 #KT-28940 Fixed
2019-10-13 18:21:38 +03:00
Nikolay Krasko 4f488ddd16 Remove lazy values with dummy post compute lambdas 2019-10-13 18:21:38 +03:00
Denis Zharkov 01f0589ddf [Invariant Fix] Use the same lock inside single GlobalFacade
Before refinement, order of accessing compiler's entities (supertypes,
descriptors, memberscopes) was always the following:

    sources -> libraries -> SDK (built-ins)

With refinement, it is sometimes possible to inverse this order, e.g.
access sources after libraries or SDK. This mainly happens in the following
scenario:

- we reference some library/SDK class, but do not acquire source-lock
  This might seem a bit weird, but actually it is quite easy to achieve
  as soon as we understand that analysis sources doesn't necessarily
  acquires respective lock, only forcing lazy computations does so.
  E.g., we can just traverse PSI tree and meet some refernce to "Any?" -
  this doesn't involves acquiring source-lock

- we start resolving it, which usually involves acquiring library/SDK-lock
  (e.g., in order to get it supertypes or memberScope)

- because we reference it from the source-module, we may like to refine
  it, in which case we will have to acquire source-lock on refinement
  cache

Obviously, that may lead to deadlocks, so, in this commit we disable
creating granular locks when we work with refinement.

Note that if refinement is disabled (which is the case for all non-MPP
projects), we still create separate locks.
2019-07-30 12:41:39 +03:00
Dmitry Savvinov 72e28d37fc [Injection] Introduce PlatformSpecificExtensions and PlatformExtensionsClashResolver
This commit introduces the ability to register a PlatformExtensionClashResolver
in a container. Each PlatformExtensionClashResolver has a corresponding
PlatformSpecificExtensions.

If, during container composition, several instances of
PlatformSpecificExtensions were registred, instead of throwing
InvalidCardinalityException, corresponding PlatformExtensionClashResolver
will be asked to resolve clash.

This allows to make injection more composable and less coupled across
different contributors of service, providing a basis for such motivating
cases as composing containers with both JS and JVM services (for analysis
of multiplatform modules).
Previously, that would be impossible:
a) JS would inject default instances for some services which would clash
with non-default JVM services (like SyntheticScopes)
b) Also, there are a very few services for which *both* platforms provide
non-default implementations, so they should be merged manually on
case-by-case basis (e.g., IdentifierChecker)
2019-05-28 13:08:08 +03:00
Dmitry Savvinov d80eba31be [Injection] Discriminate default instances during clashes resolution
The idea is to try to resolve the dependency without considering default
instances first.

This makes containers more composable, e.g., it is now possible to put
several containers together as long as all except one provide default
implemenetation for some particular service (non-default implementation
will be automatically chosen, and all defaults will be discarded).
2019-05-28 13:08:08 +03:00
Nikolay Krasko 213b98fefe Review changes: revert compiler behaviour, add test, remove inner classes 2019-03-12 14:28:31 +03:00
Harry Billinis 6ba134b1be Better names suggestion for constant like reference expressions (KT-28485)
Code was simplified after @igorwojda suggestions

 #KT-28485 Fixed
2019-03-12 14:28:31 +03:00
Dmitry Gridin 57040f6f9d Minor: refactoring & fix warnings 2019-03-11 23:38:19 +07:00
Yan Zhulanow eb1543c71a Minor: Fix a few compilation warnings in compiler and compiler tests, fix formatting 2019-03-06 03:30:55 +03:00
Sergey Rostov f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Vyacheslav Gerasimov f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Dmitry Savvinov 69fff12384 Drop LockBasedStorageManager.defaultDebugName, use meaningful name everywhere
Also, drop `createDelegatingWithSameLock` as it was unused
2019-01-14 11:10:37 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Dmitry Petrov 0191e3d1cf Migrate to release coroutines 2018-09-27 21:59:31 +03:00
Ilya Gorbunov a18770fbbb Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.
2018-09-12 06:05:05 +03:00
Ilya Gorbunov c1829782b7 Turn off compiler prerelease flag #KT-26643 2018-09-11 21:10:04 +03:00
Ilya Gorbunov 0f5f90cf52 Advance project version to 1.3-SNAPSHOT
Set LATEST_STABLE language version and current version of stdlib to 1.3, set IS_PRE_RELEASE
Remove "EXPERIMENTAL" from 1.3 version description in tests and gradle options
2018-08-30 14:49:27 +03:00
Alexander Udalov 6f9441d3f4 Do not output empty non-root packages in tests with txt
Mostly to avoid listing every internal package in
kotlin-stdlib/kotlin-reflect, as in
https://github.com/JetBrains/kotlin/blob/acd5b62148d797ffd24c4811d1d663f0c1ae7885/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/conversionOfSignedToUnsigned.txt#L144
2018-08-06 13:43:32 +02:00
Alexander Udalov 1b15619457 Move BinaryVersion to metadata, JVM versions to metadata.jvm
To be used in kotlinx-metadata
2018-05-16 17:16:22 +02:00
Dmitry Savvinov d438988fc6 Fix javadoc for StorageManager.createLazyValueWithPostCompute 2018-04-11 16:03:19 +03:00
Dmitry Savvinov d8b7de4f0e Add extra diagnostic information when no common supertypes are found
We're suspecting that the culprit of such errors is race condition on
'supertypes' in AbstractTypeConstructor, when it is created using
'LockBasedStorageManager.NO_LOCKS'
2018-04-10 10:47:22 +03:00
Alexey Tsvetkov 8a82c1618c Use Plugins DSL in Kotlin Gradle scripts
When plugins DSL is used, there is no need to
manually generate typesafe accessors for extensions and
conventions (by running `./gradlew kotlinDslAccessorsSnapshot`).
2018-03-26 16:09:29 +03:00
Nikolay Krasko 117890dba8 Fix generating cls stubs when is metadata using type tables (KT-23345)
Affected cases:
 - return type for suspend lambda
 - aliased type in type alias declaration
 - using type alias instead of aliased type in declarations

 #KT-23345 Fixed
2018-03-22 11:54:03 +03:00
Yan Zhulanow 34d1611ed4 Add Pill support to compiler and IDE modules 2018-03-02 03:15:17 +03:00
Alexander Udalov b6a55f74f4 Support patch versions in RequireKotlin with kind=COMPILER_VERSION 2018-02-08 17:47:37 +03:00
Denis Zharkov 3cfe43f83a Add -Xsupport-compatqual-checker-framework-annotations flag
It's implemented through Jsr305State while it's not related
to jsr-305 becasue currently it's the most convenient way
to introduce the flag.

Probably, it's worth renaming Jsr305State to something more abstract
like NullabilityAnnotationsConfiguration

 #KT-21982 Fixed
2018-01-10 17:02:46 +03:00
Ilya Gorbunov 093f796fc7 Write compiler and stdlib versions from gradle build 2017-11-01 17:26:18 +03:00
Alexander Udalov 0510c553c3 Mark class files as pre-release if language version > LATEST_STABLE
#KT-20547 Fixed
2017-10-16 15:09:36 +02:00
Leonid Stashevsky 0348561cd2 Add annotation for default parameter value 2017-10-06 15:45:38 +03:00
Leonid Stashevsky 95d32d8d1e Add @UnderMigration annotation and options for report level 2017-10-03 16:44:02 +03:00
Denis Zharkov cd3edfc5b2 Introduce MemberScope::classifierNames and some implementations
It aims to help with further optimizations
2017-09-28 14:01:30 +03:00
Ilya Chernikov 95035b3d72 Fix various tests 2017-09-20 11:51:23 +02:00