Commit Graph

84437 Commits

Author SHA1 Message Date
Ivan Kochurkin d4e1cded59 [FIR] Implement RESOLUTION_TO_CLASSIFIER 2021-07-28 23:18:38 +03:00
Ivan Kochurkin 2574dc907c [FIR] Implement FUNCTION_EXPECTED 2021-07-28 23:17:31 +03:00
Ivan Kochurkin 263e40e753 [FIR] Implement NO_RECEIVER_ALLOWED 2021-07-28 22:52:06 +03:00
Dmitry Savvinov 45a384bb77 Exclude stdlib-common from non-JVM targets as well
This is a continuation of KT-46936. This commit removes stdlib-common
from platform-specific source sets of JS/Native targets, as well as
Android and 'jvm { withJava() }'

The tests are made on kotlin-ide side, see the KT-46936 for attached
commits.

^KT-46936
^KT-47695 Fixed
^KT-47604 Fixed
2021-07-28 20:02:13 +03:00
Dmitry Petrov ce79fc77c9 JVM minor cleanup in bytecode analyzers 2021-07-28 19:53:39 +03:00
Hung Nguyen f95c50064c KT-45777: Refactor IncrementalJvmCache to support classpath snapshotting
Extract minimal required information into the new `KotlinClassInfo`
class. This info will be part of the classpath snapshot of the
`KotlinCompile` task in an upcoming change.

Bug: KT-45777
Test: Existing tests should pass (this is a refactoring-only change)
2021-07-28 19:32:10 +03:00
Pavel Kirpichenkov 19467861c9 [MPP] Fix false positive expect-actual mismatch
Use type refiner to correctly expand actual type alias - expect
class chains, produced by the commonizer. In a case when type
refiner doesn't exist for module create a one-shot thread local
instance. This might happen with modules without source code
in project (coming from build system model).

^KT-46691 Fixed
2021-07-28 18:57:08 +03:00
Pavel Kirpichenkov 2d91917ac7 [MPP] Make type refinement capability aware of HMPP state
Introduce intermediate state for cases when module doens't
have a type refiner even though HMPP is enabled.

KT-46691
2021-07-28 18:57:07 +03:00
Pavel Kirpichenkov 566640aa6d [MPP] Move KotlinTypeRefinerImpl (frontend -> descriptors)
ExpectedActualResolver in certain cases needs an ability
to create a standalone refiner instance, see the following
commits. A direct module dependency (resolution -> frontend)
can't be added, the opposite one already exists which leads
to a dependency cycle. Both modules depend on core.descriptors
module where KotlinTypeRefiner resides.

KT-46691
2021-07-28 18:57:07 +03:00
Pavel Kirpichenkov 1f3004a667 [MPP] Support multiple levels of actual type alias expansions
Commonizer might transform typealias chains into several
expect classes with actual type aliases. In this case
refining a common type once is not enough as the result
will be another expect type from type alias expansion.

KT-46691
2021-07-28 18:57:05 +03:00
Andrey Zinovyev d84cc4333c [FIR] Add INITIALIZATION_BEFORE_DECLARATION diagnostic 2021-07-28 16:56:54 +03:00
Andrey Zinovyev b706e776ad [FIR] Add VARIABLE_WITH_NO_TYPE_NO_INITIALIZER diagnostic 2021-07-28 16:56:53 +03:00
Svyatoslav Scherbina a63f218dd3 Stop using ModuleDescriptor.name for top-level ObjCExport name prefix
^KT-47809 Fixed

Do similar for C export.
2021-07-28 12:46:11 +00:00
Alexander Shabalin 48a2b23b3a Add a separate compiler switch for runtime asserts 2021-07-28 07:43:08 +00:00
Alexander Likhachev c3515cc338 [Gradle] Use compiler argument -opt-in instead of '-Xopt-in'
#KT-35832 Fixed
2021-07-28 05:58:58 +00:00
Alexander Likhachev 10f9c217fd [Gradle] Advance K/N version to 1.6.0-dev-1728 2021-07-28 05:58:58 +00:00
Dmitry Petrov 4267852030 JVM cleanup bytecode analyzers 2021-07-28 08:04:55 +03:00
pyos e9b177352c JVM_IR: do not inline reads of constructor arguments into accessors 2021-07-28 02:16:01 +02:00
Vasily Levchenko 2baf344f5f [kotlin gradle plugin] enable to work with embedded k/n compiler. 2021-07-27 19:44:31 +00:00
Vasily Levchenko 1eb951749d [build][kotlin-native] native compiler embeddable 2021-07-27 19:44:31 +00:00
Viacheslav Kormushkin fa2e787f76 CocoaPods Gradle plugin: Support incremental task execution when switching between Xcode and terminal
#KT-37511
2021-07-27 16:08:32 +00:00
Ilya Kirillov 91ecaa32e3 HL API: render local fqNames in reference resolve tests 2021-07-27 17:58:47 +03:00
Ilya Kirillov 77fcb12af8 Fix project leaking in tests
The project was leaking via MockApplication -> LowMemoryWatcherManager -> List<Project>
It happened due to unregistered disposable provided to the MockApplication
2021-07-27 17:58:47 +03:00
Ilya Kirillov f19dfd9d2a HL API: restore SymbolByReferenceTest
Now it is possible as references are working in HL API tests now
2021-07-27 17:58:46 +03:00
Ilya Kirillov c678d4b506 HL API: generate reference resolve tests
The testdata is taken from corresponding IDE reference resolve tests
2021-07-27 17:58:45 +03:00
Ilya Kirillov 7ba8e7d1d3 LL API: fix KtPackageProvider package existent checks for tests
Before it was not able to check nested packages for existence

Also, implement unimplemented getKotlinSubPackageFqNames
2021-07-27 17:58:45 +03:00
Ilya Kirillov 4fe240d1b4 HL API: fix KtUserType kt -> fir mapping for non-IDEA usages
createType(KtTypeElement) requires some access to IJ services which are unavailable to IJ core
2021-07-27 17:58:44 +03:00
Ilya Kirillov 970d7b5a78 HL API: implement tests for reference resolve 2021-07-27 17:58:43 +03:00
Ilya Kirillov 55489b6249 FIR IDE: fix containing KtFirSymbolContainingDeclarationProvider for implicit constructors 2021-07-27 17:58:42 +03:00
Ilya Kirillov eb69153fbc HL API: fix renderer for package symbols 2021-07-27 17:58:40 +03:00
Mikhail Glukhikh 84bd347841 Make EXPERIMENTAL_API_USAGE_ERR warning till 1.6 for signature type case 2021-07-27 14:58:56 +03:00
Mikhail Glukhikh 810def829c Make EXPERIMENTAL_ANNOTATION_ON_OVERRIDE warning till 1.6 2021-07-27 14:58:55 +03:00
Mikhail Glukhikh bb38eaae61 Postpone OptIn release to version 1.7 2021-07-27 14:56:54 +03:00
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00
Alexander Udalov 91c39ed01c Build: remove obsolete compiler arguments
These compiler arguments enable features which are enabled by default in
the current Kotlin anyway.

The only exception is in :compiler:cli which uses an old language
version.
2021-07-27 13:35:38 +02:00
Steffi Stumpos 707e1c7f8d [Test] Add service to provide additional classpath to box tests 2021-07-27 14:05:51 +03:00
Yahor Berdnikau a55eacd8db Migrate Gradle daemon memory leak tests to JUnit5.
^KT-45745 In Progress
2021-07-27 11:43:32 +03:00
Pavel Kunyavskiy be0a0a7784 [K/N] Support escape analysis with new mm 2021-07-27 08:22:02 +00:00
Igor Yakovlev f671061328 [FIR IDE] Add check resolved type for phase less than Types 2021-07-26 23:08:54 +02:00
Igor Yakovlev 02f2f6c148 [FIR IDE] Code review minor changes 2021-07-26 23:08:54 +02:00
Igor Yakovlev 4eb534e39b [FIR IDE] Remove withFirWithPossibleResolve inside function 2021-07-26 23:08:54 +02:00
Igor Yakovlev 563f8c8541 [FIR IDE] Split names of withRef function to phase and type versions 2021-07-26 23:08:54 +02:00
Igor Yakovlev 66fa624ab7 [FIR IDE] Fix IDE return type calculators 2021-07-26 23:08:54 +02:00
Igor Yakovlev 4711577b17 [FIR IDE] Add containing file workaround for FirLightAnonymousClassForSymbol 2021-07-26 23:08:54 +02:00
Igor Yakovlev a4426cd40d [FIR IDE] Fix invalid partial resolve of file annotations 2021-07-26 23:08:54 +02:00
Igor Yakovlev e1c8f302a4 [FIR IDE] Make fir resolve phase volatile and remove locks 2021-07-26 23:08:54 +02:00
Igor Yakovlev 78e249c2d5 [FIR IDE] Fix creating fir light classes for NotUnderContentRootModuleInfo module content 2021-07-26 23:08:53 +02:00
Igor Yakovlev ab2aaec4fe [FIR IDE] Ensure resolve for status transformer 2021-07-26 23:08:53 +02:00
Igor Yakovlev 4e870b6796 [FIR IDE] Fix invalid resolve for fir synthetic properties and accessors 2021-07-26 23:08:53 +02:00
Igor Yakovlev 6700179ee4 [FIR IDE] Add LibraryModuleSourceInfoBase and filter out light classes for sources from libraries 2021-07-26 23:08:53 +02:00