Compare commits

...

4448 Commits

Author SHA1 Message Date
max-kammerer
ca6d13b330 Update worker11.kt 2021-07-20 12:51:45 +02:00
Yahor Berdnikau
caa6b630ab Apply 'kotlin-android' plugin dynamically.
Only apply when one of android plugins are also applied to the project.

If none of AGP plugins are applied and 'kotlin-android' is - exception
 in 'afterEvaluate {..}' will be thrown.

^KT-46626 Fixed
2021-07-20 13:44:45 +03:00
Dmitriy Novozhilov
f3116cb64a Fix NON_EXHAUSTIVE_WHEN_STATEMENT warnings in project code 2021-07-20 13:33:46 +03:00
Dmitriy Novozhilov
a6edd852ff [FIR] Report NON_EXHAUSTIVE_WHEN_STATEMENT/NO_ELSE_IN_WHEN for when's on logical types
^KT-47709 In Progress
2021-07-20 13:33:44 +03:00
Dmitriy Novozhilov
ef635f6a96 [FE 1.0] Report NON_EXHAUSTIVE_WHEN_STATEMENT/NO_ELSE_IN_WHEN for when's on logical types
^KT-47709 In Progress
2021-07-20 13:33:43 +03:00
Dmitriy Novozhilov
85c7f386eb Add Kotlin 1.7 language version 2021-07-20 13:33:41 +03:00
Andrey Zinovyev
4a37de51bb [FIR] Add ANONYMOUS_INITIALIZER_IN_INTERFACE diagnostic 2021-07-20 13:29:00 +03:00
Yahor Berdnikau
304d01127f Fix false positive on Java/Kotlin JVM target validation.
Fix false positive case when java toolchain was set to <JDK1.8. In such
case Java tasks return '8' (or less) for target instead of '1.8'.

^KT-47520 Fixed
2021-07-20 09:25:06 +00:00
nataliya.valtman
f76864260a Log changed files into ES statistic 2021-07-20 11:26:55 +03:00
Dmitriy Novozhilov
9b3b386f0a [FIR IDE] Ignore HMMP compiler test 2021-07-20 10:33:54 +03:00
Dmitriy Novozhilov
749dbf4d44 [FIR] Safe dependency symbol provider in IDE session 2021-07-20 10:33:53 +03:00
Dmitriy Novozhilov
37c096cb10 [FIR] Support creation of IR of common + platform sources in FirAnalyzerFacade 2021-07-20 10:33:52 +03:00
Dmitriy Novozhilov
df11ccf755 [FIR] Fix dependency on jvm descriptors for running fir2ir tests with JPS 2021-07-20 10:33:51 +03:00
Dmitriy Novozhilov
5354e4afe4 [FIR] Ignore some MPP backend tests
FIR doesn't support actual declarations in same module where expect
  declarations lay
2021-07-20 10:33:50 +03:00
Dmitriy Novozhilov
c3060e861f [FIR] Add expect actual checker 2021-07-20 10:33:49 +03:00
Dmitriy Novozhilov
faadb08174 [FIR-IDE] Fix generating conversions for pair with non-trivial converters 2021-07-20 10:33:48 +03:00
Dmitriy Novozhilov
b363d95160 [FIR-IDE] Add conversion for Map type 2021-07-20 10:33:47 +03:00
Dmitriy Novozhilov
3b2df7ade3 [FIR] Inherit expect modifier from outer classes 2021-07-20 10:33:46 +03:00
Dmitriy Novozhilov
18af4155b8 [FIR] Properly infer open modality for functions of expect interfaces 2021-07-20 10:33:45 +03:00
Dmitriy Novozhilov
3991383853 [FIR] Provide compiler light classes from all source modules 2021-07-20 10:33:44 +03:00
Dmitriy Novozhilov
8729421e7a [FIR] Add kind to all FirSessions 2021-07-20 10:33:43 +03:00
Dmitriy Novozhilov
2c1ada131d [FIR] Don't generate implicit primary constructor for expect classes 2021-07-20 10:33:42 +03:00
Dmitriy Novozhilov
b1e47a46cd [FIR] Inherit isExpect flag of members from containing class 2021-07-20 10:33:41 +03:00
Dmitriy Novozhilov
9fd25af1a7 [FIR] Add pretty toString to FirSession and ModuleData 2021-07-20 10:33:40 +03:00
Dmitriy Novozhilov
55775a7beb [FIR] Use proper moduleData in fake override generator 2021-07-20 10:33:38 +03:00
Dmitriy Novozhilov
7f20b83159 [FIR] Use proper moduleData in synthetic properties scope 2021-07-20 10:33:37 +03:00
Dmitriy Novozhilov
7008f02962 [FIR] Create fir classes for java annotations and enums with Final modality 2021-07-20 10:33:34 +03:00
Dmitriy Novozhilov
6e83820f97 Move ExpectActualCompatibility to :compiler:resolution.common 2021-07-20 10:33:33 +03:00
Dmitriy Novozhilov
950db81aa4 [FIR] Split compileModulesUsingFrontendIR to multiple functions 2021-07-20 10:33:32 +03:00
Dmitriy Novozhilov
ec1651df92 [FIR] Store dependencies symbol provider as separate session component 2021-07-20 10:33:31 +03:00
Ilya Matveev
1c5361dacd [K/N] disable throwThroughBridge test for wasm32 2021-07-20 07:19:38 +00:00
Hung Nguyen
ecf6001365 KotlinCompile: Prepare for classpath snapshotting and diffing
This commit prepares necessary components only. The core parts of
classpath snapshotting and diffing will be implemented next.

Bug: KT-45777
Test: Existing IncrementalCompilationClasspathSnapshotJvmMultiProjectIT
      and IncrementalJavaChangeClasspathSnapshotIT
2021-07-20 04:04:43 +03:00
Hung Nguyen
41345b2c50 Pass classpath changes from KotlinCompile task to Kotlin compiler
This commit wires necessary components only. The actual classpath
changes will be provided later.

Bug: KT-45777
Test: Existing IncrementalCompilationClasspathSnapshotJvmMultiProjectIT
      and IncrementalJavaChangeClasspathSnapshotIT
2021-07-20 04:04:43 +03:00
Hung Nguyen
c8b3b6df9c KotlinCompile: Set up artifact transform to take classpath snapshot
This commit sets up the artifact transform only. The actual classpath
snapshotting and computation of classpath changes will be done later.

Bug: KT-45777
Test: Existing IncrementalCompilationClasspathSnapshotJvmMultiProjectIT
      and IncrementalJavaChangeClasspathSnapshotIT
2021-07-20 04:04:43 +03:00
Ilmir Usmanov
5517aa36e1 Minor. Add debugger test
#KT-47749
2021-07-19 22:07:17 +00:00
Ilmir Usmanov
e870a200c4 Merge consequent LVT records
that is, if LVT record starts where previous one ends, merge them.
 #KT-47749 Fixed
2021-07-19 22:07:16 +00:00
Ilmir Usmanov
5ae01c8b2a Do not duplicate $result in LVT
#KT-47749
2021-07-19 22:07:16 +00:00
Ilmir Usmanov
b4d356c5bd Split LVT record for known nulls
Since they are not spilled, the logic for splitting LVT records, that
is applied for spilled variables, was not applied for known nulls.
Fix that by applying the logic to them.
 #KT-47749
2021-07-19 22:07:15 +00:00
Mads Ager
83dddd73b0 Always add a local variable for its live ranges.
There used to be code that extended a previous range instead.
However, that does not work as that extension could have the
local cover code where it does not exists. Since we no longer
extend the range of locals, we should always introduce a new
one even if there was another one for a previous range.
2021-07-19 22:07:14 +00:00
Ilya Muradyan
ae650ef19b Add EPL 1.0 licence text for Eclipse Aether dependencies 2021-07-19 21:31:50 +03:00
Ilya Muradyan
46bbe5b1cb Replace Ivy resolver with Maven resolver in all places 2021-07-19 21:31:49 +03:00
Ilya Muradyan
014765a302 Add dependencies-maven-all artifact 2021-07-19 21:31:48 +03:00
Ilya Muradyan
f7c2adae30 Always use wagon classloader as a plexus class world
In CLI compiler, system classloader doesn't load all classes directly,
so wagons (including HttpWagon) happen to be invisible to
Plexus DI that leads to artifacts download failures.
2021-07-19 21:31:46 +03:00
Alexander Likhachev
b93bd1fe09 [Gradle] Simplify optInAnnotation function name to optIn in DSL
#KT-38111
2021-07-19 19:57:00 +03:00
Dmitry Petrov
e276dec4de JVM don't merge local values in FixStackAnalyzer
We care only about stacks there.
This yields about 10-15% in a pathological case such as KT-41510.
2021-07-19 19:24:57 +03:00
Ilya Kirillov
230fce65e5 LL API: add kt -> fir mapping tests for types 2021-07-19 18:45:44 +03:00
Ilya Kirillov
1423aa2c43 LL API: fix kt -> fir mapping of type inside nullable type 2021-07-19 18:45:43 +03:00
Ilya Kirillov
ddd257adc2 LL API: add test for kt -> fir mapping of qualified calls 2021-07-19 18:45:42 +03:00
Ilya Kirillov
3ae1fe69da LL API: add test for kt -> fir mapping 2021-07-19 18:45:41 +03:00
Ilya Kirillov
b380bcfd99 LL API: add kt -> fir mapping tests for expressions 2021-07-19 18:45:40 +03:00
Ilya Kirillov
0554e2a083 LL API: fix kt -> fir mapping for KtStringTemplateEntryWithExpression 2021-07-19 18:45:38 +03:00
Ilya Kirillov
9d53ad4346 LL API: fix kt -> fir mapping for KtObjectLiteralExpression 2021-07-19 18:45:37 +03:00
Ilya Kirillov
32baac52e6 LL API: add kt -> fir mapping tests for property delegation 2021-07-19 18:45:36 +03:00
Ilya Kirillov
831f05a802 LL API: fix kt -> fir mapping for KtImportList 2021-07-19 18:45:35 +03:00
Ilya Kirillov
c266d3e075 LL API: fix kt -> fir mapping for KtValueArgumentList 2021-07-19 18:45:34 +03:00
Ilya Kirillov
f6a97cdec6 LL API: fix kt -> fir mapping for KtValueArgument 2021-07-19 18:45:32 +03:00
Ilya Kirillov
6139d97b2a LL API: allow getOrBuildFir to return null 2021-07-19 18:45:31 +03:00
Ilya Kirillov
4bca296dc6 LL API: introduce helper function for throwing invalid FirElement exception 2021-07-19 18:45:29 +03:00
Ilya Kirillov
c0eb669191 LL API: add basic tests for kt -> fir mapping 2021-07-19 18:45:28 +03:00
Elena Lepilkina
609296a46b [K/N] Use libclang_rt version for simulator for last Xcode versions (KT-47333 fixed) 2021-07-19 14:12:41 +00:00
Mikhael Bogdanov
03ccbf1b17 Upgrade kotlinx-metadata-jvm and binary-compatibility-validator versions 2021-07-19 13:49:05 +00:00
Ilya Chernikov
0cd29adcc7 Get rid of kotlinx-coroutines usage in scripting libs and plugins
the dependency on the coroutines library caused various problems like
KT-30778, or stdlib/runtime version conflicts.
The only function used was `runBlocking`, so this change replaces it
with the internal implementation based on the similar internal thing
from the stdlib.
#KT-30778 fixed
2021-07-19 16:35:36 +03:00
Alexander Udalov
9b1de90452 Cache async-profiler when using -Xprofile 2021-07-19 15:14:57 +02:00
Igor Chevdar
bea82ba2cd [K/N][stdlib] Added @EagerInitialization annotation
It is needed in the lazy top level properties initialization strategy to
revert to the previous strategy at least for the transition period
2021-07-19 17:23:35 +05:00
Mikhael Bogdanov
4de6fd8be2 Prepare NewMultiplatformIT tests for compiler migration to 1.6 2021-07-19 12:15:26 +00:00
Dmitriy Novozhilov
c304363aea [FE 1.0] Report WRONG_ANNOTATION_TARGET on annotations on type arguments
^KT-47772 Fixed
2021-07-19 14:00:24 +03:00
Andrey Zinovyev
046d886850 [FIR] Fix Nothing returning expressions when checking for not null 2021-07-19 13:40:32 +03:00
Andrey Zinovyev
7e9f27436a [FIR] Fix cfg for safe call inside elvis 2021-07-19 13:40:31 +03:00
Andrey Zinovyev
c160511244 [FIR] Basic support for break inside try-finally blocks
Support single try expression only
2021-07-19 13:40:30 +03:00
Andrey Zinovyev
a6984c5198 [FIR] Add NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostic 2021-07-19 13:40:28 +03:00
Ilmir Usmanov
151478aa27 Raise deprecations of suspend calls with dangling lambda to error
#KT-22562
2021-07-19 08:36:36 +00:00
Dmitry Petrov
d41fc0b599 PSI2IR fix suspend conversion tests
- support chained suspend conversion + SAM conversion
- support suspend conversion in vararg elements
2021-07-17 09:10:19 +03:00
Victor Petukhov
0cc6fbbc6e Add tests for converting expressions of function types to suspending functional types 2021-07-17 09:10:17 +03:00
Viacheslav Kormushkin
780b9a032b Link CocoaPods frameworks with iosTest binary
#KT-44857 #KT-37513
2021-07-16 19:42:24 +00:00
Mads Ager
b51ff799cb Fix IteratorNext intrinsic to cast its dispatch receiver to
the expected type.

^KT-47741 Fixed.
2021-07-16 21:07:11 +02:00
Ilya Kirillov
f83cc69379 HL API: hacky fix garbage collected diagnostic in call 2021-07-16 21:06:05 +03:00
Ilya Kirillov
d7f1353d3d HL API: update resolve call tests 2021-07-16 21:06:04 +03:00
Ilya Kirillov
44812ae45a HL API: update symbols testdata after adding hasStableParameterNames to function symbol 2021-07-16 21:06:03 +03:00
Mark Punzalan
cb85fd26f5 FIR IDE: Expand KtCall API to include annotation calls and delegated
constructor calls.
2021-07-16 21:06:02 +03:00
Mark Punzalan
d30d8037cf FIR IDE: Add KtFunctionLikeSymbol.hasStableParameterNames. 2021-07-16 21:06:00 +03:00
Mark Punzalan
5c111f8979 FIR IDE: Add argument mapping to KtFunctionCall. 2021-07-16 21:05:59 +03:00
Alexander Likhachev
6fe730a12e [Gradle, JS] Add IT that no tasks configured on help task execution
#KT-47559 Fixed
2021-07-16 20:14:51 +03:00
Alexander Likhachev
0740d11378 [Gradle, JS] Configure run tasks lazily
#KT-47559 In Progress
2021-07-16 20:14:49 +03:00
Victor Petukhov
6a1ec92d39 Introduce specific error for calls which could be resolved only with unrestricted builder inference
^KT-47747 Fixed
2021-07-16 19:32:36 +03:00
Victor Petukhov
357fda2efa Initialize builder inference lambda anyway, even a call is inapplicable
^KT-47744 Fixed
2021-07-16 19:32:35 +03:00
Alexander Likhachev
2b0ba6fa40 [Gradle, MPP] Add test for KT-47611, KT-47612
#KT-47611 Fixed
#KT-47612 Fixed
2021-07-16 18:33:45 +03:00
Alexander Likhachev
8109b66a79 [Gradle, MPP] Make publishing compatible with configuration cache
Capture artifact coordinates more accurately to conform with configuration cache
#KT-47611 In Progress
2021-07-16 18:33:45 +03:00
Alexander Likhachev
77471c0cd8 [Gradle, MPP] Make kotlin tooling metadata task compatible w/ conf cache
The value should be memoized in task, so it can be serialized in a way to not use project in execution time
#KT-47612 In Progress
2021-07-16 18:33:43 +03:00
Mikhael Bogdanov
5f53a2071d Update test affected by ProperTypeInferenceConstraintsProcessing feature 2021-07-16 13:26:37 +00:00
Mikhael Bogdanov
392dce9a40 Update test affected by PrivateInFileEffectiveVisibility feature 2021-07-16 13:26:36 +00:00
Mikhael Bogdanov
c519003e13 Update test affected by ProhibitSimplificationOfNonTrivialConstBooleanExpressions feature 2021-07-16 13:26:36 +00:00
Mikhael Bogdanov
a657e63dbb Update test affected by ForbidUsingExtensionPropertyTypeParameterInDelegate feature 2021-07-16 13:26:35 +00:00
Mikhael Bogdanov
70df4f10c5 Update test affected by AbstractClassMemberNotImplementedWithIntermediateAbstractClass feature 2021-07-16 13:26:34 +00:00
Mikhael Bogdanov
f05d470f6a Update test affected by 'ProhibitJvmFieldOnOverrideFromInterfaceInPrimaryConstructor' feature 2021-07-16 13:26:33 +00:00
pyos
f5dd5ead1f JVM: produce a better error on @JvmStatic external in interface
Java does not permit `static native` methods in interfaces, so this
never worked on any existing JRE.

 #KT-43696 Fixed
2021-07-16 15:24:09 +02:00
pyos
ad7ed483f3 JVM_IR: copy correspondingProperty of static external functions
Required for correctly mapping their names.

 #KT-47715 Fixed
2021-07-16 15:24:05 +02:00
Ilya Goncharov
adeb2f527b [Gradle, JS] Fail incremental test if there is source maps warning
^KT-47751 fixed
2021-07-16 15:39:52 +03:00
Ilya Goncharov
f73726c330 [Gradle, JS] Ignore source maps arguments in cache building
^KT-47751 fixed
2021-07-16 15:39:50 +03:00
Yahor Berdnikau
d82681889b Ignore empty directories on input properties hash calculation.
Annotate all '@InputFiles' and '@InputDirectory' input properties
with '@IgnoreEmptyDirectories' annotation, so empty directories
will be excluded from input hash calculation.

^KT-27687 Fixed
2021-07-16 12:35:15 +00:00
Dmitriy Novozhilov
22f57220c1 [FE 1.0] Report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE on rhs of assign
^KT-47729 Fixed
2021-07-16 15:18:46 +03:00
Dmitriy Novozhilov
afb7625d0c [FE 1.0] Fix false positive INTEGER_OPERATOR_RESOLVE_WILL_CHANGE
^KT-47729 In progress
2021-07-16 15:18:44 +03:00
Dmitriy Novozhilov
2fb5f776d8 [FE 1.0] Report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE on calls in parenthesis
^KT-47729 In progress
2021-07-16 15:18:38 +03:00
Victor Petukhov
ea4ab46765 Report implicit inferred Nothing only for own type parameters and in delegation resolve
^KT-47724 Fixed
2021-07-16 11:21:51 +03:00
Alexander Likhachev
7bb4612149 [Gradle] Add IT that useExperimentalAnnotation produces deprecation warn
#KT-38111 Fixed
2021-07-16 11:01:15 +03:00
Alexander Likhachev
68ced78d89 [Gradle] Rename experimental annotations to opt-in in test data
#KT-38111 In Progress
2021-07-16 11:01:14 +03:00
Alexander Likhachev
fa68dbc736 [Gradle] Rename experimental annotations to opt-in annotations in DSL
Methods and accessors with old names are preserved in public API and marked as deprecated now
#KT-38111 In Progress
2021-07-16 11:01:12 +03:00
Aleksei.Cherepanov
d9701d57bb Fix JPS tests after 2d65383a 2021-07-16 05:35:05 +03:00
Ilya Chernikov
c83614386e [minor] FIR: (temporarily) fix testdata due to different builtins behavior 2021-07-16 02:24:45 +03:00
Ilya Chernikov
02bf745eef IR: Remove some unused IrBuiltIns methods 2021-07-16 02:24:44 +03:00
Ilya Chernikov
51dc829aae IR: Move unsigned classes loading from builtins back to symbols
see #KT-47540 for the motivation
2021-07-16 02:24:43 +03:00
Ilya Chernikov
808f5148f3 IR: implemented generic knownBuiltIns property 2021-07-16 02:24:42 +03:00
Ilya Chernikov
a7d494480c [minor] FIR: minor fixes in FIR-based IrBuiltIns 2021-07-16 02:24:41 +03:00
Ilya Chernikov
56805dded8 [minor] IR: minor builtins infrastructure fixes 2021-07-16 02:24:40 +03:00
Ilya Chernikov
19f52d9aae [minor] FIR: fix irbuiltins implementation after rebase 2021-07-16 02:24:38 +03:00
Ilya Chernikov
873a7c6ef1 FIR: Implement delayed binding of overriddens in the delegated members
fixes the problem when overridden symbols on delegated members were
build on the incomplete fake overrides leading to the incorrect
generation of the function for default parameter and thus to the
codegen error (see withDefaultsMultipleFilesOrder test for an example)
2021-07-16 02:24:37 +03:00
Ilya Chernikov
c9b6847d83 FIR: Add test on delegated member with default param in overridden...
sensitive to the file processing order, therefore failing on the
current fir2ir at least with the new irBuiltIns
2021-07-16 02:24:36 +03:00
Ilya Chernikov
a2385b5edd [minor] FIR: Fix Fir2ir jvmmappedscope functions origins 2021-07-16 02:24:35 +03:00
Ilya Chernikov
6001a81a30 [minor] FIR: Fix IR builtins modality 2021-07-16 02:24:34 +03:00
Ilya Chernikov
5b2acea98f FIR: Add analysis flag for loading IR builtins from sources 2021-07-16 02:24:32 +03:00
Ilya Chernikov
c2c02ddb27 FIR: refactoring IrBuiltIns initialization logic...
to allow to try to load them from dependencies first
and to intialize fake overrides properly
2021-07-16 02:24:31 +03:00
Ilya Chernikov
9de27bc4d8 FIR: Avoid "Mutating Fir2Ir lazy elements" error
for classes came from sources
2021-07-16 02:24:30 +03:00
Ilya Chernikov
8f5d5c3ace FIR: Fixes in testdata after implementing FIR-specific IrBuiltIns 2021-07-16 02:24:29 +03:00
Ilya Chernikov
01f26ec699 FIR: Switch to FIR-based IrBuiltIns in FIR compilation
get rid of using old FE for builtins on FIR compilation
2021-07-16 02:24:28 +03:00
Ilya Chernikov
3b20ec46ef FIR: Set correct modality to default accessors on deserialization
fixes some tests with new IrBuiltIns
2021-07-16 02:24:27 +03:00
Ilya Chernikov
5b677c068f FIR: Refactor JvmMappedScope to fix container-related tests with new builtins 2021-07-16 02:24:25 +03:00
Ilya Chernikov
80a710a5c5 FIR: implementing IrBuiltIns over FIR 2021-07-16 02:24:24 +03:00
Ilya Chernikov
cb4999f23c Native: port native to the new IrBuiltIns 2021-07-16 02:24:22 +03:00
Ilya Chernikov
48a3c64901 IR: Refactor primitive arrays handling in the new IrBuiltIns
for better compatibility e.g. with native
2021-07-16 02:24:20 +03:00
Ilya Chernikov
3b2bb2ba9f IR: Fix error rendering on IR symbol binding conflict
it could be called with uninitialized `owner` parameter, leading
to the NPE on render
2021-07-16 02:24:19 +03:00
Ilya Chernikov
dee0487185 IR: Refactor IrBuiltIns to abstract it from descriptors 2021-07-16 02:24:18 +03:00
Nikolay Lunyak
25d2e61a82 [FIR2IR] Adding 2 new runners for fir2ir-specific tests 2021-07-15 23:15:39 +03:00
Alexander Likhachev
a6e477fa88 [Build] Add dependency verification data for jna 2021-07-15 20:41:59 +03:00
Alexander Likhachev
1a77b57a7b [Gradle] Provide JNA jar to compiler classpath with intellij-core 203+
#KT-47748 Fixed
2021-07-15 20:41:57 +03:00
Yahor Berdnikau
da1d49e622 Add new ways to set Kotlin daemon JVM arguments.
Additionally to inheriting Gradle daemon arguments or configuring via
 Gradle daemon arguments system property, it is also possible now
 to configure arguments either using "kotlin.daemon.jvmargs" property
 or extension DSL.

Extension DSL overrides special gradle property arguments, which
overrides Gradle daemon arguments.

^KT-45747 Fixed
2021-07-15 17:27:38 +00:00
Dmitry Petrov
b98322c1b4 JVM don't optimize methods with too many TCBs 2021-07-15 20:18:18 +03:00
Dmitry Petrov
d65d66c03a JVM reserve 2 slots for node predecessors/successors in CFG 2021-07-15 20:18:15 +03:00
Dmitry Petrov
6c2d93bb8b JVM traverse nodes in reverse order in 'findSafelyReachableReturns' 2021-07-15 20:18:13 +03:00
Mikhael Bogdanov
f080dbb78c Update resolveAnnotations tests in new infrastructure 2021-07-15 17:08:17 +00:00
Mikhael Bogdanov
671ef7dfff Regenerate tests 2021-07-15 17:08:16 +00:00
Mikhael Bogdanov
3aeb9291fe Move resolveAnnotations tests into diagnostics tests 2021-07-15 17:08:16 +00:00
Jinseong Jeon
9ec4d19a3f FIR IDE: avoid finding symbol for function type parameter 2021-07-15 18:29:33 +02:00
Jinseong Jeon
2e502bd01e FIR IDE: fix anonymous function symbol retrieval from function literal 2021-07-15 18:29:32 +02:00
Dmitry Petrov
8ea4916d64 JVM_IR KT-47739 recognize fake override external stubs 2021-07-15 19:20:39 +03:00
Ivan Kochurkin
dd54338ec0 [FIR] Fix positioning and detecting of WRONG_NUMBER_OF_TYPE_ARGUMENTS
Refactor code and fix compilation errors caused by changes to symbol.fir
2021-07-15 19:02:58 +03:00
Ivan Kochurkin
345152d198 [FIR] Add containingDeclarationSymbol to FirTypeParameter 2021-07-15 19:02:56 +03:00
Ivan Kochurkin
0c25d280ee [FIR] Fix calculating of source of TypeArgumentList, add source to FirQualifierPart
Fix positioning for TYPE_ARGUMENTS_NOT_ALLOWED
2021-07-15 19:02:54 +03:00
Ivan Kochurkin
28a6928873 [FIR] Check rest OUTER_CLASS_ARGUMENTS_REQUIRED diagnostics on checkers stage
Add FirOuterClassArgumentsRequiredChecker
2021-07-15 19:02:45 +03:00
Ivan Kochurkin
0fc8be4d60 [FIR] Implement OUTER_CLASS_ARGUMENTS_REQUIRED diagnostics 2021-07-15 19:02:40 +03:00
Yahor Berdnikau
f7ed2f813d Exclude Gradle Kotlin runtime dependencies from 'no-arg' plugin.
This should remove warnings on multiple versions in build classpath
runtime.

^KT-47635 Fixed
2021-07-15 15:27:56 +00:00
Yahor Berdnikau
8db1c52c09 Exclude Gradle Kotlin runtime from 'sam-with-receiver' plugin.
This should remove warnings on multiple dependencies versions
in the build classpath runtime.

^KT-47636 Fixed
2021-07-15 15:27:24 +00:00
Mikhail Glukhikh
40c3c317b2 RawFirBuilder: optimize package name calculation in compiler mode 2021-07-15 12:46:23 +00:00
Ilya Goncharov
dcc54101a7 [Gradle, JS] Add test with icremental JS Ir in parallel build 2021-07-15 11:42:48 +00:00
Svyatoslav Kuzmich
a468792a19 [Wasm] Support Milestone 3 of V8 Wasm GC
Advance V8 version to 9.2.212

Relevant Wasm GC changes:
f9f8ffa445
2021-07-15 10:59:06 +00:00
sebastian.sellmair
9500b2d36e [Commonizer] Add HierarchicalCInteropCallableAnnotationCommonizationTest.test single platform not marked as objc 2021-07-15 10:04:45 +00:00
sebastian.sellmair
17ed498390 [Commonizer] approximationKeys: Fix closing ] for type parameter types' upper bounds 2021-07-15 10:04:45 +00:00
sebastian.sellmair
daa046589e [Commonizer] approximationKeys: Minor cleanup of buildApproximationSignature 2021-07-15 10:04:44 +00:00
sebastian.sellmair
2c8ce2539b [Commonizer] HierarchicalPropertyCommonizationTest: Add test property with and without setter 2021-07-15 10:04:43 +00:00
sebastian.sellmair
8bab6c3076 [Commonizer] Commonize 'val' and 'var' properties
If a setter is not present on all platforms a fallback private setter
shall be emitted.

^KT-47502 Verification Pending
^KT-47691 Verification Pending
2021-07-15 10:04:43 +00:00
sebastian.sellmair
c4d90dc744 [Commonizer] Implement alis type substitution as CirNodeTransformer
This has the advantage, that the substitution only has to run on
functions or properties that are 'incomplete' (missing at least
one other target declaration)

^KT-47433 Verification Pending
2021-07-15 10:04:42 +00:00
sebastian.sellmair
7c450f9884 [Commonizer] Implement CirAliasTypeSubstitutor
This will substitute non-commonizable classifiers with known
type-aliases (which might be commonizable).

A simple example depending on this substitution comes from posix:
Most function and properties use the `FILE` typealias which
is available across all platforms.

Some linux platforms use `__IO_FILE` in their signature, which
is just linux specific. This type substitution will figure out, that
this type can be substituted with `FILE`.

^KT-47433 Verification Pending
2021-07-15 10:04:41 +00:00
sebastian.sellmair
906346b7d9 [Commonizer] Drop CirProperty interface for plain data class 2021-07-15 10:04:41 +00:00
sebastian.sellmair
f0feca286e [Commonizer] Drop CirExtensionReceiver interface for plain data class 2021-07-15 10:04:40 +00:00
sebastian.sellmair
fdee49ee59 [Commonizer] Drop CirTypeParameter interface for plain data class 2021-07-15 10:04:39 +00:00
sebastian.sellmair
4a4516731a [Commonizer] Drop CirValueParameter interface for plain class 2021-07-15 10:04:39 +00:00
sebastian.sellmair
e246a12cd3 [Commonizer] Drop CirFunction interface for plain data class 2021-07-15 10:04:38 +00:00
sebastian.sellmair
0c32abed02 [Commonizer] Remove now unnecessary ArtificialCirDeclaration
This marker interface is not necessary anymore, since no new actuals
will be generated by the Commonizer. It was used to filter declarations
during the serializ
2021-07-15 10:04:37 +00:00
sebastian.sellmair
e041532dd2 [Commonizer] InlineSourceBuilder: Also mark ModuleBuilder functions with InlineSourcesCommonizationTestDsl 2021-07-15 10:04:37 +00:00
sebastian.sellmair
87ac436a35 [Commonizer] Implement HierarchicalCInteropCallableAnnotationCommonizationTest 2021-07-15 10:04:36 +00:00
sebastian.sellmair
8acfeb3e17 [Commonizer] Remove computing signatures from metadata 2021-07-15 10:04:36 +00:00
sebastian.sellmair
f3ff9814a8 [Commonizer] Create approximation keys based on Cir instead of metadata 2021-07-15 10:04:35 +00:00
sebastian.sellmair
09f9a1ce5b [Commonizer] Share Test: Commonizer / Light run configuration
This run configuration can be used to run only light weight/faster tests
2021-07-15 10:04:34 +00:00
Andrey Kuleshov
26a71af6b3 [Native, All platforms] HotFix of the incorrect parsing of long strings to Float and Double (#4492)
### What's done:
- Fixed incorrect logic of String.toFloat() and String.toDouble().
  Long string without any digits were treated as Float or Double:
  "this string does not look as float isn't it?".toFloat() == "Infinity".

- Fixed incorrect parsing of floating point constants "NaN" and "Infinity":
  String values like "NaNPICEZy" or "InfinityN" were treated as valid numbers.

- Merged parsing logic for Double and Float:
  Removed the code duplication, unified methods, made the code more Kotlin-like, not C++-like.

- Updated tests:
  Removed useless tests that checked nothing, updated tests with regression scenarios.
2021-07-15 14:47:55 +07:00
Sergey Bogolepov
118889add5 [K/N] Fix mingw_x86 compilation
It was broken in 9ed97a27f1.
2021-07-15 04:55:36 +00:00
Roman Artemev
447900c3f2 [K/N] Make sure all module names are uniq
In case of klib -> binary compilation there were two different modules
with the same. It breaks invariant about uniqueness if module name.
2021-07-15 03:09:46 +03:00
Georgy Bronnikov
ba61700be6 Regenerate tests 2021-07-14 21:20:49 +03:00
Georgy Bronnikov
4af2aaedb1 IR, temporary: a simpler mangling for flexible types
Mangling for flexible types will need another look.
Complicated cases still do not work.
2021-07-14 21:20:48 +03:00
Georgy Bronnikov
c3f4fcde0b JVM_IR: compute signatures for fake overrides of Java fields 2021-07-14 21:20:47 +03:00
Georgy Bronnikov
8c3386b607 IR: set file in declarationTable when serializing IR 2021-07-14 21:20:46 +03:00
Georgy Bronnikov
05a42b8cd5 IR: handle CompositeSignature in DescriptorByIdSignatureFinder 2021-07-14 21:20:45 +03:00
Georgy Bronnikov
da946e464f Fix compilation after rebase: add debugInfo to JvmIr.proto 2021-07-14 21:20:43 +03:00
Georgy Bronnikov
f4d358069c Fixes after rebase, not related to IrLibraryFile 2021-07-14 21:20:42 +03:00
Georgy Bronnikov
08b950fc2a JVM_IR: Supply fake file name to signatures of file local declarations 2021-07-14 21:20:41 +03:00
Georgy Bronnikov
225705a237 IR: do not serialize nonlocal initializers in inline-only mode 2021-07-14 21:20:40 +03:00
Georgy Bronnikov
28bff2ba4f JVM_IR: add test for calling monitorEnter/Exit from serialized code. 2021-07-14 21:20:38 +03:00
Georgy Bronnikov
dffb22de9d JVM_IR: avoid duplication in declaration lists during deserialization 2021-07-14 21:20:36 +03:00
Georgy Bronnikov
fa4efd3303 JVM_IR: fix deserialization of Java static field symbols 2021-07-14 21:20:35 +03:00
Georgy Bronnikov
955ee07517 IR: compute signature for scripts 2021-07-14 21:20:33 +03:00
Georgy Bronnikov
9d0c6fb157 IR: remove an overly optimistic assert 2021-07-14 21:20:32 +03:00
Georgy Bronnikov
c3a94e1e62 FIR: adapt to changes in IR interface
JvmGeneratorExtensionsImpl, JvmIrCodegenFactory need new arguments.
2021-07-14 21:20:31 +03:00
Georgy Bronnikov
20b76d4149 JVM_IR: reorganize initialization of JvmGeneratorExtensionsImpl
CachedFields are now created at initialization.
Therefore we need CompilerConfiguration as a constructor parameter.
2021-07-14 21:20:30 +03:00
Georgy Bronnikov
7bbc04b6a2 JVM_IR: reconstruct fake overrides after IR deserialization.
We need to keep track of local signatures for deserialized symbols.
2021-07-14 21:20:29 +03:00
Georgy Bronnikov
a63cc95a2a JVM_IR: untangle backend.jvm and serialization.jvm (again) 2021-07-14 21:20:28 +03:00
Georgy Bronnikov
1c4466951f IR: a flag to GeneratorExtensions to control IR deserialization
There is no need to search for IR embedded in toplevel classes when none
is expected (in npon-JVM backends or when -Xserialize-ir is not set).
2021-07-14 21:20:27 +03:00
Georgy Bronnikov
ec1c97c684 JVM_IR: register builtin annotation constructors in SymbolTable
When deserializing IR, these annotations need to be visible.
2021-07-14 21:20:26 +03:00
Georgy Bronnikov
8d15a1d13d JVM_IR: use signatures in AbstractIrSerializeCompileKotlinAgainstInlineKotlinTest
Using signatures allows us to identify calls from a new module to an old
one.
2021-07-14 21:20:24 +03:00
Georgy Bronnikov
49619cda48 Restore Native compilation 2021-07-14 21:20:23 +03:00
Georgy Bronnikov
931733f8cc JVM_IR: deal with JvmStatic in imported IR 2021-07-14 21:20:22 +03:00
Georgy Bronnikov
96ce124268 JVM_IR: serialize fake overrides in IR 2021-07-14 21:20:21 +03:00
Georgy Bronnikov
2d3a558d50 JVM_IR: normalize visibility before serializing 2021-07-14 21:20:20 +03:00
Georgy Bronnikov
a328ebc889 JVM_IR: extract cached fields into a separate class 2021-07-14 21:20:18 +03:00
Georgy Bronnikov
50068607b9 JVM_IR: call serializeIr from a phase
This circumvents the need to run expect/actual resolution on
deserialized IR.
2021-07-14 21:20:17 +03:00
Georgy Bronnikov
0d5fe0b029 JVM_IR: load serialized data for every affected property of IrLazyFunction 2021-07-14 21:20:16 +03:00
Georgy Bronnikov
f4e6eb00fd JVM_IR: generate unbound symbols after deserializing IR 2021-07-14 21:20:15 +03:00
Georgy Bronnikov
6b80c00cc6 JVM_IR: deserialize lazy declarations 2021-07-14 21:20:14 +03:00
Georgy Bronnikov
ad8892f71f JVM_IR: test that inline functions have deserialized bodies 2021-07-14 21:20:12 +03:00
Georgy Bronnikov
7b52a8c07d JVM_IR: deal with facade classes when computing signature 2021-07-14 21:20:11 +03:00
Georgy Bronnikov
97d3eda23c JVM_IR: run Kotlin against Kotlin tests with serialization 2021-07-14 21:20:10 +03:00
Georgy Bronnikov
ab3d6490ed JVM_IR: save auxTables as byte strings 2021-07-14 21:20:09 +03:00
Georgy Bronnikov
7dbdb311e1 JVM_IR: read serialized IR from annotation 2021-07-14 21:20:08 +03:00
Georgy Bronnikov
baaecaa052 JVM_IR: write serialized IR to an annotation 2021-07-14 21:20:06 +03:00
Georgy Bronnikov
b177779b66 IR: compute signatures for fields 2021-07-14 21:20:05 +03:00
Georgy Bronnikov
b2617199bc JVM_IR: call serialization for IR.
Serializer for IR is called when -Xserialize-ir flag is set.
2021-07-14 21:20:04 +03:00
Georgy Bronnikov
9efd0d7589 JVM_IR: JvmIrSerializer 2021-07-14 21:20:02 +03:00
Mikhail Glukhikh
113d2653aa Drop deprecated -Xexperimental flag from compiler and tests 2021-07-14 21:18:23 +03:00
anastasiia.spaseeva
cbcec8d624 Add changelog for 1.5.21 2021-07-14 19:37:14 +03:00
Margarita Bobova
ed3326fd83 Add changelog for 1.5.20 2021-07-14 19:37:12 +03:00
Nikita Bobko
bf6718e0a5 Fix compilation in kotlin-ide 2021-07-14 17:17:19 +02:00
Ilya Goncharov
047041dc6e [Gradle, JS] Await worker which builds cache 2021-07-14 14:46:04 +00:00
Pavel Kunyavskiy
92789984e0 [K/N] Make SafeContinuation thread-safe 2021-07-14 09:03:31 +00:00
pyos
07cb3a5ff8 JVM: do not reify methods of objects in lambdas
All type parameters used in them are not from the inline function
anyway.
2021-07-14 10:11:05 +02:00
pyos
717cf2066a JVM: remove more redundant properties from LambdaInfo 2021-07-14 10:11:05 +02:00
pyos
c1c56ca388 JVM: refactor extraction of default inline lambdas a bit more 2021-07-14 10:11:05 +02:00
pyos
91cf1a1a4d JVM: remove a redundant DefaultLambda field
and add a comment explaining one branch of the inliner... Better than
nothing, I guess?
2021-07-14 10:11:05 +02:00
pyos
100d2d629c JVM: inline default lambda coercions from bridge invoke
The type of the default lambda may be a subtype of the parameter type,
so we can't really generate our own coercions at all as we don't know
the precise Kotlin type of the `invoke` method.
2021-07-14 10:11:05 +02:00
pyos
d0b9c4ae6b JVM: generalize getMethodNode
to allow matching by arbitrary predicates.
2021-07-14 10:11:05 +02:00
Alexander Likhachev
f986591ba9 [Build] Suppress ivy url senseless comparison warning
It's marked as not null in Gradle, but it's still possible to declare Ivy repository with null url which leads to GeneralKotlin2JsGradlePluginIT#testJsBothModeWithTests test false fail (cache redirector script is used in Gradle integration tests)
2021-07-14 10:59:14 +03:00
Ilya Matveev
922aad6865 [K/N] Add exp10 and exp10f to good function list for call checker
Clang may replace a call to `pow (10.0, x)` with a call to `exp10(x)`
(or `__exp10` on MacOS).

We use this function in float parsing logic, so this function should
be added to the good function list.
2021-07-14 04:49:04 +00:00
Nikolay Krasko
0f2e653625 Use cache-redirector for yarn download (KTI-577) 2021-07-13 22:36:51 +03:00
Nikolay Krasko
ec04af9eea Update cache redirector list 2021-07-13 22:36:50 +03:00
Dmitry Petrov
dc16d66fb1 Minor: regenerate tests 2021-07-13 21:23:17 +03:00
pyos
3dc7b6c3ee IR: preserve argument evaluation order more carefully
1. receivers should be evaluated before named arguments;
 2. just because an argument has no side effects doesn't mean it is not
    affected by the other arguments' side effects - in that case it
    should still be evaluated in source order.

 #KT-47660 Fixed
2021-07-13 21:23:15 +03:00
Roman Artemev
b5942204dc [KLIB] Enable accidentally disabled IC for klibs in K/JS 2021-07-13 18:58:57 +03:00
Roman Artemev
ece9307471 [JS IR] Fix destination directory in Incremental compiler runner for JS 2021-07-13 18:58:56 +03:00
Aleksei.Cherepanov
d2881a7920 Improve performance of Lookup storage
Reduce size of lookup map after rebuild, reduce waiting time by replacing operations of read+write with append, also split remove garbage process into smaller operations in get

#KT-46804 Fixed
2021-07-13 18:39:38 +03:00
Alexander Udalov
35f6337de3 Remove obsolete kotlin.build.useIR flag
(cherry picked from commit 91e47f1fd7)
2021-07-13 14:01:19 +02:00
Elena Lepilkina
c401cf961d [K/N][C interop] Support Kotlin special names processing (KT-47209 fixed) 2021-07-13 11:56:31 +00:00
Roman Artemev
0326518fc9 [KLIB] Cutting down usages of moduleDescriptor in linker
Replace map key `ModuleDescriptor` with `String` which is module name
2021-07-13 14:43:42 +03:00
Roman Artemev
eadf252de9 [KLIB] Provide KotlinLibrary for Konan Interop Deserializer 2021-07-13 14:43:41 +03:00
Roman Artemev
0a49b24320 [JS IR] Move klib resolution from cli into compiler
Simplify CLI -> Compiler API
Clean up code
2021-07-13 14:43:40 +03:00
Roman Artemev
103e4ef2a5 [JS IR] Disable ts export check in PIR mode in box tests
Since that feature is not declared as working yet
2021-07-13 14:43:38 +03:00
Elena Lepilkina
025e572462 [K/N] Fixed case with parameter which can be optimized with BCE 2021-07-13 09:22:13 +00:00
Elena Lepilkina
2477ea80c6 Reverted loops order processing in ForLoopsLowering 2021-07-13 09:22:12 +00:00
Elena Lepilkina
c096e6a3eb [K/N] Analyze vals in bounds check elimination 2021-07-13 09:22:11 +00:00
Elena Lepilkina
9503627864 Changed an order of processing loops in ForLoopsLowering 2021-07-13 09:22:11 +00:00
Elena Lepilkina
0e04c21625 [K/N] Bounds check elimination in basic for loops forms 2021-07-13 09:22:10 +00:00
Elena Lepilkina
7975311ca2 [K/N] Added tests for bounds checks 2021-07-13 09:22:09 +00:00
Elena Lepilkina
ac074207c7 [K/N] ForLoopsLowering: Use get without bounds check in ArrayIterationHandler 2021-07-13 09:22:08 +00:00
Dmitriy Novozhilov
f33f3c769f Fix USELESS_IS_CHECK warnings in compiler code 2021-07-13 10:35:05 +03:00
Dmitriy Novozhilov
968f823b72 [JVM IR]Fix detecting annotation retention 2021-07-13 10:35:04 +03:00
Dmitriy Novozhilov
47b0071560 [FE 1.0] Properly handle intersection types in check if cast possible or not
^KT-47685 Fixed
2021-07-13 10:35:03 +03:00
Dmitriy Novozhilov
f0c4d06fc9 [FE 1.0] Cleanup PatternMatchingTypingVisitor.kt 2021-07-13 10:35:02 +03:00
Dmitriy Novozhilov
7b5a5f5682 [FE 1.0] Report USELESS_IS_CHECK if is expression is always false
^KT-47684 Fixed
2021-07-13 10:35:01 +03:00
Dmitriy Novozhilov
785e2f862c [PSI] Ignore when failed to get file text
This is change from 36ff952 which was forgotten when applying 203 bunch
2021-07-13 10:34:59 +03:00
Dmitriy Novozhilov
daa4c708a2 [FIR] Remove unused parameter from ensureResolvedForCalls 2021-07-13 10:31:36 +03:00
Dmitriy Novozhilov
c3b20c9ccb [FIR IDE] Add forgotten space to renderer in diagnostic generator 2021-07-13 10:31:34 +03:00
Dmitriy Novozhilov
22a4da024b [FIR] Fix all illegal usages of symbol.fir in checkers module 2021-07-13 10:31:34 +03:00
Dmitriy Novozhilov
e94d75d433 [FIR] Add opt-in annotation which prevents from using symbol.fir 2021-07-13 10:31:32 +03:00
Dmitriy Novozhilov
c99a02796f [FIR] Replace getContainingClass usages with getContainingClassSymbol 2021-07-13 10:31:31 +03:00
Dmitriy Novozhilov
48a25e2fe6 [FIR] Add some status utils over symbols to addition to utils over fir 2021-07-13 10:31:30 +03:00
Dmitriy Novozhilov
b2c6dd8d53 Convert ClassKind.java to Kotlin 2021-07-13 10:31:29 +03:00
Dmitriy Novozhilov
0062f1ba27 Rename ClassKind.java to ClassKind.kt 2021-07-13 10:31:28 +03:00
Dmitriy Novozhilov
22938522b3 [FIR] Add forgotten updating phase of value parameters 2021-07-13 10:31:27 +03:00
Dmitriy Novozhilov
d3966e8844 [FIR] Add accessors to parts of signatures to symbols 2021-07-13 10:31:26 +03:00
Dmitriy Novozhilov
0f06ab537f [FIR] Remove useSiteSession parameter from ensureResolved 2021-07-13 10:31:25 +03:00
Dmitriy Novozhilov
92cfaf68bb [FIR] Remove unused FirFunctionSymbol.parameters 2021-07-13 10:31:24 +03:00
Dmitriy Novozhilov
4deb935f76 [FIR] Mark value classes as inline in raw fir building 2021-07-13 10:31:23 +03:00
Dmitriy Novozhilov
8df56af068 [FIR] Add forgotten settings of resolve phase 2021-07-13 10:31:22 +03:00
Dmitriy Novozhilov
9f161f16b3 [FIR] Move FirPhaseManager to :compiler:fir:tree 2021-07-13 10:31:21 +03:00
Dmitriy Novozhilov
51fc2e453f [FIR] Unity FirCallableDeclaration and FirCallableMemberDeclaration
After removal of all diamonds in FirDeclaration hierarchy
  FirCallableMemberDeclaration was only one inheritor of
  FirCallableDeclaration, so there is no need to keep them both
2021-07-13 10:31:20 +03:00
Dmitriy Novozhilov
adc45fd3dd [FIR] Remove useless generic parameter from deprecation utils 2021-07-13 10:31:18 +03:00
Dmitriy Novozhilov
c50fe4e399 [FIR] Move some components implementations from :entrypoint to appropriate modules 2021-07-13 10:31:17 +03:00
Alexander Udalov
173e194dac Remove dependency on JVM specifics in serialization.common
Move handling of EnhancedNullability to JVM subclasses in
serialization.jvm. Looks like this was possible because of accidental
dependency of frontend on compiler.common.jvm introduced in 564d382b9d.

Also fix a minor typo in the file name typeEnhancementUtils.kt.
2021-07-13 01:54:41 +02:00
Alexander Udalov
7a42f603f2 JVM IR: rename mangler implementation classes 2021-07-13 01:54:41 +02:00
Alexander Udalov
1e16c7d8d4 Minor, update kotlinx-metadata-jvm changelog
According to changes in 1e7295c6.
2021-07-12 22:40:02 +02:00
pyos
d988853c11 JVM_IR: optimize out redundant delegated property receiver fields
Now this:

    class C {
        val x = something
        val y by x::property
    }

is *exactly* the same as this:

    class C {
        val x = something
        val y get() = x.property
    }

(plus a `getY$delegate` method)
2021-07-12 22:38:45 +02:00
pyos
2fe7cf27ad kotlinp: use JVM_IR backend for compiling tests
Also, test optimized delegated properties.
2021-07-12 22:38:45 +02:00
pyos
791fa411d8 JVM_IR: write correct lambda invoke() signature in metadata 2021-07-12 22:38:45 +02:00
pyos
a7c13db575 JVM_IR: add $delegate methods to a few exclusion lists
1. they don't need type annotations;
 2. internal ones include the module name before the `$delegate` part,
    so further mangling is redundant
 3. they don't need multifile facade bridges.

Unlike `$annotations`, delegated properties don't appear in interfaces,
so exclusions in InterfaceLowering would be redundant.
2021-07-12 22:38:45 +02:00
pyos
6897e89bbc JVM: add tests for optimized getDelegate 2021-07-12 22:38:45 +02:00
pyos
debd58d377 JVM: use $delegate methods in KProperty[0-2].getDelegate
#KT-39055 Fixed
2021-07-12 22:38:44 +02:00
pyos
1e7295c64e JVM: add $delegate method support to kotlinx-metadata
and kotlinp as well -- it is now possible to see the effect of the
previous commit.
2021-07-12 22:38:44 +02:00
pyos
5d0102a966 JVM_IR: generate $delegate methods for val x by ::y 2021-07-12 22:38:44 +02:00
pyos
7ae4303e1b JVM_IR: slightly refactor JvmPropertiesLowering
to make it easier to generate different kinds of synthetic methods.

 #KT-47609 Fixed
2021-07-12 22:38:44 +02:00
pyos
a943cdadef JVM_IR: support generation of bound reflected property references
Not currently used though, since only references for delegated
properties' accessors are reflected, and those are unbound.
2021-07-12 22:38:43 +02:00
pyos
664bb055c8 JVM_IR: support codegen of property delegate methods
The purpose of a property-related method is now determined by its
origin; codegen no longer assumes all methods with Property metadata
source are `getX$annotations`.
2021-07-12 22:38:43 +02:00
pyos
6a3c79bb9e JVM: support on-the-fly generation of property delegates in metadata
Optimizations may remove the `x$delegate` field, in which case there
should be a `getX$delegate` method to reconstruct the value if needed
due to a call to `KProperty{0,1,2}.getDelegate`. We need to know the
signature of this method somehow.
2021-07-12 22:38:43 +02:00
pyos
e49410e07b JVM_IR: optimize delegation by property references
E.g. a statement like

    var x by ::y

is semantically equivalent to

    var x
      get() = y
      set(value) { y = value }

and thus does not need a full property reference object, or even a field
if the receiver is not bound.

 #KT-39054 Fixed
 #KT-47102 Fixed
2021-07-12 22:38:43 +02:00
Ivan Kochurkin
66e052b9b3 [FIR] Implement SPREAD_OF_NULLABLE 2021-07-12 23:16:47 +03:00
Nikita Bobko
83c5c41dd4 Fix that marketplace identifies newly uploaded Kotlin plugin artifacts as Kotlin 1.2 artifacts
This `compiler.xml` is packed into `kotlin-idea.jar` and causes troubles for marketplace
in identifying correct Kotlin plugin version
2021-07-12 22:04:20 +03:00
Mikhail Glukhikh
a997a98054 Commend -Xopt-in deprecation warning (due to bootstrap problems) 2021-07-12 21:26:21 +03:00
Mikhail Glukhikh
a92ab1bc86 Deprecate EXPERIMENTAL_IS_NOT_ENABLED diagnostic #KT-47638 Fixed 2021-07-12 21:26:20 +03:00
Mikhail Glukhikh
5871f3d663 CLI: support -option=value syntax for non-advanced flags #KT-47640 Fixed 2021-07-12 21:26:19 +03:00
Mikhail Glukhikh
d8417fd622 Introduce -opt-in stable compiler option instead of -Xopt-in
#KT-47099 Fixed
2021-07-12 21:26:18 +03:00
Mikhail Glukhikh
47c8bab48e Replace -Xuse-experimental with -Xopt-in in codebase 2021-07-12 21:26:17 +03:00
Mikhail Glukhikh
195b6d1fb1 Deprecate -Xuse-experimental #KT-47623 Fixed 2021-07-12 21:26:16 +03:00
Mikhail Glukhikh
d9531f0c61 Don't report EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET for forbidden targets
#KT-47589 Fixed
2021-07-12 21:26:15 +03:00
Ilmir Usmanov
ac7538a269 Set receivers for inline class default function stub calls
Default function stubs have dispatch and receiver parameters, but
inline class methods are static by design with receivers as ordinary
parameters. So, take these parameters and set them as receivers during
lowerings.
 #KT-46230: Fixed
2021-07-12 19:46:09 +03:00
Florian Kistner
31420a934c MI-187 Add asserts for module dependencies 2021-07-12 18:23:19 +03:00
Florian Kistner
3fe388bd17 MI-187 Also allow foreign DerivedModuleInfos, if their original module is known to the ResolverForProject 2021-07-12 18:23:17 +03:00
Mikhail Glukhikh
5f6be619c0 FIR: Don't get all*Checkers multiple times 2021-07-12 15:47:59 +03:00
Elena Lepilkina
3cabfb6a85 [K/N][New MM] Rare GC calls to optimize swiftinterop benchmarks 2021-07-12 12:27:05 +00:00
Elena Lepilkina
cdeda58ed4 [K/N][perf] Added opportunity to set up tagged branch and added benchmarks plots for new MM 2021-07-12 12:26:20 +00:00
Victor Petukhov
33a281c637 Introduce separate compiler flag for unrestricted builder inference 2021-07-12 13:57:13 +03:00
Alexander Shabalin
274dabb61d Collect stacktraces without allocating kotlin objects. 2021-07-12 08:49:33 +00:00
Alexander Shabalin
fca89c2118 Backport span from C++20
Does not support ranges and construction from arbitrary contiguous iterators as both need C++20 concepts for an adequate implementation.
2021-07-12 08:48:20 +00:00
Dmitriy Novozhilov
5efde67a0c [FIR IDE] Register java enhancement state in FirIdeSessions
This was forgotten in 6d364a5f
2021-07-12 11:47:25 +03:00
Dmitry Petrov
1f8d6d6edb JVM additional DCE tests 2021-07-12 11:09:30 +03:00
Dmitriy Novozhilov
6d364a5fee [FIR] Register enhancement state in library session too
This is needed for enhancement scopes for deserialized java declarations
2021-07-12 10:15:07 +03:00
Dmitriy Novozhilov
8e0793091a Add @NoInfer to safeAs type
This change will force specify type argument of every safeAs call
2021-07-12 10:11:36 +03:00
Dmitriy Novozhilov
ddc3ef1121 Fix all illegal usages of safeAs function
Call of `safeAs` without specifying explicit type argument is hardly
  readable and may leads to hardly detectable errors
2021-07-12 10:11:36 +03:00
Ilya Gorbunov
5072653957 Duration: parse explicit positive values parenthesized 2021-07-12 04:39:28 +00:00
Ilya Gorbunov
682cb8e34a Duration default toString: use 0, 1, 2, 3, 6, or 9 decimal digits
KT-42851
2021-07-12 04:39:27 +00:00
Ilya Gorbunov
7551719b85 Duration parsing: simplify range checks 2021-07-12 04:39:27 +00:00
Ilya Gorbunov
0427eec20f Quote invalid strings in exception messages 2021-07-12 04:39:26 +00:00
Ilya Gorbunov
3f6e2be687 Duration: do not use scientific format for large values
The largest duration value formatted in ns with maximal decimals
would fit in 40 chars.
2021-07-12 04:39:25 +00:00
Ilya Gorbunov
1be1e5279c Duration: parse and format negative values parenthesized 2021-07-12 04:39:25 +00:00
Ilya Gorbunov
ca1a9e4ca3 Duration: longer than long values in ISO components, test negative cases 2021-07-12 04:39:24 +00:00
Ilya Gorbunov
1c6ab08220 Introduce functions to parse a duration from a string KT-45325 2021-07-12 04:39:23 +00:00
Ilya Gorbunov
7ab6f6c9b2 Change Duration.INFINITE.toIsoString representation 2021-07-12 04:39:23 +00:00
Ilya Gorbunov
ae3d9cc3cd Small durations are formatted with sub-second units KT-42851 2021-07-12 04:39:22 +00:00
Ilya Gorbunov
150ce812f1 Use days component in the default duration format KT-42851 2021-07-12 04:39:21 +00:00
Ilya Gorbunov
255c4b405e Duration: round Double value to Long ns instead of truncating it KT-47675 2021-07-12 04:39:21 +00:00
Ilya Gorbunov
42cd2e65e6 Change Duration.toString format KT-42851 2021-07-12 04:39:20 +00:00
Dmitry Petrov
804db3ce91 JVM KT-47613 custom control flow analyzer for CFG builder 2021-07-11 20:16:09 +03:00
Dmitry Petrov
fe71435104 JVM KT-47613 traverse nodes backwards in backward analysis 2021-07-11 20:16:09 +03:00
Viacheslav Kormushkin
8c021af646 M1 support for cocoapods
#KT-47078
2021-07-10 19:23:51 +00:00
Ilya Gorbunov
455fee29e4 Find correct next match after matchAt and matchEntire KT-47676 2021-07-10 21:31:20 +03:00
Ilya Gorbunov
28a0698463 Regex.matchAt/matchesAt #KT-34021 2021-07-10 21:31:19 +03:00
Dmitry Petrov
d99d25e51e JVM use SPBs in fix stack analyzer 2021-07-10 19:25:25 +03:00
Dmitry Petrov
38f45d2969 JVM update licence for InstructionLivenessAnalyzer.kt 2021-07-10 19:25:24 +03:00
Dmitry Petrov
68560c60f3 JVM use FastMethodAnalyzer when possible 2021-07-10 19:25:22 +03:00
Dmitry Petrov
c54e680021 JVM FastMethodAnalyzer: prune some exception edges 2021-07-10 19:25:21 +03:00
Dmitry Petrov
07b89c6b4b JVM FastMethodAnalyzer 2021-07-10 19:25:20 +03:00
Alexander Udalov
6f72c681ed JVM IR: fix name and parent of JvmSymbols.kClassJava
In contrast to other top-level functions/properties declared in
JvmSymbols (unsafeCoerce, signatureString, etc), kClassJava refers to a
real symbol from the library. Since not all calls to it are intrinsified
(see KClassJavaProperty.kt:30), it makes sense to allow to reference it
when constructing IR. For that, it needs to have the correct file facade
as the parent, and the JvmName annotation so that its name is mapped
correctly in the codegen.

Co-authored-by: Leonid Startsev <leonid.startsev@jetbrains.com>
2021-07-10 15:33:25 +02:00
Alexander Udalov
d33debdf7c IR: minor, cleanup Symbols 2021-07-10 15:33:25 +02:00
Yahor Berdnikau
de22a467a1 Ensure default toolchain is also set to java only modules.
^KT-46972 Fixed
2021-07-09 19:36:27 +03:00
Victor Petukhov
a8e28e4b69 Update compiler tests 2021-07-09 19:21:28 +03:00
Victor Petukhov
967304ffca Don't compute default type for a fixing type variable for self type if the corresponding feature is disabled 2021-07-09 19:21:27 +03:00
Victor Petukhov
584facc95f Fix fir-related problems and tests for inferring self types 2021-07-09 19:21:25 +03:00
Victor Petukhov
9e48ef85ea Add tests for inferring self types from Java 2021-07-09 19:21:22 +03:00
Victor Petukhov
3b16865152 Don't approximate captured types while substitute them in upper bound position 2021-07-09 19:21:17 +03:00
Victor Petukhov
c2cf2f36cd Implement inferring materialized self types through a default type in ResultTypeResolver 2021-07-09 19:21:04 +03:00
Victor Petukhov
3787099a38 Put the type inference on calls with self types under the compiler flag 2021-07-09 19:20:56 +03:00
Victor Petukhov
51c5a54e31 Support type inference for self type materialization calls 2021-07-09 19:20:54 +03:00
Mikhail Zarechenskiy
44cf4be1e5 Inference for some kind of self types 2021-07-09 19:20:52 +03:00
Andrey Zinovyev
db72fd1e93 [FIR] Fix inheritance check for substitution overrides
And delegates
2021-07-09 17:14:37 +03:00
Alexander Udalov
d43ed1cf75 Minor, add test on typeOf with intersection type 2021-07-09 14:53:57 +02:00
Alexander Udalov
a7e48c3af1 Improve toString of platform types created by typeOf
In the stdlib implementation, render "!" if the type is only
nullability-flexible. Otherwise, render "($lower..$upper)".

Note that full kotlin-reflect has a much more complicated logic (see
`DescriptorRendererImpl.renderFlexibleType`) that renders things like
`(Mutable)List` and so on. It is not a goal of the stdlib implementation
to replicate all of that, since it requires copying a large amount of
code, namely the entirety of `JavaToKotlinClassMap` to map Java class
names to Kotlin.
2021-07-09 14:53:56 +02:00
Alexander Udalov
ddfa94e7e9 Support Nothing type in typeOf
The proper support will come in KT-15518, but that would be a breaking
change even for stable Kotlin without kotlin-reflect. Before that issue
is fixed, represent Nothing in types with the Void class, and use a flag
in the no-reflect implementation to remember that it's not actually the
Void class itself.

 #KT-39166 Fixed
2021-07-09 14:40:05 +02:00
Alexander Udalov
02774fae0c Report error on non-reified type parameter with recursive bound in typeOf
Instead of throwing an exception.

 #KT-40173
2021-07-09 14:31:52 +02:00
Alexander Udalov
438ce57183 Report error on typeOf<suspend ...>()
Otherwise an invalid type is constructed which causes kotlin-reflect to
crash, and stdlib implementation to render the type incorrectly. The
reason is that suspend functional types are not properly supported in
reflection. Once they are supported, this error can be removed.

 #KT-47562
2021-07-09 14:31:52 +02:00
Alexander Udalov
68432f0c20 Fix deprecation/unchecked warnings after update to 203 2021-07-09 14:24:07 +02:00
Dmitriy Novozhilov
c6f754cf7a [Build] remove dependency on IDEA classes from :visualizer 2021-07-09 14:38:03 +03:00
Dmitriy Novozhilov
aa3a73c6c2 [FIR] Move JavaTypeEnhancementState to session component 2021-07-09 14:38:02 +03:00
Simon Ogorodnik
e102bdea20 [Build] Fix xerces usage in FIR modularized tests 2021-07-09 11:08:13 +00:00
Victor Petukhov
c3a5a7754d Use proper applicability for constraint warnings
^KT-47316 Fixed
2021-07-09 14:07:01 +03:00
Victor Petukhov
1224d28deb Move java type enhancement stuff to :core:compiler.common.jvm 2021-07-09 13:22:02 +03:00
Nikita Bobko
c112e768de Update ReadMe to point to up-to-date Kotlin IDEA plugin location 2021-07-09 10:14:41 +00:00
Pavel Kunyavskiy
31857f23a3 [K/N] Refactoring: remove copypaste 2021-07-09 08:53:08 +00:00
Pavel Kunyavskiy
594ff1474d [K/N] Make llvm Int1 boolean, not byte 2021-07-09 08:53:08 +00:00
Pavel Kunyavskiy
eec8fdf16a [K/N] Implement isExperimentalMM intrinsic 2021-07-09 08:53:07 +00:00
Ilya Muradyan
55ec6729b0 [REPL] Fix completion after final expressions 2021-07-09 04:06:53 +03:00
Vyacheslav Gerasimov
a915eddf22 Build: Upgrade Idea Ext plugin to 1.0.1 2021-07-08 23:24:09 +03:00
Dmitry Petrov
24fcadb869 JVM don't run CCE on methods without optimizable conditional jumps 2021-07-08 22:11:59 +03:00
Alexander Udalov
25f0beed12 Load async-profiler.jar if possible when using -Xprofile
Instead of requiring it to be on the compiler classpath.

This will make it much easier to profile the Kotlin compiler daemon in
Gradle, by just specifying a compiler argument instead of also manually
patching the compiler jar.
2021-07-08 20:44:45 +02:00
Ilya Muradyan
787ce6335c Change nestedClasses logic to accept classes with nested type aliases
#KT-47650 fixed
2021-07-08 21:04:53 +03:00
Simon Ogorodnik
ca86b7ff7d [Build] Make getToolchainCompilerFor private and fix LibrariesCommon 2021-07-08 17:06:31 +00:00
Simon Ogorodnik
c0e479eadb [Build] Allow to override JDK 10 with JDK 11 2021-07-08 17:06:31 +00:00
Simon Ogorodnik
18eccdbc1f [Build] Allow to override JDK 9 with JDK 11 2021-07-08 17:06:30 +00:00
Simon Ogorodnik
a31bdc6454 [Build] Respect overrides in getToolchainLauncherFor 2021-07-08 17:06:29 +00:00
Simon Ogorodnik
bf25ccfc0e [Build] Allow kotlin.build.isObsoleteJdkOverrideEnabled=true on CI 2021-07-08 17:06:28 +00:00
Ilya Kirillov
eab1a78d48 FIR IDE: mute failing multimodule tests 2021-07-08 18:25:44 +03:00
Roman Golyshev
dcc30cb672 FIR IDE: Mute test with java file in the dependency
The corresponding JavaSymbolProvider currently is unable to
see the `Foo` class, because under the hood it uses
`JvmDependenciesIndexImpl` which doesn't know about the corresponding
.java file because it is created for m2-module `project`

I wasn't able to fix it yet
2021-07-08 18:25:42 +03:00
Roman Golyshev
0d443d526d FIR IDE: Use more correct implementation of TestModuleSourceInfo::dependencies
When only `regularDependencies` were used, multiplatform tests were
failing because `actual` modules did not see the `expected` ones
2021-07-08 18:25:41 +03:00
Ilya Kirillov
a9bb577154 FIR IDE: add ability to run multimodule tests 2021-07-08 18:25:39 +03:00
Andrey Zinovyev
1cb34541bd [FIR] Fixes after delegation scope rework 2021-07-08 18:13:52 +03:00
Andrey Zinovyev
02297d2c75 [FIR] Rollback exposure of j.u.List.sort method 2021-07-08 18:13:51 +03:00
Andrey Zinovyev
221e642d97 [FIR] Fix inheritance diagnostics for new FirDeclaration hierarchy
Plus several small fixes in reporting itself
2021-07-08 18:13:49 +03:00
Andrey Zinovyev
b36f8ed8f5 [FIR] DATA_CLASS_OVERRIDE_CONFLICT diagnostic 2021-07-08 18:13:48 +03:00
Andrey Zinovyev
b44785c24e [FIR] NOTHING_TO_OVERRIDE diagnostic 2021-07-08 18:13:47 +03:00
Andrey Zinovyev
9452b788bf [FIR] Implement CANNOT_OVERRIDE_INVISIBLE_MEMBER diagnostic 2021-07-08 18:13:46 +03:00
Andrey Zinovyev
f4c8108ee0 [FIR] Substitute type parameters in inheritance checker 2021-07-08 18:13:45 +03:00
Andrey Zinovyev
3f7d050f8f [FIR] Implement CONFLICTING_INHERITED_MEMBERS diagnostic 2021-07-08 18:13:44 +03:00
Andrey Zinovyev
78519f851e [FIR] Implement VAR_OVERRIDDEN_BY_VAL_BY_DELEGATION diagnostic 2021-07-08 18:13:43 +03:00
Andrey Zinovyev
c98cd3b190 [FIR] Implement properties types mismatch on inheritence
PROPERTY_TYPE_MISMATCH_ON_INHERITANCE,
VAR_TYPE_MISMATCH_ON_INHERITANCE,
PROPERTY_TYPE_MISMATCH_BY_DELEGATION
2021-07-08 18:13:41 +03:00
Andrey Zinovyev
8c7ee0b714 [FIR] Implement RETURN_TYPE_MISMATCH_BY_DELEGATION diagnostic 2021-07-08 18:13:40 +03:00
Andrey Zinovyev
94da1e37aa [FIR] Implement RETURN_TYPE_MISMATCH_ON_INHERITANCE diagnostic 2021-07-08 18:13:38 +03:00
Konstantin Tskhovrebov
8012eb3214 Add support Apple M1 for KMP embedAndSign task.
#KT-47077
2021-07-08 16:43:59 +03:00
Hung Nguyen
a0e003ac5d Add tests for kotlin.incremental.useClasspathSnapshot feature
This ensures we don't regress when developing the feature.

Bug: KT-45777
Test: New IncrementalCompilationClasspathSnapshotJvmMultiProjectIT
      and IncrementalJavaChangeClasspathSnapshotIT
2021-07-08 15:05:38 +03:00
Dmitriy Novozhilov
d44a2f6fd3 Fix dependency on javac2.jar
In 203.8084.24 this jar was moved from intellij dependencies to
  libraries of intellij java plugin
2021-07-08 13:29:22 +03:00
Dmitriy Novozhilov
30578cfb95 Delete DynamicBundle copy
We can safely use it from IDEA after IDEA-248785 was fixed
2021-07-08 13:29:21 +03:00
Dmitriy Novozhilov
d6a6ec42a2 Use 203.8084.24 as IDEA dependency instead of 203.6682.168 2021-07-08 13:29:21 +03:00
Dmitriy Novozhilov
d473d22d8c [Test] Migrate SpecTestsConsistencyTest to JUnit5 2021-07-08 13:29:21 +03:00
Dmitriy Novozhilov
c0c9e4a114 Update testadata of PSI dump of java records 2021-07-08 13:29:21 +03:00
Dmitriy Novozhilov
955c506294 Update load java testdata with type use annotations 2021-07-08 13:29:21 +03:00
Dmitriy Novozhilov
4d4d3a998b [FIR] Update load java testdata according to new sealed modifier 2021-07-08 13:29:20 +03:00
Dmitriy Novozhilov
5552f5f5b2 [FIR] Update light classes testdata
In 203 platform java.lang.Object in position of type parameter
  bound is not rendered
2021-07-08 13:29:20 +03:00
Dmitriy Novozhilov
a710cdf822 [FIR] Properly unregister java element finder in CLI compiler 2021-07-08 13:29:20 +03:00
Dmitriy Novozhilov
817c4381f5 Fix asm version in kotlinp 2021-07-08 13:29:20 +03:00
Dmitriy Novozhilov
11faf04a4c [Test] Remove dependencies on IDEA classes from test modules
Some of IDEA services (like in `com.intellij/execution`) was copied,
  because they are used in tests but jars with them compiled with
  jdk 11 and we run our tests on jdk 8, so their bytecode can not
  be read
2021-07-08 13:29:19 +03:00
Dmitriy Novozhilov
11dfbd41ac [Test] Delete obsolete descriptor renderer tests 2021-07-08 13:29:19 +03:00
Dmitriy Novozhilov
eb94575c69 Remove redundant usages of IDEA services in CLI 2021-07-08 13:29:19 +03:00
Dmitriy Novozhilov
82e3e00bf5 Fix compilation after migrating to ASM 9 2021-07-08 13:29:19 +03:00
Yan Zhulanow
9e2fb6e25a Add verification metadata for IntelliJ 2020.3 2021-07-08 13:29:18 +03:00
Dmitriy Novozhilov
80971d7b8b ~~~~ switch 203 ~~~~ 2021-07-08 13:29:18 +03:00
Yan Zhulanow
ca8e35e7db Return 203 bunch back 2021-07-08 13:29:18 +03:00
Yan Zhulanow
cf65754ea4 Update 203 bunch 2021-07-08 13:29:18 +03:00
Dmitriy Novozhilov
ccc3e3510c [Test] Remove useless dependencies on IDEA from FIR test modules 2021-07-08 13:29:18 +03:00
Dmitriy Novozhilov
b6bc57fa09 [Test] Remove useless dependencies on IDEA from :compiler:tests-common-new 2021-07-08 13:29:17 +03:00
Dmitriy Novozhilov
88b7694762 [Test] Remove useless dependencies on IDEA from :compiler:tests-common 2021-07-08 13:29:17 +03:00
Nikita Bobko
2a26c29390 Disable kotlin-scripting-ide-common publishing
We don't need this artifact in IDE anymore since we are not
going to move ide-common classes to kotlin repo. See previous commit
2021-07-08 10:01:35 +00:00
Nikita Bobko
3ca0e11dab Add README to scripting-ide-common
Originally, we though that we would move classes from `ide-common` from Kotlin plugin to this
module but it turns that these classes are heavily used in Kotlin plugin and it's better to
keep them with the rest of Kotlin plugin. So now classes in `scripting-ide-common` are copy-pasted
2021-07-08 10:01:34 +00:00
Anton Yalyshev
e32a975814 Add change notes for 1.5.30-M1 2021-07-08 10:25:25 +03:00
Dmitry Petrov
1a0a3df9d2 JVM_IR simplify BridgeLowering
Generate bridges immediately for each class.

No need to compute existing signatures for a given method name unless it
requires a special bridge.
2021-07-07 21:24:55 +03:00
Xin Wang
8317daa00b Don't generate nullability assertions in methods for directly invoked lambdas 2021-07-07 20:32:47 +03:00
Nikita Bobko
fbe062ee64 [refactoring] Move files in scripting-ide-common into unique subpackage
I am afraid of FQN clashes with classes in `ide-common` in kotlin-ide
2021-07-07 16:51:45 +02:00
Nikita Bobko
339231b05e Move KtFunctionLiteral.findLabelAndCall from kotlin-ide.frontend-independent to compiler.psi
I want to be able to use this function in `:kotlin-scripting-ide-common` & `frontend-independent`

This commit also allows to remove copy-pasted `findLabelAndCall` in `scripting-ide-services` module
2021-07-07 16:51:44 +02:00
Dmitry Gridin
a8a6f51a0e [common] fix flexible type approximation in renders
^KTIJ-3030 Fixed

(cherry picked from commit 4855d88a9f6fbce9aeeea6fe1f29dd099a833aed)

KT-CR-2373
2021-07-07 16:51:44 +02:00
Matthew Gharrity
958b0ff24a Ignore diagnostics in ShadowedDeclarationsFilter
During code completion, ShadowedDeclarationsFilter resolves many
synthetic calls (sometimes >1000 for certain projects/scenarios).
By ignoring diagnostics we can avoid running call checkers
during this process (pending a sibling change in the compiler).

Relates to KT-44276 and github.com/JetBrains/kotlin/pull/4027
2021-07-07 16:51:44 +02:00
Matthew Gharrity
e2109c3f8f ShadowedDeclarationsFilter: check for equivalence
If there are multiple copies of the same library on the classpath,
then ShadowedDeclarationsFilter becomes very slow because it
encounters many equal-signature declarations and thus has to resolve
a lot of calls in order to pick among them.

Having multiple copies of the same library on the classpath is
somewhat common in real-world projects. It occurs in the
JetBrains/intellij-kotlin project, for example. In that project,
ShadowedDeclarationsFilter ends up resolving thousands of calls,
accounting for around 80% of completion time when there are
many completion results (see KT-44276).

We can optimize ShadowedDeclarationsFilter by checking whether the
descriptors in an equal-signature group are structurally equivalent.
If they are, we can just pick one rather than running resolve.

Testing on a small project with Kotlin stdlib duplicated on the
classpath, this change reduces overhead in ShadowedDeclarationsFilter
from 1200 ms to 20 ms when running completion on the prefix 'a'.
End-to-end completion time is cut in half.

Test: JvmBasicCompletionTestGenerated.Common.Shadowing
2021-07-07 16:51:43 +02:00
Andrei Klunnyi
decfcd28d2 KT-39398 Wrong import of unrelated object member is suggested for receiver
Receiver of a function call '<receiver>.foo()' (where receiver is a
class/object/alias name) might be specified incorrectly - corresponding
[companion] object might not be declared.

Before this commit '<receiver>' was considered to be undefined (null).
As a consequence, import suggestion included all 'foo()' functions from
the search scope.

Now as a value of '<receiver>' we set class/object/alias itself
resulting in an empty import suggestion list.
See org/jetbrains/kotlin/idea/util/CallType.kt:307
(#extractReceiverTypeFrom(descriptor: ClassDescriptor)).
2021-07-07 16:51:43 +02:00
Nikita Bobko
365821ae54 2/2 Extract code which is required for :kotlin-scripting-ide-services from ide-common into seprate module
Extract the code and keep it in Kotlin repo. See previous preparation commit as well
2021-07-07 16:51:43 +02:00
Nikita Bobko
cf3f35e1c8 1/2 Preparation commit: move ide-common files which are required for scripting to separate directory
This commit is needed to preserve git history
2021-07-07 16:51:43 +02:00
pyos
50797dba8d JVM: do not use crossinline flag when inlining assertions
Crossinline lambdas *can* be inlined into objects, but don't *have* to;
the correct place should be determined from the context, not from the
parameter.
2021-07-07 16:48:01 +02:00
pyos
e64cda61d5 JVM_IR: do not generate $assertionsDisabled twice during inlining 2021-07-07 16:48:01 +02:00
Ilya Matveev
123c76053f [Gradle][tests] Fix running CocoaPods on Apple M1 2021-07-07 17:13:34 +03:00
Ilya Matveev
5fad5e017e [Gradle][tests] Disable workaround for XCode 12.3 2021-07-07 17:13:31 +03:00
Ilya Matveev
53a4187427 [Gradle][tests] Install CocoaPods to a temp dir instead of HOME 2021-07-07 17:13:29 +03:00
Ilya Matveev
aa9ff3d6bb [Gradle][tests] Install cocoapods in MPP plugin tests 2021-07-07 17:13:26 +03:00
Svyatoslav Scherbina
2d0dbf9729 Native: improve ObjCExport thread state switching 2021-07-07 13:53:27 +00:00
Ilya Goncharov
1a27f91a98 [Gradle, JS] Remove redundant suppression 2021-07-07 16:40:22 +03:00
Ilya Goncharov
f7e69fb2ef [Gradle, JS] Update verification data with Yarn 2021-07-07 16:40:20 +03:00
Ilya Goncharov
da1bdf87cb [Gradle, JS] Use injected services of fs 2021-07-07 16:40:19 +03:00
Ilya Goncharov
e2adf9793c [Gradle, JS] Node into PATH during installing of dependencies
^KT-37895 fixed
2021-07-07 16:40:17 +03:00
Ilya Goncharov
065a5d98fb [Gradle, JS] Configuration cache friendly 2021-07-07 16:40:16 +03:00
Ilya Goncharov
81ac48390c [Gradle, JS] Make yarn working without downloading
^KT-32071 fixed
2021-07-07 16:40:15 +03:00
Ilya Goncharov
eb73527b9f [Gradle, JS] No additional checks of setup tasks 2021-07-07 16:40:13 +03:00
Ilya Goncharov
54d47de008 [Gradle, JS] Yarn as a dependency with ivy repository like Node.js
^KT-34985 fixed
2021-07-07 16:40:11 +03:00
Anton Yalyshev
1507f1a9c0 Add change notes for 1.5.21 2021-07-07 16:30:34 +03:00
Andrey Zinovyev
de3f31cf78 [FIR] Partial implementation of DEPRECATION(_ERROR) diagnostics
No support for inheritance deprecations
and deprecations in qualifier's parts
2021-07-07 16:19:28 +03:00
Andrey Zinovyev
9fad55d551 [FIR] Use @DeprecatedSinceKotlin in the resolution 2021-07-07 16:19:27 +03:00
Igor Yakovlev
b64f7909b8 [FIR IDE] Implement own fir light classes support 2021-07-07 14:08:41 +02:00
Yahor Berdnikau
7fff282565 Fix AllOpen plugin exposes common with Gradle runtime dependencies.
^KT-47354 Fixed
2021-07-07 11:31:18 +00:00
Mikhail Glukhikh
fa086d22c2 Don't build kotlin-gradle-statistics in FIR mode at all 2021-07-07 14:28:03 +03:00
Mikhail Glukhikh
863a2c6498 Disable kotlin-gradle-statistics and wasm.ir under FIR 2021-07-07 14:28:02 +03:00
Mikhail Glukhikh
c7877cb440 FIR: fix contract deserialization for assertIs<T> 2021-07-07 14:28:00 +03:00
Ilya Goncharov
e0c1f50f03 [Gradle, JS] Fix node.js repository declaration
^KT-47557 fixed
2021-07-07 08:26:07 +00:00
Sergey Bogolepov
f05110f99b [K/N] Add some tests for https://youtrack.jetbrains.com/issue/KT-47605 2021-07-07 07:50:57 +00:00
Sergey Bogolepov
9ed97a27f1 [K/N] Introduce LLD compatibility checker for MinGW
We are going to switch to LLD linker for MinGW targets.
Right now LLD for MinGW doesn't support all features
of ld.bfd and thus this change might be breaking for some users.
To make transition smoother, we run lld -### to show a warning to user
so they can update their compilation options before LLD will be turned
on by default.

More details: https://youtrack.jetbrains.com/issue/KT-47605
2021-07-07 07:50:57 +00:00
Ilya Kirillov
30d0fea003 FIR IDE: enable explicit API mode in idea-frontend-fir module 2021-07-07 01:40:03 +03:00
Ilya Kirillov
51576c70b6 FIR: introduce package directive
The package directive is needed for KtElement -> FirElement mapping in IDE.
There should be some FirElement which will be result of mapping of elements
inside KtPackageDirective.
2021-07-06 22:49:50 +03:00
Mikhail Glukhikh
bf40c07cc3 FIR: drop questionable DiagnosticKind.NotRootCause 2021-07-06 18:43:16 +03:00
Mikhail Glukhikh
7d583973ab Disable -Werror in FIR mode inside disableDeprecatedJvmTargetWarning 2021-07-06 18:27:53 +03:00
Tianyu Geng
768ddea18f FIR checker: ILLEGAL_DECLARATION_IN_WHEN_SUBJECT 2021-07-06 18:27:47 +03:00
Tianyu Geng
31573a98e8 FIR checker: report EXPECTED_CONDITION 2021-07-06 18:27:23 +03:00
Sergey Bogolepov
e396da0562 [K/N] Update list of targets with stable caches
Enable compiler caches for iosSimulatorArm64 and macosArm64 targets
to make Apple Silicon distribution feature complete with
Intel-based one.
2021-07-06 18:15:30 +03:00
Victor Petukhov
65fd8fc174 Add generated files with descriptors for foreign annotation tests 2021-07-06 18:10:22 +03:00
Ilya Goncharov
c797d38312 [Gradle, JS]Add base dirs and prefix for correct source maps calculating 2021-07-06 12:59:03 +00:00
Alexander Udalov
e7b37d99cb Fix new compiler warnings in daemon and build-common 2021-07-06 13:31:21 +02:00
Sergey Shanshin
0d211a53cb Support serializable classes clash with JVM primitive types by name
Fixes Kotlin/kotlinx.serialization#1353
2021-07-06 12:52:53 +03:00
Ilya Goncharov
7181631051 [Gradle, JS] Add statistics for Kotlin/JS
- source map usages (legacy, ir)
- incremental klib
- incremental JS IR
- property lazy initialization

^KT-47435 fixed
2021-07-06 07:38:56 +00:00
Victor Petukhov
6cfb1f40d6 Specify jspecify mode explicitly for warnings in tests 2021-07-06 09:54:32 +03:00
Victor Petukhov
74aa8e7497 Get rid of singleOrNull of NullabilityAnnotationStates 2021-07-06 09:54:31 +03:00
Victor Petukhov
877ca370c2 Use memoized function to compute and store annotation states cache 2021-07-06 09:54:31 +03:00
Victor Petukhov
50ad5116b5 Add CLI test for -Xnullability-annotations 2021-07-06 09:54:30 +03:00
Victor Petukhov
b0a44705b4 Take into account user defined jsr-305 annotations 2021-07-06 09:54:30 +03:00
Victor Petukhov
b2dff10e32 Implement caching states for nullability annotations 2021-07-06 09:54:30 +03:00
Victor Petukhov
a82772f31a Depend on passed language version explicitly to compute nullability annotation settings 2021-07-06 09:54:29 +03:00
Victor Petukhov
18384788a4 Move type enhancement state stuff into core:descriptors.jvm 2021-07-06 09:54:29 +03:00
Victor Petukhov
8de05691a9 Revert "Move fqname related stuff into core:util.runtime module"
This reverts commit e651e1c6
2021-07-06 09:54:28 +03:00
Victor Petukhov
ea901d81fb Get rid of redundant Jsr305State 2021-07-06 09:54:28 +03:00
Victor Petukhov
f46dc713d7 Support rxjava 3 nullability annotations 2021-07-06 09:54:28 +03:00
Victor Petukhov
6d3badb2cd Support configuring of nullability annotations with their report levels through a test directive 2021-07-06 09:54:27 +03:00
Victor Petukhov
61c2f1b203 Extract building JSR-305 settings to separate function 2021-07-06 09:54:27 +03:00
Victor Petukhov
f92ab691f8 Add explicit enabling of TypeEnhancementImprovementsInStrictMode in jspecify tests 2021-07-06 09:54:26 +03:00
Victor Petukhov
39ffcd3ba6 User proper report level for compatqual nullability annotations 2021-07-06 09:54:26 +03:00
Victor Petukhov
e16033f8d8 Add androidx recently nullability annotations 2021-07-06 09:54:26 +03:00
Victor Petukhov
d5180f79aa Support picking settings of exacter annotations by the length of the matching part of fqname 2021-07-06 09:54:25 +03:00
Victor Petukhov
70dbc50305 Rename JSPECIFY_DEFAULT_NOT_NULL to JSPECIFY_NULL_MARKED 2021-07-06 09:54:25 +03:00
Victor Petukhov
4173f2d294 Don't forget jspecify annotation during extracting nullability from known annotations 2021-07-06 09:54:24 +03:00
Victor Petukhov
46d0b16142 Use new default settings for java nullability annotations in JavaTypeEnhancementState and get rid of all hardcoded defaults 2021-07-06 09:54:24 +03:00
Victor Petukhov
8e7c0e8c61 Describe default settings for java nullability annotations depending on current kotlin version 2021-07-06 09:54:24 +03:00
Victor Petukhov
205087cae3 Move fqname related stuff into core:util.runtime module 2021-07-06 09:54:23 +03:00
Victor Petukhov
c8af1b735f Introduce compiler flag to manage status of specific Java nullability annotations 2021-07-06 09:54:23 +03:00
Yahor Berdnikau
c3a3e99724 Fix toolchain is not applied for modules with 'java' plugin.
Use common base java plugin for configuration action: 'java-base'.

^KT-46972 Fixed
2021-07-05 23:15:44 +02:00
Alexander Udalov
113632c49c Psi2ir: load single-value Java array annotation arguments correctly
#KT-47467 Fixed
2021-07-05 21:49:10 +02:00
Pavel Punegov
269f83f86e Update kotlin-build-gradle-plugin to 0.0.31 2021-07-05 19:43:28 +00:00
Pavel Punegov
c2fe46020e Native: improve CompilerVersion to correspond to the versioning schema
* Add pub and dev-google-pr meta versions
* Allow using release versions with and without build number
* Add tests for version parsing
2021-07-05 19:43:27 +00:00
Yahor Berdnikau
1bd0607b53 Fix toolchain jdk override was not working for all modules.
Now it also considers the case when separate tasks toolchain
are configured or module only has java toolchain.

^KT-46972 Fixed
2021-07-05 21:15:04 +02:00
Pavel Kunyavskiy
70ca222806 [K/N] Disable external calls checker for wasm target 2021-07-05 18:49:09 +00:00
Zalim Bashorov
4c4bcb1e3e [Gradle, JS] Turn on by default sourcemap generation for JS IR
#KT-46551 Fixed
2021-07-05 21:01:45 +03:00
Zalim Bashorov
8da62b56fb [IR] Put correct line numbers on return while inlining
#KT-46551 In Progress
2021-07-05 21:01:44 +03:00
Zalim Bashorov
d1f5ab4b09 [JS IR] Generate correct source locations in sourcemap for inline declarations
* Keep returnable blocks.
* Add a new lowering which simplifies returnable blocks by introducing
  temporary variable for result and changing returnable block's type to Unit.
* Use information from returnable blocks in codegen to generate
  the right source locations in sourcemap.
* Support in namer (LocalNameGenerator).
* Fix some lowerings to work correctly with returnable blocks.

#KT-46551 In Progress
2021-07-05 21:01:43 +03:00
Zalim Bashorov
2460f5f9ae [JS CLI] Support sourcemap generation for IR BE in CLI
#KT-46551 In Progress
2021-07-05 21:01:41 +03:00
Zalim Bashorov
5a3efc1a98 [JS IR] Fill source info in codegen
#KT-46551 In Progress
2021-07-05 21:01:40 +03:00
Zalim Bashorov
64c6d852de [JS IR] Preparing for introducing sourcemap as another compilation output
* Rename `JsCode` to `CompilationOutputs`.
* Rename members of CompilerResult.

#KT-46551 In Progress
2021-07-05 21:01:38 +03:00
Zalim Bashorov
d9b7230144 [JS IR] add dependency to sourcmap module
#KT-46551 In Progress
2021-07-05 21:01:37 +03:00
Zalim Bashorov
aae1057f35 [IR] Support IrReturnableBlock inside IR renderer 2021-07-05 21:01:35 +03:00
Ilya Chernikov
6911860cca Clean-up coroutines usage in scripting libs and plugin
#KT-30778 fixed (again)
2021-07-05 19:26:42 +03:00
Ilya Chernikov
49e0b639f8 Add JSR-223 tests with compilable and bindings 2021-07-05 19:26:40 +03:00
Ilya Chernikov
32b6cfe2ea [Scripting] fix receiver substitution in script JVM IR lowering 2021-07-05 19:26:39 +03:00
Ilya Chernikov
a7b94b398a [minor] Bump serialization lib version in scripting test 2021-07-05 19:26:38 +03:00
Ilya Chernikov
0c2591e938 Bump coroutines version used in scripting to 1.5.0
#KT-43917 fixed
2021-07-05 19:26:37 +03:00
Igor Yakovlev
64afba299f [imltogradle] Don't use deprecated kotlinOptions.jdkHome in generated build.gradle.kts files 2021-07-05 17:52:04 +02:00
Tianyu Geng
4c439bb5d7 FIR: fix DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR
DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR should be an error but it's
somehow a warning in FIR.
2021-07-05 18:32:37 +03:00
Tianyu Geng
db1db6c64c FIR: fix CYCLIC_CONSTRUCTOR_DELEGATION_CALL
Somehow it's a warning in FIR, but it should be an error.
2021-07-05 18:32:36 +03:00
Jinseong Jeon
cd78a156c5 FIR checker: apply member checkers to anonymous objects
because they can have member properties/functions too.
2021-07-05 18:32:34 +03:00
Jinseong Jeon
64a275cf83 FIR: fix type comparator
As many other places did, this one is supposed to return the diff value
if the given two intersection types' sizes are different.
2021-07-05 18:32:33 +03:00
Tianyu Geng
cdfb2fb3d9 FIR checker: report SETTER_PROJECTED_OUT 2021-07-05 18:32:32 +03:00
pyos
c3a91efea3 JVM_IR: fix primitive comparison optimizations
1. the `primitive == object?.something` fusion should not apply to
    `primitive.equals(object?.something)` because it can't;

 2. coercions to Int are there for a reason - don't remove them;

 3. better optimize `primitive == object?.something` -- the result
    should be subject to if-null fusion, so it needs to have a specific
    pattern that resembles safe calls.

 #KT-47597 Fixed
2021-07-05 18:13:09 +03:00
Yahor Berdnikau
7e70c93cbf Allow to avoid using JDK 1.6 and JDK 1.7 in the repo.
This behaviour could be enabled via adding
'kotlin.build.isObsoleteJdkOverrideEnabled=true'
to the 'local.properties' file.

^KT-46972 Fixed
2021-07-05 14:11:13 +00:00
Yahor Berdnikau
7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Yahor Berdnikau
08d831934a Revert "Build: add temporary option to suppress jdkHome warning"
This reverts commit 1dfcec3a93.
2021-07-05 14:11:11 +00:00
sebastian.sellmair
5b5dddc2d1 [Commonizer] Restore TypeAliasCommonizer's Commutative property & TypeAliasTypeCommonizer: substitute underlying-type arguments
^KT-47574 The fix done here supports only one level of substituting
underlying type-arguments.

HierarchicalTypeAliasCommonizationTest.`KT-47574 - test long typealias chain`
will assert proper behaviour for nested chains.
2021-07-05 09:00:46 +00:00
sebastian.sellmair
448302d19b [Commonizer] CommonizeNativeDistributionTest.commonize - apple platforms(): Require macos 2021-07-05 09:00:45 +00:00
sebastian.sellmair
1e801e77a2 [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Remove unnecessary annotations and reformat file 2021-07-05 09:00:44 +00:00
sebastian.sellmair
684e51b0be [Commonizer] Implement TypeCommonizer as AssociativeCommonizer 2021-07-05 09:00:44 +00:00
sebastian.sellmair
b29fd17d26 [Commonizer] Use AssociativeCommonizer signature to implement ClassOrTypeAliasTypeCommonizer
This drastically improves performance for now, since the previous
Adapter implementation was at least O(n^2). While the Adapter
implementation could have been reduced to O(n), the Signature of
StatelessCommonizer was misleading.

StatelessCommonizer will be introduced back later when other
Commonizer implementations are ready to be converted to a new
Signature.
2021-07-05 09:00:43 +00:00
sebastian.sellmair
20f55ef0b7 [Commonizer] Commonize 'const val' and 'val' properties 2021-07-05 09:00:42 +00:00
sebastian.sellmair
9794068f22 [Commonizer] typeAliasUtils: computeSuitableUnderlyingType: Consider commonized type-aliases 2021-07-05 09:00:42 +00:00
sebastian.sellmair
5ca81b01f0 [Commonizer] Improve AbstractCommonizerTest diagnostic message 2021-07-05 09:00:41 +00:00
sebastian.sellmair
d7022cb378 [Commonizer] Move ClassTypeCommonizer and TypeAliasTypeCommonizer into seperate files 2021-07-05 09:00:40 +00:00
sebastian.sellmair
8f73df0f85 [Commonizer] Implement new ClassOrTypeAliasTypeCommonizer
^KT-47432 Verification Pending
^KT-47434 Verification Pending
2021-07-05 09:00:39 +00:00
sebastian.sellmair
8e2780345c [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Un-ignore tests fore ^KT-47432 and ^KT-47434 and add additional test's 2021-07-05 09:00:39 +00:00
Pavel Kunyavskiy
fc75486611 [K/N] Debug tool for checking state at call points of unknown functions
After linking runtime, llvm-ir is modified to add checker function
call at all points where unknown function, which can possibly run long
is called. This function checks Native state is set, to avoid long locks
at gc.
2021-07-05 08:35:23 +00:00
Pavel Kunyavskiy
1ba04fdd21 [K/N] Introduce external calls checker compiler option 2021-07-05 08:35:23 +00:00
Pavel Kunyavskiy
271fc35082 [K/N] Minor debug info fix 2021-07-05 08:35:22 +00:00
Pavel Kunyavskiy
4c2d518cf5 [K/N] Move ClearCurrentThreadData() out of TestSupport 2021-07-05 08:35:21 +00:00
Pavel Kunyavskiy
65bebd3058 [K/N] Support AddressToSymbol using dladdr, if availible 2021-07-05 08:35:20 +00:00
Pavel Kunyavskiy
b7707d8755 [K/N] Introduce api for getting existing global by name from StaticData 2021-07-05 08:35:20 +00:00
Pavel Kunyavskiy
1db2903e4f [K/N] Add utilities to check if thread is registered now 2021-07-05 08:35:19 +00:00
Vyacheslav Gerasimov
aff9d96e8a Build: Update gradle enterprise and test distribution plugins 2021-07-04 18:15:36 +03:00
Dmitriy Novozhilov
6e1fce6b8b [FIR] Fix creating scopes for enum entry initializers
Before we analyzed initializers of enum entry with scope for constructor
  in implict type mode, so scope was untouchable. Now we analyze them
  in body resolve phase, so previously we add value parameters to
  constructors scope, which mess up scope of enum entry initializer
2021-07-04 13:29:03 +03:00
Dmitriy Novozhilov
1593c4859d [FIR] Get rid of all conditional reads of FirDeclaration.resolvePhase 2021-07-04 13:29:03 +03:00
Dmitriy Novozhilov
43fe0c3bc1 [FIR] Don't initialize type of FirAnonymousObjectExpression
In some cases we check that some declaration (e.g. field) was
  analyzed by checking type of it's body/initializer (is it implicit
  or not), so if type of FirAnonymousObjectExpression is not implicit
  we can skip resolve of anonymous object itself
2021-07-04 11:17:50 +03:00
Dmitriy Novozhilov
32173a408a [FIR] Update type of getter after approximation of property type 2021-07-04 11:17:49 +03:00
Roman Artemev
d472b6c71c [Psi2Ir] Replace custom IrProperty node with common one 2021-07-02 19:58:31 +03:00
Roman Artemev
4d5186d332 [Psi2Ir] Untangle psi2ir from frontend.java
Add extension method to detect and unwrap `JavaSyntheticProperty`
2021-07-02 19:58:30 +03:00
Dmitriy Novozhilov
3f5e6a79c7 Replace all throw error(...) with just error(...)
`throw` is not needed in this case, because `error(...)` already
  raises exception (so `throw` is unreachable). Also after previous
  commit compiler reports `UNREACHABLE_CODE` warning on such `throw`
2021-07-02 17:55:21 +03:00
Dmitriy Novozhilov
ae608ea67f [FE 1.0] Always create return value for CallInstruction
This fixes missing `USED_AS_EXPRESSION` recordings
^KT-47527 Fixed
2021-07-02 17:55:20 +03:00
bracadabra
b2372ff0b9 Fix UTFDataFormatException on encoding long subplugin options.
ObjectOutputStream.writeUTF(String) has an unsigned short limit on
String length. On Projects with deep nested modules subplugin
options could produce String over this limit.

^KT-45202 Fixed
2021-07-02 16:17:54 +02:00
Simon Ogorodnik
f8ab16c823 [Build] Fix useFir project exclusion logic 2021-07-02 16:13:05 +03:00
Dmitriy Novozhilov
f7c68afb18 [FIR] Don't report EXPOSED_FUNCTION_RETURN_TYPE on property accessors 2021-07-02 15:55:12 +03:00
Dmitriy Novozhilov
3a34a2ca62 [FIR] Properly infer published effective visibility for member declarations 2021-07-02 15:55:10 +03:00
Dmitriy Novozhilov
f1bf3c0d5a [FIR] Don't duplicate annotations from enum entry to its initializer 2021-07-02 15:55:09 +03:00
Dmitriy Novozhilov
9f547171da [FIR] Properly calculate annotation targets for enum entries 2021-07-02 15:55:08 +03:00
Dmitriy Novozhilov
7baea7244a [FIR] Don't report VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION on lambda parameters 2021-07-02 15:55:07 +03:00
Dmitriy Novozhilov
0ab4770f02 [FIR] Add correctly reported diagnostics to testdata 2021-07-02 15:55:05 +03:00
Dmitriy Novozhilov
1f1065d858 [FIR] Add specific checkers for each leaf expression type 2021-07-02 15:55:04 +03:00
Dmitriy Novozhilov
d3ba821371 [FIR] Add specific checkers for each leaf declaration type 2021-07-02 15:55:02 +03:00
Dmitriy Novozhilov
2446ad9510 Advance bootstrap to 1.6.0-dev-328 2021-07-02 15:46:20 +03:00
Igor Laevsky
ce6459d059 WASM: Optimize few cases where spread operator is used on an immediate array 2021-07-02 15:39:30 +03:00
Igor Laevsky
d835b3c164 WASM: Implement spread operator 2021-07-02 15:39:29 +03:00
Igor Laevsky
f5e59194b5 WASM: Fix linker issues around fake overrides 2021-07-02 15:39:28 +03:00
Igor Laevsky
74a87e2b79 WASM: Add few helper array library functions from Slava's changes 2021-07-02 15:39:26 +03:00
Ilya Matveev
dc8186cb83 [K/N][Interop] Fix throwing exceptions through bridges in opt mode
By default, C functions compiled to bitcode by clang have the
nounwind attribute. If such functions throws an exception, the
behaviour is undefined.

Our interop machinery can process foreign exceptions on call sites
(terminate or wrap them in Kotlin exceptions). But if the interop
bridges have the nounwind attribute, LLVM optimizations (particularly
inlining) may lead to the situation when a foreign exception is ignored by
our foreign exception handler.

This patch fixes the issue by compiling bridges with -fexceptions flag.
This flag makes clang to not set the nounwind attribute, so exceptions
can be thrown through C frames.
2021-07-02 11:51:06 +00:00
Dmitry Petrov
c132e1a39f PSI2IR fix flaky SOE 2021-07-02 13:10:04 +03:00
Roman Golyshev
7b1052296e Do not try to create a light class for classes in unexpected positions
Example of such class declaration would be `10 < class A` expression

The expression is uncompilable, but parsable. Unfortunately, the
FIR compiler does not save `class A` reference in it (because it
is not an expression, and only an expression can be a LHS or RHS of
binary expression `10 < ...`)

When we try to build light classes, we will try to find/build FIR
declaration for this class, but we won't be able to, and this will throw
an error

Adding this check should fix few
`FirKotlinHighlightingPassTestGenerated$Regression` tests
2021-07-02 04:07:26 +03:00
Dmitry Petrov
584310615c JVM_IR KT-47499 use proper signature for 'clone' intrinsic 2021-07-01 22:10:47 +03:00
Alexander Udalov
e2f462095d IR: move JVM-specific flexible types to backend.jvm 2021-07-01 19:35:46 +02:00
Alexander Udalov
2834c22a85 IR: add BackendContext.typeSystem and JvmIrTypeSystemContext
To be able to override JVM-specific behavior of IrTypeSystemContext in
JVM IR, for things like JVM flexible types.
2021-07-01 19:35:44 +02:00
Alexander Udalov
ae07127f08 JVM IR: support raw types in typeOf 2021-07-01 19:33:56 +02:00
Alexander Udalov
012c7c39af Improve KType.toString for primitive type arguments in stdlib implementation 2021-07-01 19:33:55 +02:00
Alexander Udalov
7306256127 JVM IR: support mutability-flexible types 2021-07-01 19:33:55 +02:00
Alexander Udalov
0cb905a4b1 Support mutable collection types in typeOf
flexibleTypes_1_6.kt is fixed for JVM IR in a subsequent commit.

 #KT-35877 Fixed
2021-07-01 19:33:55 +02:00
Alexander Udalov
6e975b3498 Support flexible types internally in typeOf
#KT-45066 Fixed
2021-07-01 19:33:55 +02:00
Alexander Udalov
26cdb2f928 Reformat reflection.jvm, fix inspections 2021-07-01 19:33:54 +02:00
Yahor Berdnikau
a44e82a1d9 Fix publication failed in projects which are using BOM.
^KT-47444 Fixed
2021-07-01 15:14:35 +00:00
Denis.Zharkov
6e763f5a61 Minor. Add review fixes
Didn't squash them because there are file-moving-renaming commits above
2021-07-01 17:49:40 +03:00
Denis.Zharkov
a3f64f65f2 FIR: Fix serialization of non-delegated members in FirDelegatedMemberScope 2021-07-01 17:49:39 +03:00
Denis.Zharkov
3671b14e5b FIR: Fix compilation after rebase 2021-07-01 17:49:38 +03:00
Denis.Zharkov
44113f8501 FIR: Get rid of hacks related to previous structure of FirDelegatedScope
^KT-47413 Fixed
2021-07-01 17:49:36 +03:00
Denis.Zharkov
8a3a7a1ab5 FIR: Rename FirNewDelegatedMemberScope 2021-07-01 17:49:34 +03:00
Denis.Zharkov
4d28b9ea3b FIR: Remove FirDelegatedMemberScope 2021-07-01 17:49:32 +03:00
Denis.Zharkov
a77cbb8f63 FIR: Rework FirNotImplementedOverrideChecker around delegated members reporting 2021-07-01 17:49:30 +03:00
Denis.Zharkov
a213ee0e01 FIR: Rework delegated scope
Now delegated members are generated just to declared scope

^KT-47413 In Progress
2021-07-01 17:49:29 +03:00
Denis.Zharkov
082dc3332e FIR2IR: Move util methods closer to the single usage 2021-07-01 17:49:27 +03:00
Roman Artemev
9ef0909e39 Advance K/N version to make Gradle Klib IT tests work 2021-07-01 17:40:47 +03:00
Roman Artemev
7ef63fbb45 [Psi2Ir] Isolate type translator in file scope
Create TypeTranslator per file to avoid reusing it between files
2021-07-01 17:40:46 +03:00
Roman Artemev
ae3a2d4e71 Use DescriptorVisibilities.isPrivate instead of simple equality 2021-07-01 17:40:44 +03:00
Roman Artemev
55793d078c [KLIB] Fix Mangler Checker to work with new signatures 2021-07-01 17:40:43 +03:00
Roman Artemev
09d30c91bf [JS TESTS] Disable mangler checker in tests 2021-07-01 17:40:41 +03:00
Roman Artemev
a8d0e60328 [JS TESTS] Extend test frame with some features
- Setting up specific ABI version for module
- Disabling mangle verification
2021-07-01 17:40:40 +03:00
Roman Artemev
3403c464fe [KLIB] Promote library ABI version 2021-07-01 17:40:39 +03:00
Roman Artemev
b8e5185b61 [KLIB] Add extra debug information for Local signatures 2021-07-01 17:40:37 +03:00
Roman Artemev
b5c28c1912 [KLIB] Introduce compatible mode for klibs.
Based on library ABI version linker could decide which signature mode
to be used to guarantee backward compatibility.
2021-07-01 17:40:36 +03:00
Roman Artemev
3e99951a66 [Psi2Ir] Fix IrText testdata 2021-07-01 17:40:33 +03:00
Roman Artemev
6cdac22a23 [IR] Introduce new IdSignatures
FileSignature, CompositeSignature, LocalSignature

They are needed to make possible reference any non-local declaration via
 signature, including private signature, type parameters and so on.

- Support those new signatures in proto and klibs
- Rename `isPublic` -> `isPubliclyVisible` due to changed semantic
- Fix FIR
- clean up code
2021-07-01 17:40:31 +03:00
Roman Artemev
7139785036 [KLIB] Rename proto PublicIdSignature -> CommonIdSignature 2021-07-01 17:40:30 +03:00
Roman Artemev
0856cd82d7 [IR] Rename PublicSignature -> CommonSignature 2021-07-01 17:40:28 +03:00
Roman Artemev
5a284de2d4 add tests for private signatures
regenerate tests

add test for EnumEntry's argument declarations

add another test

regenerate test

fix test a bit
2021-07-01 17:40:27 +03:00
Svyatoslav Scherbina
2865d8bd45 Deprecate Obj-C 'alloc' and 'allocWithZone:' methods in Kotlin
Using these methods in Kotlin is usually a mistake.
2021-07-01 12:20:24 +00:00
Ilya Matveev
e5aa7e1625 [K/N] Disable some tests for noop GC 2021-07-01 10:05:02 +00:00
Alexander Shabalin
c286a9d8c6 Extract StackTrace from Exceptions 2021-07-01 07:23:47 +00:00
Roman Golyshev
bd0f48e07a Add rendering for FirValueParameter in DECLARATION_NAME renderer
Without it NAME renderer renders parameters as '???'
2021-06-30 19:35:33 +03:00
Ivan Kylchik
c176d4d7b0 Rename createTempDirectory to getOrCreateTempDirectory
With cache this function can be used to get already created directory
by name.
2021-06-30 19:33:17 +03:00
Ivan Kylchik
88aa71b0aa Add possibility to dump and test IR after execution of given lowering 2021-06-30 19:33:15 +03:00
Ilya Kirillov
330f15ff7d Add uast-kotlin-idea-fir module to the list of ide modules 2021-06-30 16:38:31 +02:00
Konstantin Tskhovrebov
b45140d237 Update default K/N ios test simulator to "iPhone 12".
#KT-45416
2021-06-30 14:19:53 +00:00
Pavel Kunyavskiy
b2f0e0e0d3 Revert "Native: exclude tests that fail due to the KT-47405 and KT-47408"
This reverts commit 6ae6209031.
2021-06-30 13:47:28 +00:00
Pavel Kunyavskiy
abf6ae70e2 [K/N] Add workaround options to arm64 targets 2021-06-30 13:47:28 +00:00
Dmitry Petrov
37b05cd9c2 JVM_IR KT-47120 treat outer name as case-insensitive for local classes 2021-06-30 14:04:22 +03:00
Andrey Zinovyev
1130344fb1 [lombok] Get field names directly from JavaClassImpl
Otherwise it fails with recursion on annotation types
#KT-47513 Fixed
2021-06-30 10:44:31 +03:00
Ivan Kochurkin
9b71175902 [FIR] Get rid of unnecessary creation of error expression for LightTree, other minor simplifications 2021-06-29 22:39:24 +03:00
Ivan Kochurkin
9f7a8c3948 [FIR] Implement ILLEGAL_SELECTOR 2021-06-29 22:39:23 +03:00
Ivan Kochurkin
a7276b25ae [FIR] Add expression field to FirErrorExpression
It is used to report diagnostics even in erroneous code (within ILLEGAL_SELECTOR for instance).
2021-06-29 22:39:22 +03:00
Ivan Kochurkin
59257e47c9 [FIR] Implement FUNCTION_CALL_EXPECTED 2021-06-29 22:39:22 +03:00
Dmitriy Novozhilov
d048bccfa2 Build: fix detecting .iml files for kotlin-ide development 2021-06-29 21:03:31 +03:00
Dmitriy Novozhilov
5816d7ae9f [FIR] Rename FirStatusOwner back to FirMemberDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
f400477c70 [FIR] Remove generic parameter from FirDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
511e564b20 [FIR] Add specific symbols for value parameters and enum entries
Make FirVariableSymbol a sealed class
2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
62d781a70f [FIR] Move delegateFieldSymbol from FirVariable to FirProperty 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
dc3ee6318c [FIR] Rename type parameters of NullableMap from KEY, VALUE to K, V 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
6c8096643c [FIR] Move danglingConstraints attribute to other attributes 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov
eca77324e0 [FIR] Move declaration comparators to separate package 2021-06-29 21:03:29 +03:00
Dmitriy Novozhilov
725be466f0 [FIR] Move declaration utils to separate package 2021-06-29 21:03:29 +03:00
Dmitriy Novozhilov
10ff0975bc [FIR] Split FirDeclarationUtil.kt to multiple files 2021-06-29 21:03:29 +03:00
Dmitriy Novozhilov
4225813d79 [FIR] Update CFG dumps according to changed order of visiting class children 2021-06-29 21:03:29 +03:00
Dmitriy Novozhilov
1324e9223f [FIR] Make FirDeclaration an abstract class 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov
b3e5c6e079 [FIR] Add symbol to all declarations. Get rid of FirSymbolOwner 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov
39cd1c8504 [FIR] Squash AbstractFirBasedSymbol with FirBasedSymbol 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov
823cbc59b7 [FIR] Split FirAnonymousFunction to expression and declaration 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov
85b844c748 [FIR] Split FirAnonymousObject to expression and declaration 2021-06-29 21:03:27 +03:00
Victor Petukhov
ad89d43186 Prevent recursion on captured recursive type parameters of inner classes during computing bound for them
^KT-47459 Fixed
2021-06-29 20:53:54 +03:00
Victor Petukhov
e071281b20 Prevent recursion on erasion of raw types with interdependent type parameters
^KT-47480 Fixed
2021-06-29 20:53:52 +03:00
Jiaxiang Chen
0774d4d734 expose original message collector in CLIConfiguration 2021-06-29 19:01:09 +03:00
Simon Ogorodnik
54c914e3fd [Build] Update NodeJs to 16.2.0 2021-06-29 18:35:13 +03:00
Simon Ogorodnik
021d053cfe [Gradle, JS] Fix architecture detection for M1 in NodeJsPlatform 2021-06-29 18:35:11 +03:00
Dmitry Petrov
68c3f30aa7 JVM_IR KT-47510 indy callee parent is a package fragment, not a class 2021-06-29 17:00:31 +03:00
Konstantin Tskhovrebov
a54e758189 For XCFramework with default name register 'nameless' task 'assembleXCFramework`
#KT-42667
2021-06-29 13:11:14 +00:00
Ivan Gavrilovic
08c505f9ba KT-47347: Kapt processors should not be input files for stub generation
This commit avoids passing kapt processors as sources for stub generation
task, and it also avoid using them as input files for stub generation.
Instead, it adds a new property that simply records if processors are
present (as going from empty to 1+ processors should re-run stubs).

Fixes #KT-47347

Test: Kapt3IT.kt
2021-06-29 15:11:29 +03:00
Aleksei.Cherepanov
d564bfd450 Fix visibility for JPS build 2021-06-29 14:36:50 +03:00
max-kammerer
71d59f89cb Fix type 2021-06-29 12:54:43 +02:00
Andrei Klunnyi
72d188efd9 Update contributing guide
After Kotlin-IDE-plugin is moved to intellij repository, this commit
updates contributing.md guide with corresponding references.
Other than that brief information on current repository is provided.
2021-06-29 10:46:29 +00:00
Ilya Goncharov
b678cc3c90 [JS IR] Fast return in boolean externals lowering
- Put fqname when available instead of just name
2021-06-29 10:12:56 +00:00
Ilya Goncharov
b03af384af [JS IR] Add test with exception diagnostic of boolean in externals 2021-06-29 10:12:56 +00:00
Ilya Goncharov
82f979b11f [JS IR] Add property name to boolean in externals diagnostic 2021-06-29 10:12:55 +00:00
Ilya Goncharov
21a3494bca [JS IR] Add test with boolean in external interface
[JS IR] Add possibility to safely access Boolean in external declaration

[JS IR] Add diagnostic for booleans in externals
2021-06-29 10:12:54 +00:00
Tianyu Geng
2e049c1208 FIR DFA: fix CFG with normal arg after lambda [KT-46825]
The fix is a bit hacky, but it's very simple. In addition, it still does
not handle the case where the receiver is a lambda function. But such
case seems to be fairly rare in practice.
2021-06-29 10:46:41 +03:00
Tianyu Geng
b78b50e1f8 FIR DFA: workaround KT-46826 2021-06-29 10:46:40 +03:00
Tianyu Geng
0ecc752813 FIR checker: report SMARTCAST_IMPOSSIBLE for local variables 2021-06-29 10:46:38 +03:00
Alexander Shabalin
092750e215 Fix race in Lazy for the new MM 2021-06-29 06:29:57 +00:00
Alexander Shabalin
455625bcee Use FreezableAtomicReference in unhandled exception hook 2021-06-29 06:29:57 +00:00
Dmitry Gridin
fe855d09d8 fix idea compilation 2021-06-29 10:46:47 +07:00
Dmitry Gridin
274bae1d05 KtArrayAccessReference: remove redundant functions 2021-06-29 10:04:27 +07:00
Alexander Udalov
4b7fa44e80 CLI: fix resolution of Java records as single file roots
#KT-46764 Fixed
2021-06-29 01:22:08 +02:00
Ivan Kochurkin
e295849733 [FIR] Refactor FirSupertypesChecker: split big function on small ones 2021-06-29 02:00:11 +03:00
Ivan Kochurkin
fb9ce06ff5 [FIR] Implement DELEGATION_NOT_TO_INTERFACE 2021-06-29 02:00:11 +03:00
Ivan Kochurkin
c3a6ba52f6 [FIR] Implement CLASS_CANNOT_BE_EXTENDED_DIRECTLY 2021-06-29 02:00:10 +03:00
Ivan Kochurkin
92d7a61b4f [FIR] Implement INCONSISTENT_TYPE_PARAMETER_VALUES, INCONSISTENT_TYPE_PARAMETER_BOUNDS 2021-06-29 02:00:09 +03:00
Ivan Kochurkin
ec20f52707 [FIR] Implement EXPANDED_TYPE_CANNOT_BE_INHERITED, PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE
Add `starAsModifier` to `modifierSetPosition`
2021-06-29 02:00:08 +03:00
Ivan Kochurkin
937846b62d [FIR] Implement TYPEALIAS_SHOULD_EXPAND_TO_CLASS 2021-06-29 02:00:06 +03:00
Ivan Kochurkin
e8a790993b [FIR] Add ConeUnsupportedDynamicType 2021-06-29 02:00:03 +03:00
Denis.Zharkov
0ec693db89 Fix parsing regression related to T!!
^KT-47445 Fixed
2021-06-28 21:48:13 +03:00
Dmitry Petrov
768afc5ba4 JVM_IR KT-47492 fix 'for' loop generation 2021-06-28 21:07:54 +03:00
Roman Artemev
6993b86d3b [IR] Fix IrCapturedType equals/hashCode
It could lead to SOE if CT has itself as superType
- fix KT-47424
2021-06-28 20:43:14 +03:00
Dmitry Petrov
7ccefebf1c PSI2IR flatten more levels of indirection to avoid SOE in big exprs 2021-06-28 18:18:27 +03:00
Igor Yakovlev
cd0ea7f7f7 [FIR] Add explicit types to needReplacePhase transformers methods 2021-06-28 17:21:43 +03:00
Igor Yakovlev
30c381f16d [FIR] Fix invalid CallableId for methods in anonymous objects 2021-06-28 17:21:42 +03:00
Abduqodiri Qurbonzoda
47aa04d55d Test fix: java6 doesn't throw on invalid AbstractMutableList.addAll index
If the collection of elements to be added is empty, java6 implementation
of AbstractMutableList.addAll doesn't throw on invalid index.

The failing test was introduced in 59031543e2
which fixed #KT-47211.
2021-06-28 13:58:41 +00:00
Zalim Bashorov
a908e5576d [JS] Extract sourcemap generating related files to a separate module
It's required to reuse the same infrastructure in the new backend.
2021-06-28 16:04:09 +03:00
sebastian.sellmair
a63c179227 KotlinNativePlatformDependencies: Ensure 'commonizeNativeDistributionTask' is registered when 'isAllowCommonizer' is true 2021-06-28 13:00:19 +00:00
Svyatoslav Scherbina
b3980f9555 kotlin-native/samples: fix cocoapods after faulty cherry-pick 64129314
Move its source file to where it belongs.
2021-06-28 12:56:09 +00:00
Dmitry Petrov
560c269e05 PSI2IR KT-47450 prevent SOE when generating IR for deep expressions 2021-06-28 15:41:41 +03:00
Dmitriy Novozhilov
c4d9945782 Fix JPS build after removal of IDE plugin from repo 2021-06-28 14:32:24 +03:00
Ilya Goncharov
b76cbdaa41 [Gradle, JS] Remove redundant worksapces properties in yarn extensions 2021-06-28 13:38:04 +03:00
Ilya Goncharov
e3c291db27 [Gradle, JS] Not rewrite package.json if json was not changed 2021-06-28 13:38:03 +03:00
Ilya Goncharov
6219eb24c0 [Gradle, JS] Remove redundant test 2021-06-28 13:38:02 +03:00
Ilya Goncharov
1cc5a9493c [Gradle, JS] RootPackageJson task with up-to-date status 2021-06-28 13:38:01 +03:00
Ilya Goncharov
f182a1c750 [Gradle, JS] Sort for tools npm dependencies 2021-06-28 13:37:58 +03:00
Ilya Goncharov
3fc2a77281 [Gradle, JS] Remove redundant caching infrastructure 2021-06-28 13:37:57 +03:00
Ilya Goncharov
4d2376ac4c [Gradle, JS] Use package.json files instead of pre-package.json 2021-06-28 13:37:55 +03:00
Ilya Goncharov
f8bd440356 [Gradle, JS] Not force to write package.json in rootPackageJson 2021-06-28 13:37:53 +03:00
Ilya Goncharov
c4a1053aa7 [Gradle, JS] Add imported packages as workspace, not file dependencies 2021-06-28 13:37:52 +03:00
Alexander Udalov
f430d569d0 Fix warnings in js-ir/runtime/jsIntrinsics.kt
Suppress "UNUSED_PARAMETER" to fix compilation warnings. Also suppress
"unused" to make the file less yellow in the IDE.

Also enable `-Werror`, unless Gradle property
`kotlin.build.disable.werror` is set to true.
2021-06-28 12:19:35 +02:00
Svyatoslav Scherbina
eeffa49cd9 Native: don't generate .companion in ObjCExport if the companion is not exported
^KT-47462 Fixed
2021-06-28 08:19:12 +00:00
Svyatoslav Scherbina
786cb47450 Native: improve ObjCExport test for companion enum entry clash 2021-06-28 08:19:11 +00:00
Ivan Gavrilovic
929c4624cc KT-47416: Pass Android annotationProcessorOptions to kapt
This commits makes sure that "static" DSL options from
`android.javaCompileOptions.annotationProcessorOptions`
are passed to KAPT when running w/o kotlinc.

A regression was introduced in 19708cfa87.

Fixes #KT-47416
Test: Kapt3AndroidIT.testStaticDslOptionsPassedToKapt
2021-06-28 09:10:53 +02:00
Anton Bannykh
d303b783be KLIB: serialization support for global signatures and lowered IR features
Including:
- returnable blocks
- raw function references
- standalone type and value parameters
- file symbols
2021-06-27 22:56:35 +03:00
Anton Bannykh
6f01789139 IR: public symbols for the new global signatures 2021-06-27 22:56:35 +03:00
Anton Bannykh
aa5e7c65be KLIB: queue modules instead of ModuleDeserializationState
This approach is more general and expandable.
2021-06-27 22:56:35 +03:00
Anton Bannykh
e4707b236b JS IC: new signatures
Lowered IR might have cross-file references for fields, type parameters
and other stuff. Thus there is a need to make file-local and scope-local
signatures unique at least within a module.
2021-06-27 22:56:34 +03:00
Anton Bannykh
eba0661016 JS IC: .proto update 2021-06-27 22:56:34 +03:00
Anton Bannykh
b77d481ac6 IR: hide assert behind a flag
In JS IC the symbol might be unbound at this moment
2021-06-27 22:56:34 +03:00
Anton Bannykh
dbeb09af89 IR: fix SecondaryCtorLowering.kt 2021-06-27 22:56:34 +03:00
Anton Bannykh
bd4e7ffef8 JS PIR: store signatures for lowered declarations inside PIR declarations 2021-06-27 22:56:33 +03:00
Anton Bannykh
e0bdabcf61 JS IR: fix js SAM lowering 2021-06-27 22:56:33 +03:00
Anton Bannykh
9462131014 JS IR: fix offsets in BlockDecompositionLowering 2021-06-27 22:56:33 +03:00
Anton Bannykh
600099585d IR: refactor IdSignatureSerializer
Use a separate instance for each file.
2021-06-27 22:56:33 +03:00
Yahor Berdnikau
87dd357ec6 Add Gradle test task to run Gradle and Kotlin daemon tests.
These tests could not run in parallel, as they could not share
Gradle or Kotlin daemons with other running in parallel tests.

^KT-45745 In Progress
2021-06-27 21:35:54 +02:00
Andrey Zinovyev
c8fa8b0444 [lombok] Don't fail on fake overrides
#KT-47455 Fixes
2021-06-27 13:46:09 +03:00
Dmitriy Novozhilov
80b81934de Advance bootstrap to 1.5.30-dev-2862 2021-06-26 18:18:43 +03:00
Dmitriy Novozhilov
a8501bcef5 [FE 1.0] Fix message of INTEGER_OPERATOR_RESOLVE_WILL_CHANGE warning
^KT-47446 Fixed
2021-06-26 13:46:27 +03:00
Mikhael Bogdanov
5f62b72c82 Properly process big types 2021-06-26 06:10:16 +02:00
Mikhael Bogdanov
0fd1f549a9 Properly process special symbols during indy-with-constants concatenation
#KT-47320 Fixed
2021-06-26 06:10:16 +02:00
Zalim Bashorov
e947556aaa [IR] Use separate directories for each module for IR dumps
It allows avoiding overwriting content generated for other modules.

Also, added using additional ".kt" prefix to file extension for dumps generated with  Kotlin like syntax.
2021-06-26 01:38:04 +03:00
Alexander Shabalin
28b6427d3e Make FreezableAtomicReference atomic when unfrozen for the new MM. 2021-06-25 21:18:37 +00:00
Alexander Likhachev
518e8691b7 [Gradle, JS] Remove duplicate minimal Gradle version requirement
Minimal Gradle version for all Kotlin plugins is now 6.1 and minimal Gradle versions for all integration tests is set to 6.1.1
2021-06-25 22:40:06 +03:00
Alexander Likhachev
e8e95e6476 [Gradle, JS] Add test for KT-47154 regression
#KT-47154 Fixed
2021-06-25 22:40:04 +03:00
Alexander Likhachev
26510190cc [Gradle, JS] Include compiler type into library filter cache key
Previous fix could lead to unresolved symbols from main implementation in test compilation when module is compiled with both JS (IR and legacy) compilers because of single cached filter for both compileTestKotlinJsLegacy and compileTestKotlinJsIr tasks
#KT-47154 In Progress
2021-06-25 22:40:03 +03:00
Ivan Kochurkin
568eb255f5 [FIR] Split UpperBoundViolated checkers on two files (expression and declaration), add FirUpperBoundViolatedHelpers 2021-06-25 20:57:48 +03:00
Ivan Kochurkin
a26ffde820 [FIR] Correct support of projections and type aliases for UPPER_BOUND_VIOLATED, extend tests 2021-06-25 20:57:47 +03:00
Ivan Kochurkin
66e2b44272 [FIR] Implement UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION diagnostics, fix handling of UPPER_BOUND_VIOLATED 2021-06-25 20:57:46 +03:00
Ivan Kochurkin
5741374883 [FIR] Report UPPER_BOUND_VIOLATED only on checkers stage, fix detection of missing cases and testData 2021-06-25 20:57:45 +03:00
Ivan Kochurkin
ada14413e0 [FIR] Fix location of UPPER_BOUND_VIOLATED, fix detecting of several diagnostics, simplify FirUpperBoundViolatedChecker.kt 2021-06-25 20:57:44 +03:00
Dmitry Petrov
1298ba431b JVM_IR KT-47449 handle star projection arguments in default lambda types 2021-06-25 20:42:22 +03:00
Yahor Berdnikau
5486fec0f9 Validate Java and Kotlin target compatibility have same value.
This will ensure compiled java sources and kotlin sources class files
has the same bytecode version.

^KT-45611 Fixed
^KT-43095 Fixed
2021-06-25 16:28:57 +00:00
Yahor Berdnikau
6d929a8c3b Ensure toolchain is properly configured.
User specified toolchain maybe configured after initial task
configuration action will happen.

^KT-43095 In Progress
2021-06-25 16:28:56 +00:00
Yahor Berdnikau
4e556af54d Rename KotlinJavaToolchainProvider to DefaultKotlinJavaToolchain.
'Provider' suffix doesn't make sense.

^KT-45611 In Progress
^KT-43095 In Progress
2021-06-25 16:28:56 +00:00
Yahor Berdnikau
af2f716f4d Set 'jvmTarget' value on toolchain configuration.
Toolchain will set 'kotlinOptions.jvmTarget' value to the toolchain
jdk version, if 'jvmTarget' is not explicitly set by user.

If toolchain is not configured, 'jvmTarget' field uses default value,
which is now - "1.8".

^KT-45611 In Progress
^KT-43095 In Progress
2021-06-25 16:28:55 +00:00
Yahor Berdnikau
430306b23d Change 'jvmTarget' backing property visibility to internal.
Allows to check if this property was updated by the user or not.

^KT-45611 In Progress
^KT-43095 In Progress
2021-06-25 16:28:54 +00:00
Denis.Zharkov
48d170a858 Regenerate DiagnosisCompilerTestFE10TestdataTestGenerated 2021-06-25 18:41:15 +03:00
Denis.Zharkov
7645663d12 Deprecate (V)::a reference resolution to companion in FE 1.0
^KT-45315 Fixed
2021-06-25 18:41:14 +03:00
Denis.Zharkov
46b297477c Deprecate ambiguous cases in FE 1.0: companion property vs enum entry
^KT-37591 Fixed
2021-06-25 18:41:12 +03:00
Dmitriy Novozhilov
24bb9a4e14 Approximate expected type before reporting INTEGER_OPERATOR_RESOLVE_WILL_CHANGE
^KT-47447 Fixed
2021-06-25 18:39:01 +03:00
Ilya Goncharov
5bfdd5be5f [Gradle, JS] SubPlugin environment to js ir link task 2021-06-25 14:15:58 +00:00
Dmitriy Novozhilov
05883afc0a Deprecate simplification of complex boolean constant expressions in whens and loops
^KT-39883 In Progress
2021-06-25 16:37:35 +03:00
Dmitriy Novozhilov
8a2e0cedf9 Add test for exhaustive when with subject of Boolean! type 2021-06-25 16:37:34 +03:00
Dmitriy Novozhilov
09994ee8ea [FIR] Make type of safe call always nullable
^KT-46860 In Progress
2021-06-25 16:37:32 +03:00
Dmitriy Novozhilov
f18e38a49f [FIR] Properly setup source element for FirSafeCallExpression 2021-06-25 16:37:31 +03:00
Dmitriy Novozhilov
26b9948e5f [FE 1.0] Make type of safe call always nullable
^KT-46860 In Progress
2021-06-25 16:37:30 +03:00
Dmitriy Novozhilov
805fad980f [FIR] Fix creating DEBUG_CALL_INFO for safe calls 2021-06-25 16:37:29 +03:00
Dmitriy Novozhilov
9116c341ba [FIR] Fix detecting selector for safe calls in light tree 2021-06-25 16:37:27 +03:00
Dmitry Savvinov
4f8c854ead Exclude stdlib-common from jvm-specific compilations and source sets
^KT-46936 Fixed

Note that it is the slightly hack-ish fix; the proper one would remove
the dependency from kotlin-stdlib to kotlin-stdlib-common
2021-06-25 15:17:07 +03:00
Dmitry Savvinov
fa869c2c2a Add test on KT-46936 2021-06-25 15:17:06 +03:00
Dmitriy Novozhilov
1bce49023d Advance bootstrap to 1.5.30-dev-2757 2021-06-25 13:25:48 +03:00
sebastian.sellmair
b2dda0769c [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Ignore tests for ^KT-47434 2021-06-25 09:25:11 +00:00
sebastian.sellmair
c234999c09 [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Ignore tests for ^KT-47433 2021-06-25 09:25:10 +00:00
sebastian.sellmair
815d71a923 [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Ignore tests for ^KT-47432 2021-06-25 09:25:10 +00:00
sebastian.sellmair
eaa0eb2851 [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Add function parameter tests 2021-06-25 09:25:09 +00:00
sebastian.sellmair
4bcae0cc6f [Commonizer] Add CommonizeNativeDistributionTest.commonize - unix platforms() 2021-06-25 09:25:08 +00:00
sebastian.sellmair
1adf8091b1 [Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Add tests for issues found during okio investigation 2021-06-25 09:25:07 +00:00
Abduqodiri Qurbonzoda
aabc00f53f Throw IllegalStateException from MapBuilder iterator.remove() #KT-47419 2021-06-24 22:59:15 +00:00
Anton Bannykh
1006eb0945 IR: fix offsets in constant folding lowering 2021-06-25 00:59:28 +03:00
Anton Bannykh
9d1a8b2d58 IR: fill type parameters in inline class static method delegation call 2021-06-25 00:59:27 +03:00
Anton Bannykh
61a08be6b4 JS IR: don't rename the local declarations
IR2JS handles clashing declarations anyway.
2021-06-25 00:59:25 +03:00
Anton Bannykh
a56cc89010 JS IR: fill enum constructor call type parameters 2021-06-25 00:59:24 +03:00
Anton Bannykh
eb0c13793b JS IR: introduce 'lower per module' mode
This mode is closer to how IC supposed to work - reusing work
from dependencies, not re-lowering them.
2021-06-25 00:59:23 +03:00
Anton Bannykh
a4cb70af31 JS IR: gather statement origins in one place
Preparing to serialize lowered IR
2021-06-25 00:59:22 +03:00
Anton Bannykh
1b2f4ad071 dumpKotlinLike: add a flag to treat else as true
Deserialized IR always has `true` instead of `else` branch.
Dumping `else` as `true` helps comparing regular and serialized IR.
2021-06-25 00:59:20 +03:00
Sergey Igushkin
cf2c686630 Fix kotlin-test variants for correct resolution in *DependenciesMetadata
Make Gradle choose the `commonVariant` when a capability-less dependency
on kotlin-test is resolved for configurations requesting the common
artifacts.

Issue #KTIJ-6098 Fixed
2021-06-24 19:49:14 +00:00
Tianyu Geng
84f8d4d315 FIR IDE: handle reference to package and outer classes
For a qualified name like `foo.bar.Outer.Inner`, FIR represents it as
one atomic FIR element. Hence, to properly resolve these names to the
corresponding package and class, we need some additional work.
2021-06-24 18:27:51 +02:00
Tianyu Geng
a537074e1e FIR: add a boolean tracking if a class ref resolves to the companion object 2021-06-24 18:27:50 +02:00
Tianyu Geng
45ccec3b64 FIR IDE: Add HLAddWhenRemainingBranchesIntention 2021-06-24 18:26:20 +02:00
Tianyu Geng
63c65edda2 FIR IDE: AddWhenRemainingBranchFix
The fix reuses logic that is already available from
FirWhenExhaustivenessTransformer to collect missing when branches. The
current logic unfortunately uses hackyAllowRunningOnEdt to shorten the
generated code.
2021-06-24 18:26:18 +02:00
Tianyu Geng
6ec247b861 FIR: accept when(nothing) {} as exhaustive
FE1.0 accepts this but FIR current rejects it.
2021-06-24 18:26:17 +02:00
pyos
26e3237b8c JVM_IR: never rename public/protected fields
And if that causes a platform declaration clash, that's not a problem
that can be solved without breaking the ABI anyway.

 #KT-47412 Fixed
2021-06-24 17:41:06 +03:00
Jinseong Jeon
ee02303816 FIR IDE/UAST: resolve call from KtUnaryExpression 2021-06-24 16:38:24 +02:00
Jinseong Jeon
ed2cf9afd7 FIR IDE: handle other FIR calls for KtBinaryExpression 2021-06-24 16:38:24 +02:00
Elena Lepilkina
85ecbcb8f0 [K/N] Changed inlineThreshold after BCE for varargs 2021-06-24 12:57:57 +00:00
Yahor Berdnikau
e57ac5f67b Fix flaky test.
Narrow down unexpected string, so it will not clash with other output.
In this case 'AutoCloseable' was printed when Gradle 7 was generating
api jar.
2021-06-24 14:08:24 +02:00
pyos
88320cbb05 JVM_IR: produce collection stubs in a stable order
This means not storing intermediate results in any HashSets.

 #KT-47411 Fixed
2021-06-24 14:47:49 +03:00
Pavel Punegov
6ae6209031 Native: exclude tests that fail due to the KT-47405 and KT-47408 2021-06-24 10:54:45 +00:00
Denis.Zharkov
c8c558b575 FIR: Use Any? expect type to the argument list of ==
^KT-47409 Related
2021-06-24 12:17:46 +03:00
Denis.Zharkov
4892ad42b9 FIR: Do not mark not found classes' based types from Java as error
The same happens in FE1.0
2021-06-24 12:17:45 +03:00
Denis.Zharkov
201dded237 FIR: Fix serialization of delegated members
^KT-47413 Relates
2021-06-24 12:17:43 +03:00
Alexander Shabalin
cc71069a3a Do not require freezing for Worker.executeAfter on experimental MM 2021-06-24 07:57:23 +00:00
Ilya Kirillov
16e9c74523 FIR IDE: fix testdata after introducing isStatic property for symbols 2021-06-23 22:22:19 +03:00
Tianyu Geng
476d1da1cf Rename SelfTargetingIntention#allowCaretInsideElement
The current method makes it a bit hard to understand its purpose.
2021-06-23 22:22:18 +03:00
Tianyu Geng
abcc716ffc Document org.jetbrains.kotlin.idea.intentions.SelfTargetingIntention#allowCaretInsideElement
Also update its usage so that the contract of this method is easier to
understand.
2021-06-23 22:22:17 +03:00
Tianyu Geng
5a1223e812 FIR IDE: don't add return for when expressions when converting to block
There doesn't seem to be a good reason why FE1.0 does this. Hence we
won't do it in FIR.
2021-06-23 22:22:15 +03:00
Tianyu Geng
55e7cc7ea3 FIR IDE: add HLConvertToBlockBodyIntention 2021-06-23 22:22:14 +03:00
Tianyu Geng
030749eaeb FIR IDE: make KtExpressionTypeProvider work for more cases
Currently it doesn't work for the following

* labeled expression
* annotated expressions
* object literal expressions
2021-06-23 22:22:13 +03:00
Tianyu Geng
3aa6cb25ba FIR IDE: Add ImportMemberIntention 2021-06-23 22:22:12 +03:00
Tianyu Geng
66d44f2471 FIR IDE: Add ImportAllMembersIntention 2021-06-23 22:22:10 +03:00
Tianyu Geng
8d69f32d04 FIR IDE: fix test infra swallowing test failure output 2021-06-23 22:22:09 +03:00
Tianyu Geng
22fbd2044c FIR IDE: make ref shortener strictly follow range restriction 2021-06-23 22:22:08 +03:00
Tianyu Geng
726d141589 FIR IDE: Add fine-grained control to KtReferenceShortener
This change makes it possible to control how references to a symbol should be shortened.
2021-06-23 22:22:07 +03:00
Ilya Kirillov
8ac2a48eaf Allow specify path of compiler extension points for ide tests 2021-06-23 20:36:20 +03:00
Dmitry Petrov
0104b1275f JVM_IR KT-47398 handle @EnhancedNullability String subject as in 1.0 2021-06-23 20:11:24 +03:00
Dmitry Petrov
c26d71c4ef JVM KT-47365 add box test 2021-06-23 20:11:23 +03:00
sebastian.sellmair
7535f142c0 [Commonizer] SetExtensions: isSubsetOf: Use == over identity check
^KT-47301
2021-06-23 13:43:46 +00:00
sebastian.sellmair
ae57641456 [Commonizer] deserializeCirTree.kt: Optimize imports
^KT-47301
2021-06-23 13:43:45 +00:00
sebastian.sellmair
6044c58333 [Gradle] NativeDistributionCommonizerTask: Cleanup up-to-date checker comments
^KT-47301
2021-06-23 13:43:44 +00:00
sebastian.sellmair
a643ce89ff [Commonizer] Add CommonizerQueueTest.test diamond output targets()
^KT-47301
2021-06-23 13:43:44 +00:00
sebastian.sellmair
770efb7ecb [Commonizer] Replace InputTargetsSelectorInterface with a simple function
^KT-47301
2021-06-23 13:43:43 +00:00
sebastian.sellmair
5a8b39e08d [Gradle] GetCommonizerTargetOfSourceSet: Simplify implementation by only relying on compilations 2021-06-23 13:43:42 +00:00
sebastian.sellmair
19b99d5d91 [Gradle] Project.getCommonizerTarget(sourceSet: KotlinSourceSet): Ignore orphan source sets
Orphan source set's (source sets without compilation) can't break any
compilation. The decision to ignore those source sets for determining
the platform was already done for the IDE import.
In order to stay consistent, this function also ignores orphans.
2021-06-23 13:43:41 +00:00
sebastian.sellmair
97ea9c2c16 [Gradle] Rename HierarchicalNativeDistributionCommonizerTask to NativeDistributionCommonizerTask
^KT-47301
2021-06-23 13:43:40 +00:00
sebastian.sellmair
91259569d7 [Gradle] Remove old NativeDistributionCommonizerTask.kt
- Remove kotlin.mpp.enableHierarchicalCommonization gradle property:
This had to be done, since newer optimizations are not compatible
with non-hierarchical commonization

^KT-47301
2021-06-23 13:43:39 +00:00
sebastian.sellmair
73ffc0d180 [Gradle] NativeDistributionCommonizationCache: Support associative commonization
^KT-47301
2021-06-23 13:43:38 +00:00
sebastian.sellmair
21cef41ba5 [Commonizer] AbstractCommonizationFromSourcesTest remove assertions on commonized leaf/platform libraries
Those assertions are not necessary anymore, since the commonizer is not
expected to produce any new "actuals" per given expect.
The IDE is supposed to analyze leaf source sets against the original
platform libraries.
2021-06-23 13:43:37 +00:00
sebastian.sellmair
42f60d981f [Commonizer] Implement associative commonization
^KT-47301 Verification Pending
2021-06-23 13:43:36 +00:00
Kirill Shmakov
5fdbcb3dd1 [K/N][debug] Update LLDB bundle to support Apple Silicon
This is related to KTIJ-18889
2021-06-23 15:13:05 +03:00
Nikita Bobko
5a6f07402b Fix 'Generate FIR Checker Components and FIR/IDE Diagnostics' run configuration 2021-06-23 14:06:08 +02:00
Ilmir Usmanov
435b522cc5 Minor. Unmute test 2021-06-23 11:18:25 +02:00
pyos
537ce05bc9 JVM_IR: assume function reference adapters are tail-call
Meaning, they never need continuation objects. This shouldn't affect
correctness (if the assumption is valid, the continuation object
should always have been removed in the end), but the phantom
continuation sometimes left behind unused accessors (and in case of
inline function references, those accessors would refer to non-existent
functions) - see the modified test and Kotlin/kotlinx.coroutines#2769.
2021-06-23 11:18:25 +02:00
Vasily Levchenko
635a0fb01c [build][performance]kotlin:kotlin-build-gradle-plugin 0.0.29 -> 0.0.30 2021-06-23 09:07:29 +00:00
Andrey Uskov
92b08dfcfb Revert "Unify the way to set compiler options using System.properties"
This reverts commit 28e4e775
2021-06-23 11:34:04 +03:00
Dmitry Petrov
f30fc4863c JVM add ABI tests for non-approximated SAM types
Note that resulting SAM method
    public final method accept(p0: java.lang.Object): void
has a signature less specific than the resulting bridge method
    public synthetic bridge method accept(p0: X): void
2021-06-22 21:13:57 +03:00
Dmitry Petrov
c77884f067 Refactor SAM type handling, replace non-approximated arguments with * 2021-06-22 21:13:56 +03:00
Victor Petukhov
4aeabb6b0f Use upper bound aware type approximator for intersection types inside sam types in contravariant positions to build proper types in terms of subtyping 2021-06-22 21:13:55 +03:00
Victor Petukhov
6a78e0a10c Introduce type parameter's upper bound aware type approximator for intersection types 2021-06-22 21:13:54 +03:00
Victor Petukhov
750f327878 Use receivers from candidate as a fallback during completion of callable references
^KT-45083 Fixed
2021-06-22 21:13:53 +03:00
Nikita Bobko
fe8f7cfcae settings.gradle: update list of FIR IDE modules & attach them only when latest platform is used 2021-06-22 18:43:51 +02:00
Andrey Uskov
28e4e77542 Unify the way to set compiler options using System.properties
Now compiler flags with boolean values which are controlled by system
properties could be set in similar way. The following syntax is
appropriate. For setting flag:
'-DflagName,'-DflagName=[y|Y|true|TRUE|yes|YES|on|ON]'
for unsetting flag:
'-DflagName=[n|N|false|FALSE|no|NO|off|OFF]'
2021-06-22 19:35:28 +03:00
Svyatoslav Scherbina
04e8140162 Native: emit _Nullable_result attribute when generating Objective-C header
^KT-47042 Fixed
2021-06-22 16:12:37 +00:00
Nikita Bobko
9bf802a188 Move some idea-frontend-fir testData from compiler to IDE repo
This testData isn't used here but used in IDE repo
2021-06-22 18:41:42 +03:00
Nikita Bobko
c35e0438b6 Switch disableKotlinPluginModules flag 2021-06-22 17:21:04 +03:00
sebastian.sellmair
2006f89260 KotlinTargetContainerWithNativeShortcuts: Remove macos arm based targets
^KT-47126 Verification Pending
2021-06-22 12:21:05 +00:00
Svyatoslav Scherbina
9b49d0cf76 Native: fix testObjCExport testdata after 53baef88
(was broken during rebase)
2021-06-22 12:49:09 +03:00
Svyatoslav Scherbina
53baef8892 Add more tests for Native ObjCExport virtual adapters machinery 2021-06-22 09:29:30 +00:00
Svyatoslav Scherbina
5d5628f56e Native: apply ObjCExport virtual adapters from interfaces of supers
Previously they were skipped, and this was an incorrect optimization:
even if super class implements the interface too, this doesn't mean
that virtual adapters provided by that interface are inherited
by non-exported subclass that needs them;
for example, this doesn't happen when the super class is exported
(i.e. Obj-C class is not created at runtime).

Remove incorrect optimization instead of making it more sophisticated,
because it is useless anyway.

^KT-46431 Fixed
2021-06-22 09:29:29 +00:00
Alexander Shabalin
b7fbe09ef4 Fix Experimental MM tests on mingw 2021-06-22 08:58:00 +00:00
Abduqodiri Qurbonzoda
6db5fc0a23 Use teamcity kotlinLibsRepo and kotlinNativeDistDir parameters 2021-06-22 08:40:58 +00:00
Abduqodiri Qurbonzoda
013a7fe62d Rename the project from kotlin-dokka-stdlib to kotlin-stdlib-docs 2021-06-22 08:40:57 +00:00
Abduqodiri Qurbonzoda
d8d9a2689d Add sourcelink to generated documentation 2021-06-22 08:40:57 +00:00
Abduqodiri Qurbonzoda
6a9b9dc0a5 Print extracting info 2021-06-22 08:40:56 +00:00
Abduqodiri Qurbonzoda
40e23d8366 Use local libs from kotlin/build/repo and kotlin/kotlin-native/dist 2021-06-22 08:40:55 +00:00
Abduqodiri Qurbonzoda
5611fdcf25 Handle TeamCity build environment 2021-06-22 08:40:55 +00:00
Abduqodiri Qurbonzoda
e5b4fa83cb Use local sources dirs 2021-06-22 08:40:54 +00:00
Abduqodiri Qurbonzoda
72b1459353 Remove dependency on dokka build configuration artifacts 2021-06-22 08:40:53 +00:00
Abduqodiri Qurbonzoda
b5be7ddc4c Remove redundant kotlin_sources configuration 2021-06-22 08:40:52 +00:00
Abduqodiri Qurbonzoda
9777888ed4 Remove redundant use of mac and windows binaries 2021-06-22 08:40:52 +00:00
Abduqodiri Qurbonzoda
feaef467cd Remove redundant configuration declarations 2021-06-22 08:40:51 +00:00
Abduqodiri Qurbonzoda
d5d5891476 Move kotlin-dokka-stdlib scripts to libraries/tools/ 2021-06-22 08:40:50 +00:00
Nikolay Krasko
b406689035 Re-enable ":compiler:android-tests" module 2021-06-22 11:02:51 +03:00
Nikolay Krasko
d6aedc3229 Ignore more tasks if disableKotlinPluginModules explicitly set 2021-06-22 11:02:49 +03:00
Konstantin Tskhovrebov
28b8237836 Adapt XCFramework for using with groovy dsl. 2021-06-22 07:13:06 +00:00
Konstantin Tskhovrebov
c906d62c55 Add debug symbols for XCFrameworks. 2021-06-22 07:13:05 +00:00
Konstantin Tskhovrebov
297d661107 Add Apple M1 platforms to fat plist mapper. 2021-06-22 07:13:04 +00:00
Konstantin Tskhovrebov
84ae3df8b6 Add 'XCFramework' extension for creating XCFrameworks.
#KT-42667
2021-06-22 07:13:03 +00:00
Viacheslav Kormushkin
9fa55a6809 Fixed cocoapods error: expected ';' after module name
#KT-44235
2021-06-22 05:10:52 +00:00
nataliya.valtman
f6b428f271 KT-34862 use abi snapshot instead of build history files
Use jar snapshot instead build history file to avoid using time stamps and support remote gradle cache
2021-06-22 07:48:14 +03:00
Nikita Bobko
e5fbd0e2d8 Publish :idea-frontend-api, :idea-frontend-fir, :idea-fir-low-level-api modules artifacts
These artifacts are used in Kotlin plugin
2021-06-22 03:06:18 +03:00
Nikita Bobko
8b018f0a40 frontend-api-generator: remove unused module dependencies 2021-06-22 03:06:17 +03:00
Nikita Bobko
938cd955e1 Remove :idea prefix in IDE FIR modules which are going to stay in kotlin repo
This commit fixes not possibility to build project with `disableKotlinPluginModules`
flag on because Gradle tries to resolve `:idea` module which is disabled
2021-06-22 03:06:16 +03:00
Georgy Bronnikov
40872dd4ca JVM_IR: fix parallel compilation
Non-static inline functions that return inline
classes need to be tracked when copying files for by-file lowering.

FIXED: KT-45680
2021-06-22 02:22:36 +03:00
Ilya Goncharov
594cc29dd2 [Gradle, JS] Necessary to use approach with traversing all source sets
Because common source sets included into JS compilation, it can be detected as JS associated compilations.
So necessary to set attribute about JS compiler attribute only (at least at the beginning) to JS only source sets (source sets which are not included into any non js compilations)

[Gradle, JS] Add test with resolving JS variant of MPP library

[Gradle, JS] Add additional filtering of JS targets

[Gradle, JS] Add test on local resolve

^KT-47163 fixed
^KT-47114 fixed
2021-06-21 21:22:35 +03:00
Jinseong Jeon
03f85bea8f FIR checker: report VAL_REASSIGNMENT on value parameter 2021-06-21 20:58:01 +03:00
Jinseong Jeon
2486555208 FIR checker: refactor VAL_REASSIGNMENT checker 2021-06-21 20:58:00 +03:00
Jinseong Jeon
338503a4ae FIR checker: minor cleanup in FirPropertyInitializationAnalyzer 2021-06-21 20:57:58 +03:00
Ilya Kirillov
06918769e7 FIR IDE: actualize testdata 2021-06-21 20:43:45 +03:00
Ilya Kirillov
80c6506a21 FIR IDE: return back symbol restoring to symbol testss 2021-06-21 20:43:44 +03:00
Ilya Kirillov
dbba9297ff FIR IDE: restore InnerDeclarationsResolvePhaseTest 2021-06-21 20:43:43 +03:00
Ilya Kirillov
a9715de704 FIR IDE: fix leaking of FirJavaElementFinder in tests 2021-06-21 20:43:42 +03:00
Ilya Kirillov
61651c685c FIR IDE: restore FirLazyDeclarationResolveTest 2021-06-21 20:43:40 +03:00
Ilya Kirillov
c70629c22a FIR IDE: migrate LL API test to the test infrastructure from HL API 2021-06-21 20:43:39 +03:00
Dmitry Petrov
c19792e7c5 JVM_IR KT-47326 downcast field receiver on JvmField lowering 2021-06-21 19:17:54 +03:00
Alexander Shabalin
ebc4e10684 Fix GC stress test. 2021-06-21 16:07:57 +00:00
pyos
cf660cf24a JVM_IR: expect unboxed return value from suspend default stubs
#KT-47206 Fixed
2021-06-21 18:53:31 +03:00
Mark Punzalan
578fcf2ebf FIR: Render fun status flag in FirRenderer. 2021-06-21 18:45:38 +03:00
Mark Punzalan
efe3f7b87e FIR: Do not load inline flag when deserializing properties; there is
no `inline` flag for serialized properties.

In order to test this, I added the changes to FirRenderer to make sure
the flag is not loaded. However, this revealed that the `inline` status
was propagated upward to the `FirProperty` during raw FIR building,
causing test failures.

I removed the upward propagation for `inline`. I also removed it for
`external` because it is incorrect: `external` on properties (used in
JS) should be separate from `external` on accessors (used in JNI
interop for JVM). The `external` flags are also serialized separately
for properties and accessors.
2021-06-21 18:45:37 +03:00
Yahor Berdnikau
030697d430 Restore removed 'kotlinPluginVersion' property.
And marked it as '@Deprecated'.

^KT-47317 Fixed
2021-06-21 17:38:57 +02:00
Marina Shishkina
b68c00e0e9 rrr/1.5.20-release/ayalyshev/change-notes
Update links in the plugin description

Update UTM for the kotlinlang link

Add change notes for 1.5.20

Co-authored-by: Anton Yalyshev <Anton.Yalyshev@jetbrains.com>
2021-06-21 18:30:05 +03:00
pyos
913ac289ed JVM_IR: extract boolean-valued DFS on IR elements into a helper 2021-06-21 16:19:24 +03:00
pyos
ee4d9a89ea JVM_IR: read inline fun bytecode to detect unused property references
I.e. optimize `$$delegatedProperties` in the same way as the old
backend. This is more reliable than trying to match bytecode.
2021-06-21 16:19:23 +03:00
pyos
bd6d96114b JVM_IR: generate shorter bytecode for reflected property references 2021-06-21 16:19:23 +03:00
Alexander Shabalin
7079ad49bc Add a test on attaching new threads while collecting 2021-06-21 12:26:01 +00:00
Elena Lepilkina
7c45154fc5 [K/N] Added copy array benchmark 2021-06-21 12:23:25 +00:00
Jinseong Jeon
bc09d94717 FIR UAST: running resolve API tests for both plugins 2021-06-21 13:49:47 +03:00
Jinseong Jeon
610b68c29d FIR/UAST: commonize expressions with label 2021-06-21 13:49:46 +03:00
Jinseong Jeon
fa613a32b2 FIR/UAST: commonize safe qualified expression 2021-06-21 13:49:45 +03:00
Jinseong Jeon
2999d0bd4b FIR/UAST: commonize double colon expressions 2021-06-21 13:49:44 +03:00
Jinseong Jeon
77e8aed995 FIR/UAST: move multi resolve utils/APIs to the base module/service 2021-06-21 13:49:42 +03:00
Jinseong Jeon
e870bf7399 FIR/UAST: commonize simple reference expression 2021-06-21 13:49:41 +03:00
Jinseong Jeon
4ec745abd7 FIR: relax simple type requirement in AbstractTypeMapper
The counterparts in old FE don't have such restriction, so it can
map a type that has a flexible type as a type argument to JVM type,
e.g., Stream<String..String?>
2021-06-21 13:49:40 +03:00
Jinseong Jeon
08e486d1a7 FIR/UAST: commonize dot qualified expression 2021-06-21 13:49:39 +03:00
Ilya Kirillov
8f70ef41f0 FIR IDE: consider resolve inside completion candidate checker 2021-06-21 13:43:49 +03:00
Ilya Kirillov
9d07832175 fix "FIR IDE: implement completion for variables with functional types with receivers" 2021-06-21 13:43:48 +03:00
Ilya Kirillov
0ebb9cc4a6 FIR IDE: extract completion groups to object 2021-06-21 13:43:47 +03:00
Ilya Kirillov
20f2e4f313 FIR IDE: introduce basic weighting for completion based by groups 2021-06-21 13:43:46 +03:00
Ilya Kirillov
a5edbd531b FIR IDE: add ::class/::class.java to callable references completion 2021-06-21 13:43:45 +03:00
Ilya Kirillov
915c8b7996 FIR IDE: implement completion for variables with functional types with receivers 2021-06-21 13:43:44 +03:00
Ilya Kirillov
167917cf07 FIR IDE: ignore attributes in completion tests 2021-06-21 13:43:43 +03:00
Ilya Kirillov
72e26771d8 FIR IDE: do not require resolve bodies toc check candidates for completion 2021-06-21 13:43:41 +03:00
Ilya Kirillov
b8248f0197 FIR IDE: do not ignore parameters for extension applicability for completion 2021-06-21 13:43:40 +03:00
Ilya Kirillov
ae9ac33f0f FIR IDE: implement completion for infix functions 2021-06-21 13:43:39 +03:00
Ilya Kirillov
2ffc7ad0a0 FIR IDE: implement completion for callable references 2021-06-21 13:43:38 +03:00
Dmitriy Novozhilov
a42e9c236a [FIR] Fix PSI types of some diagnostics 2021-06-21 13:13:18 +03:00
Dmitriy Novozhilov
b218573bb3 [FIR] Add pretty toString to FirDiagnosticFactory 2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
3564db4f7b [FIR] Add assertion which checks that diagnostic is reported on proper PSI element 2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
a288b8b00e [FIR] Remove useless type parameters from classes related to diagnostics
Generics removed from:
 - FirPsiSourceElement
 - FirDiagnostic
 - FirDiagnosticRenderer
 - FirDiagnosticFactory
2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
386f6d9331 [FIR] Safe KClass of PSI type in diagnostic factory 2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
399b7aceef [FIR] Fix reporting diagnostics in CLI which was broken in previous commit
Note: reporting properly works only for PSI
2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
d807ac2f05 [FIR] Don't inherit FIR diagnostics from FE 1.0 diagnostics 2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
3d544be655 [FIR] Add ability to specify custom position strategy for specific diagnostic 2021-06-21 13:13:17 +03:00
Dmitriy Novozhilov
9ef712c096 [FIR] Prohibit using FirDiagnosticFactory.on for creating diagnostics
In most cases it's better to use `FirDiagnosticReporter.reportOn`, so
  `on` methods now marked as opt in
2021-06-21 13:13:16 +03:00
Andrei Klunnyi
89801a1ac7 KT-44841 Move sealed: no warning on splitting hierarchy (JPS)
To provide similar behavior for both Gradle and JPS projects target and
source directories are now taken into account.

Prior to this commit AbstractMoveTest.kt contained a hack allowing not
to create empty target directories. It breaks updated logic of the move
check and therefore is removed.
To commit empty target directories under 'before' to git one needs to
put something in them (git ignores dirs otherwise). Hence .gitignore-s.

^KT-44841 Fixed
2021-06-21 09:51:17 +00:00
Svyatoslav Scherbina
b961812efd Native: fix thread state when calling ObjC completion for Kotlin suspend 2021-06-21 09:37:25 +00:00
Ilya Kirillov
87c6ab493b FIR IDE: mute some highlighting tests
They may fail if they run separately
2021-06-21 04:15:37 +02:00
Ilya Kirillov
bbefc064a9 FIR IDE: fix EntityWasGarbageCollectedException for KtType 2021-06-21 03:38:25 +02:00
Ilya Kirillov
f00170eb31 FIR IDE: add missing runtime dependencies for tests 2021-06-21 02:50:11 +02:00
Ilya Kirillov
caf4eba2df FIR IDE: do not run tests from idea-fir module in parallel 2021-06-21 02:19:23 +02:00
Ilya Kirillov
dd0a91cc15 FIR IDE: invalidate caches between lightclasses tests 2021-06-21 00:51:31 +02:00
Ilya Kirillov
c2ae434737 Remove // FIR_IDE_IGNORE directive from passing tests 2021-06-21 00:51:31 +02:00
Ilya Kirillov
822590a62b FIR IDE: temporary disable AbstractFirLazyDeclarationResolveTest.kt 2021-06-21 00:51:31 +02:00
Ilya Kirillov
90f6d458b5 FIR IDE: fix test task name 2021-06-21 00:51:31 +02:00
Ilya Kirillov
f20dd8b673 FIR IDE: fixes after rebase 2021-06-21 00:51:30 +02:00
Ilya Kirillov
cf04be5207 FIR IDE: temp mute failing light class test 2021-06-21 00:51:30 +02:00
Ilya Kirillov
e9d1fb7c40 FIR IDE: mute completion tests failing with "Class LinkedHashMap was not found" 2021-06-21 00:51:30 +02:00
Ilya Kirillov
3e42ae03a9 Move frontend api modules out of ide modules 2021-06-20 22:07:49 +02:00
Ilya Kirillov
495a5136bb extract frontendApiTests to separate gradle task 2021-06-20 22:07:49 +02:00
Ilya Kirillov
d5cd4955cc FIR IDE: temporary update testdata of lazy resovle test 2021-06-20 22:07:46 +02:00
Ilya Kirillov
72b8593240 FIR IDE: do not use IJ test infrastructure in frontend-api-fir tests 2021-06-20 22:07:31 +02:00
Ilya Kirillov
606c3c136c FIR IDE: remove dependency to IDEA from low-level-api fir impl module 2021-06-20 22:07:28 +02:00
Ilya Kirillov
0c5883cbe0 FIR IDE: do not depend on IDEA modules in frontend-api 2021-06-20 22:07:15 +02:00
Ilya Kirillov
28dbfeb845 Move KtReference interface to psi module 2021-06-20 22:07:15 +02:00
Ilya Kirillov
796baf261d FIR IDE: move KtIconProvider out of idea-frontend-api module 2021-06-20 22:07:15 +02:00
Ilya Kirillov
75331b3448 FIR IDE: abstract low-level-api from dependency on idea 2021-06-20 22:07:11 +02:00
Ilya Kirillov
a483098303 FIR IDE: abstract DeclarationProvider 2021-06-20 22:02:17 +02:00
Ilya Kirillov
7fe2adc37e FIR IDE: do not use helper methods unavailable in intellij-core 2021-06-20 22:02:17 +02:00
Ilya Kirillov
32919489f4 FIR IDE: separate index helper in LL API and completion 2021-06-20 22:02:17 +02:00
Jinseong Jeon
7a5d61928b FIR/IDE: migrate FIR evaluator to idea-frontend-fir 2021-06-19 21:58:48 -07:00
Jinseong Jeon
fcdb8866d2 FIR: rewrite evaluator to use eval utils in frontend.common 2021-06-19 21:58:47 -07:00
Jinseong Jeon
477c1c8cd7 Migrate CompileTimeType and OperationsMap to frontend.common 2021-06-19 21:58:47 -07:00
Jinseong Jeon
833761ac3c FIR IDE/UAST: add KtCompileTimeConstantProvider with evaluate API 2021-06-19 21:58:41 -07:00
Jinseong Jeon
7d157f006b Rename CompileTimeConstantEvaluator to have Fir prefix 2021-06-19 21:35:36 -07:00
Jinseong Jeon
720104de78 Temporarily allow deprecated conversions in FIR operations map
Also, switch to the new copyright header
2021-06-19 21:35:35 -07:00
Jinseong Jeon
fc5d1d8cb5 FirConstKind has been renamed to ConstantValueKind (d243319) 2021-06-19 21:35:35 -07:00
Jinseong Jeon
bb297b87bd Avoid hard-coded operator names in CompileTimeConstantEvaluator 2021-06-19 21:35:34 -07:00
Jinseong Jeon
a969924248 FIR: generate operations map for CompileTimeConstantEvaluator 2021-06-19 21:35:34 -07:00
Jinseong Jeon
5e2525175e Introduce fir.evaluate module with CompileTimeConstantEvaluator 2021-06-19 21:35:33 -07:00
Igor Yakovlev
ec80c21fd1 [FIR IDE] Fix lazy resolve for local declarations 2021-06-19 19:23:24 +02:00
Igor Yakovlev
c17a67ba61 [FIR IDE] Fix invalid collecting designation for local declarations 2021-06-19 19:23:24 +02:00
Igor Yakovlev
41c42a5016 [FIR IDE] Remove session scope default parameter from lazy resolve interface 2021-06-19 19:23:24 +02:00
Igor Yakovlev
52765c333d [FIR IDE] Add test for local function lazy resolve and add phase into test data 2021-06-19 19:23:24 +02:00
Igor Yakovlev
2319a53fae [FIR] Fixed invalid phase for values value parameter 2021-06-19 19:23:23 +02:00
Igor Yakovlev
8012429e31 [FIR IDE] Fix loop inheritance tests 2021-06-19 19:23:23 +02:00
Igor Yakovlev
3a1057eb60 [FIR IDE] Enable passing spec tests 2021-06-19 19:23:23 +02:00
Igor Yakovlev
b612e13061 [FIR IDE] Always resolve to Body in ide fir renderer 2021-06-19 19:23:23 +02:00
Igor Yakovlev
e900a1fa57 [FIR IDE] Fix local declarations resolve 2021-06-19 19:23:23 +02:00
Igor Yakovlev
4a212dc6a0 [FIR IDE] Fix unresolved supertype for typealiases 2021-06-19 19:23:23 +02:00
Igor Yakovlev
6c0bacc548 [FIR IDE] Fix invalid status for class symbols 2021-06-19 19:23:23 +02:00
Igor Yakovlev
21b1e4b072 [FIR IDE] Add lazy resolve phases tests 2021-06-19 19:23:23 +02:00
Igor Yakovlev
df1b41f05c [FIR IDE] Rename refactoring 2021-06-19 19:23:22 +02:00
Igor Yakovlev
eded837115 [FIR IDE] Add typed lazy resolve implementation 2021-06-19 19:23:22 +02:00
Igor Yakovlev
7a0391b9b3 [FIR IDE] Move refactoring for constructor of the FileStructure 2021-06-19 19:23:22 +02:00
Igor Yakovlev
a60be78898 [FIR IDE] Remove designation collecting for local declarations 2021-06-19 19:23:22 +02:00
Igor Yakovlev
0cbb29f494 [FIR IDE] Remove typed fir designation 2021-06-19 19:23:22 +02:00
Igor Yakovlev
a4dbf0ae57 [FIR IDE] Update class modifiers requirements for resolve phase 2021-06-19 19:23:22 +02:00
Igor Yakovlev
3573f5066b [FIR] Remove redundant println from RawFirBuilder 2021-06-19 19:23:22 +02:00
Igor Yakovlev
83382bea13 [FIR IDE] Concurrent identity cache for files 2021-06-19 19:23:21 +02:00
Igor Yakovlev
f98995f6cb [FIR IDE] Implement lazy designated resolve for all resolve FIR phases 2021-06-19 19:23:21 +02:00
Jinseong Jeon
cda1a7edbe FIR/UAST: commonize UAnnotationMethod 2021-06-19 11:39:46 +02:00
Jinseong Jeon
638b0beadb FIR UAST: unify UMethod creation 2021-06-19 11:39:46 +02:00
Jinseong Jeon
5ec5b7f041 FIR/UAST: commonize constructor declarations 2021-06-19 11:39:45 +02:00
Jinseong Jeon
cbaa645dbe FIR/UAST: commonize base UMethod 2021-06-19 11:39:45 +02:00
Jinseong Jeon
4a06ca637a FIR/UAST: commonize anonymous UClass 2021-06-19 11:39:45 +02:00
Jinseong Jeon
3bd4cb274d FIR/UAST: commonize invalid UClass 2021-06-19 11:39:44 +02:00
Jinseong Jeon
1749c90083 FIR/UAST: commonize base UClass (with bogus annotation abstraction) 2021-06-19 11:39:44 +02:00
Jinseong Jeon
06c20bb10e FIR/UAST: commonize abstraction of Kotlin UClass 2021-06-19 11:39:43 +02:00
Jinseong Jeon
0c011f4e73 UAST: place method declarations together 2021-06-19 11:39:43 +02:00
Jinseong Jeon
beddf03f74 FIR/UAST: convert annotation via base converter 2021-06-19 11:39:42 +02:00
Jinseong Jeon
33ff90a6da FIR/UAST: commonize named/vararg expressions 2021-06-19 11:39:42 +02:00
Jinseong Jeon
dcf99e9fd1 UAST: delete redundant file
This is rather a test input, and indeed there is testData/Suspend.kt
2021-06-19 11:39:42 +02:00
Jinseong Jeon
4e4b104488 FIR/UAST: commonize expression list 2021-06-19 11:39:41 +02:00
Jinseong Jeon
2e58b57db9 UAST: remove redundant override: expression list's evaluate()
The super function in `KotlinEvaluatableUElement` is almost same,
except for handling of `UnsignedErrorValueTypeConstant`.
Such handling was added later, so I assume the addition to this override
was missed. In any cases, this override is unnecessary.
2021-06-19 11:39:41 +02:00
Jinseong Jeon
31d1c002c5 FIR UAST: implement constructors/delegations
But, the logic is identical to the counterpart in FE1.0 UAST
Many declaration abstractions, such as (primary|secondary) constructor
methods and class, are very similar, and thus can be commonized soon
once the remaining parts (in particular, annotations) are done.
2021-06-19 11:39:40 +02:00
Nikita Bobko
8b3c6489da Fix kotlin resources iml path 2021-06-18 17:42:23 +02:00
Nikita Bobko
306f8b7358 [imltogradle] Add "imls in same directory are not allowed" check 2021-06-18 17:42:23 +02:00
Ilya Goncharov
eed23ddbe3 [JS, Frontend] Add test with extension member in external interface 2021-06-18 17:20:57 +03:00
Ilya Goncharov
83c1a119ee [JS, Frontend] Add option to allow extension lambdas in externals 2021-06-18 17:20:56 +03:00
Svyatoslav Scherbina
2a54f1c610 Improve exception messages for kotlin.native.concurrent.* operations 2021-06-18 13:51:21 +00:00
nataliya.valtman
6a32e7bd5a Add typealias testcase for incremental compilation 2021-06-18 16:50:17 +03:00
Anton Bannykh
48fe46303d JS IR: declare intrinsics for lowerings in stdlib
- simplifies lowered IR serialization
- removes some hacks in jsOperators.kt
- intrinsics can be directly invoked in stdlib
2021-06-18 15:26:52 +03:00
Ilya Matveev
94384ce2ca [K/N][Runtime] Add a lock method to thread registry 2021-06-18 12:20:04 +00:00
Ilya Matveev
cece652412 [K/N][Runtime] Separate thread registering and making it 'Runnable'
The new GC will require threads to suspend right after registering
if Stop-The-World is requested. This patch changes the initial
thread state to kNative and adds a separate state switch right
after thread registering. This switch suspends if it is necessary.
2021-06-18 12:20:03 +00:00
Alexander Shabalin
e240b8a8ee Add a separate aggressive GC mode 2021-06-18 12:03:02 +00:00
Igor Chevdar
1cfe1c41ef [K/N][IR] Fixed problem with klib compilation
Fixes https://youtrack.jetbrains.com/issue/KT-46896
2021-06-18 16:21:24 +05:00
Igor Chevdar
421ff68cd6 [K/N][codegen] Fix for https://youtrack.jetbrains.com/issue/KT-47183 2021-06-18 15:57:45 +05:00
Yahor Berdnikau
7aa882b921 Add test for multiplatform plugin.
^KT-43095 In Progress
2021-06-18 10:50:26 +00:00
Yahor Berdnikau
0f1da3c412 Make GradleCompileTaskProvider compatible with configuration cache.
Refactor it such way that it could be used via Provider and
don't raise configuration cache errors.

^KT-45611 In Progress
^KT-43095 In Progress
2021-06-18 10:50:26 +00:00
Yahor Berdnikau
84ec4106f7 Don't set toolchain if it is not configured.
Before even when user did not configure toolchain, default toolchain
was still created, but with recent changes it does not make sense.

^KT-43095 In Progress
2021-06-18 10:50:25 +00:00
Yahor Berdnikau
1c9b013732 Change dsl method to 'jvmToolchain'.
This better reflects that applying toolchain only affects jvm
backend compilations.

^KT-43095 In Progress
2021-06-18 10:50:24 +00:00
Yahor Berdnikau
1a6bb5cd08 Allow to pass any object for 'jdkVersion'.
This object should be accepted by 'JavaVersion.toVersion' method.

^KT-45611 In Progress
2021-06-18 10:50:23 +00:00
Yahor Berdnikau
46d5df4991 Consider toolchain only as input for 'jdkHome' compilation option.
This change will limit toolchain scope only to the JVM compilations,
as Kotlin compiler itself does not care about JDK version it is running
 on and should always produce same output for non-JVM backends.
For JVM backend there is one condition - 'jdkHome' should always point
 to the same JDK version.

Few additional changes:
- allow to set specific JDK location even on Gradle versions 6.7+
- Fix typo in deprecation message

^KT-45611 In Progress
^KT-43095 In Progress
2021-06-18 10:50:23 +00:00
Yahor Berdnikau
1bb64ffa22 Revert "Print path to java executable Kotlin daemon was started with."
This reverts commit 3e69bcba47.
2021-06-18 10:50:22 +00:00
Yahor Berdnikau
f9ec6bb66a Revert "Optionally make java executable path contribute to the daemon id."
This reverts commit ac86ad252f.
2021-06-18 10:50:21 +00:00
Pavel Kunyavskiy
d7a3310042 [K/N] KT-43780: support of more convenient objects using from objC/Swift 2021-06-18 08:02:22 +00:00
Pavel Kunyavskiy
0952a95949 [K/N] reuse common code for companionObject util 2021-06-18 08:02:21 +00:00
Viacheslav Kormushkin
0b6d2cd21a Custom name support for fat frameworks
#KT-30805
2021-06-18 06:28:01 +00:00
Dmitry Petrov
ce107d06d4 JVM_IR add test for KT-47300 2021-06-17 21:40:30 +03:00
Roman Golyshev
1cd75b1e82 kotlin-stdlib:jvm-minimal-for-test -> kotlin-stdlib-jvm-minimal-for-test
Changed after cherry-picking 8baf570ee7
to the master-for-ide branch
2021-06-17 20:19:49 +03:00
Roman Golyshev
6ea4b8997b Add kotlin-stdlib-minimal-for-test.jar artefact to the published dependencies
Some compiler tests rely on this jar instead of the regular `stdlib`
2021-06-17 20:19:48 +03:00
Vyacheslav Gerasimov
73d4110c92 Build: Rollback kotlin-stdlib-jvm-minimal-for-test publication
Continue publishing to the internal/repo only
2021-06-17 19:43:11 +03:00
Vyacheslav Gerasimov
58f1fb644f Build: Stop publishing jars with original classifier
#KTI-580
2021-06-17 19:43:10 +03:00
Vyacheslav Gerasimov
fb805028c1 Build: Add runtimeJar variant to the default java component if present 2021-06-17 19:43:09 +03:00
Vyacheslav Gerasimov
a0469a1d62 Build: Make Gradle plugin publications reuse POMs from the main one
#KTI-571
2021-06-17 19:43:07 +03:00
Nikolay Krasko
80677c88cb Update gradle task in generated files 2021-06-17 18:36:10 +03:00
Nikolay Krasko
c8ae9a7090 [imltogradle] Speedup files traversing by ignoring directories 2021-06-17 18:36:09 +03:00
Nikolay Krasko
7e8168a7e6 Ignore more boostrap libraries in dependency verification 2021-06-17 18:36:08 +03:00
Nikolay Krasko
d72f1097d7 Cleanup dependency verification for 211 kotlin-ide 2021-06-17 18:36:07 +03:00
Nikolay Krasko
6139f095e7 Disable dependencies verification for kotlin-ide projects 2021-06-17 18:36:06 +03:00
Nikolay Krasko
71ee9cf1be Fix generateIdeaGradleFiles on Windows 2021-06-17 18:36:04 +03:00
Ilya Kirillov
8c69913640 FIR IDE: temporary ignore failing intention tests 2021-06-17 17:27:00 +03:00
Mark Punzalan
97c10b0b84 FIR IDE: Change PSI element type for NO_COMPANION_OBJECT and
EXPRESSION_EXPECTED_PACKAGE_FOUND from KtSimpleNameExpression to
KtExpression (source can be KtDotQualifiedExpression).
2021-06-17 17:26:58 +03:00
Alexander Shabalin
91a852d3fd Fix integer conversion on 32-bit 2021-06-17 14:16:16 +00:00
Margarita Bobova
eaed67df29 Move 1.4.x changelog to a separate file 2021-06-17 14:50:36 +03:00
Ivan Kochurkin
a0aaf42fb1 Some string and minor optimizations 2021-06-17 13:49:08 +03:00
Ivan Kochurkin
bc3c05a3bd [FIR] Replace lists with Long in Modifier, refactor Modifier and derived classes 2021-06-17 13:49:08 +03:00
Ivan Kochurkin
6199b85eb9 [FIR] Introduce ModifierKind and optimize Modifier in lightTree 2021-06-17 13:49:08 +03:00
Ivan Kochurkin
ce4e60afd3 [FIR] Simplify FirCyclicTypeBoundsChecker and replace PersistentList with MutableList 2021-06-17 13:49:07 +03:00
Ivan Kochurkin
1e430b7b03 [FIR] Replace PersistentList with MutableList in Context, simplify DeclarationConverter 2021-06-17 13:49:07 +03:00
Ivan Kochurkin
366017d267 [FIR] Replace PersistentList with MutableList in BodyResolveContext, LocalClassesNavigation 2021-06-17 13:49:06 +03:00
Andrey Zinovyev
d360932ebc [FIR] Fill overriddenSymbols for fake overridden IrProperty 2021-06-17 13:24:12 +03:00
Sergey Bogolepov
4f98a0e083 [Native] Introduce optInCacheableTargets
Create an explicit list of targets that have unstable compiler caches
in konan.properties. It allows to control all lists of cacheable targets
in a single place.
2021-06-17 09:19:44 +00:00
Roman Golyshev
108dd37242 Add possibility to use baseDir in CoroutineHelpersSourceFilesProvider 2021-06-17 02:41:32 +03:00
Nikita Nazarov
adec873118 [EE_IR] Update ignore directive 2021-06-17 02:40:04 +03:00
Alexander Shabalin
e3eec33b24 Add aggressively allocating stress test for GC 2021-06-16 21:34:05 +00:00
Alexander Shabalin
7ae59856cb Add internal MemoryUsageInfo object
Currently it only provides peak RSS usage for iOS, Linux, macOS and Windows.
2021-06-16 21:34:04 +00:00
Nikita Bobko
670d66984f Reduce Gradle configuration phase time in case when 'attachedIntellijVersion' flag is specified
Traversing intellij repo is long
2021-06-16 21:58:36 +03:00
Nikita Bobko
526a664077 [imltogradle] Add a bit of logging 2021-06-16 21:58:36 +03:00
Nikita Bobko
c954fa4900 Make it possible to attach community version of kotlin-ide 2021-06-16 21:58:34 +03:00
Roman Artemev
8ac5d03f02 [Test] fix module name in klib text tests
It failed on windows machines due to illegal '<' in path
2021-06-16 21:16:58 +03:00
Roman Artemev
56604a9654 [K/N] Promote kotlin-build-gradle-plugin version 0.0.29 -> 0.0.30
Missed fix
2021-06-16 21:16:57 +03:00
Roman Artemev
2c34888a57 [TEST] Add comment in klib text tests runner 2021-06-16 21:16:56 +03:00
Roman Artemev
71af11052a [TEST] Mute tests irText klib tests 2021-06-16 21:16:55 +03:00
Roman Artemev
e82552975d [TEST] support test muting in klib text tests runner 2021-06-16 21:16:54 +03:00
Roman Artemev
5bc884ce2b [KLIB] Fix fakeoverride builder
Set proper visibility in case of cross-module internal overrides.
TODO: KT-47192
2021-06-16 21:16:53 +03:00
Roman Artemev
0cb23a6e65 [KLIB] Fix serialization of loops with control statements in condition 2021-06-16 21:16:52 +03:00
Roman Artemev
e5c6a5b80d [IR] Clean up Fake Override builder a bit 2021-06-16 21:16:51 +03:00
Roman Artemev
1831c0a14b [IR] Support disabling of rendering IrErrorType inner KotlinType 2021-06-16 21:16:50 +03:00
Roman Artemev
2eac442705 [IR] Support stable order in IR dump
That mode is need to test deserialization of klibs
2021-06-16 21:16:49 +03:00
Roman Artemev
bbcd511c44 [TEST] fix irText testData
- support DELEGATED_MEMBER overrides
2021-06-16 21:16:48 +03:00
Roman Artemev
cb130181a2 [Psi2Ir] Fix overridden symbols of Delegated Properties 2021-06-16 21:16:47 +03:00
Roman Artemev
32bbc3b8ad [KLIB] Fix SimpleTypeKey in case of type abbreviation 2021-06-16 21:16:46 +03:00
Roman Artemev
2f772c7a7c [KLIB] Add IrStatementOrigin into IrConstructorCall message 2021-06-16 21:16:45 +03:00
Roman Artemev
16ea3d9ae9 [TEST] Add IrText klib tests 2021-06-16 21:16:44 +03:00
Roman Artemev
14c91ca0de [TEST] Set proper TARGET_BACKEND for jvm-specific irText tests 2021-06-16 21:16:43 +03:00
Roman Golyshev
b587b71b0f FIR IDE: Move KtDeclarationAndFirDeclarationEqualityChecker.kt to nested api package 2021-06-16 15:38:57 +00:00
Roman Golyshev
c42fec5c93 FIR IDE: Refactor findSourceFirCompiledDeclaration
Add `FirDeclarationForCompiledElementSearcher` class to encapsulate
searching by the compiled declarations, move it to the separate file
2021-06-16 15:38:56 +00:00
Roman Golyshev
b0bac90a8b FIR IDE: Make findNonLocalDeclarationForCompiledElement a member of FirModuleResolveState 2021-06-16 15:38:56 +00:00
Roman Golyshev
e1f985424f FIR IDE: Move KtDeclarationAndFirDeclarationEqualityChecker to api package 2021-06-16 15:38:55 +00:00
Roman Golyshev
ad34c19f9a FIR IDE: Add explicit assertion that module info is ModuleSourceInfo 2021-06-16 15:38:54 +00:00
Roman Golyshev
44f74888e0 FIR IDE: Add tests for resolving compiled declarations
Also, use correct index to find source for properties in
`FirIdeDeserializedDeclarationSourceProvider` - this bug
was revealed by the tests
2021-06-16 15:38:53 +00:00
Roman Golyshev
0fe068c6ce FIR IDE: Find FIR declarations for compiled PSI elements separately
When PSI declaration comes from the library with classfiles,
its `moduleInfo` is represented by `LibrarySourceInfo` class.
In this case we have to resort to other ways of looking for
corresponding FIR declaration

It is easy to do for classes (by `classId`) and for the properties
(by `classId` of the containing class and property's name)

It is harder for callables, so we use
`KtDeclarationAndFirDeclarationEqualityChecker` to do that
2021-06-16 15:38:52 +00:00
Roman Golyshev
be51738483 FIR IDE: Move KtDeclarationAndFirDeclarationEqualityChecker to idea-fir-low-level-api module
It will be required to compare PSI and FIR declarations
for compiled PSI elements
2021-06-16 15:38:51 +00:00
Roman Golyshev
66047f159f FIR IDE: Resolve declaration in withFirDeclaration only if needed 2021-06-16 15:38:51 +00:00
Roman Golyshev
9e4c5eed5f FIR IDE: Make ModuleLibrariesSearchScope work only on .class sources
If this scope will accepts sources, then it will cause problems later
(when we will get libraries' sources from indices and will try to
resolve them to FIR declaration)
2021-06-16 15:38:50 +00:00
Igor Chevdar
caa852061a [box-tests] Ignored a test for K/N
More info in https://youtrack.jetbrains.com/issue/KT-44571
2021-06-16 17:25:07 +05:00
Abduqodiri Qurbonzoda
59031543e2 Throw on invalid AbstractMutableList.addAll index #KT-47211 2021-06-16 11:59:46 +00:00
Nikita Nazarov
7e44cddbab Introduce the fragment compiler backend to the debugger infrastructure 2021-06-16 13:58:18 +03:00
pyos
aa47191de4 JVM: hide ExpressionCodegen in finally block generation during inlining 2021-06-16 12:13:32 +02:00
pyos
108bd01698 JVM: refine the stack spilling around inline calls
Not all suspend functions need it - only those with suspension points.
2021-06-16 12:13:32 +02:00
pyos
b136acb185 JVM: move callSiteFile to InlineCallSiteInfo 2021-06-16 12:13:32 +02:00
pyos
6c1a5e1211 JVM: make inline function argument processing a bit shorter 2021-06-16 12:13:32 +02:00
pyos
392e4fba42 JVM: fix inlining of default lambdas of signature (Result) -> Any
They have no `invoke` bridge, and the overridden invoke expectes a boxed
`Result` as an argument.
2021-06-16 12:13:32 +02:00
pyos
a0a14d9e25 JVM: remove descriptors from SourceCompilerForInline
Printing the call site source on errors isn't really useful anyway - the
old backend points to a specific PsiElement, and JVM_IR wraps the
exception in FunctionCodegen (and printing the source never worked with
JVM_IR anyway).
2021-06-16 12:13:32 +02:00
pyos
32ad747632 JVM: load default lambda method nodes immediately
The ones that are not needed are filtered out before DefaultLambda is
even constructed anyway, and this way we need fewer lateinit vars.
2021-06-16 12:13:32 +02:00
pyos
1e953eaf01 JVM: remove contextKind from SourceCompilerForInline
Guess what? It's only useful for the old backend's type mapper!
2021-06-16 12:13:32 +02:00
pyos
1109348b6d JVM: remove lookupLocation from SourceCompilerForInline 2021-06-16 12:13:32 +02:00
pyos
b6e9f64e18 JVM: remove functionDescriptor from InlineCodegen 2021-06-16 12:13:32 +02:00
pyos
d89e2d9f08 JVM: split inline intrinsics into "needed by JVM_IR" and "not"
or, alternatively, "suspend" and "not".
2021-06-16 12:13:32 +02:00
pyos
eb4d831d27 JVM_IR: implement typeOf<T> as a codegen intrinsic
rather than a fake inline function.

Also, generate more correct instructions for typeOf. Not sure how that
even worked before - `aconst(Boolean)` isn't even valid.
2021-06-16 12:13:32 +02:00
pyos
7dbf08ae1c JVM: move loadCompiledInlineFunction out of InlineCodegen 2021-06-16 12:13:32 +02:00
pyos
8307367f90 JVM: don't thread callDefault through the inliner
It's only used by the old backend, and should be given to
PsiSourceCompilerForInline by PsiInlineCodegen.
2021-06-16 12:13:32 +02:00
sebastian.sellmair
6dd598c7a7 [Gradle] Enable Kotlin tooling metadata artifact by default
^KT-44584
2021-06-16 09:44:32 +00:00
Igor Chevdar
a1e5bef3ad [box-tests] Ignored some tests for K/N
A file included twice in a source set is not supported for now
2021-06-16 14:27:14 +05:00
Iaroslav Postovalov
0ba3ddcc29 Minor. Fix a typo, change visibility of internal object 2021-06-16 10:22:44 +03:00
Svyatoslav Scherbina
e324c9b3fb Generate initRuntimeIfNeeded() at the beginning of staticCFunction
#KT-44283 Fixed
2021-06-16 06:39:51 +00:00
Yaroslav Chernyshev
6e9739caec Add regression test for MPP android source set with resources 2021-06-16 09:32:45 +03:00
Georgy Bronnikov
f0f01db66e Temporarily mute a failing test 2021-06-16 01:48:28 +03:00
Ilya Kirillov
39e2df6916 FIR IDE: render unresolved types as qualifiers for member generator 2021-06-16 01:17:44 +03:00
Ilya Kirillov
cf7870e376 FIR IDE: implement toString for KtType 2021-06-16 01:17:43 +03:00
Ilya Kirillov
af9e6253e4 FIR IDE: add ability to specify type argument in KtClassTypeBuilder 2021-06-16 01:17:42 +03:00
Ilya Kirillov
148c90dd1e FIR IDE: do not make KtTypeArgumentWithVariance abstract
As it does not require specific FIR implementation
2021-06-16 01:17:41 +03:00
Ilya Kirillov
6a9c49dd9d FIR IDE: rename coneType parameter in KtFirType constructors to not accidentally leak it via lambdas 2021-06-16 01:17:40 +03:00
Ilya Kirillov
1d1eab6947 FIR IDE: make KtSymbolByFirBuilder to be a weak ref in KtType to avoid memory leaks 2021-06-16 01:17:39 +03:00
Ilya Kirillov
73bb2e76f2 FIR IDE: introduce KtFirDefinitelyNotNullType 2021-06-16 01:17:38 +03:00
Ilya Kirillov
8177a70ff9 FIR IDE: introduce KtCapturedType 2021-06-16 01:17:36 +03:00
Ilya Kirillov
e2cfd933f1 FIR IDE: introduce HL API for creating class types 2021-06-16 01:17:35 +03:00
Ilya Kirillov
8094a5448d FIR IDE: render error message for KtClassErrorType 2021-06-16 01:17:34 +03:00
Ilya Kirillov
0a6c96492a FIR IDE: simplify KtType hierarchy
- get rid of Kt(Non)DenotatbleType super classes as unused
- make KtErrorType to inherit KtClassType to be consistent with FIR
2021-06-16 01:17:32 +03:00
Tianyu Geng
f6078b24df FIR IDE: AddToString quickfix 2021-06-15 20:19:53 +02:00
Tianyu Geng
1b8b5b9a79 FIR IDE: move AddToStringFix to fe-independent 2021-06-15 20:19:52 +02:00
Tianyu Geng
4bedf41f9c FIR IDE: RemoveNulalbleFix quickfix 2021-06-15 20:19:52 +02:00
Tianyu Geng
b10de3dd2d FIR IDE: Move RemoveNullableFix to fe-independent 2021-06-15 20:19:52 +02:00
Victor Petukhov
559bedf5ae Continue processing not builder inference stub variables in the type checker during computing common super type
^KT-47148 Fixed
2021-06-15 17:40:56 +03:00
Victor Petukhov
85f4cec948 Don't ignore Java nullability annotations without target and unresolved when nullability qualifiers are extracted, with enabled type enhancement improvements
^KT-47276 Fixed
2021-06-15 17:28:25 +03:00
Mads Ager
ae03e2983d [JVM_IR] Keep track of catch variable gaps.
This ensures that catch variables are not visible in duplicated
finally blocks generated at an exit within the catch variable
scope.

^KT-46449 Fixed
2021-06-15 15:18:59 +02:00
Elena Lepilkina
6aba6ea670 [K/N][perf] Fix separator stayed wrong after migrating from groovy 2021-06-15 11:39:25 +00:00
Victor Petukhov
9fa0cf132f Regenerate idea fir low level api tests 2021-06-15 12:52:06 +03:00
Pavel Punegov
f9d5cc90a8 [native] Disable test that fail due to the unaligned int64 access 2021-06-15 11:51:43 +03:00
Vasily Levchenko
695339e21f [k/n][tests][debugger] test for KT-47198. 2021-06-15 08:04:19 +00:00
Vasily Levchenko
524a9351de [k/n][tests][debugger] modify test to conform KT-47198 2021-06-15 08:04:18 +00:00
Vasily Levchenko
81fd6126d9 [k/n][codegen][d/i] dont generate debug line information for prolog and {locals,stack}_init
- fixes KT-47198
2021-06-15 08:04:17 +00:00
Vasily Levchenko
bb42e601ab [k/n][tests][lldb] add quit to each lldb tests. 2021-06-15 08:04:17 +00:00
Victor Petukhov
1b82227308 Don't do new captured type specific checks for old ones in the type checker
^KT-47143 Fixed
2021-06-15 10:07:20 +03:00
Nikita Bobko
02a56a3077 [imltogradle] Fix 'Configuration with name 'compileOnlyApi' not found' 2021-06-14 16:56:55 +02:00
Nikita Bobko
ce0bef6b60 Update 211 platform version for Kotlin plugin 2021-06-14 16:56:55 +02:00
Nikita Bobko
3bf7eef4d8 [imltogradle] Generate maven repos based on 'jarRepositories.xml' from Community
This commit minimizes difference between build.gradle.kts
files generated from ultimate & community infrastructure
2021-06-14 16:56:55 +02:00
Jinseong Jeon
ce26d54917 FIR IDE: extract PsiType conversions to KtPsiTypeProvider 2021-06-13 00:10:47 +03:00
Jinseong Jeon
0db510ad8b FIR IDE/UAST: introduce UAST-specific version of analyse 2021-06-13 00:10:46 +03:00
Jinseong Jeon
1517fd0ca0 FIR/UAST: commonoize array access expression 2021-06-13 00:10:45 +03:00
Jinseong Jeon
ef8eddf1da FIR UAST: add array access tests 2021-06-13 00:10:44 +03:00
Jinseong Jeon
9a539aac7d FIR/UAST: commonize binary expression with type 2021-06-13 00:10:43 +03:00
Jinseong Jeon
b2e644b485 FIR/UAST: commonize type check expression 2021-06-13 00:10:41 +03:00
Jinseong Jeon
6e0f755b39 UAST: migrate kinds constants to the base module 2021-06-13 00:10:39 +03:00
Jinseong Jeon
47ede5bdc8 FIR IDE/UAST: get PsiType from KtTypeReference 2021-06-13 00:10:38 +03:00
Jinseong Jeon
a3710bed6a FIR/UAST: commonize type reference expression 2021-06-13 00:10:37 +03:00
Jinseong Jeon
517fd24f14 UAST: unify implementation/creation of type reference expression 2021-06-13 00:10:36 +03:00
Jinseong Jeon
fa36098214 FIR IDE/UAST: get PsiType from KtExpression 2021-06-13 00:10:34 +03:00
Ilya Kirillov
7d7782e8ff Fix FE1.0 intention test 2021-06-12 23:53:46 +03:00
Mark Punzalan
235f4200df FIR IDE: Add descriptions for HLAddAccessorIntentions (copied from FE
1.0 implementations).
2021-06-12 23:53:45 +03:00
Mark Punzalan
9b5f754e75 FIR IDE: Enable add accessors quickfix for MUST_BE_INITIALIZED.
Also added diagnosticFixFactoriesFromIntentionActions() to share
quickfix-creation across multiple diagnostics with the same PSI.
2021-06-12 23:53:44 +03:00
Mark Punzalan
cd6dbd2515 FIR IDE: Assert that the action to invoke in
AbstractHighLevelQuickFixTest is of type QuickFixActionBase.
2021-06-12 23:53:43 +03:00
Mark Punzalan
783e5972d0 FIR IDE: Ensure all fixes provided by HLDiagnosticFixFactory are of type
QuickFixActionBase.

This allows us to verify in the quickfix tests that the action comes
from a diagnostic-based quickfix, and not an available intention. We
are adding APIs that wrap IntentionActions as QuickFixActionBase.
2021-06-12 23:53:42 +03:00
Mark Punzalan
43a8299f48 FIR IDE: Delete AddAccessorsIntention in favor of
HLAddAccessorIntentions.
2021-06-12 23:53:41 +03:00
Mark Punzalan
91e62832ee FIR IDE: Add applicability range to HLAddAccessorIntention (copied from
FE 1.0's logic) and actually check the range in AbstractHLIntention.
2021-06-12 23:53:40 +03:00
Mark Punzalan
a497dd1d31 FIR IDE: Enable add accessor intentions in plugin. 2021-06-12 23:53:39 +03:00
Ilya Kirillov
4f12966d66 FIR IDE: warn about enabled Android plugin 2021-06-12 19:40:43 +03:00
Ilya Kirillov
af7766b3ac FIR IDE: add fir icon to status bar to distinguish fir/fe10 ide 2021-06-12 19:40:42 +03:00
Jinseong Jeon
8977e7766b FIR/UAST: commonize throw expression 2021-06-12 16:00:43 +02:00
Jinseong Jeon
c21fce6cbc FIR/UAST: commonize parenthesized expression 2021-06-12 16:00:42 +02:00
Jinseong Jeon
c089b8ed04 FIR/UAST: commonize labeled expression 2021-06-12 16:00:41 +02:00
Jinseong Jeon
6e1b04e4c9 FIR/UAST: commonize if expression 2021-06-12 16:00:40 +02:00
Jinseong Jeon
50f750187b FIR/UAST: commonize loop/break/continue expressions 2021-06-12 16:00:39 +02:00
Jinseong Jeon
1146f60db3 FIR/UAST: commonize block and return expressions 2021-06-12 16:00:37 +02:00
Jinseong Jeon
16b3d2110e FIR/UAST: commonize literal expressions 2021-06-12 16:00:36 +02:00
Jinseong Jeon
6b5bddeed7 FIR/UAST: commonize KotlinEvaluatableUElement 2021-06-12 16:00:35 +02:00
Jinseong Jeon
ce10410aba FIR UAST: refactor FE1 UAST tests 2021-06-12 16:00:34 +02:00
Jinseong Jeon
e1a99ede09 FIR UAST: introduce values tests 2021-06-12 16:00:32 +02:00
Jinseong Jeon
cf2f36fa49 UAST: utilize values test base 2021-06-12 16:00:31 +02:00
Jinseong Jeon
d17dd4a1e6 FIR/UAST: commonize KotlinUElementWithType 2021-06-12 16:00:30 +02:00
Jinseong Jeon
1025851edd FIR UAST: introduce types tests 2021-06-12 16:00:29 +02:00
Jinseong Jeon
6afb68cec0 UAST: utilize types test base 2021-06-12 16:00:28 +02:00
Vyacheslav Gerasimov
06b4fe1613 Build: Fix kotlin-stdlib-jvm-minimal-for-test usages
Name changed after publishing with main artifacts for external usage
2021-06-12 04:33:32 +03:00
Steffi Stumpos
8baf570ee7 Build: Publish the new compiler test infrastructure 2021-06-12 04:33:31 +03:00
Mikhail Glukhikh
af5e2f3c93 FIR checkers: properly handle annotations with more than one argument 2021-06-11 22:03:33 +03:00
Mikhail Glukhikh
ceb527c5e4 FIR: add OptIn checkers draft + some annotation / SinceKotlin utilities 2021-06-11 22:03:32 +03:00
Mikhail Glukhikh
bd39e457a7 FIR: make ArrayMapOwner.arrayMap really protected 2021-06-11 22:03:32 +03:00
Mikhail Glukhikh
0972020324 Extract common parts from ExperimentalUsageChecker 2021-06-11 22:03:32 +03:00
Mikhail Glukhikh
f0453d2f5c FIR: distinguish qualified access / qualified access expression checkers 2021-06-11 22:03:32 +03:00
Mads Ager
6b6ba77869 [JVM_IR] Trim the expression test string for null assertions.
^KT-47166 Fixed.
2021-06-11 21:54:04 +03:00
Alexander Shabalin
58adfd8488 Disable enum and object isFrozen tests on wasm 2021-06-11 18:12:15 +00:00
Roman Golyshev
3f0cc67f17 Fix converting string GLOB to regexp in TestConfigurationBuilder
This is required when `p1|p2|p3|...|pN` concatenation is used (see `or`
extension function above `toMatchingRegexString`)

This is a follow-up to the 6f4b6c1b5b7bc05557306179e25a79fa234aa77f
commit
2021-06-11 20:06:04 +03:00
Roman Golyshev
30f20cb835 Use more reliable paths matching in TestConfigurationBuilder
Without it, even the slightest difference between the pattern and
testDataPath would cause the path to be excluded, for example:

testDataPath = /some/absolute/path.txt
pattern = absolute/*

The example above didn't match, and it resulted in different
configurations when tests were launched with different testDataPaths

Now, the example above will look like this:

testDataPath = /some/absolute/path.txt
patter = */absolute/*

Now it matches correctly
2021-06-11 20:06:03 +03:00
nataliya.valtman
d42a6771b0 Update statistics that should be sent to ES
Next properties should be set in gradle.properties or via -D option:
systemProp.kotlin.plugin.stat.password
systemProp.kotlin.plugin.stat.user
systemProp.kotlin.plugin.stat.enabled=true
systemProp.kotlin.plugin.stat.label
systemProp.kotlin.plugin.stat.endpoint=es_endpoint/index/_doc
kotlin.build.report.verbose=true
kotlin.build.report.enable=true
2021-06-11 19:12:05 +03:00
Dmitry Petrov
bf077b893c PSI2IR KT-47245 handle declaration statements in control structures 2021-06-11 16:42:31 +03:00
pyos
3be348f910 JVM_IR: fix parentClassId for property accessors 2021-06-11 15:03:13 +02:00
pyos
d4485bc475 JVM: remove unused methodOwner from InlineCodegen 2021-06-11 15:03:13 +02:00
pyos
ed26e97df8 JVM: refactor loading of inline functions from binaries
The IR path no longer does any descriptor unwrapping or old-style type
mapping.
2021-06-11 15:03:13 +02:00
pyos
7bcd738bb1 JVM: inline createInlineMethodNode into InlineCodegenForDefaultBody
Most of it is unused, since there we know the target function will also
need to be compiled from source.
2021-06-11 15:03:13 +02:00
pyos
4c7eb815fc JVM: remove some FunctionDescriptors from SourceCompilerForInline 2021-06-11 15:03:13 +02:00
pyos
a24ad233ee JVM: move PsiSourceCompilerForInline to a separate file 2021-06-11 15:03:13 +02:00
pyos
955b9260d1 JVM: move more old backend code out of InlineCodegen 2021-06-11 15:03:13 +02:00
pyos
043452fb62 JVM: make handling of captured params for default lambdas shorter 2021-06-11 15:03:13 +02:00
pyos
4cae880b44 JVM: remove unused DefaultLambda.parameterOffsetsInDefault 2021-06-11 15:03:13 +02:00
pyos
8a3af851d9 JVM: pregenerate inline lambda bodies as early as possible
Which in JVM_IR is immediately in `genValueAndPut`, but for the old
backend needs to be delayed until `genCallInner` for some reason.
2021-06-11 15:03:13 +02:00
pyos
90412ade8a JVM: remove second parameter of putClosureParametersOnStack
Only used by the old backend.
2021-06-11 15:03:13 +02:00
pyos
d4c8a033b1 JVM: remove BaseExpressionCodegen.pushClosureOnStack
It's only used by the old backend
2021-06-11 15:03:13 +02:00
pyos
b6c3c9942d JVM: move activeLambda to PsiInlineCodegen 2021-06-11 15:03:13 +02:00
pyos
7333abf50d JVM: purge redundant val BaseExpressionCodegen.v 2021-06-11 15:03:13 +02:00
pyos
1f9db7cf25 FE: properly clear the deferred generator stack
Before this commit the stack wasn't cleared for read variable case.
#KT-47168 Fixed
2021-06-11 15:56:20 +03:00
Sergey Bogolepov
2f632ada42 [Native] Remove unused code 2021-06-11 12:18:15 +00:00
Sergey Bogolepov
36386de9a2 [Native] Drop explicit -fPIC flag setup
We don't need to explicitly set -fPIC flag everywhere
because since d82109cc92
it is set by default for all ClangArgs users.
2021-06-11 12:18:14 +00:00
Sergey Bogolepov
7550351702 [Native] Fix runtime code according to Clang 11 warnings 2021-06-11 12:17:00 +00:00
Georgy Bronnikov
91387e644f IR: repair collectAndFilterRealOverrides 2021-06-11 15:05:45 +03:00
Georgy Bronnikov
7e6782d684 JVM_IR: simplify resolveFakeOverride call in SyntheticAccessorLowering 2021-06-11 15:05:45 +03:00
Georgy Bronnikov
fca804de14 IR: properly compute IrProperty.resolveFakeOverride()
Now that IrProperty has its own overriddenSymbols, we can generalize the
search for fake overrides. Also works for fake override properties
derived from Java fields.
2021-06-11 15:05:45 +03:00
Jinseong Jeon
3769fd8e07 FIR UAST: fix import resolve test
The `resolve` failure (or `null` return) of import directive for
`java.lang.Thread.sleep` is legitimate, since there are two static methods
in `java.lang.Thread`:
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Thread.html
hence not able to resolve to a single method.

Unless we change `UImportStatement` to be a subtype of `UMultiResolvable`,
instead of `UResolvable`, we can't properly test `resolve` API for that.
2021-06-11 14:51:07 +03:00
Yahor Berdnikau
da25d58fa7 Control cache redirector status in test via project settings.
Test will use project `gradle.properties` file to get current
cache redirector status, so it could be controlled from one place.

^KT-47185 Fixed
2021-06-11 11:44:36 +00:00
Yahor Berdnikau
7b1db6992e Enable cache redirector for old tests setup.
^KT-47185 Fixed
2021-06-11 11:44:35 +00:00
Yahor Berdnikau
e98de36aaa Enable cache redirector for Junit5 tests.
^KT-47185 In Progress
2021-06-11 11:44:34 +00:00
Yahor Berdnikau
5d0abf0e33 Lazily apply cache redirector to all project modules.
Mainly move it from 'afterEvaluate { .. }' block.

^KT-47185 In Progress
2021-06-11 11:44:34 +00:00
Viacheslav Kormushkin
3c0709cf4f A new DSL for framework configuration within cocoapods block
#KT-46479
#KT-35723
2021-06-11 11:10:49 +00:00
Mikhail Glukhikh
5a3f84c8fa Add forgotten test data file 2021-06-11 13:17:01 +03:00
Svyatoslav Scherbina
b13e7d1e28 Native: enable more Obj-C interop tests for new MM 2021-06-11 07:35:50 +00:00
Svyatoslav Scherbina
79d4047e86 Native: improve thread state switching for Obj-C interop 2021-06-11 07:35:49 +00:00
Svyatoslav Scherbina
85ab4f68df Native: support reentrant mode for CalledFromNativeGuard 2021-06-11 07:35:48 +00:00
sebastian.sellmair
1bcafd3cd0 [Gradle] commonizeCInterop task: Require hierarchical commonization to be enabled
^KT-47133 Verification Pending
2021-06-11 07:03:24 +00:00
Roman Golyshev
d781902626 Add possibility to use baseDir in SpecHelpersSourceFilesProvider
In IJ infrastructure we have specific path prefix for compiler testData
2021-06-11 02:28:39 +03:00
Vladimir Dolzhenko
2c8d583d8b Added ad-hoc KtValueArgument.stringTemplateExpression
Use only stub stringTemplateExpression if it is present and don't use ast nodes as it could be unbounded

#KT-47034 Fixed
2021-06-10 21:14:32 +00:00
Yahor Berdnikau
a383c1ce79 Ensure kapt tasks don't capture sources state in configuration cache.
Kapt tasks have captured sources state inside SourceRoots container
internal collection, that was cached by configuration cache.
This lead to the compilation errors whenever sources files
were changed (deleted or renamed), because kapt still expected
previous file state to exist.

Now SourceRoots will not create internal collection, but rather
reuse standard Gradle FileCollection methods that perform required
calculations dynamically.

^KT-46651 Fixed
2021-06-10 20:00:39 +00:00
Yahor Berdnikau
3d36e11e80 Make 'kapt.verbose' property compatible with configuration cache.
^KT-46651 In Progress
2021-06-10 20:00:38 +00:00
Ilya Kirillov
c4b1fa8ec0 Fix FE1.0 plugin testdata after adding // IGNORE_FIR directive 2021-06-10 19:05:33 +02:00
Ilya Kirillov
bc306a5195 FIR IDE: Regenerate quickfix tests 2021-06-10 19:05:33 +02:00
Tianyu Geng
90a0c9bb25 FIR IDE: quickfix to add override keyword
Also enables more tests that covers previous quickfixes
2021-06-10 19:05:33 +02:00
Alexander Likhachev
1658f4433d [Build] Update Gradle Enterprise plugin to 3.6.2 2021-06-10 18:39:21 +03:00
Alexander Likhachev
17991c5b6e [Build] Update common-custom-user-data-gradle-plugin to 1.4
Now the plugin detects IDEA via system properties using Gradle providers and shoudn't cause undeclared system property reads issue
#KT-44611 In Progress
2021-06-10 18:39:20 +03:00
Nikita Bobko
debc0d2b93 Add .idea/libraries-with-intellij-classes.xml to .gitignore 2021-06-10 17:37:50 +02:00
Vladimir Dolzhenko
1eb04d5440 Support Kotlin 1.5 / 1.6 language versions come from external sources
#KTIJ-15743 Fixed

Original commit: 784f77a2b98b0c9719f4919e45a193f35d7d9875
2021-06-10 13:12:36 +00:00
Dmitriy Novozhilov
1a0516e2c8 Fix codebase according to KT-47225 2021-06-10 16:01:18 +03:00
Tianyu Geng
baa3a3c81d FIR IDE: ignore smartcast if it's unstable in HL API 2021-06-10 16:01:17 +03:00
Tianyu Geng
78401b3ae0 FIR: add helper to check if a smartcast expressioin is stable 2021-06-10 16:01:16 +03:00
Tianyu Geng
3c8693758b FIR: handle synthetic properties with unstable smartcast
Synthetic properties from Java getter/setters need to be specially
handled so that candidates from such symbols are marked with unstable.
2021-06-10 16:01:14 +03:00
Tianyu Geng
ce767046eb FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-10 16:01:13 +03:00
Tianyu Geng
2bb7ef9747 FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more
places during DFA. Now mutable properties, property with custom getters,
delegated properties, etc are also treatd as a `RealVariable`. In
general this is needed in order to carry out smartcast computation in
order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side
effects that improves behavior of some test files.
2021-06-10 16:01:11 +03:00
Tianyu Geng
97ea37c82f FIR: add smartcast stability to FIR 2021-06-10 16:01:09 +03:00
Nikita Bobko
02bd17a4e2 Add compiler/fir/raw-fir/psi2fir/testData to testdata which is used by Kotlin plugin in IJ infra 2021-06-10 12:16:16 +02:00
Alexander Shabalin
cf47d95aa5 Rename SingleThreadMarkAndSweep into SameThreadMarkAndSweep 2021-06-10 09:59:38 +00:00
Alexander Shabalin
9ebba93dd9 Make SingleThreadMarkAndSweep support multiple threads 2021-06-10 09:59:37 +00:00
Alexander Shabalin
10ae9c511b Allow filtering of gtest tests 2021-06-10 09:59:37 +00:00
Svyatoslav Scherbina
11fb8677c6 Update kotlin-native/gradlew to 6.8.3
to match gradlew at repo root directory
2021-06-10 09:24:15 +00:00
Sebastian Sellmair
4e7460d91f Merge KT-MR-3320 from rra/sellmair/kt-46957-enable_linuxMips32_in_tests 2021-06-10 09:14:17 +00:00
Andrey Zinovyev
371452d49a [FIR] Fix CANNOT_BE_IMPORTED for java static methods/variables 2021-06-10 11:28:34 +03:00
Dmitriy Dolovov
2b161581ca K/N: Use class FQN in default toString() implementation
^KT-47167
2021-06-10 11:02:21 +03:00
Dmitriy Dolovov
d42ff069f6 [Native][IR] Move verbose RTTI for local classes and anonymous objects
^KT-45304
2021-06-10 11:02:16 +03:00
Dmitriy Dolovov
6bac016b3a [IR] Support top-level callables in InventNamesForLocalClasses lowering
^KT-45304
2021-06-10 11:02:10 +03:00
Dmitriy Dolovov
9861cb0438 [IR] Commonize InventNamesForLocalClasses lowering
^KT-45304
2021-06-10 11:02:04 +03:00
Yaroslav Chernyshev
6f8b3f22ca Fix adding non-directory to resources for Android source set
#KTIJ-17113 Fixed
2021-06-10 10:26:42 +03:00
Ilya Kirillov
e12f3ff88a FIR IDE: fix compilation 2021-06-09 22:49:57 +03:00
Mark Punzalan
befa8aaac7 FIR IDE: Enable add initializer quickfix for MUST_BE_INITIALIZED. 2021-06-09 22:49:56 +03:00
Mark Punzalan
bb2246ebaf FIR IDE: Add diagnosticFixFactories() API to share quickfix-creation
across multiple diagnostics with the same PSI.
2021-06-09 22:49:55 +03:00
Mark Punzalan
2773506f4c FIR IDE: Don't offer AddExclExclCallFix when expression is definitely
null.
2021-06-09 22:49:52 +03:00
Mark Punzalan
97ea901507 FIR IDE: Add isDefinitelyNull() and isDefinitelyNotNull() to
KtExpressionTypeProvider.
2021-06-09 22:49:51 +03:00
Mark Punzalan
c6427d57f1 FIR IDE: Enable AddExclExclCallFix for ASSIGNMENT_TYPE_MISMATCH and
INITIALIZER_TYPE_MISMATCH.
2021-06-09 22:49:50 +03:00
Mark Punzalan
eddc590aaf FIR: Rename parameters for (ASSIGNMENT|RESULT)_TYPE_MISMATCH. 2021-06-09 22:49:49 +03:00
Nikolay Krasko
b6b983aa2a Update kotlin:kotlin-build-gradle-plugin 0.0.29 -> 0.0.30 (KTI-563)
Remove ultimate mentioning
2021-06-09 22:19:53 +03:00
Nikolay Krasko
ee3fe6c605 Add dependency on dist in tests of kotlin.core.descriptors.runtime
JvmRuntimeDescriptorLoaderTestGenerated fails without stdlib.
2021-06-09 20:05:27 +03:00
Nikolay Krasko
85bc1d6aa2 Remove org.jfrog.buildinfo:build-info-extractor-gradle
There were some conflicts that shouldn't be an issue anymore.

Revert: 713f6e1ed3
2021-06-09 20:05:25 +03:00
Nikolay Krasko
965eff66ce Add information about protected branches 2021-06-09 20:05:24 +03:00
Nikita Bobko
3aebd0315f Make it possible to run DiagnosisCompilerTestDataSpecTestGenerated from fir-low-level-api in IJ infra 2021-06-09 19:44:08 +03:00
Nikita Bobko
294ec3905b [cleanup] Remove unused AbstractSymbolByFqNameTest 2021-06-09 19:44:06 +03:00
Andrey Uskov
446eb390ef Update Gradle version used in project to 6.9 2021-06-09 19:06:18 +03:00
Alexander Shabalin
b1e0e43ba4 Add isFrozen test on object 2021-06-09 15:03:15 +00:00
Nikolay Krasko
48a4d7d418 Build: drop maven publication for Kotlin plugin artifacts 2021-06-09 17:43:54 +03:00
Nikolay Krasko
32f811e0ec Build: Cleanup old platforms from the build 2021-06-09 17:43:53 +03:00
Nikolay Krasko
a4005cef19 Build: Drop ultimate, cidr and kmm from the build (KTI-563) 2021-06-09 17:43:52 +03:00
Alexander Likhachev
9a4ff6e201 [Gradle, JS] Add libraries filter caching in compile task
Previously any compile task was honestly reading dependency metadata from filesystem to check whether it's K/JS module even if another compile task already tested this dependency. Now the result of check is cached in build service that is cleared after build finish. It can save many rebuild time on incremental compilation of complex projects.
#KT-47154 Fixed
2021-06-09 17:25:56 +03:00
Dmitry Petrov
dbb933e6a6 JVM use instruction liveness analysis instead of DFA in DCE 2021-06-09 17:04:47 +03:00
Dmitry Petrov
3d8735c978 Minor: add excluded path to CodeConformanceTest 2021-06-09 17:04:46 +03:00
Nikita Bobko
2c92a60878 Fix obvious 'disableKotlinPluginModules' logging mistake 2021-06-09 15:44:10 +02:00
Nikita Bobko
a7894a6298 Introduce 'disableKotlinPluginModules' flag
We are about to drop Kotlin plugin sources from Kotlin repo
(since they are merged into intellij-commmunity repo).
Let's introduce the flag which we could use for testing
2021-06-09 15:41:37 +02:00
Tianyu Geng
32f55a2269 FIR checker: report VIRTUAL_MEMBER_HIDDEN 2021-06-09 16:27:49 +03:00
Tianyu Geng
d3dfb33f89 FIR: consolidate duplicated logic in FirOverrideChecker 2021-06-09 16:27:26 +03:00
Nikita Bobko
8bb98f8f86 [imltogradle] Do not resolve transitive dependencies in gralde if don't resolve them in JPS
This fixes problems of Gradle not being possible to find transitive maven artifacts
if actually we don't need them
2021-06-09 15:16:18 +02:00
Pavel Kirpichenkov
d76bb45716 [Commonizer] Add CommonizerHierarchicalIT
Test platform dependencies on leaf source sets
^KT-46716 Verification pending
2021-06-09 12:49:07 +00:00
Pavel Kirpichenkov
5f7576e546 [Commonizer] Use original K/N distribution libraries for leaf targets
^KT-46716
2021-06-09 12:49:04 +00:00
Mikhail Glukhikh
c33608e009 FIR: don't render resolved type annotations in favor of attributes 2021-06-09 15:42:43 +03:00
Mikhail Glukhikh
06379ec587 FIR: handle varargs properly during annotation serialization 2021-06-09 15:42:42 +03:00
Mikhail Glukhikh
da671eedc9 FIR: avoid CCE in constants during annotation serialization 2021-06-09 15:42:41 +03:00
Mikhail Glukhikh
3127fad23d FIR: more precise annotation argument serialization 2021-06-09 15:42:39 +03:00
Mikhail Glukhikh
491267b4f7 FIR2IR: convert annotations on local variables 2021-06-09 15:42:38 +03:00
Mikhail Glukhikh
77dd0ad396 FIR: handle custom attributes more precise 2021-06-09 15:42:37 +03:00
Mikhail Glukhikh
4f70f47fa6 FIR2IR: convert annotations on type parameters #KT-46967 Fixed 2021-06-09 15:42:36 +03:00
Svyatoslav Scherbina
3412c0bc53 Update kotlin-native/samples to 1.5.10 2021-06-09 12:35:05 +00:00
Andrey Zinovyev
ddc9c1bd1b [FIR] Fix extension property reference resolution
On type with star projection
#KT-44372 Fixed
2021-06-09 15:15:28 +03:00
Mikhail Glukhikh
2b4ea8e6e7 Add forgotten test data 2021-06-09 14:59:57 +03:00
Vasily Levchenko
89b589846b Merge KT-MR-3224 from rrn/minamoto/kt-33364 2021-06-09 11:50:28 +00:00
Ilya Goncharov
dd9ea9f9eb [Gradle, JS] Actualize versions of npm dependencies
^KT-46608 fixed
^KT-47176 fixed
2021-06-09 14:49:33 +03:00
pyos
ade8b0a7d3 JVM_IR: box bound receiver before calling the reference constructor
This is needed for the inliner: since the information about Kotlin type
of the bound receiver is nowhere in the output binary, the inliner will
have no clue how to box inline class values. Moving the boxing outside
the object means the inliner doesn't need to know about it; from its
point of view, the captured value has type `Any`.
2021-06-09 14:36:07 +03:00
nataliya.valtman
117c99aee6 send build stat to ES 2021-06-09 13:25:10 +03:00
Sergey Igushkin
14a7e90c69 KT-38954: Filter Android attributes during publishing
* Always filter out the variant name attribute: it is never requested
  by consumers, while its presence makes Gradle count it as an
  unmatched attribute, sometimes leading to ambiguity;

* Filter out the build type attribute: if all variants have the same
  build type, then remove the build type attribute from all variants;
  Otherwise, remove the build type attribute from the release variants
  in order to make them compatible with all other consumer's build 
  types.

  * Add an opt-out flat for always keeping the attribute:
    "kotlin.android.buildTypeAttribute.keep" Gradle property

Issue #KT-38954 Fixed
2021-06-09 10:18:15 +00:00
sebastian.sellmair
4e508c6d9c Update K/N version to 1.5.30-dev-1916
^KT-46957
2021-06-09 11:53:58 +02:00
sebastian.sellmair
f9901a5d50 [Commonizer] CommonizerIT: Enable linuxMips32 target
^KT-46957
2021-06-09 11:47:57 +02:00
Vasily Levchenko
79600f32d2 [codegenerator][refactor] extract method for tramboline generation 2021-06-09 11:39:57 +02:00
Vasily Levchenko
0651f7de20 [kotlin-native][tests] kt-33364 test added 2021-06-09 11:39:56 +02:00
Vasily Levchenko
bebede9e4f [codegeneration][debug info] enchance debugger behaviour for paramterless when
- generates tramboline like a11b07f6c3 on -Xg-generate-when-marker=enable
- fixes issue KT-33364
2021-06-09 11:39:55 +02:00
Vladimir Dolzhenko
de76aeb9d1 Optimize SdkInfo lookup for a huge monorepo with no SdkInfo
DFS of SdkInfo on moduleInfo and reuse cached libraryInfo dependencies
fix traverse order

#KT-47065 Fixed
Relates to #KT-46622
2021-06-09 08:31:46 +00:00
Andrey Zinovyev
972cd9e9e7 [FIR] Fix PACKAGE_CANNOT_BE_IMPORTED diagnostic
Don't report it when there is a function/property with the same name as
package
2021-06-09 09:02:49 +03:00
Yahor Berdnikau
ec705d88a5 Allow to enable Gradle debug for particular builds.
^KT-45745 In Progress
2021-06-08 21:05:39 +02:00
Yahor Berdnikau
90238978ee Update block to print build info on error.
^KT-45745 In Progress
2021-06-08 21:05:38 +02:00
Yahor Berdnikau
b0b646037e Print build output on build result assertion failure.
^KT-45745 In Progress
2021-06-08 21:05:38 +02:00
Yahor Berdnikau
5b60ef7d54 Allow to enable force output for specific builds.
^KT-45745 In Progress
2021-06-08 21:05:38 +02:00
Yahor Berdnikau
8b17888a18 Fix typo in annotation name.
^KT-45745 In Progress
2021-06-08 21:05:35 +02:00
Aleksei.Cherepanov
35c067b215 Fix import for JPS build of Kotlin repo
Changed link of configuration on TC for getting artifacts
from "Compiler Dist (202) and Maven Artifacts"
to "Kotlin / Kotlin Public / Aggregate"
2021-06-08 22:01:31 +03:00
Denis.Zharkov
2653565f56 FIR: Support exhaustive whens on subjects of intersection type 2021-06-08 18:59:48 +03:00
Anton Lakotka
c8b9a3a6f0 Disallow unsafe reads of KPM PluginData from Compile Task 2021-06-08 15:49:05 +00:00
Anton Lakotka
52abecab43 Rename sensitive flag to isTransient and inverse logic, add file outputs
isTransient with default value as false makes it a bit more readable
Some Compiler Plugins can use file outputs properties to dump some data
there and gradle can support incremental build
with file outputs.
2021-06-08 15:49:05 +00:00
Anton Lakotka
70a2678bbc Add integration test for kpm compiler plugin sensitive options 2021-06-08 15:49:04 +00:00
Anton Lakotka
c01be75f47 Reuse code in MetadataCompilationTasksConfigurator for native task 2021-06-08 15:49:03 +00:00
Anton Lakotka
28fe070a2f Track plugin options with indices 2021-06-08 15:49:02 +00:00
Anton Lakotka
bc7ff04f1f Store sensitive plugin options in Task inputs 2021-06-08 15:49:01 +00:00
Anton Lakotka
9e084a7256 Fix overload call of project.files in abstractVariants.kt 2021-06-08 15:49:01 +00:00
Anton Lakotka
26a2509ebb Add basic test for Kotlin Project Model compiler plugins 2021-06-08 15:49:00 +00:00
Anton Lakotka
a0fb5c31ea Don't configure runtimeDependencyFiles during variant instantiation 2021-06-08 15:48:59 +00:00
Anton Lakotka
5a58c1c437 [Kotlin Project Model] Add compiler plugin support 2021-06-08 15:48:58 +00:00
Nikita Bobko
16e6fe0e08 Fix compilation for some Kotlin plugin modules when IJ infra is attached to kotlin repo
For example it fixes compilation of `:kotlin-ide.kotlin.generators:testClasses`

This commit fixes that Gradle tries to find jars of 202 IDEA in ivy repo of 211 IDEA:
```
* What went wrong:
Execution failed for task ':kotlin-ide.kotlin.tests-common:compileTestKotlin'.
> Could not resolve all files for configuration ':kotlin-ide.kotlin.tests-common:testCompileClasspath'.
   > Could not find extensions-211.6693.111.jar (kotlin.build:ideaIC:211.6693.111).
     Searched in the following locations:
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/lib/extensions.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/extensions.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/intellij-core/211.6693.111/artifacts/extensions.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/plugins/ideaIC/lib/extensions.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/sources/extensions-211.6693.111.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/extensions.jar
   > Could not find guava-29.0-jre-211.6693.111.jar (kotlin.build:ideaIC:211.6693.111).
     Searched in the following locations:
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/lib/guava-29.0-jre.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/guava-29.0-jre.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/intellij-core/211.6693.111/artifacts/guava-29.0-jre.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/plugins/ideaIC/lib/guava-29.0-jre.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/sources/guava-29.0-jre-211.6693.111.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/guava-29.0-jre.jar
   > Could not find asm-all-8.0.1-211.6693.111.jar (kotlin.build:ideaIC:211.6693.111).
     Searched in the following locations:
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/lib/asm-all-8.0.1.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/asm-all-8.0.1.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/intellij-core/211.6693.111/artifacts/asm-all-8.0.1.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/plugins/ideaIC/lib/asm-all-8.0.1.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/sources/asm-all-8.0.1-211.6693.111.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/asm-all-8.0.1.jar
   > Could not find streamex-0.7.2-211.6693.111.jar (kotlin.build:ideaIC:211.6693.111).
     Searched in the following locations:
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/lib/streamex-0.7.2.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/streamex-0.7.2.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/intellij-core/211.6693.111/artifacts/streamex-0.7.2.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/artifacts/plugins/ideaIC/lib/streamex-0.7.2.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/sources/streamex-0.7.2-211.6693.111.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/211.6693.111/streamex-0.7.2.jar
```
2021-06-08 17:18:35 +02:00
Nikita Bobko
bf287c0b85 [imltogradle] Don't generate unnecessary tests-jar with real dependencies when a module doesn't have any source root
This helps to prevent "fake" circular dependencies when
module A depends on tests of module B but module B doesn't have test source roots

In particular this commit fixes when running `:kotlin-ide.kotlin.generators:testClasses` task:
```
Circular dependency between the following tasks:
:kotlin-ide.kotlin.gradle.gradle-tooling:compileTestJava
+--- :kotlin-ide.kotlin.gradle.gradle-tooling:compileTestKotlin
|    \--- :kotlin-ide.kotlin.test-framework:testJar
|         +--- :kotlin-ide.kotlin.test-framework:compileTestKotlin
|         |    +--- :kotlin-ide.kotlin.idea:testJar
|         |    |    +--- :kotlin-ide.kotlin.idea:compileTestKotlin
|         |    |    |    \--- :kotlin-ide.kotlin.gradle.gradle-tooling:testJar
|         |    |    |         +--- :kotlin-ide.kotlin.gradle.gradle-tooling:compileTestKotlin (*)
|         |    |    |         \--- :kotlin-ide.kotlin.gradle.gradle-tooling:testClasses
|         |    |    |              \--- :kotlin-ide.kotlin.gradle.gradle-tooling:compileTestJava (*)
|         |    |    \--- :kotlin-ide.kotlin.idea:testClasses
|         |    |         \--- :kotlin-ide.kotlin.idea:compileTestJava
|         |    |              +--- :kotlin-ide.kotlin.gradle.gradle-tooling:testJar (*)
|         |    |              \--- :kotlin-ide.kotlin.idea:compileTestKotlin (*)
|         |    \--- :kotlin-ide.kotlin.jvm:testJar
|         |         +--- :kotlin-ide.kotlin.jvm:compileTestKotlin
|         |         |    +--- :kotlin-ide.kotlin.gradle.gradle-tooling:testJar (*)
|         |         |    +--- :kotlin-ide.kotlin.idea:testJar (*)
|         |         |    \--- :kotlin-ide.kotlin.repl:testJar
|         |         |         +--- :kotlin-ide.kotlin.repl:compileTestKotlin
|         |         |         |    \--- :kotlin-ide.kotlin.idea:testJar (*)
|         |         |         \--- :kotlin-ide.kotlin.repl:testClasses
|         |         |              \--- :kotlin-ide.kotlin.repl:compileTestJava
|         |         |                   +--- :kotlin-ide.kotlin.idea:testJar (*)
|         |         |                   \--- :kotlin-ide.kotlin.repl:compileTestKotlin (*)
|         |         \--- :kotlin-ide.kotlin.jvm:testClasses
|         |              \--- :kotlin-ide.kotlin.jvm:compileTestJava
|         |                   +--- :kotlin-ide.kotlin.gradle.gradle-tooling:testJar (*)
|         |                   +--- :kotlin-ide.kotlin.idea:testJar (*)
|         |                   +--- :kotlin-ide.kotlin.jvm:compileTestKotlin (*)
|         |                   \--- :kotlin-ide.kotlin.repl:testJar (*)
|         \--- :kotlin-ide.kotlin.test-framework:testClasses
|              \--- :kotlin-ide.kotlin.test-framework:compileTestJava
|                   +--- :kotlin-ide.kotlin.idea:testJar (*)
|                   +--- :kotlin-ide.kotlin.jvm:testJar (*)
|                   \--- :kotlin-ide.kotlin.test-framework:compileTestKotlin (*)
\--- :kotlin-ide.kotlin.test-framework:testJar (*)
```
2021-06-08 17:15:17 +02:00
Sergey Bogolepov
bcd28615a6 [Native] Add initial version of LLVM buildscript
Previously there was no determined way to build LLVM for Kotlin/Native.
This commits adds a Python script that allows to do so on all hosts.
2021-06-08 14:42:43 +00:00
Ilya Matveev
1530a0823f [K/N] Use finalization task to generate report for runtime tests
The approach with doLast doesn't work if the test binary failed.
This patch uses a finalization task instead to ensure that we
process the XML report regardless of whether the tests pass
or fail.
2021-06-08 12:44:14 +00:00
Ilya Matveev
f08d473d3c [K/N][Runtime tests] Support << operator for thread states 2021-06-08 12:44:13 +00:00
Elena Lepilkina
7ed22360f9 [K/N] Use in array varargs optimized implementations of set operators without bound checks 2021-06-08 11:59:56 +00:00
Elena Lepilkina
2cb3a20733 [K/N] Added functions for set/get array operatorswithout bounds check 2021-06-08 11:59:56 +00:00
Leonid Startsev
dd21326425 Create a copy of incorrectly deserialized parent's writeSelf function
To avoid problems during code generation when INVOKEDYNAMIC
is used instead of static

#KT-47161 Fixed
2021-06-08 11:53:47 +00:00
Vladimir Ivanov
7c7905b55c [Native] Disable unaligned float test (not supported yet) (#4434) 2021-06-08 13:18:58 +03:00
Dmitriy Novozhilov
773fc25587 Fix compilation after 3572a96b 2021-06-08 12:16:03 +03:00
Sergey Bogolepov
1ae8e01b32 [Native][MIPS] Add stddef.h to platform.posix on linux
For some reason, ptrdiff_t is missing in platform.posix on MIPS,
yet referenced from platform.linux.__morecore. Fixed by adding parent
header.
This fix is ABI for MIPS targets breaking because some declarations move
from platform.linux to platform.posix package.

^KT-46957 Fixed
2021-06-08 09:02:49 +00:00
Mikhail Glukhikh
0e63484738 Fix OptIn marker usages in code according to new limitation 2021-06-08 11:37:35 +03:00
Mikhail Glukhikh
63bc3f9708 Forbid experimental markers on various targets #KT-45845 Fixed
In this commit we forbid experimental markers on:
- local variables
- value parameters
- fields, including delegate fields
- property getters
2021-06-08 11:37:34 +03:00
Mikhail Glukhikh
eb9c658c1c OptIn: handle usages via type aliases properly 2021-06-08 11:37:33 +03:00
Mikhail Glukhikh
b4ee116de7 Experimental checkers: simplify visiting code a bit 2021-06-08 11:37:32 +03:00
Mikhail Glukhikh
702d839c66 Forbid TYPE and TYPE_PARAMETER as possible OptIn targets 2021-06-08 11:37:31 +03:00
Mikhail Glukhikh
603afe89a2 Forbid using experimental markers on override declarations
#KT-45844 Fixed
2021-06-08 11:37:30 +03:00
Mikhail Glukhikh
bb9efab3c4 Forbid experimental markers on getter #KT-45845 Fixed 2021-06-08 11:37:29 +03:00
Mikhail Glukhikh
0a670bf055 Report EXPERIMENTAL_API diagnostics on various implicit usages
#KT-32443 Fixed
#KT-22852 Fixed
2021-06-08 11:37:28 +03:00
Mikhail Glukhikh
d8d38862d9 Introduce EXPERIMENTAL_ANNOTATION_WITH_WRONG_RETENTION diagnostic
#KT-22941 Fixed
2021-06-08 11:37:27 +03:00
Mikhail Glukhikh
7393465696 Don't report EXPERIMENTAL_OVERRIDE_ERROR on annotated local functions
#KT-31728 Fixed
2021-06-08 11:37:26 +03:00
Mikhail Glukhikh
cb232725f0 FoldConstantLowering: drop unnecessary experimental annotation 2021-06-08 11:37:25 +03:00
Mikhail Glukhikh
fa307a5f75 Drop LocalCallableIdConstructor OptIn-annotation 2021-06-08 11:37:24 +03:00
Andrey Zinovyev
3572a96bb9 [FIR] Lookup in local sources in default imports based on the flag
Reuse ALLOW_KOTLIN_PACKAGE for that
2021-06-08 08:23:25 +00:00
Andrey Zinovyev
3eeddf7077 [FIR] Use member scope to look up function/property by name 2021-06-08 08:18:57 +00:00
Andrey Zinovyev
c507d1c938 [FIR] Implement OPERATOR_RENAMED_ON_IMPORT diagnostic 2021-06-08 08:18:56 +00:00
Andrey Zinovyev
7c669b65c3 [FIR] Implement CONFLICTING_IMPORT diagnostic 2021-06-08 08:18:55 +00:00
Andrey Zinovyev
14789cb9e5 [FIR] Implement CANNOT_BE_IMPORTED diagnostic 2021-06-08 08:18:54 +00:00
Andrey Zinovyev
bf153ab0f0 [FIR] Implement CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON diagnostic 2021-06-08 08:18:54 +00:00
Abduqodiri Qurbonzoda
fdd9287836 Get rid of platform differences in Regex.split() doc 2021-06-08 00:32:33 +00:00
Abduqodiri Qurbonzoda
0b521b5183 Get rid of platform differences in Regex.findAll() doc 2021-06-08 00:32:32 +00:00
Abduqodiri Qurbonzoda
53b6c25533 Get rid of platform differences in Grouping<T, K>.eachCount() doc 2021-06-08 00:32:31 +00:00
Abduqodiri Qurbonzoda
91d1baf3b5 Get rid of platform differences in Array.orEmpty() doc 2021-06-08 00:32:30 +00:00
Abduqodiri Qurbonzoda
cc3c33b8ae Get rid of platform differences in Collection<T>.toTypedArray() doc 2021-06-08 00:32:29 +00:00
Abduqodiri Qurbonzoda
c64592665b Get rid of platform differences in MutableList.sortWith() doc 2021-06-08 00:32:29 +00:00
Abduqodiri Qurbonzoda
a9946b01e6 Get rid of platform differences in MutableList.sort() doc 2021-06-08 00:32:28 +00:00
Abduqodiri Qurbonzoda
225be54c61 Get rid of platform differences in Regex.find doc 2021-06-08 00:32:27 +00:00
Abduqodiri Qurbonzoda
7fdd1154ee Add default value for K/N actual functions #KT-46183 2021-06-08 00:32:26 +00:00
konrad.sztenderski
e338c5651b Expose some methods and properties related to Cocoapods dependencies to access them in Apple gradle plugin 2021-06-07 21:28:07 +02:00
Dmitry Petrov
81b09ca09f KT-46267 JVM_IR don't generate unnecessary ATHROW in lateinit var read 2021-06-07 20:02:24 +03:00
Simon Ogorodnik
d3453e98b0 FIR Tests: Add async-profiler per-pass sampling to full pipeline 2021-06-07 19:43:28 +03:00
Simon Ogorodnik
718e9c11f5 FIR Tests: Fix FirMetaModularizedTest to run properly on Windows 2021-06-07 19:43:10 +03:00
Elena Lepilkina
97a38ba0a9 [K/N] Added benchmarks for KT-46482 and KT-46425 2021-06-07 14:35:32 +00:00
Ilya Kirillov
74567f4b02 FIR IDE: restore fir ide spec tests with shorten test class name to make TC happy
Otherwise, TC will complain about too long fq test method names
2021-06-07 16:48:56 +03:00
Ivan Kylchik
cc169613c1 Drop result of finally block after interpretation
This change is needed due to using FIR as frontend for tests. In this
case finally block doesn't has coercion to unit so it's result must
be dropped manually.
2021-06-07 15:35:20 +03:00
Ivan Kylchik
61d65436f4 Fix interpreter files provider to make tests work on windows 2021-06-07 15:35:19 +03:00
Ivan Kylchik
5596e1e1e1 Properly support char and boolean arrays in interpreter
For now boolean array will expect proper Boolean instead of any value.
This change just unify logic of working with primitive arrays.
2021-06-07 15:35:18 +03:00
Ivan Kylchik
25989b36c5 Allow to create object in interpreter only if it is compile time 2021-06-07 15:35:16 +03:00
Ivan Kylchik
6e12cee626 Extract common checker logic into accessesTopLevelOrObjectField 2021-06-07 15:35:15 +03:00
Ivan Kylchik
49d8bd5845 Remove unnecessary property message from interpreter exceptions 2021-06-07 15:35:14 +03:00
Ivan Kylchik
e28ab45c51 Add ir interpreter tests 2021-06-07 15:35:12 +03:00
Ivan Kylchik
cc2d7340dc Implement simple test system to check ir interpreter correctness 2021-06-07 15:35:11 +03:00
Ivan Kylchik
3b250132d0 Put all logic of working with expect/actual declarations inside Wrapper
For now decision of how to work with class or function is made by their
signatures.
2021-06-07 15:35:09 +03:00
Ivan Kylchik
0cc866a2fb Support Enum class as intrinsic in ir interpreter
Methods of Enum class don't have bodies, so must be treated as
intrinsics
2021-06-07 15:35:08 +03:00
Ivan Kylchik
e5617ede7e Add Throwable class into interpreter builtins map
Methods of Throwable class doesn't have bodies using FIR, so they must
be handled as builtins
2021-06-07 15:35:07 +03:00
Ivan Kylchik
8234c9cec1 Add toString function with nullable receiver into builtins map
On JVM we don't have body for this function, so we must process it as
intrinsic or builtin
2021-06-07 15:35:06 +03:00
Ivan Kylchik
7882fdf232 Simplify logic of checking that IrGetField can be interpreted 2021-06-07 15:35:04 +03:00
Ivan Kylchik
ca1932b3a5 Set proper fir type for deserialized annotation's arguments 2021-06-07 15:35:03 +03:00
Ivan Kylchik
b3fa7b25cf Optimize Utils.kt by removing unused functions 2021-06-07 15:35:02 +03:00
Ivan Kylchik
877832ef8c Optimize some methods of CallStack and Frame 2021-06-07 15:35:01 +03:00
Ivan Kylchik
e0438d1123 Implement better workflow of interpretation with callable reference 2021-06-07 15:34:59 +03:00
Ivan Kylchik
9a8e0f3fb3 Add new builtins methods for some interfaces into IrBuiltInsMapGenerated
This change allow us to skip looking for override when evaluate call
for some primitive.
2021-06-07 15:34:58 +03:00
Ivan Kylchik
b4463b948c Rewrite unfoldValueParameters to take into account recursive calls
The workflow of evaluation value arguments is now like this:
1. Calculate not null arguments
2. Add them into intermediate stack
3. Calculate defaults for those parameters that have no argument
This flow allow us to avoid early addition of variable onto stack.
2021-06-07 15:34:57 +03:00
Ivan Kylchik
6411d09579 Rewrite wrap function to take into account function name
This is needed to understand whenever arrays must be unwrapped or not.
For now, in case of kotlin.Array.set and kotlin.Pair.<init> calls it is
considered to remain arrays as Primitive class to save their irType
info.
2021-06-07 15:34:55 +03:00
Ivan Kylchik
04b36ff19e Make interpreted functions implicitly return Unit as result 2021-06-07 15:34:54 +03:00
Ivan Kylchik
0e8ca12499 Add callback to methods of CallInterceptor to specify default behaviour 2021-06-07 15:34:53 +03:00
Ivan Kylchik
285929ad07 Add new intercept method in CallInterceptor for proxy 2021-06-07 15:34:52 +03:00
Ivan Kylchik
25d01099d8 Add CallInterceptor interface and implement its default realization
CallInterceptor will handle calls, constructor calls, getting enum
entries and objects. It will make a decision for interpreter: this call
must be handled as intrinsic or it must be interpreted.
2021-06-07 15:34:50 +03:00
Ivan Kylchik
c8b268a789 Refactor entire IrInterpreter to achieve better code quality 2021-06-07 15:34:49 +03:00
Ivan Kylchik
3294af5e49 Get correct irClass from class reference in case of reified parameter 2021-06-07 15:34:47 +03:00
Ivan Kylchik
fe99b235d3 Implement more precise control flow in ir interpreter
"More precise" in terms of the number of passing tests.
In this case ControlStructures test block was used.
2021-06-07 15:34:46 +03:00
Ivan Kylchik
c3ad319c13 Implement correct processing for receivers of IrFunctionReference 2021-06-07 15:34:44 +03:00
Ivan Kylchik
a73173e480 Fix interpretation of arguments with default value 2021-06-07 15:34:43 +03:00
Ivan Kylchik
38f4e6e8bf Implement interpretation of assert method 2021-06-07 15:34:42 +03:00
Ivan Kylchik
8617809528 Rename expression value parameter to declaration 2021-06-07 15:34:40 +03:00
Alexander Udalov
e6254b51e1 Rewrite generator for IrBuiltInsMapGenerated
Similarly to 742fef9042 with OperationsMapGenerated, use optimized
`when` over strings instead of lambdas because lambdas lead to a lot of
bytecode.

The change in `IrConst.toPrimitive` is needed because for operations
like `Byte.plus(Int)` the IrConst instance would have the IR type for
kotlin.Byte, but the actual runtime value of type Int
(java.lang.Integer), which would lead to CCE from
`interpretBinaryFunction`. Previously it didn't fail because of
unchecked cast before calling the lambda, which allowed a value of
runtime type java.lang.Integer to sneak through to the lambda parameter
and be "unboxed" to the correct type via the `(... as Number).toByte()`
conversion which backend generates.

The main benefit of this change is that it reduces the size of the
proguarded compiler jar by ~0.69%.
2021-06-07 15:34:39 +03:00
Ivan Kylchik
ac7a1c7762 Add new intrinsic handler for sourceLocation function 2021-06-07 15:34:38 +03:00
Ivan Kylchik
7fe776fe10 Simplify work with stack by adding additional newFrame method 2021-06-07 15:34:37 +03:00
Ivan Kylchik
d578aa0ec5 Pass irFile in interpreter method in IrConstTransformer 2021-06-07 15:34:35 +03:00
Ivan Kylchik
ec16c40bf4 Save right entry point for expression 2021-06-07 15:34:34 +03:00
Ivan Kylchik
9d9ab498aa Remove typeArguments field in State interface 2021-06-07 15:34:33 +03:00
Ivan Kylchik
a10d88924f Simplify getIrFunctionByIrCall method in KFunctionState
Removed check of invoke symbols equality. Without this check it is
possible to store init functions in KFunctionState
2021-06-07 15:34:32 +03:00
Ivan Kylchik
3d1d86e9cb Change call method of KProperty1Proxy to invoke corresponding accessors 2021-06-07 15:34:30 +03:00
Ivan Kylchik
64d5cea337 Implement getter and setter for KPropertyProxy 2021-06-07 15:34:29 +03:00
Ivan Kylchik
f89b75e387 Implement interpretation of KParameter interface 2021-06-07 15:34:28 +03:00
Ivan Kylchik
a4edddaa6e Extract all reflection state classes into separate files 2021-06-07 15:34:26 +03:00
Ivan Kylchik
aa321f2333 Move ReflectionState.kt into separate package "reflection" 2021-06-07 15:34:25 +03:00
Ivan Kylchik
5a95e5b45f Implement interpretation for KType and KTypeParameter 2021-06-07 15:34:24 +03:00
Ivan Kylchik
88b5b5f702 Implement interpretation of KVisibility class
For now it is interpreted as Wrapper, but maybe further it will be
converted to Common
2021-06-07 15:34:23 +03:00
Ivan Kylchik
40bf4fafc9 Implement basic interpretation of IrClassReference 2021-06-07 15:34:22 +03:00
Ivan Kylchik
002804941f Replace Lambda state with KFunctionState 2021-06-07 15:34:21 +03:00
Ivan Kylchik
749200d518 Fix constructor call checker
Forget to check constructor for availability of compile time annotation
2021-06-07 15:34:19 +03:00
Ivan Kylchik
41ea1525d1 Implement basic interpretation for KProperty 2021-06-07 15:34:18 +03:00
Ivan Kylchik
c3d0438405 Allow to interpret property reference 2021-06-07 15:34:16 +03:00
Ivan Kylchik
ac858f760a Forbid vararg flattening in place there array was expected 2021-06-07 15:34:15 +03:00
Ivan Kylchik
8b2706aaee Change interpretConstructor method to be able to init object single time 2021-06-07 15:34:13 +03:00
Ivan Kylchik
903e883809 Add additional type arguments to stack from super types 2021-06-07 15:34:12 +03:00
Ivan Kylchik
a9d686b9f9 Add outer object to stack when interpreting constructor of inner class 2021-06-07 15:34:11 +03:00
Ivan Kylchik
b570d3f7fd Fix interpreter error related to recreating Unit object 2021-06-07 15:34:09 +03:00
Ivan Kylchik
b98f680d65 Fix interpreter error related to incorrect work of get value for objects 2021-06-07 15:34:08 +03:00
Ivan Kylchik
d931e2eead Implement simple proxy for non interface structures like kotlin.Pair 2021-06-07 15:34:07 +03:00
Ivan Kylchik
1e5096294e Implement proxy for custom interfaces 2021-06-07 15:34:06 +03:00
Ivan Kylchik
96a090f2ab Implement LambdaProxy class 2021-06-07 15:34:04 +03:00
Ivan Kylchik
1d0acedc48 Rewrite Complex class as interface
This change allow ExceptionState to be both: State and Throwable
2021-06-07 15:34:03 +03:00
Ivan Kylchik
6808151af7 Remove method getOriginal from Complex class
Common class no longer contains Common super classes,
all fields are now inside one single object.
2021-06-07 15:34:02 +03:00
Ivan Kylchik
4c75576414 Implement basic proxy for Common state
For now proxy works only for Any class methods and only for Common
state.
2021-06-07 15:34:01 +03:00
Ivan Kylchik
3c0c8d97cc Add possibility to interpret spread operator on unsigned arrays 2021-06-07 15:33:59 +03:00
Ivan Kylchik
ca231ccc53 Rethrow InterpreterTimeOutError as UserException 2021-06-07 15:33:58 +03:00
Ivan Kylchik
c23e8517b3 Fix type arguments saving for arrays 2021-06-07 15:33:57 +03:00
Ivan Kylchik
7ecf4b17b6 Change evaluation function for arrayOf
For now it will get only elements variable from stack instead of all
2021-06-07 15:33:56 +03:00
Ivan Kylchik
4010eb11bd Implement method to calculate EQEQ ir builtin function 2021-06-07 15:33:54 +03:00
Ivan Kylchik
9b1f11b22b Extend compile time checker to check constructors body 2021-06-07 15:33:53 +03:00
Ivan Kylchik
cc0bbac354 Support isSubtypeOf check for functional type 2021-06-07 15:33:52 +03:00
Ivan Kylchik
c1aa39065f Add handler for setters in getIrFunction method 2021-06-07 15:33:49 +03:00
Ivan Kylchik
6a483a8464 Add simple handler for StackOverflowError in ir interpreter 2021-06-07 15:33:48 +03:00
Ivan Kylchik
f3d7dc5f22 Rewrite exceptions handler in ir interpreter
For now there are 2 types of exceptions:
1. UserExceptions - express user and jvm like exceptions
2. InterpreterError - thrown only if something is wrong with interpreter
2021-06-07 15:33:47 +03:00
Ivan Kylchik
c3b0c9c6b2 Support multiple nested try blocks 2021-06-07 15:33:46 +03:00
Ivan Kylchik
ad6ba0cf11 Support lateinit var interpretation 2021-06-07 15:33:45 +03:00
Ivan Kylchik
b45df06680 Forbid to interpret non const top level properties 2021-06-07 15:33:43 +03:00
Ivan Kylchik
393ad9ae9b Fix compile time checker for get and set field expressions 2021-06-07 15:33:42 +03:00
Ivan Kylchik
a084dabdde Return Unit value from block if statements count is equal to zero 2021-06-07 15:33:41 +03:00
Ivan Kylchik
13ab7eafca Move out compile time function checker logic to EvaluationMode.kt 2021-06-07 15:33:40 +03:00
Ivan Kylchik
84e6e1e305 Add WITH_ANNOTATIONS evaluation mode
This mode means that function can be executed if it has
CompileTimeCalculation annotation. FULL mode for now will mean deep
check without annotation help
2021-06-07 15:33:39 +03:00
Ivan Kylchik
1151c6177b Move IrCompileTimeChecker to separate checker package 2021-06-07 15:33:37 +03:00
Ivan Kylchik
47ed6789d2 Fix interpreting of java static members such as Boolean.TRUE 2021-06-07 15:33:36 +03:00
Denis.Zharkov
592256976e FIR: Fix inference of builder-inference function from expect type
Previously, such calls were being completed with FULL mode and incorrect
INFERENCE_NO_INFORMATION_FOR_PARAMETER has been reported
2021-06-07 15:25:57 +03:00
Denis.Zharkov
18e93b50d9 FIR: Fix loading read-only collection Java types with incorrect variance 2021-06-07 15:25:56 +03:00
Denis.Zharkov
5ade831665 FIR: Fix INFERENCE_NO_INFORMATION_FOR_PARAMETER on type alias with generic expansion
^KT-46996 Fixed
2021-06-07 15:25:55 +03:00
Denis.Zharkov
d76db0e011 FIR: Mute backend tests relevant to new INFERENCE_NO_INFORMATION_FOR_PARAMETER
See KT-46967 and KT-46996
2021-06-07 15:25:53 +03:00
Denis.Zharkov
d932d5b0a5 FIR: Support adding expect type to calls in foo() as R position
See https://kotlinlang.org/docs/whatsnew12.html#support-for-foo-as-a-shorthand-for-this-foo
2021-06-07 15:25:51 +03:00
Denis.Zharkov
6136526a3a FIR: Avoid reporting inference errors from DelegatedPropertyConstraintPosition
All necessary diagnostics have already been reported through the checkers
2021-06-07 15:25:50 +03:00
Denis.Zharkov
43f3fe1ebe FIR: Avoid missing errors during delegation resolution
Merge inference errors from delegation partially resolved calls to the main system
2021-06-07 15:25:49 +03:00
Denis.Zharkov
0aca3a3737 FIR: Adjust test data after introduction of INFERENCE_NO_INFORMATION_FOR_PARAMETER
See previous commits for details
2021-06-07 15:25:47 +03:00
Denis.Zharkov
c420957eac FIR: Report INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic 2021-06-07 15:25:45 +03:00
Pavel Punegov
6e901e3785 Filter out JRE installations on MacOS
java_home tool shows also JRE installations located at
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" path.
They should not be used as there are no javac and other tools there.
2021-06-07 11:03:08 +00:00
Anton Yalyshev
9b8ae8ce4f 1.5.20-RC Change-notes correction. 2021-06-07 13:51:46 +03:00
Anton Yalyshev
503700d60b Add change notes for 1.5.20-RC 2021-06-07 13:51:44 +03:00
sebastian.sellmair
70924f6c15 [Commonizer] Link ticket ^KT-47100 in HierarchicalPropertyCommonizationTest 2021-06-07 09:07:43 +00:00
sebastian.sellmair
ffcd57cb31 [Commonizer] TypeCommonizer: Support commonizing typeAlias and their underlying types 2021-06-07 09:07:43 +00:00
sebastian.sellmair
92093bbabd [Commonizer] HierarchicalPropertyCommonizationTest.test differently typeAliased property - * 2021-06-07 09:07:42 +00:00
sebastian.sellmair
0cf1618960 [Commonizer] Implement CirNodeRelationship over CommonizerCondition 2021-06-07 09:07:41 +00:00
sebastian.sellmair
8272564ca0 [Commonizer] Prototype: Commonize TypeAliases with Classes
^KT-45992 Fixed
^KT-46061 Fixed
2021-06-07 09:07:40 +00:00
sebastian.sellmair
b394dde339 [Commonizer] Implement HierarchicalClassAndTypeAliasCommonizationTest
^KT-45992
^KT-46061
2021-06-07 09:07:39 +00:00
pyos
d5200e3688 JVM_IR: box returned Result if overriding Any?
This is only relevant with MangleClassMembersReturningInlineClasses
disabled, as otherwise returning Result causes name mangling and thus
bridges.
2021-06-07 09:57:42 +02:00
pyos
0bd8d16fe2 JVM_IR: fix Result types in continuations & remove more codegen hacks
#KT-47129 Fixed
2021-06-07 09:57:42 +02:00
Pavel Punegov
e8490f950a Chose archive name depending on the version of the compiler 2021-06-06 14:44:34 +00:00
Pavel Punegov
ca3150163d Use old archive naming in the NativePlatformLibsIT test 2021-06-06 14:44:33 +00:00
Ilya Muradyan
8be5f009f1 [REPL] Fix completion for function arguments 2021-06-06 09:00:52 +03:00
Nikolay Krasko
0bc34f0ff9 Add information about 211.6693.111 Community idea to verification 2021-06-04 21:39:33 +03:00
Nikolay Krasko
17f042a4a3 Add information about 211.6693.111 Ultimate idea to verification 2021-06-04 21:39:32 +03:00
Nikolay Krasko
2401c37795 Fix double registration of NodeJSPlugin tasks
Can be reproduced when both ``intellijVersionForIde` and `installIntellijUltimate` are enabled
2021-06-04 21:39:31 +03:00
Nikolay Krasko
07be073e7f Minor: regenerate verification-metadata.xml 2021-06-04 21:39:30 +03:00
Dmitry Petrov
7fd033adae JVM_IR KT-47073 use type parameter upper bound for default value 2021-06-04 20:54:01 +03:00
Svyatoslav Scherbina
e4b723fe4a Native: enable some of ObjCExport tests with new GC 2021-06-04 16:58:27 +00:00
Svyatoslav Scherbina
fa36ccedeb Native: improve ObjCExport thread state switching 2021-06-04 16:58:26 +00:00
Svyatoslav Scherbina
388538be60 Native: minor exception handling refactoring
Move parts of exception handling implementation from IrToBitcode
to CodeGenerator, to allow using filteringExceptionHandler in ObjCExport.
2021-06-04 16:58:25 +00:00
Nikolay Krasko
2801704ad3 Temporary remove DiagnosisCompilerTestDataSpecTestGenerated.java tests
Buildserver fails because of too long path names
2021-06-04 18:25:45 +03:00
Nikolay Krasko
478b1f65fb Fix builds: ideaIC might be absent in the build 2021-06-04 15:15:13 +03:00
Ilya Kirillov
febc4986d1 FIR IDE: mute spec testdata based test failing in FIR IDE 2021-06-04 13:16:18 +02:00
Ilya Kirillov
d474ff2b03 FIR IDE: generate tests based on compiler spec tests for ide 2021-06-04 13:16:18 +02:00
Ilya Kirillov
335a2d7b71 FIR IDE: add tests based on compiler spec tests for ide 2021-06-04 13:16:17 +02:00
Ilya Kirillov
a8a31231f7 Get rid of duplicated file names in spec tests
Otherwise, corresponding IDE tests would fail on creation duplicated
files in the same directory
2021-06-04 13:16:17 +02:00
Victor Petukhov
2d3ed4b7da Update FIR test data 2021-06-04 13:25:10 +03:00
Alexander Gorshenev
f5d656ec4f [Native] Revert klib printer change 2021-06-04 02:36:54 +03:00
Ivan Kochurkin
c4c2fbb5a0 [FIR] Implement RECURSIVE_TYPEALIAS_EXPANSION, CYCLIC_INHERITANCE_HIERARCHY diagnostics, fix stackoverlow exception in case if typealias points to type with type arguments 2021-06-03 20:41:58 +03:00
Mark Punzalan
d1531f9cdd FIR: Choose a resolved candidate for augmented assignment when both
assign and operator candidates are unsuccessful.
2021-06-03 20:18:04 +03:00
Mark Punzalan
32bb64a225 FIR: Report UNSAFE_OPERATOR_CALL for augmented assignments (was
reporting UNSAFE_CALL).
2021-06-03 20:18:03 +03:00
Mark Punzalan
ef923d4cfe FIR IDE: Enable ReplaceInfixOrOperatorCallFix for
UNSAFE_IMPLICIT_INVOKE_CALL.
2021-06-03 20:18:02 +03:00
Mark Punzalan
6de1000818 FIR: Report UNSAFE_INFIX_CALL for all infix-style calls, even if the
candidate is not an infix function.

This mirrors FE 1.0 (see
`AbstractTracingStrategy.reportUnsafeCallOnBinaryExpression()`) and
allows consistent handling for quickfixes on infix calls.
2021-06-03 20:18:01 +03:00
Mark Punzalan
ca7649edbb FIR IDE: Enable ReplaceInfixOrOperatorCallFix for UNSAFE_CALL,
UNSAFE_INFIX_CALL, UNSAFE_OPERATOR_CALL.
2021-06-03 20:17:59 +03:00
Mark Punzalan
5a7f4ffc99 FIR IDE: Enable tests for ReplaceInfixOrOperatorCallFix. 2021-06-03 20:17:58 +03:00
Mark Punzalan
afeeec3091 IDE: Move ReplaceInfixOrOperatorCallFix to idea-frontend-independent. 2021-06-03 20:17:57 +03:00
Mark Punzalan
5a6d543fba IDE: Don't do any resolution in ReplaceInfixOrOperatorCallFix.invoke(). 2021-06-03 20:17:56 +03:00
Mark Punzalan
06adb405e1 IDE: Remove duplicate quickfix message in resources. 2021-06-03 20:17:54 +03:00
Ilya Kirillov
e5f6e4e1e8 FIR IDE: do not fail on FirDeclarationOrigin.ImportedFromObject for symbol 2021-06-03 19:39:16 +03:00
Ilya Kirillov
be99f24278 FIR IDE: fix uast import test after fixing import references 2021-06-03 19:39:15 +03:00
Ilya Kirillov
ae7a6dc742 FIR IDE: remove error handling from function completion 2021-06-03 19:39:13 +03:00
Ilya Kirillov
a1fcc34bbc FIR IDE: choose better name for completion helpers 2021-06-03 19:39:12 +03:00
Ilya Kirillov
2e57361457 FIR IDE: add type arguments and -> symbol to when conditions completion 2021-06-03 19:39:11 +03:00
Ilya Kirillov
fa2f2c34cb FIR IDE: fix flaky completion test 2021-06-03 19:39:09 +03:00
Ilya Kirillov
108176d0b6 FIR IDE: enable passing completion tests 2021-06-03 19:39:08 +03:00
Ilya Kirillov
88129c3354 FIR IDE: implement completion inside string templates 2021-06-03 19:39:07 +03:00
Ilya Kirillov
59b22fadad FIR IDE: add tests for completion where clause 2021-06-03 19:39:06 +03:00
Ilya Kirillov
edbfff71e9 FIR IDE: fix shortenings for enums 2021-06-03 19:39:05 +03:00
Ilya Kirillov
0da488058d FIR IDE: add tests for completion in sealed when 2021-06-03 19:39:03 +03:00
Ilya Kirillov
9af0885e82 FIR IDE: implement completion in sealed when 2021-06-03 19:39:02 +03:00
Ilya Kirillov
4bdf46e0a4 FIR IDE: fix icon for enum entry 2021-06-03 19:39:01 +03:00
Ilya Kirillov
1e1ce3067f FIR IDE: implement basic classifier name contributor 2021-06-03 19:39:00 +03:00
Ilya Kirillov
58d5907041 FIR IDE: do not complete after where constraint type param with qualifier 2021-06-03 19:38:59 +03:00
Ilya Kirillov
ff369b1917 IDE/FIR IDE: fix not showed following type parameters in completion 2021-06-03 19:38:57 +03:00
Ilya Kirillov
0f13359229 FIR IDE: implement completion in where clause 2021-06-03 19:38:56 +03:00
Ilya Kirillov
5b5bbdd113 FIR IDE: add receiver parameter for callable lookup elements in completion 2021-06-03 19:38:55 +03:00
Ilya Kirillov
aef071691f FIR IDE: refactor: separate lookup element factories into different files 2021-06-03 19:38:54 +03:00
Ilya Kirillov
62e4b53d03 FIR IDE: fix not added import for functions 2021-06-03 19:38:52 +03:00
Ilya Kirillov
0534d3fb98 fix after rebase 2021-06-03 19:38:51 +03:00
Ilya Kirillov
a926a1f534 FIR IDE: handle . after package name in completion tests 2021-06-03 19:38:50 +03:00
Ilya Kirillov
4785f36d8d FIR IDE: implement completion for packages 2021-06-03 19:38:49 +03:00
Ilya Kirillov
943ae108f5 FIR IDE: introduce import statement completion 2021-06-03 19:38:48 +03:00
Ilya Kirillov
c998d0f026 FIR: make FirStaticScope to be name aware 2021-06-03 19:38:47 +03:00
Ilya Kirillov
b81ef157b2 FIR IDE: fix reference resolve in import statement 2021-06-03 19:38:45 +03:00
Ilya Kirillov
55621b7aad FIR IDE: do not complete callables for classifier without companion 2021-06-03 19:38:44 +03:00
Ilya Kirillov
365bc5712b FIR IDE: do not add internal packages to completion 2021-06-03 19:38:42 +03:00
Ilya Kirillov
48b69b4f3f FIR IDE: add test for super keyword completion with qualifier 2021-06-03 19:38:41 +03:00
Ilya Kirillov
0a6243fc67 FIR IDE: implement super qualifier completion 2021-06-03 19:38:40 +03:00
Ilya Kirillov
7d351ca6b1 FIR IDE: add possibility to have different testdata for fir & fe10 keyword tests 2021-06-03 19:38:39 +03:00
Ilya Kirillov
c81a9c9d18 FIR IDE: mute test which fails as we have no decalration name completion 2021-06-03 19:38:37 +03:00
Ilya Kirillov
0739f6974f FIR IDE: fix completion of type arguments without closing > 2021-06-03 19:38:36 +03:00
Ilya Kirillov
d510f0809a FIR IDE: do not break formatting of reference shortenner 2021-06-03 19:38:35 +03:00
Ilya Kirillov
11e77d464d FIR IDE: add completion with package receiver 2021-06-03 19:38:34 +03:00
Ilya Kirillov
e77783a0e5 FIR IDE: add packages name completion 2021-06-03 19:38:32 +03:00
Ilya Kirillov
df93dc91d1 FIR IDE: fix package reference resolve 2021-06-03 19:38:31 +03:00
Ilya Kirillov
d76ec9db50 FIR IDE: add completion for annotations 2021-06-03 19:38:30 +03:00
Ilya Kirillov
6b450e6fdf FIR: make FirOnlyClassifiersScope/FirOnlyCallablesScope to be name aware 2021-06-03 19:38:29 +03:00
Ilya Kirillov
fcc5af99f3 FIR IDE: enable passing keyword tests 2021-06-03 19:38:27 +03:00
Ilya Kirillov
f7cf80b8e9 FIR IDE: render short names as for completion lookup element types 2021-06-03 19:38:26 +03:00
Ilya Kirillov
a718a2c2d8 FIR IDE: fix completion of top level type aliases 2021-06-03 19:38:25 +03:00
Ilya Kirillov
bcf7116955 FIR IDE: add type completion with dot 2021-06-03 19:38:24 +03:00
Ilya Kirillov
e03916e7fb FIR IDE: add index helper to FirBasicCompletionContext 2021-06-03 19:38:22 +03:00
Ilya Kirillov
6c9831f7d4 FIR IDE: separate callable and type completion 2021-06-03 19:38:21 +03:00
Ilya Kirillov
e7288b3293 FIR IDE: extract FirCallableCompletionContributor 2021-06-03 19:38:20 +03:00
Ilya Kirillov
8dda232ae3 FIR IDE: move CompletionVisibilityChecker/ExtensionApplicabilityChecker to dedicated package 2021-06-03 19:38:19 +03:00
Ilya Kirillov
a437cd9d86 FIR IDE: do not capture KtAnalysisSession receiver for CompletionVisibilityChecker/ExtensionApplicabilityChecker 2021-06-03 19:38:18 +03:00
Ilya Kirillov
3df075061c FIR IDE: extract classifier completion separate completion provider 2021-06-03 19:38:17 +03:00
Victor Petukhov
1e5998e0ba Add constraints between two different stub variables instead of creating constraint error due to T1 isn't subtype of T2
^KT-44241 Fixed
2021-06-03 19:18:09 +03:00
Nikita Bobko
071ae301b4 Add possibility to use baseDir in AdditionalDiagnosticsSourceFilesProvider
In IJ infrastructure we have specific path prefix for compiler testData
2021-06-03 19:05:47 +03:00
Jinseong Jeon
10f19c8f4a FIR UAST: invalidate caches between tests 2021-06-03 17:56:16 +02:00
Jinseong Jeon
37d8e6ddc3 FIR UAST: relocate render/log test data 2021-06-03 17:56:16 +02:00
Jinseong Jeon
80b94a43b0 FIR/UAST: split KotlinUIdentifier into a separate file 2021-06-03 17:56:16 +02:00
Jinseong Jeon
68766024b3 FIR/UAST: commonize Identifier implementations 2021-06-03 17:56:16 +02:00
Jinseong Jeon
6af930f6df FIR UAST: convert LeafPsiElement to UIdentifier 2021-06-03 17:56:16 +02:00
Jinseong Jeon
83256ef3bd FIR UAST: introduce identifiers and refNames tests 2021-06-03 17:56:16 +02:00
Jinseong Jeon
c37123603c UAST: utilize identifier test base 2021-06-03 17:56:16 +02:00
Ivan Kochurkin
da15f0ffe8 [FIR] Consider fullyExpandedType instead of original type in isSubtypeForTypeMismatch, consider lookupTag in isError method 2021-06-03 18:24:36 +03:00
Ivan Kochurkin
0b0a96a1d3 [FIR] Fix processing of nested type arguments, extract extractTypeRefAndSourceFromTypeArgument method to FirHelpers and use it from FirClassVarianceChecker and FirConflictingProjectionChecker 2021-06-03 18:24:35 +03:00
Ivan Kochurkin
f081a6b4fa [FIR] Implement REDUNDANT_PROJECTION diagnostics, rename FirConflictingProjectionChecker -> FirProjectionRelationChecker, fix tests 2021-06-03 18:24:34 +03:00
Ivan Kochurkin
03e577bf98 [FIR] Implement CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION diagnostics, fix tests 2021-06-03 18:24:32 +03:00
Ivan Kochurkin
ca970f0a8b [FIR] Add ConeKotlinTypeConflictingProjection, return it from substituteArgument instead of ConeStarProjection in appropriate cases, remove plus operator from ProjectionKind 2021-06-03 18:24:30 +03:00
Ivan Kochurkin
b85846c0c0 [FIR] Fix location for CONFLICTING_PROJECTION diagnostics, extend conflictingProjection.kt with test sample 2021-06-03 18:24:29 +03:00
Ilya Goncharov
ce78457eaa [Gradle, JS] Use replace by just string, not regexp in webpack config
^KT-43379 fixed
2021-06-03 17:55:05 +03:00
Ilya Goncharov
8c38c4a8e7 [Gradle, JS] Add dependency from packageJson task on included build's rootPackageJson 2021-06-03 17:55:04 +03:00
Victor Petukhov
19c07e048a Don't check suitability of a builder inference call if unrestricted builder inference is enabled
^KT-42139 Fixed
2021-06-03 17:28:40 +03:00
Dmitry Savvinov
f8fbbc01b6 Don't append 'is a module' suffix to ModuleDescriptor debug text 2021-06-03 17:22:00 +03:00
Dmitry Savvinov
708fead1cc Add debug strings to frontend scopes-related structures
Such as:
- PackageFragmentProviders, and, in particular,
CompositePackageFragmentProviders
- JavaPackageFragments
- Scopes produced by those providers

The rationale is that a lot of frontend-facing bugs (like red code) are
easily recognizeable in resolution. But at that point you just see a
bunch of scopes, without meaningful toStrings, you don't know who has
produced them, and what's exactly wrong.

With this commit it should make debugging slightly easier: now at least
you'll be able to see that "this scope is a scope of package fragment
for foo.bar of module baz" and decide whether the declaration should or
should not have been resolved from such scope.
2021-06-03 17:21:59 +03:00
Alexander Dudinsky
a51c65ed60 Update test data for MultiModuleHighlightingTest.testLanguageVersionsViaFacets
Add `Resolved to error element` markers
2021-06-03 16:42:24 +03:00
Nikita Bobko
e4205e5aa7 Pack 'compiler/testData/diagnostics/helpers' into kotlin-compiler-testdata-for-ide
This testdata is required for AbstractDiagnosisCompilerTestDataTest in FIR IDE in IJ infrastructure
2021-06-03 15:34:46 +02:00
Mikhail Glukhikh
2bf0e6744d FIR2IR: optimize coerceToUnitIfNeeded in implicit cast inserter 2021-06-03 16:14:42 +03:00
Mikhail Glukhikh
13d91837be FIR: cache functional type symbols in type resolver 2021-06-03 16:14:42 +03:00
Mikhail Glukhikh
1294c8de53 FIR: don't get class symbol if it's unnecessary (Java type conversion) 2021-06-03 16:14:41 +03:00
Nikita Bobko
3c7b07b90f Include tests-compiler-utils into kotlin-compiler-tests-for-ide artifact
It fixes:
```
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/fir/FirCfgConsistencyChecker

	at org.jetbrains.kotlin.test.frontend.fir.handlers.FirCfgConsistencyHandler.processModule(FirCfgConsistencyHandler.kt:15)
	at org.jetbrains.kotlin.test.frontend.fir.handlers.FirCfgConsistencyHandler.processModule(FirCfgConsistencyHandler.kt:13)
	at org.jetbrains.kotlin.test.TestRunnerKt.processModule(TestRunner.kt:236)
	at org.jetbrains.kotlin.test.TestRunnerKt.hackyProcess(TestRunner.kt:231)
	at org.jetbrains.kotlin.test.TestRunnerKt.access$hackyProcess(TestRunner.kt:1)
```
while running `DiagnosisCompilerTestFE10TestdataTestGenerated.Tests#testBinaryCallsOnNullableValues` (and probably other tests) in new infrastructure
2021-06-03 15:04:10 +02:00
Dmitry Petrov
107e71acb0 Minor: fix Android tests 2021-06-03 13:05:23 +03:00
pyos
4128d27510 JVM_IR: do not use invokedynamic for inline fun references 2021-06-03 13:05:23 +03:00
Mads Ager
5d53d34d85 Fix regression test for KT-46962. 2021-06-03 13:05:23 +03:00
Victor Petukhov
124a14c8df Use separate constraint position during call substitution as part of inferring postponed type variables
^KT-47052 Fixed
^KT-47082 Fixed
2021-06-03 12:37:17 +03:00
Ilmir Usmanov
7a2ecc58d4 Minor. Regenerate tests 2021-06-03 12:35:26 +03:00
pyos
d5d3d9f112 Add regression tests for KT-46890 and other stuff 2021-06-03 12:35:25 +03:00
pyos
ada4c48eba JVM_IR: correctly (?) unbox Result when needed
and don't unbox when not needed.

 #KT-46890 Fixed
2021-06-03 12:35:24 +03:00
pyos
288451db4d JVM_IR: remove an unnecessary hack from BridgeLowering
Correct IR is more important than whether some inaccessible members
precisely match what was generated by the old backend.
2021-06-03 12:35:23 +03:00
Dmitriy Novozhilov
6f54e9fd5c Revert "FIR: add smartcast stability to FIR"
This reverts commit 96bd2c54
2021-06-03 09:54:02 +03:00
Dmitriy Novozhilov
0497f60af3 Revert "FIR DFA: store stability in RealVariable"
This reverts commit 62f7e8f7
2021-06-03 09:53:57 +03:00
Dmitriy Novozhilov
796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00
Ilya Kirillov
20d1a84002 FIR/FIR IDE: fix FirFailingTestSuppressor for IDE
We need to have IdeTestIgnoreHandler executed after FirFailingTestSuppressor,
otherwise IdeTestIgnoreHandler will suppress exceptions
and FirFailingTestSuppressor will throw error
saying that file .fir.fail exists but test passes
2021-06-03 00:19:52 +03:00
Ilya Kirillov
948d9390d6 FIR: "//TODO make thread safe" comment from FirBuiltinSymbolProvider 2021-06-03 00:09:03 +03:00
Ilya Kirillov
f361312e45 FIR: use FirCachesFactory in BuiltInsPackageFragment.tryGetSyntheticFunctionalInterface 2021-06-03 00:09:02 +03:00
Ilya Kirillov
ba2315430b FIR: get rid of lateinit var in FirBuiltinSymbolProvider for thread safety 2021-06-03 00:09:01 +03:00
Ilya Kirillov
863156679d FIR: use FirCachesFactory in BuiltInsPackageFragment.getClassLikeSymbolByFqName 2021-06-03 00:09:00 +03:00
Dmitry Petrov
7a43c2de79 JVM remove dead code during constant condition elimination
This avoids an extra call to 'analyze', which is rather costly.

Update debugger testData: Constant condition
elimination now performs DCE more consistently.
2021-06-03 00:08:27 +03:00
Dmitry Petrov
1fd94d1bc2 JVM Minor: cleanup RedundantNullCheckMethodTransformer 2021-06-03 00:08:25 +03:00
Mads Ager
0b5ec5535c [JVM_IR] Add String.plus(Any) to intrinsics list.
This filters it out for use in SAM wrapper generation with
invoke-dynamic.

The intrinsic is not actually used for code generation so
it is added to the list of intrinsics that should have been
lowered away before codegen.

^KT-45779 Fixed
2021-06-03 00:04:47 +03:00
Alexander Udalov
c1021623e8 Do not use ClassLoader.getResourceAsStream in reflection
Use ClassLoader.getResource + openStream instead, to workaround an issue
in URLClassLoader.

Also set useCaches to false because kotlin-reflect only reads builtins
metadata once per class loader, and doesn't need it to be cached. Using
caches here might also lead to the problem of closed input streams when
protobuf is read in parallel. The test doesn't check exactly this,
though (it seems to succeed even if cached connections are used).

Note that BuiltInsResourceLoader has a JDK 9+ specialization at
libraries/reflect/api/src/java9, but that implementation does not need
any changes because it uses Module.getResourceAsStream which is not
affected by this issue in URLClassLoader.

 #KT-18277 Fixed
2021-06-02 22:54:16 +02:00
Vasily Levchenko
a0503aa2d7 [kotlin-native][test][debugger] exclude non constant part of stack trace from gold values
(cherry picked from commit ac072d3cc0aea0d311062f58fb5382cac6912deb)
2021-06-02 18:36:59 +00:00
Nikita Bobko
ea24da117b Publish compiler testdata which is required for Kotlin plugin 2021-06-02 21:30:03 +03:00
Sergey Shanshin
71c9e62d64 Added support serialization of local classes in IR backend
Resolves Kotlin/kotlinx.serialization#1427
2021-06-02 16:43:31 +00:00
Pavel Punegov
ac0dc94800 Since 1.5.30-dev-1466 a new archive naming schema was introduced
Support both names in NativeCompilerDownloader
2021-06-02 18:30:52 +03:00
Pavel Punegov
789799ac17 Revert simpleOsName in HostManager
Support old naming in simpleOsName.
Introduce new platformName method for the new archive naming.
2021-06-02 18:30:52 +03:00
Leonid Startsev
1f837134bb Support for @EncodeDefault annotation 2021-06-02 13:43:39 +00:00
Alexander Dudinsky
e6e3c9b236 Use master name for tests with snapshot version Kotlin Gradle Plugin 2021-06-02 15:23:31 +03:00
Roman Artemev
5f65b46dfc [JS IR] Unmute fixed tests 2021-06-02 13:42:35 +03:00
Roman Artemev
a36135baf1 [JS IR] Fix reflection generation 2021-06-02 13:42:35 +03:00
Roman Artemev
974779e91b [JS IR] Support function reference to array inline constructor 2021-06-02 13:42:34 +03:00
Tianyu Geng
84334b087c FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-02 13:19:12 +03:00
Tianyu Geng
62f7e8f71f FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more
places during DFA. Now mutable properties, property with custom getters,
delegated properties, etc are also treatd as a `RealVariable`. In
general this is needed in order to carry out smartcast computation in
order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side
effects that improves behavior of some test files.
2021-06-02 13:19:12 +03:00
Tianyu Geng
96bd2c54f0 FIR: add smartcast stability to FIR 2021-06-02 13:19:12 +03:00
Tianyu Geng
931a637bdd FIR: use isReal() and isSynthetic() helper consistently 2021-06-02 13:19:11 +03:00
Vladimir Ivanov
2165cc8f0d [Native] Fix test data for testObjCExportNoGeneric (#4424) 2021-06-02 11:13:07 +03:00
Vladimir Ivanov
e06a60bda5 [Native] Clean up nested comment when exporting kdoc to objc header (#4410)
* [Native] Clean up nested comment when exporting kdoc to objc header

* [kdoc-export] Add test witg nested comment block

* Remove redundant assert

Co-authored-by: Vladimir Ivanov <vladimir.d.ivanov@jetbrains.com>
2021-06-02 10:18:32 +03:00
Alexander Udalov
61d5595790 Remove dependency of ir.serialization.common on frontend 2021-06-01 20:28:23 +02:00
Alexander Udalov
dfea915f92 Remove dependency of frontend on compiler.common.jvm
Looks like it was added accidentally in 564d382b9d; common frontend
shouldn't depend on JVM-specific modules.

Since then, it has been accidentally used in two places in
ir.serialization.common to refer to JVM specifics, and that should be
abstracted away in the future.
2021-06-01 20:28:23 +02:00
Alexander Udalov
81ce1da352 Move PsiSourceElement to psi 2021-06-01 20:28:23 +02:00
Alexander Udalov
bcf47ddc94 Move optional annotation utilities to module 'resolution'
To avoid depending on a heavy module 'frontend' in parts of the compiler
where checking for optional annotations is needed, such as in
'ir.serialization.common'.
2021-06-01 20:28:22 +02:00
Alexander Udalov
e790fa8ac9 Remove dependency of serialization on frontend
Move ApplicationExtensionDescriptor and ProjectExtensionDescriptor to
:compiler:util.
2021-06-01 20:28:22 +02:00
Alexander Udalov
8b3769b88e Remove dependency of ir.serialization.common on ir.backend.common 2021-06-01 20:28:22 +02:00
Alexander Udalov
a3ad03d1ad Slightly refactor module dependencies of backend.js/serialization.js
The comment in serialization.js/build.gradle.kts is not needed because
such dependency cannot be introduced accidentally, since Gradle does not
support cycles in module dependencies.
2021-06-01 20:28:22 +02:00
Leonid Startsev
b43e5a5e7d fixup! Fix tests and review notes 2021-06-01 16:41:56 +00:00
Leonid Startsev
6a5cf00d7a Optimize serializer instantiation: use Companion.serializer() when possible
Add test for sealed hierarchy
2021-06-01 16:41:55 +00:00
Leonid Startsev
b61277df97 Support annotations in constructor signatures of special serializers 2021-06-01 16:41:55 +00:00
Leonid Startsev
229085f3d1 Support default parameter values in @SerialInfo annotations
#KT-46739 Fixed
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1461
2021-06-01 16:41:54 +00:00
Mads Ager
f846dd8ea2 [JVM_IR] Avoid using special names in static inline class replacements.
Fixes KT-46952
2021-06-01 16:22:14 +02:00
Aleksei.Cherepanov
b1ab597616 Fix FIR tests after ee45aa6b 2021-06-01 15:59:17 +03:00
Pavel Punegov
3293a888ca [native] Archive naming: use $os-$arch convention 2021-06-01 10:20:05 +00:00
Pavel Punegov
48ef739525 [native] Rename Apple MacOS targets in simpleOsName
Use Arm64 suffix for Apple Arm arch and X64 for Intel X86_64
2021-06-01 10:20:04 +00:00
Alexander Shabalin
825b77cc82 Remove unused ostream 2021-06-01 07:01:11 +00:00
Mikhael Bogdanov
b72aa76415 Support class type parameters annotation checking 2021-06-01 06:33:51 +02:00
Mikhael Bogdanov
a8186d19d6 Support annotations on class type parameters
#KT-43714
2021-06-01 06:33:50 +02:00
Dmitry Petrov
9091ca7b51 JVM_IR KT-46864 handle "unused" LDC instructions properly 2021-05-31 21:12:35 +03:00
Andrey Uskov
be097244d4 fixup synchronizations 2021-05-31 20:23:54 +03:00
Aleksei.Cherepanov
b0d721c9d0 Fix synchronization in translation-result map
#KT-27660 Fixed
2021-05-31 20:23:53 +03:00
Aleksei.Cherepanov
290d424111 Fix synchronization in source-to-classes table 2021-05-31 20:23:52 +03:00
Aleksei.Cherepanov
ee45aa6b08 Fixed closing of cache storage
#KTIJ-7680 Fixed
#KT-45843 Fixed
2021-05-31 20:23:51 +03:00
Mads Ager
886ce055f5 [JVM_IR] Do not use invoke-dynamic for targeting inline-only methods.
Fixes https://youtrack.jetbrains.com/issue/KT-46962
2021-05-31 18:11:50 +03:00
pyos
5c2753b5d1 JVM_IR: use substituted return type in function reference invoke
#KT-46982 Fixed
2021-05-31 16:01:22 +03:00
Vasily Levchenko
84c10079e4 [kotlin-native][tests] kt-42208 test added. 2021-05-31 11:45:32 +00:00
Vasily Levchenko
1ff6dc1275 [kotlin][tests][compiler/testData/debug/stepping] kt-42208 test added. 2021-05-31 11:45:31 +00:00
Vasily Levchenko
ecbae02f17 [IR][provisional function expression] another line information provider added for func_expression -> function_reference conversion 2021-05-31 11:45:31 +00:00
Dmitriy Novozhilov
c6a2d85c87 [Build] Remove incorrect dependency
`intellijDep()` includes jars with JUnit3 and JUnit4. JUnit5 runner
  which is used in compiler tests sees old junit on classpath and checks
  if this version can be ran using Vintage test engine. Looks like recent
  changes in platform changed order of this jars on classpath, so now
  jar with JUnit3 is closer than JUnit4 (and they have same classes inside),
  so version checker from JUnit5 observes JUnit3 and fails with error
  of incompatible versions. Since old JUnits are not needed at all in those
  modules now only required jars from intellijDep are included
2021-05-31 14:03:37 +03:00
Dmitriy Novozhilov
6121d156a1 [Build] Add workarounds for JPS build
Compilation of `:kotlin-gradle-statistics:test` is broken in gradle
  too, so this module is removed from JPS to allow build project with
  "Rebuild project" action

Dependency on `:kotlin-uast-base` changed to `implementation` because
  project import assumes `shadow` dependency as _Provided_ instead of
  _Compile_ in module structure which leads to problem that this
  dependency is missing during build (this is bug inside JPS itself)
2021-05-31 14:03:37 +03:00
Abduqodiri Qurbonzoda
d934c97bf5 Equivalize isLowerCase and isUpperCase behavior in all platforms #KT-46184 2021-05-31 13:42:46 +03:00
Yahor Berdnikau
0b10f255d7 Update 'kotlinOptions.jdkHome' deprecation message.
Also mention java toolchains approach.

^KT-43095 Fixed
2021-05-31 10:22:50 +00:00
Yahor Berdnikau
c5e6215d27 Set UsesKotlinJavaToolchain interface to extend Task interface.
Limit use-case of UsesKotlinJavaToolchain interface to only Gradle tasks
and allow to query all tasks using
 'taskContainer.withType(UsesKotlinJavaToolchain.class)'.

^KT-43095 In Progress
2021-05-31 10:22:50 +00:00
Yahor Berdnikau
4c943e7cd1 Allow to configure non-default JDK using toolchain via extension.
Add method into "kotlin" extension to set toolchain for all tasks.
This will also set toolchain for java compile tasks. Also user may
set toolchain via "java" extension and it will be applied to Kotlin
tasks as well.

^KT-43092 In Progress
2021-05-31 10:22:49 +00:00
Yahor Berdnikau
8e1c420c9f Allow to set non-default JDK for tasks via java toolchain.
Has to split jdk/toolchain setters, because, when toolchain setter is
in the 'UsesKotlinJavaToolchain', Groovy fails to create meta class
on <Gradle 6.7 with ClassNotFoundException.

^KT-43092 In Progress
2021-05-31 10:22:48 +00:00
Ilya Matveev
de5dcfcbd8 [K/N][Runtime] Support suspending mutators in the new MM 2021-05-31 09:48:46 +00:00
Alexander Likhachev
94a94a557d [Gradle, JS] Add test for KT-47045 2021-05-31 11:43:18 +03:00
Alexander Likhachev
89f8c5a651 [Gradle, JS] Prevent adding unintended implicit dependencies
The way JS compilations are mapped to task requirements were changed from `compilation` objects to compilations's `disambiguatedName` in order to support Gradle configuration cache. This may lead to implicitly adding unwanted dependencies in multi-module projects since compilation's `disambiguatedName` is unique within a module, not within a whole multi-module project.
#KT-47045 Fixed
2021-05-31 11:43:18 +03:00
Andrey Zinovyev
78e20c1098 [KAPT] Keep original expressions in annotations vararg
#KT-29929 Fixed
2021-05-31 08:08:37 +00:00
Dmitriy Dolovov
e927764aaf [IR][Native] Fix invalid IR return statement generation
^KT-46836
2021-05-29 19:31:13 +00:00
Victor Petukhov
15b6a3c88c Temporary don't fail fir tests if a test passes but *.fir.fail exists (needs for DiagnosisCompilerTestFE10TestdataTestGenerated) 2021-05-29 11:30:55 +03:00
Nikita Bobko
3e892d3184 'idea-fir-fe10-binding' move fir tests into subpackage 'org.jetbrains.kotlin.idea.fir'
In intellij infrastructure we run tests by matching package pattern.
So in order to be able run FIR tests we need to place them into unique package
2021-05-29 00:11:28 +03:00
Nikita Bobko
65972fa64c 'idea-frontend-fir' move fir tests into subpackage 'org.jetbrains.kotlin.idea.fir'
In intellij infrastructure we run tests by matching package pattern.
So in order to be able run FIR tests we need to place them into unique package
2021-05-29 00:11:27 +03:00
Nikita Bobko
1ba6845b59 'idea-fir' move fir tests into subpackage 'org.jetbrains.kotlin.idea.fir'
In intellij infrastructure we run tests by matching package pattern.
So in order to be able run FIR tests we need to place them into unique package
2021-05-29 00:11:26 +03:00
Alexander Udalov
e7275a7cb0 Revert "Enable JVM IR for stdlib/reflect/test libraries"
This reverts commit 15e978dbd3.

Together with the previous revert, this led to multiple failures in
Gradle integration tests:

    ConfigurationCacheIT.testIncrementalKaptProject
    ConfigurationCacheForAndroidIT.testAndroidKaptProject
    KotlinAndroid34GradleIT.testParcelize
    KotlinAndroid34GradleIT.testAndroidExtensionsManyVariants
    KotlinAndroid36GradleIT.testAndroidWithNewMppApp
    KotlinAndroid36GradleIT.testParcelize
    KotlinAndroid36GradleIT.testAndroidIcepickProject
2021-05-28 21:36:24 +02:00
Alexander Udalov
e0cc6d44a7 Revert "Remove obsolete kotlin.build.useIR flag"
This reverts commit 91e47f1fd7.
2021-05-28 21:35:57 +02:00
Victor Petukhov
67d48d0150 Fix failing test 2021-05-28 21:38:27 +03:00
Alexander Udalov
96f0b53761 IR: get overridden directly from IrProperty when resolving fake override
The previous way of getting them either via getter or setter failed on
Java properties which only have a backing field. Now that IrProperty has
overriddenSymbols (after 53c1de172f), it makes sense to use it directly
instead. Use it only in SyntheticAccessorLowering though to avoid
breaking Kotlin/Native (see KT-47019).

 #KT-46900 Fixed
2021-05-28 17:24:20 +02:00
Mark Punzalan
af35892007 FIR IDE: Enable RemoveUselessIsCheckFix and
RemoveUselessIsCheckFixForWhen.
2021-05-28 18:21:32 +03:00
Mark Punzalan
639b7537da FIR IDE: Enable RemoveUselessCastFix. 2021-05-28 18:21:31 +03:00
Pavel Kirpichenkov
f5a53c82c5 Don't write type arguments of types replaced with Any to metadata
Anonymous types are not approximated by frontend for private declarations.
Class IDs for such types are replaced by StringTable before being written
to metadata. JVM string table mangles such types and keeps them generic
for reflection. For other purposes the types are replaced with `Any`.
Type arguments of the replaced type should be ignored in the latter case.
Otherwise decompiled text builder crashes on an attempt to restore `Any`
type with non-zero number of type arguments.

The code pretending to replace a type with its first supertype was dropped
from ApproximatingStringTable for two reasons:
- the first type from `getAllSuperClassifiers` is the original type itself
which doens't provide a ClassId for anonymous type, so it was a noop
- tracking potential type arguments of the first anonymous type's supertype
would be a complication with almost no practical value (types in decompiled
text would be slightly closer to the real type of a private declaration).

^KT-46393 Fixed
2021-05-28 14:42:47 +00:00
sebastian.sellmair
fefc6f9b53 [Gradle] :kotlin-test-js-runner: Update nodejs to 16.2.0
^KT-45302
2021-05-28 14:27:36 +00:00
sebastian.sellmair
d3b1ee42be [Gradle] Test project 'commonizeHierarchically': Use new 'macos' target shortcut
^KT-45302
2021-05-28 14:27:36 +00:00
sebastian.sellmair
cc571a876a [Gradle] Implement AppleSiliconIT
^KT-45302
2021-05-28 14:27:35 +00:00
sebastian.sellmair
242d79ded6 [Gradle] :kotlin-gradle-plugin-integration-tests: Include Commonizer tests into 'native' tests
^KT-45302
2021-05-28 14:27:34 +00:00
sebastian.sellmair
b9018e8888 [Gradle] :kotlin-gradle-plugin-integration-tests: Add 'includeTestsWithPattern' util function
^KT-45302
2021-05-28 14:27:33 +00:00
sebastian.sellmair
5dcaaf47cb [Gradle] Support for Apple Silicon targets
^KT-45302 Verification Pending
2021-05-28 14:27:32 +00:00
Alexander Udalov
91e47f1fd7 Remove obsolete kotlin.build.useIR flag 2021-05-28 15:41:57 +02:00
Alexander Udalov
15e978dbd3 Enable JVM IR for stdlib/reflect/test libraries 2021-05-28 15:41:56 +02:00
Alexander Udalov
1dfcec3a93 Build: add temporary option to suppress jdkHome warning 2021-05-28 15:41:17 +02:00
Victor Petukhov
aaffd73feb Take into account FE exceptions built as FromFrontendHandler to proper mute corresponding tests for DiagnosisCompilerTestFE10TestdataTestGenerated 2021-05-28 15:48:59 +03:00
Victor Petukhov
54b9f39b3a Update tests after rebase 2021-05-28 15:36:24 +03:00
Victor Petukhov
f4788b479c Fix incorrect builder inference usage 2021-05-28 15:36:23 +03:00
Victor Petukhov
76c15e4444 Don't update null recorded type prematurely in ResolvedAtomCompleter 2021-05-28 15:36:23 +03:00
Victor Petukhov
bd7fb56a24 Fix builder inference tests 2021-05-28 15:36:23 +03:00
Victor Petukhov
4a767c597e Don't report the same diagnsotics several times 2021-05-28 15:36:23 +03:00
Victor Petukhov
e942052eb6 Substitute stub type variables in local variable descriptors 2021-05-28 15:36:22 +03:00
Victor Petukhov
758eb8f851 Fix builder inference tests 2021-05-28 15:36:22 +03:00
Victor Petukhov
be22078bd1 Return empty NotFixedToInferredTypesSubstitutor if the current substitutor is empty 2021-05-28 15:36:22 +03:00
Victor Petukhov
d8c68aacdd Split setting substitutor descriptor for entire resolved call into two parts: setting resulting substitutor and setting substitutor for resolved call's types 2021-05-28 15:36:22 +03:00
Victor Petukhov
fd5169186e Update test for the builder inference and add new ones 2021-05-28 15:36:21 +03:00
Victor Petukhov
31ed1ad5d9 Use recorded into descriptor inferred callable reference input/output types, to prevent leaking raw type parameter's types of reflectionCandidateType into the back-end 2021-05-28 15:36:21 +03:00
Victor Petukhov
84bd580f92 Complete block expressions to substitute stub type variables into last callable references there 2021-05-28 15:36:21 +03:00
Victor Petukhov
472ab09511 Do stub types substitution for property initializer's type 2021-05-28 15:36:20 +03:00
Victor Petukhov
ac222fdb41 Update type for both version of expression: parenthesis and not 2021-05-28 15:36:20 +03:00
Victor Petukhov
c0ad1c9b18 Do substitution of stub types inside smartcast types to further write it into trace and prevent dealing with that in the back-end 2021-05-28 15:36:20 +03:00
Victor Petukhov
26cbb020db Use resulting descriptor for old callable references to substitute stub type variables 2021-05-28 15:36:20 +03:00
Victor Petukhov
3ff22b67f7 Substitute type arguments of old callable references as well 2021-05-28 15:36:20 +03:00
Victor Petukhov
d5be258291 Do substitution for receivers of old (by passing though OI) callable references properly, with avoiding premature returning from the method 2021-05-28 15:36:19 +03:00
Victor Petukhov
9fd1cbd2e7 Inject stub type variables of a different builder inference call properly 2021-05-28 15:36:19 +03:00
Victor Petukhov
d486f7e188 Don't report TYPE_INFERENCE_POSTPONED_VARIABLE_IN_RECEIVER_TYPE if unrestricted build inference was enabled 2021-05-28 15:36:19 +03:00
Victor Petukhov
0c427555cf Support definitely not null stub types and proper subtyping on them 2021-05-28 15:36:19 +03:00
Victor Petukhov
0f317b01b4 Rename language feature StableBuilderInference to UnrestrictedBuilderInference 2021-05-28 15:36:19 +03:00
Victor Petukhov
0b37b2be6a Add addtional tests for builder inference 2021-05-28 15:36:19 +03:00
Victor Petukhov
ecde5414dc Reuse error type constructor for stub types 2021-05-28 15:36:18 +03:00
Victor Petukhov
ee927a15a9 Compute nullability for stub types properly 2021-05-28 15:36:18 +03:00
Victor Petukhov
afbda75581 Set member scope for builder inference stub types equivalent to Any 2021-05-28 15:36:18 +03:00
Victor Petukhov
6356b9d501 Put removing builder inference restrictions under the compiler flag 2021-05-28 15:36:17 +03:00
Victor Petukhov
5a11450d77 Split stub types into stub type for subtyping and for builder inference and use them in the proper way 2021-05-28 15:36:17 +03:00
Victor Petukhov
703a353d2e Determine empty constraint system for a builder inference call by presense of not fixed type variables 2021-05-28 15:36:17 +03:00
Victor Petukhov
c5faf532f5 Allow builder inference calls with labeled lambda
^KT-24993 Fixed
2021-05-28 15:36:16 +03:00
Victor Petukhov
90066d7e50 Add expected type constraints in a builder inference call 2021-05-28 15:36:16 +03:00
Victor Petukhov
7da47dcde8 Add type variables into common system of a builder inference call properly 2021-05-28 15:36:15 +03:00
Victor Petukhov
ac7b459f2a Do subtyping with stub types properly
1) Return stub type if we are calculating super type between two same stub types
2) Return nullable Any if those stub types are different
2021-05-28 15:36:15 +03:00
Victor Petukhov
5d0461c722 Remove restrictions for builder inference internal calls 2021-05-28 15:36:14 +03:00
Victor Petukhov
26b8e86fe1 Render stub types properly 2021-05-28 15:36:14 +03:00
Nikita Bobko
af12b2fdf0 [imltogradle] Replace "Exported transitive dependency" with original module name reference 2021-05-28 14:03:07 +02:00
Nikita Bobko
6a7770573c [imltogradle] Support attaching 211 IDEA 2021-05-28 14:03:07 +02:00
Roman Artemev
8a856e440e [KLIB] Fix linker diagnostic message 2021-05-28 13:37:30 +03:00
Roman Artemev
720edfa6aa [IR] Fix branch offests
Seems logic that right bound of branch is result's right bound,
not condition's.
2021-05-28 13:23:52 +03:00
Andrey Zinovyev
ebf6ce133b [FIR] Fix kotlin version check in annotations
@RequireKotlin has more than one string parameter, so you need to check
 'version' only
2021-05-28 12:24:58 +03:00
Elena Lepilkina
3a22761d02 [K/N] Fix MutationCheck calls for inlined property accessors 2021-05-28 06:45:53 +00:00
Elena Lepilkina
b6f35ac44d [K/N] Fix inlining of property setters by replacing ReturnsInsertion lowering 2021-05-28 06:45:52 +00:00
Yahor Berdnikau
3387615d4a Fix test requires more later Gradle version. 2021-05-27 18:12:02 +00:00
Yahor Berdnikau
cdb04f9cd7 Add 'kgpSimpleTests' task.
This task run all JUnit5 tests with annotated with '@SimpleKGPTests`
annotation and also will be used in CI configuration.

^KT-45745 In Progress
2021-05-27 18:12:02 +00:00
Alexander Shabalin
af1f57007a https://channel9.msdn.com/Shows/Going+Deep/Cpp-and-Beyond-2012-Herb-Sutter-atomic-Weapons-2-of-2 2021-05-27 17:18:55 +00:00
Nikolay Krasko
0b1884c994 Print memory consumption in the failure for GradleDaemonMemoryIT test 2021-05-27 20:13:10 +03:00
Nikolay Krasko
166f0a597b Run tests only for unique gradle versions 2021-05-27 20:13:09 +03:00
Nikolay Krasko
b5f71bacaf Never spam to log during the normal test execution in Gradle tests 2021-05-27 20:13:08 +03:00
Nikolay Krasko
9d1a6ebb18 Minor: narrow extracting functions scope 2021-05-27 20:13:07 +03:00
Mark Punzalan
d12a24418e FIR IDE: Remove multiple nested params in RemoveUselessElvisFix and
RemoveUselessCastFix.
2021-05-27 19:32:03 +03:00
Mark Punzalan
a778cc673e FIR IDE: Enable RemoveUselessElvisFix. 2021-05-27 19:32:01 +03:00
Ilya Goncharov
157046153f [Gradle, JS] Add test with dynamic webpack.config.d 2021-05-27 19:18:13 +03:00
Hung Nguyen
01c14a709a KotlinCompile: Add kotlin.incremental.useClasspathSnapshot flag
We are planning to improve incremental Kotlin compile with a new
approach using classpath snapshot (see
https://youtrack.jetbrains.com/issue/KT-45777 for more details).

The estimated steps will be as follows:
  [x] Add a flag for the new approach, disabled by default
  [ ] Add tests for the new approach, and update them as we go
  [ ] Add computation of classpath snapshot using artifact transforms
  [ ] Add computation of classpath snapshot changes
  [ ] Ensure incremental compile is fully functional with the new approach
  [ ] Measure performance + optimize: Repeat until we see evidence that
      the new approach is clearly better than the current approach
  [ ] Advertise the flag, and later on enable it by default

This commit is the first step. Although it's simple, it allows further
changes to be made safely without impacting the current approach.

Bug: KT-45777
Test: N/A (will be added in a subsequent change)
2021-05-27 19:05:26 +03:00
Nikita Bobko
1abf3a39d4 Fix kotlin-compiler-tests-for-ide. tests jars should be published 2021-05-27 17:23:46 +02:00
Nikita Bobko
2d015da1ea Make it possible to depend on the rest of :prepare:ide-plugin-dependencies modules
Those modules used as "aggregate" modules. kotlin-ide modules depend on them in coop-dev
2021-05-27 16:32:14 +02:00
Sergey Shanshin
961ee92c15 Fix bytecode for serializable enums in generated tests 2021-05-27 15:35:12 +03:00
Alexander Shabalin
e0c7cda1cf Adjust test expectations for the new MM 2021-05-27 11:39:56 +00:00
Ilya Goncharov
f2a067eda0 [Gradle, JS] In KotlinWebpack configDirectory as getter not lazy
It is useful to dynamically creating config directory during build execution

^KT-46976 fixed
2021-05-27 14:07:04 +03:00
Viacheslav Kormushkin
3709616baa Fixed failing cocoapods integration test 2021-05-27 10:47:45 +00:00
pyos
34878d17eb JVM: be more careful when removing unused constants
1. if an argument of a `pop` cannot be removed, then all other potential
   arguments of that `pop` can't be removed either, and the same applies
   to other `pop`s that touch them;
2. the same is true for primitive conversions, but this is even trickier
   to implement correctly, so I simply did the same thing as with
   boxing operators: replace the conversion itself with a `pop` and keep
   the argument as-is.

Somehow this actually removes *more* redundant primitive type conversions
than the old code in a couple bytecode text tests, so I've patched them
to kind of use the value, forcing the instructions to stay.

 #KT-46921 Fixed
2021-05-27 12:24:22 +02:00
pyos
2f60ce21a0 JVM: remove CHECKCAST handling from PopBackwardPropagationTransformer
Redundant CHECKCASTs should've been removed by a previous pass.
2021-05-27 12:24:22 +02:00
pyos
535934dc28 JVM: do not remove NOPs in PopBackwardPropagationTransformer
There is a pass that removes NOPs and runs afterwards anyway.
2021-05-27 12:24:22 +02:00
Aleksei.Cherepanov
5f4be07225 [JPS] Fix JS incremental compilation
Disable Idea JPS build mechanism for marking all sources of common output if one of them is dirty
Add source-to-outputs map for correctly removing Kotlin/JS outputs

#KT-45763 Fixed
#KT-44351 Fixed
2021-05-27 13:00:56 +03:00
Andrey Zinovyev
c2389a94fa [FIR] Resolve annotations in when expressions 2021-05-27 12:41:16 +03:00
Sergey Bogolepov
b541721a79 Deprecate Architecture.bitness property
There is no such thing as "bitness" of CPU achitecture.
Something more appropriate and correct (e.g. ABI) should be
introduced instead.
2021-05-27 10:09:25 +03:00
Sergey Bogolepov
bed42e9ab2 Revert "Drop useless bitness property from Architecture"
As it turn outs, `Architecture.bitness` leaks to public Gradle API and
we need to deprecate it gracefully.
This reverts commit 79bf2a1f.
2021-05-27 10:09:24 +03:00
sebastian.sellmair
14eca72913 Implement 'CommonizerTarget.fileName' and limit fileName length
^KT-46856 Fixed
2021-05-27 06:48:34 +00:00
sebastian.sellmair
0749443f7e Implement CommonizerIT.test KT-46856 filename too long - all native targets configured
Covers ^KT-46856
2021-05-27 06:48:33 +00:00
Abduqodiri Qurbonzoda
54994a289f Support all digit chars on JS and Native #KT-46002 2021-05-27 06:56:52 +03:00
Anton Lakotka
8481f4a9d2 Set kotlin-project-model as api dependency for kotlin-gradle-plugin-api
LanguageSettingsBuilder depends on LanguageSetting interface from KPM
which forces api dependency scope

^KT-46517 Fixed
2021-05-26 18:11:39 +00:00
Anton Lakotka
3e2b8a8898 Test Gradle buildSrc with kotlin-gradle-plugin-api dependency
For ^KT-46517
2021-05-26 18:11:39 +00:00
Anton Bannykh
b3bb033fe4 JS IR: fix plain module reference 2021-05-26 17:53:21 +03:00
Dmitriy Novozhilov
b63770bc7b Add workaround for KT-46902 2021-05-26 17:53:20 +03:00
Dmitriy Novozhilov
89e52cb780 Add workaround for KT-46900 2021-05-26 17:53:19 +03:00
Dmitriy Novozhilov
8eca31e867 Advance bootstrap to 1.5.30-dev-1023 2021-05-26 17:53:17 +03:00
pyos
d37ceb47be JVM_IR: use correct dispatch receiver type in more references
#KT-46902 Fixed
2021-05-26 15:23:19 +02:00
Sergey Shanshin
16dbafced1 Add .serializer() to enum companion and object with custom serializer
Fixes Kotlin/kotlinx.serialization#1386
2021-05-26 16:07:59 +03:00
Igor Chevdar
f431b4b171 [K/N][codegen] Escape analysis: increased a bit the number of iterations
This helps the algorithm to converge in more situations and increases
the number of stack allocated objects
2021-05-26 17:48:20 +05:00
Igor Chevdar
29584edcdd [K/N][codegen] Escape analysis: handled nulls more optimally
Helps with https://youtrack.jetbrains.com/issue/KT-44148
2021-05-26 17:46:22 +05:00
Igor Chevdar
426ac1281d [K/N][codegen] Removed square graph swelling during escape analysis
Helps with https://youtrack.jetbrains.com/issue/KT-44148
2021-05-26 17:46:15 +05:00
Konstantin Tskhovrebov
2129a762a5 Change assemble AppleFrameworkTask name to using framework name prefix
#KT-46892
2021-05-26 14:59:30 +03:00
Elena Lepilkina
a006f35df3 [K/N][build] Removed extra konanVersion variable as far as it's now same as kotlinVersion 2021-05-26 11:49:49 +00:00
Tianyu Geng
61475c48e2 FIR: fix VALUE_ARGUMENTS position strategy 2021-05-26 14:46:18 +03:00
Margarita Bobova
3bd6bf1432 Add changelog for 1.5.10 2021-05-26 13:51:48 +03:00
Margarita Bobova
e31173ca73 Add changelog for 1.5.0 2021-05-26 13:51:06 +03:00
pyos
33ddeffcfd JVM_IR: box inline class values returned by suspend inline lambdas
The call site inside the inline function expects them to return a boxed
value, like FunctionN.invoke would.

 #KT-46915 Fixed
2021-05-26 08:33:55 +02:00
pyos
117fad2018 JVM: refactor inline ExpressionLambda initialization 2021-05-26 08:33:55 +02:00
Mads Ager
d023966054 [JVM] Fix various undefined locals issues.
CoroutineTransformermethodVisitor attempts to extend the ranges
of local variables in various situations. Probably in an attempt
to give a better debugging experience. However, all of these
range extensions lead to invalid local variable tables where
something is in the local variable table where nothing is in the
corresponding slot.

The code that extends variables to the next suspension point
instead of ending them when they are no longer live has issues
with loops. When resuming and reentering the loop, the locals
table will mention a local that we did not spill and which
is therefore not restored when resuming.

The code that extends local variable table entries if there
are no suspension points between two entries doesn't work
for code such as:

```
var s: String
if (suspendHere() == "OK") {
  s = "OK"
} else {
  s = "FAIL"
}
```

If the local variable ranges are collapsed into one, one of
the branches will have the local defined in the local variable
table before the slot is initialized.
2021-05-26 08:33:34 +02:00
Nikita Bobko
14ed660f4f [cleanup] Remove unused AbstractFirMultiModuleResolveTest 2021-05-25 23:53:08 +03:00
Anton Lakotka
5d9915e133 Don't copy extendsFrom configs for resolvableMetadataConfiguration
Gradle's detached configurations doesn't respect extends from relation
to other configurations due to gradle bug.
In fact extendsFrom isn't required for resolvableMetadataConfiguration
business logic. It is enough to include all originalDependencies to
freshly created detached configuration.

^KT-46417 Fixed
2021-05-25 23:31:23 +03:00
sebastian.sellmair
e8bd8a938f Implement HierarchicalMppIT.testNativeLeafTestSourceSetsKt46417 to cover ^KT-46417 2021-05-25 23:31:22 +03:00
Ilya Goncharov
c62a965180 [IR] Not try Null constant in fold constant
^KT-46859 fixed
2021-05-25 22:29:58 +03:00
Ilya Kirillov
b18d4af37b fix fe1.0 plugin testdata 2021-05-25 20:39:37 +03:00
Mark Punzalan
2c18406632 IDE: Add test for message of VAL_OR_VAR_ON_*_PARAMETER diagnostic.
Also fall back to getting parameter descriptor if property descriptor
not found for `val/var` parameters.

^KTIJ-13030 Fixed
2021-05-25 20:39:36 +03:00
Mark Punzalan
23605e08be FIR IDE: Enable RemoveValVarFromParameterFix for
VAL_OR_VAR_ON_*_PARAMETER.
2021-05-25 20:39:35 +03:00
Mark Punzalan
af99ad0736 FIR checker: Report VAL_OR_VAR_ON_*_PARAMETER. 2021-05-25 20:39:34 +03:00
Tianyu Geng
71c5c9f6c5 FIR IDE: add quickfix to change function return type 2021-05-25 20:39:32 +03:00
Stanislav Erokhin
b5994fa3a9 Remove the Kotlin online event link 2021-05-25 19:19:26 +02:00
Andrey Zinovyev
ae079d9bdd [FIR] Move unsigned types constructor evaluation from intrinsics 2021-05-25 19:23:31 +03:00
Andrey Zinovyev
64b45e6d1b Add comments to skipped FIR tests 2021-05-25 19:23:30 +03:00
Andrey Zinovyev
dce8bd4e62 [FIR] Support constructor call of unsigned in checker 2021-05-25 19:23:29 +03:00
Andrey Zinovyev
7f2eaab02b [FIR] Support for constructor calls of unsigned types in constants 2021-05-25 19:23:27 +03:00
Dmitriy Novozhilov
f9eba6e842 [FIR] Fix determining dependencies for modular jdk in CLI 2021-05-25 15:08:47 +03:00
teamcityserver
d530344eda Merge branch 'push/zharkov-fixes-4' 2021-05-25 14:57:51 +03:00
Jinseong Jeon
5effbce363 UAST: cleanup plugin file to have only plugin definition 2021-05-25 13:09:57 +02:00
Jinseong Jeon
8b93727f64 UAST: split KotlinConverter into a separate file 2021-05-25 13:09:57 +02:00
Jinseong Jeon
0395294933 UAST: split KotlinUastResolveProviderService into a separate file 2021-05-25 13:09:57 +02:00
Jinseong Jeon
f16f9a13fd FIR/UAST: enforce the existence of BaseKotlinUastResolveProviderService 2021-05-25 13:09:57 +02:00
Jinseong Jeon
240f86b109 FIR UAST: use analyseWithCustomToken in lieu of analyse 2021-05-25 13:09:57 +02:00
Jinseong Jeon
741fdee59e FIR/UAST: commonize UnknownKotlinExpression 2021-05-25 13:09:57 +02:00
Jinseong Jeon
15a4649675 FIR/UAST: commonize UImportStatement 2021-05-25 13:09:57 +02:00
Jinseong Jeon
3c3b5aa4ac FIR/UAST: commonize abstract UElement and UExpression 2021-05-25 13:09:57 +02:00
Jinseong Jeon
a54a807dc9 FIR/UAST base: clarify what module we should not depend on
This should be part of commit bbe5cf0a
2021-05-25 13:09:57 +02:00
Denis.Zharkov
dac9d7b17a FIR: Mark a pack of tests (53) as FIR_IDENTICAL 2021-05-25 13:28:29 +03:00
Denis.Zharkov
ddbdfafa79 Remove OI/NI attributes from test data 2021-05-25 13:28:27 +03:00
Denis.Zharkov
2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00
Denis.Zharkov
d4586cefb4 FIR: Properly deserialize upper bounds of classes type parameters
^KT-46661 Fixed
2021-05-25 13:28:25 +03:00
Alexander Shabalin
858e3584a9 Disable escape analysis with the new MM 2021-05-25 10:06:40 +00:00
Ivan Gavrilovic
4f64431f10 KT-46820: Kotlin gradle plugin - prevent multiple threads from registering task
... as that is not supported by the underlying mechanism.
Build service that holds info about the incremnetal compilation
may be instantiated only during execution, and multiple tasks may
try to do that. Because the container which holds info about all
build services is not thread-safe, this change adds synchronization.

Fixes #KT-46820
2021-05-25 12:49:07 +03:00
Mikhail Glukhikh
1b7425f428 FIR mangler: handle situation with invisible type in f/o signature
Before this commit, FIR mangler effectively dropped f/o parameter with
invisible type from this module. It could lead to signature clashes.
Now we insert classId in mangler string instead.
This fixes FIR bootstrap.
2021-05-25 11:38:48 +03:00
Denis.Zharkov
924678a00d FIR: Mark a pack of tests (53) as FIR_IDENTICAL 2021-05-25 10:25:05 +03:00
Denis.Zharkov
26002a040f Remove OI/NI attributes from test data 2021-05-25 10:25:05 +03:00
Denis.Zharkov
fe1d540c95 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 10:25:04 +03:00
Denis.Zharkov
accd48de8c FIR: Properly deserialize upper bounds of classes type parameters
^KT-46661 Fixed
2021-05-25 10:25:04 +03:00
Ivan Kochurkin
cf531dbbe6 [FIR] Implement TYPE_VARIANCE_CONFLICT, TYPE_VARIANCE_CONFLICT_IN_EXPANDED_TYPE diagnostics, fix tests 2021-05-25 00:07:33 +03:00
Ivan Kochurkin
ef53f0e0b3 [FIR] Render diagnostics parameters instead of full text in debug messages (closer to old tests) 2021-05-25 00:07:32 +03:00
Ivan Kochurkin
6de97e17fe [FIR] Fix max parameters count in diagnostics from 3 to 4 2021-05-25 00:07:30 +03:00
Elena Lepilkina
7f591bcfd4 [K/N] Changed llvmInlineThreshold for new form of bitcode 2021-05-24 15:46:21 +00:00
Elena Lepilkina
2320eb8b44 [K/N] Replace invokes with combination of calls and branch instructions 2021-05-24 15:46:20 +00:00
Nikita Bobko
0be5602363 Move ':plugins:lombok:lombok-ide-plugin' module under 'attachedIntellijVersion' the flag 2021-05-24 17:02:46 +02:00
Dmitriy Dolovov
9ab764e9fd [Native] Disable debug mode in KonanLocalTest (-g) 2021-05-24 13:23:51 +00:00
nataliya.valtman
1db09d78b3 KT-46833: print correct message when history files are unavailable 2021-05-24 13:51:43 +03:00
Ilya Muradyan
23faacd21b [Scripting] Expose scripting-dependencies as API of Maven resolver 2021-05-22 04:10:39 +03:00
Ilya Muradyan
0e7d690923 [Scripting] Change compile to implementation in Maven resolver 2021-05-22 00:38:46 +03:00
Ilya Muradyan
bead0e3412 [Scripting] Fix Maven resolver dependencies 2021-05-22 00:38:44 +03:00
Dmitry Petrov
261b42f5c5 JVM_IR KT-46822 don't generate too deep StringBuilder.append trees 2021-05-21 22:28:54 +03:00
Dmitry Petrov
ba00709e4d JVM_IR KT-46839 lower varargs for *arrayOf function references 2021-05-21 22:06:52 +03:00
Alexander Udalov
6ca7b39f6a Psi2ir: do not load abbreviated types with not found classifier
This is not an ideal fix of the problem since the fact that
AbbreviatedType's classifier should be a TypeAliasDescriptor is a
reasonable assumption that might fail somewhere else, later in the
pipeline.

Previous attempts to fix this issue that were unsuccessful:

1) Do not load abbreviations for such types in deserialization at all.
   Unfortunately, it broke quite a few things like reflection and
   decompiler, where types frequently refer to symbols not reachable
   from the point where they're requested, yet we have the FQ name of
   the typealias, which is enough to render the abbreviation properly in
   both these use cases.

2) Load classifiers for unresolved abbreviations as
   MockTypeAliasDescriptor instead of MockClassDescriptor in
   NotFoundClasses. Technically this was a revert of
   e19c1b5364. But this failed because we
   don't have enough information about such typealias to correctly set
   its `expandedType`/`underlyingType` (just using nullable Any as
   before that commit is not good enough). We only know its underlying
   class (from one usage of such typealias), and even supporting that
   would involve a major refactoring of TypeDeserializer which is
   painful.

 #KT-45308 Fixed
2021-05-21 19:36:30 +02:00
Alexander Udalov
ceec451f3f Minor, slightly refactor TypeDeserializer.typeConstructor 2021-05-21 19:36:30 +02:00
Dmitriy Dolovov
ab6f577964 [Native] Support suspend functions as supertypes (remove debug code)
^KT-46777
2021-05-21 17:31:46 +00:00
Hung Nguyen
c0977dd638 Build report: Print task name instead of TaskRecord@hashCode
Previously when kotlin.build.report.enable=true, the build report
contained lines such as:
  org.jetbrains.kotlin.gradle.report.TaskRecord@2db49688 was skipped

This commit prints the task name instead of TaskRecord@hashCode so that
it is more readable, like this:
  Task ':app:compileDebugKotlin' was skipped

Bug: N/A (Clean up)
Test: Existing tests + manually checked the build report output
2021-05-21 19:35:25 +03:00
Dmitriy Novozhilov
478a512b24 [FIR] Expand type of const val in FirConstPropertyChecker 2021-05-21 17:38:26 +03:00
Vasily Levchenko
669985f853 [debug][stacktrace][mac] more tracing for stacktrace debugging 2021-05-21 11:52:08 +00:00
Dmitriy Dolovov
0be542fd33 [Native] Always enable assertions in KonanLocalTest 2021-05-21 14:37:30 +03:00
Dmitriy Novozhilov
a1ae108ce5 [FIR] Properly generate IDE diagnostics from multiple diagnostics lists 2021-05-21 14:18:58 +03:00
Dmitriy Novozhilov
09e3629d5d [FIR] Move common checkers container from :entrypoint to :checkers module 2021-05-21 14:18:57 +03:00
Dmitriy Novozhilov
a9838131ad [FIR] Move jvm specific checkers to checkers.jvm module 2021-05-21 14:18:56 +03:00
Dmitriy Novozhilov
f3c58a1df7 [FIR] Add separate diagnostic list for JVM specific diagnostics 2021-05-21 14:18:55 +03:00
Dmitriy Novozhilov
7f18d147c1 [FIR] Introduce new module for jvm specific checkers 2021-05-21 14:18:54 +03:00
Dmitriy Novozhilov
9825babc23 [FIR] Move model classes of diagnostics generation DSL to separate package 2021-05-21 14:18:52 +03:00
Denis.Zharkov
f0c85e0935 FIR: Add comments to freshly muted tests 2021-05-21 13:53:55 +03:00
Andrey Zinovyev
617d99faac [FIR] Don't keep ref to whole class proto
Store module name only
2021-05-21 12:49:59 +03:00
Andrey Zinovyev
a121061df7 [FIR] Get module name for deserialized fir2ir classes 2021-05-21 12:49:58 +03:00
Svyatoslav Scherbina
dc8934ab22 Native: fix crash in custom LLVM diagnostics handler
48a684c0 added custom LLVM diagnostic handler, using JvmCallbacks machinery,
thus triggered a bug in the latter: callbacks are cached and outlive the compilation session,
but rely on memory that is reclaimed at the end of the compilation session.
So during a subsequent compilation in the same process (e.g. when the compiler runs in the
Gradle daemon process), LLVM might call the callback which accesses the reclaimed memory, 
which in turn causes the crash.

Fix this by forcing JvmCallbacks to allocate memory that doesn't "expire" at the end of the compilation session.
2021-05-21 07:34:34 +00:00
Elena Lepilkina
573191251e [K/N] Remove redundant update of debug info 2021-05-21 06:55:07 +00:00
Alexander Shabalin
73533e4b19 Make NoOp GC support multiple mutators 2021-05-21 06:31:09 +00:00
Ilya Kirillov
792ac6ab63 FIR IDE: update resolve call testdata after adding targetFunction to KtFunctionalTypeVariableCall 2021-05-21 00:04:48 +02:00
Ilya Kirillov
c72b2caf3e Fix wrapWithSafeLetCall quickfix testdata 2021-05-21 00:01:20 +02:00
Ilya Kirillov
be4632c2fe FIR: add missing ArgumentTypeMismatch.isMismatchDueToNullability after rebase 2021-05-20 21:05:41 +02:00
Ilya Kirillov
acda71cc90 FIR IDE: restore test generator after rebase 2021-05-20 20:33:01 +02:00
Tianyu Geng
e1b542314a FIR IDE: quickfix for WrapWithSafeLetCall
There is some behavior change regarding the new WrapWithSafeLetCall quickfix

1. it now works correctly on binary expressions by wrapping it with `()`
2. it now looks for a nullable position upward and do the modification there,
   if possible. For example, consider the following code

   ```
   fun bar(s: String): String = s

   fun test(s: String?) {
     bar(bar(bar(<caret>s)))
   }
   ```

   After applying this fix, FE1.0 yields

   ```
   bar(bar(s?.let { bar(it) }))
   ```

   while the new implementation yields

   ```
   s?.let { bar(bar(bar(it))) }
   ```

   This behavior aligns with FE1.0 if `bar` accepts nullable values.
2021-05-20 20:33:00 +02:00
Tianyu Geng
0eaab6d8a2 FIR: extract common logic from KotlinNameSuggester and share 2021-05-20 20:33:00 +02:00
Tianyu Geng
00ffa69cb3 FIR: add receiver expression to UNSAFE_CALL diagnostic and its variances 2021-05-20 20:32:59 +02:00
Tianyu Geng
9106ae4f5f FIR: store in ARGUMENT_TYPE_MISMATCH whether it's due to nullability 2021-05-20 20:32:59 +02:00
Tianyu Geng
cceb7197a5 FIR: allow nullable types in diagnostic parameters 2021-05-20 20:32:59 +02:00
Tianyu Geng
594fbbb4ef FIR: Allow 4 parameters for diagnostics 2021-05-20 20:32:58 +02:00
Mark Punzalan
d2b8204fdc FIR/FIR IDE: Use entire FirVariableAssignment when reporting UNSAFE_CALL
(e.g., `nullable.a = b`), and use positioning strategies to locate the
dot in the LHS expression.

Without it, only the callee reference is reported on, which makes the
highlighting of the error and application of quickfixes incorrect in the
IDE.

Also fixed issue with annotated and/or labeled expressions on LHS of
assignment (e.g., `(@Ann label@ i) = 34`).
2021-05-20 20:32:58 +02:00
Mark Punzalan
1d9247ae0f FIR IDE: Offer AddExclExclCallFix for nullable types with an
`iterator()` function that does NOT have `operator` modifier.

This is different from FE1.0. Adding `!!` will then surface the error
that `operator` modifier needs to be added (with corresponding fix).
2021-05-20 20:32:58 +02:00
Mark Punzalan
9e01a608b2 FIR IDE: Add ability in test infra to have a "before" file different in
FIR vs FE1.0, and made file naming convention more consistent.
2021-05-20 20:32:57 +02:00
Mark Punzalan
efa3bf9c69 FIR IDE: Consolidate tests for AddExclExclFix in one directory.
I found these tests only _after_ the previous changes, so I needed to
merge and/or remove redundant tests.
2021-05-20 20:32:57 +02:00
Mark Punzalan
db82797f58 FIR IDE: Enable AddExclExclCallFix for UNSAFE_CALL,
UNSAFE_OPERATOR_CALL, UNSAFE_INFIX_CALL, ITERATOR_ON_NULLABLE,
ARGUMENT_TYPE_MISMATCH, RETURN_TYPE_MISMATCH.

TODO: Don't offer fix when target is known to be null (from data flow
analysis).
2021-05-20 20:32:56 +02:00
Mark Punzalan
71a8d9c0bb FIR quickfix: Enable addExclExclCall tests for FIR, move typeMismatch
tests for addExclExclCall to addExclExclCall directory.
2021-05-20 20:32:56 +02:00
Mark Punzalan
85cbea70bf IDE: Don't do any resolution in AddExclExclExclFix (i.e., in
isAvailable and in invoke) by moving computation of element to modify
to before instantiation (i.e., to the factories or equivalent).

This lets us to move it to idea-frontend-independent and re-use it FIR.
2021-05-20 20:32:56 +02:00
Mark Punzalan
c472c9facd IDE: Don't add this!! in AddExclExclCallFix for nullable member
access in extension function.

^KTIJ-10052 Fixed
2021-05-20 20:32:55 +02:00
Dmitry Petrov
c0fbdb1535 JVM_IR KT-46840 don't generate special function references with indy 2021-05-20 21:13:17 +03:00
Dmitriy Novozhilov
3fc7e0ed03 [FIR] Remove COMPARE_WITH_LIGHT_TREE from default directives of fir diagnostic tests 2021-05-20 20:20:40 +03:00
Nikita Bobko
f7aabf03f8 Fix kotlin-native compilation
This commit fixes:
```
org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException:
Could not find method intellijDep() for arguments [] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
```
2021-05-20 17:02:00 +02:00
Viacheslav Kormushkin
d10910e553 Added support of custom Xcode configurations to cocoapods plugin
#KT-42023
2021-05-20 17:36:08 +03:00
Denis.Zharkov
a801eccf66 FIR: Report ARGUMENT_TYPE_MISMATCH instead of TYPE_MISMATCH for arguments 2021-05-20 17:24:51 +03:00
Denis.Zharkov
db500fab94 FIR: Avoid reporting redundant TYPE_MISMATCH (for assignments) 2021-05-20 17:24:50 +03:00
Denis.Zharkov
36c9418d55 FIR: Convert couple of methods to block-body 2021-05-20 17:24:49 +03:00
Denis.Zharkov
7c05c6420a FIR: Update test data (incorrect NEW_INFERENCE_ERROR with self types)
^KT-46661 Relates
2021-05-20 17:24:48 +03:00
Denis.Zharkov
4433dffbd3 FIR: Mute test that should be disabled since 1.6 2021-05-20 17:24:47 +03:00
Denis.Zharkov
8f41badf74 Minor. Regenerate tests 2021-05-20 17:24:46 +03:00
Denis.Zharkov
c3646b11ac FIR: Fix inference when unit value should be cast to Any 2021-05-20 17:24:44 +03:00
Denis.Zharkov
d3fc22fc6a FIR: Mute suspicious test relevant to safe-call and increment
See KT-46658
2021-05-20 17:24:43 +03:00
Denis.Zharkov
c4862fb124 FIR: Unwrap type aliases in type arguments 2021-05-20 17:24:42 +03:00
Denis.Zharkov
4f08e1550d FIR: Update test data (overload resolution by lambda return type) 2021-05-20 17:24:41 +03:00
Denis.Zharkov
be68dd5c11 FIR: Update test data (suspicious UPPER_BOUND_VIOLATED) 2021-05-20 17:24:40 +03:00
Denis.Zharkov
9265377d51 FIR: Update test data (SAM conversions)
See KT-46372
2021-05-20 17:24:39 +03:00
Denis.Zharkov
601500fd99 FIR: Update test data (extension function type -> function type)
See KT-46371
2021-05-20 17:24:38 +03:00
Denis.Zharkov
e46199d28b FIR: Update test data (nested type aliases)
It's not consistent with FE 1.0, but behavior
for nested type alias is undefined, yet.
2021-05-20 17:24:37 +03:00
Denis.Zharkov
da3233c47d FIR: Update test data (NEW_INFERENCE_ERROR)
Though these diagnostics look correct (the calls or constraint
systems indeed contain errors), more precise diagnostic kinds should be
chosen later.
2021-05-20 17:24:36 +03:00
Denis.Zharkov
010a0c6cdc FIR: Update test data (delegate inference)
Changed data looks correct
2021-05-20 17:24:35 +03:00
Denis.Zharkov
7c5c744e87 FIR: Update test data (suspicious diagnostic on return statement)
There should be errors, but different: cannot infer parameter type

^KT-46422 Relates
2021-05-20 17:24:34 +03:00
Denis.Zharkov
00821bbc63 FIR: Update test data (repeated diagnostics)
They are a bit redundant, but it needs additional work to be done
to avoid them
2021-05-20 17:24:33 +03:00
Denis.Zharkov
dbc0ebd861 FIR: Update test data
changed INAPPLICABLE_CANDIDATE -> ARGUMENT_TYPE_MISMATCH
2021-05-20 17:24:32 +03:00
Denis.Zharkov
b94335dd1c FIR: Update diagnostics test data
Green code correctly became red
2021-05-20 17:24:30 +03:00
Denis.Zharkov
829f80179c FIR: Update rendered tree in test data 2021-05-20 17:24:29 +03:00
Denis.Zharkov
faa5e46396 FIR: Fix inference case with flexible captured types
Previsously, errors have been ignored because we ignored errors raised
from the completion phase

See the comment above the createConstraintPartForLowerBoundAndFlexibleTypeVariable
2021-05-20 17:24:28 +03:00
Denis.Zharkov
c758069d7c FIR: Rework reporting COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH
Previously, it was reported via additional check on successful calls
But now it's contained within FirErrorNamedReference
2021-05-20 17:24:27 +03:00
Denis.Zharkov
c46d049394 FIR: Implement more precise reporting diagnostics from new inference 2021-05-20 17:24:26 +03:00
Denis.Zharkov
c67ae8a0a3 FIR: Replicate coercion-to-unit behavior from FE 1.0 2021-05-20 17:24:25 +03:00
Denis.Zharkov
dac5c31993 Minor. Simplify ConstraintSystemUtilContext::createArgumentConstraintPosition 2021-05-20 17:24:23 +03:00
Denis.Zharkov
9c7982673b FIR: Support substitution of inner class constructor capturing outer type parameters 2021-05-20 17:24:22 +03:00
Denis.Zharkov
91806c0a68 FIR: Refine diagnostics in case argument type mismatch on lambda
Report ArgumentTypeMismatch instead of imprecise NEW_INFERENCE_ERROR
2021-05-20 17:24:21 +03:00
Denis.Zharkov
2b806e717d FIR: Avoid adding new constraints when system already has contradictions 2021-05-20 17:24:20 +03:00
Denis.Zharkov
571c16be52 FIR: Fix computing dispatch receiver for property-delegation operators 2021-05-20 17:24:19 +03:00
Denis.Zharkov
35c754c27c FIR-DFA: Ignore FinallyBlockExitNode when computing return arguments 2021-05-20 17:24:17 +03:00
Denis.Zharkov
d0a0739d10 FIR: Mute builder-inference related tests
They started failing once we began reporting diagnostics from completion

^KT-46421 Relates
2021-05-20 17:24:16 +03:00
Denis.Zharkov
78ec4b5248 FIR: Mute property-delegation-inference related tests
They started failing once we began reporting diagnostics from completion
The main reason is that we resolve `delegate()` call
from `delegate().getValue()` in the independent context, while in FE 1.0
it's being resolved within the same system as getValue

^KT-46420 Relates
2021-05-20 17:24:15 +03:00
Denis.Zharkov
cd401b5b8a FIR: Update integer literal-related tests
They started failing once we began reporting diagnostics from completion

^KT-46419 Relates
2021-05-20 17:24:14 +03:00
Denis.Zharkov
42d387925d FIR: Refine makesSenseToBeDefinitelyNotNull
Make it work just the same as the analogue from FE 1.0
This change is necessary since many tests start failing after
we began reporting diagnostics after call completion
2021-05-20 17:24:12 +03:00
Denis.Zharkov
a700fdc312 FIR: Report diagnostics introduced during call completion 2021-05-20 17:24:10 +03:00
Nikita Bobko
09321e5e41 Implement ide-iml-to-gradle-generator
This module is used to generate build.gradle.kts files
of Kotlin IDE plugin
2021-05-20 16:09:14 +02:00
Nikita Bobko
61bf6bc447 Remove ':idea:idea-jps-common' from 'compiler-components-for-jps' artifact
It seems that it was added by mistake 'compiler-components-for-jps' artifact is used in IDE.
And in IDE we have our own jps-common module
2021-05-20 16:05:38 +02:00
Nikita Bobko
0fc31bc9c7 Disable IDE modules if 'attachedIntellijVersion' flag is specified 2021-05-20 16:05:37 +02:00
Nikita Bobko
897dafc7f3 GenerateTests: extract IDE part into separate module
It's refactoring-preparation commit. In later commits I will add possibility
to disable IDE modules with flags in gradle build (first step towards
removing IDE modules from kotlin repo). Thus, we need to extract IDE tests
generator in separate module for being possible to disable it with flags
2021-05-20 16:05:37 +02:00
Nikita Bobko
ac6c810d25 Make it possible to attach platforms with different versions to kotlin repo 2021-05-20 16:05:37 +02:00
Nikita Bobko
cc34f65392 [cleanup] Remove unused variable 2021-05-20 16:05:37 +02:00
Nikita Bobko
1fa4874426 Create 'installIdeArtifacts' task
This task is used for cooperative compilation with intellij.
See 'Install compiler-for-ide jars' run configuration in
intellij/kotlin-ide/intellij-kotlin repo
2021-05-20 16:05:37 +02:00
Nikita Bobko
8dec62de2b [kotlin + intellij combined] Add one more artifact url
This commit fixes:
```
* What went wrong:
Execution failed for task ':kotlin-ide.intellij.platform.testExtensions:compileKotlin'.
> Could not resolve all files for configuration ':kotlin-ide.intellij.platform.testExtensions:compileClasspath'.
   > Could not find intellij-core-analysis-deprecated-202.7660.26.jar (kotlin.build:ideaIC:202.7660.26).
     Searched in the following locations:
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/artifacts/lib/intellij-core-analysis-deprecated.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/artifacts/intellij-core-analysis-deprecated.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/artifacts/plugins/ideaIC/lib/intellij-core-analysis-deprecated.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/sources/intellij-core-analysis-deprecated-202.7660.26.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/intellij-core-analysis-deprecated.jar
```
2021-05-20 16:05:37 +02:00
Nikita Bobko
54f7633738 build.gradle.kts: exclude :kotlin-ide from allprojects
We don't need to setup compiler args and JDK version for kotlin-ide modules.
Generated build.gradle.kts will do it themselves
2021-05-20 16:05:37 +02:00
Nikita Bobko
6d125e0880 Initial implementation of kotlin + intellij combined repo 2021-05-20 16:05:36 +02:00
Nikita Bobko
cedafedfb0 Add kotlin-ide/ to .gitignore 2021-05-20 16:05:36 +02:00
Alexander Udalov
e0b0df01da Rename fields in KotlinIr.proto according to protobuf style guide
Field names should use snake_case, and names of repeated fields should
use the singular form: https://developers.google.com/protocol-buffers/docs/style#message_and_field_names
2021-05-20 15:59:42 +02:00
Alexander Udalov
8dee36d420 Tests: do not add transitive dependencies in multi-module tests
Prefer to have all module dependencies, including dependencies on
stdlib/reflect, declared explicitly. This allows to have tests on
situations like the one in KT-45308: three modules A<-B<-C, where C
doesn't depend on A, which was compiling correctly with the old JVM
backend before 1.5, but started to fail with JVM IR in 1.5.

Also simplify the code a bit, remove duplicated logic.
2021-05-20 15:58:05 +02:00
Alexander Shabalin
eac3f507b6 Make Kotlin_initRuntimeIfNeeded switch to native state 2021-05-20 13:48:49 +00:00
Ilya Goncharov
f40110eb83 [JS IR] Fixes after rebase 2021-05-20 16:37:52 +03:00
Ilya Goncharov
d65cbdf44d [JS IR] Fixes in tests
- Compilation of tests
- add arguments to extra help
2021-05-20 16:37:50 +03:00
Ilya Goncharov
b76f5547e4 [JS IR] Remove unnecessary overrides in IrNamer 2021-05-20 16:37:48 +03:00
Ilya Goncharov
0921235637 [JS IR] Remove redundant file after rebase 2021-05-20 16:37:47 +03:00
Ilya Goncharov
18cb8a1b9b [JS IR] Add flag with writing base class to metadata 2021-05-20 16:37:45 +03:00
Ilya Goncharov
228c6879f5 [JS IR] Add per-module output module name 2021-05-20 16:37:44 +03:00
Ilya Goncharov
4d7f7fc50f [Gradle, JS] Use jsOutputName as module name 2021-05-20 16:37:43 +03:00
Ilya Goncharov
eaf25b517d [JS IR] Use module name instead of output file wo extension 2021-05-20 16:37:41 +03:00
Ilya Goncharov
0e00186ca1 [JS IR] Fix compilation after rebase 2021-05-20 16:37:39 +03:00
Anton Bannykh
0182c09318 [JS IR] fix name clashes for imported external declarations 2021-05-20 16:37:38 +03:00
Anton Bannykh
6e40c814c8 [JS IR] add a flag which prepends a custom prefix to the per-module .js files 2021-05-20 16:37:37 +03:00
Anton Bannykh
7bd9462ffb [JS IR] save the desired JS output file name in the klib.
This is only usedful for code splitting. The output .js file name
is provided by the build system during the module compilation.
It is desirable to keep the .js output file names same as in old BE,
but calculating those name during the klib -> js phase is tricky.

Thus the desired names are saved in the klib, and used later on.
2021-05-20 16:37:35 +03:00
Anton Bannykh
6633a9edc0 [JS IR] add a flag which enable safe property access
If an accessor is not available at runtime we fall back
to the property access.

This is useful in cases when JS objects are casted to Kotlin
classes implicitly. This pattern did work in the old BE, which
lead to a significant amount of code which doesn't work anymore.
2021-05-20 16:37:34 +03:00
Anton Bannykh
8b18818bcc [JS IR] add base class to the $metadata$.interfaces list
This is needed for better compatibility with the old BE.
Some code in Space relies on the $metadata$ format.
2021-05-20 16:37:32 +03:00
Steven Schäfer
984e912f8d JVM IR: Do not unbox Results in suspend lambda invoke methods (KT-46813) 2021-05-20 14:40:00 +02:00
Dmitriy Novozhilov
ff3f3d2f9b [FIR] Properly setup search scope for IC symbol provider 2021-05-20 14:21:49 +03:00
Dmitriy Novozhilov
6e4cc49f1d [FIR] Cleanup IC provider creation in FirSessionFactory 2021-05-20 14:21:47 +03:00
Dmitriy Novozhilov
6d38a236c1 [FIR] Extract FIR related part of KotlinToJVMBytecodeCompiler to separate file 2021-05-20 14:21:46 +03:00
Jinseong Jeon
f0f1e2d945 FIR checker: report CAPTURED_VAL_INITIALIZATION 2021-05-20 13:59:13 +03:00
Andrey Zinovyev
d38effcbbe Use camel-case in FirFunctionCallOrigin
Also componentCall is operator call
2021-05-20 13:46:35 +03:00
Andrey Zinovyev
419aa65381 [FIR] Fix more tests because of modifier usage in resolution 2021-05-20 13:46:34 +03:00
Andrey Zinovyev
07a8ae7e71 [FIR] Mark more calls origin as OPERATOR 2021-05-20 13:46:32 +03:00
Andrey Zinovyev
0a45b3a50b [FIR] Set Function call origin to assign operators' functions 2021-05-20 13:46:31 +03:00
Andrey Zinovyev
cd22255ab7 [FIR] Set Function call origin in light tree too
Plus actualize some tests
2021-05-20 13:46:30 +03:00
Andrey Zinovyev
e021e25d6c [FIR] Resolve operator calls to operator functions only 2021-05-20 13:46:29 +03:00
Andrey Zinovyev
b1c8669b43 [FIR] Resolve infix calls to infix functions only
Implements INFIX_MODIFIER_REQUIRED diagnostics
2021-05-20 13:46:27 +03:00
Hung Nguyen
df14deb5a0 Organize integration tests for incremental Kotlin compile
Refactor common code into new abstract class
IncrementalCompilationBaseIT to make the code cleaner and easier to
evolve.

Also add a few missing key scenarios for ABI and non-ABI changes in
Kotlin files, and make it consistent with the test for changes in Java
files.

Bug: KT-45777
Test: Updating them
2021-05-20 12:59:07 +03:00
Mikhail Glukhikh
f3c9bd16ee Fix FIR IDE overrideImplement/androidxNotNull test 2021-05-20 12:22:23 +03:00
Mikhail Glukhikh
eac6da62d6 Fix FIR IDE highlighting tests 2021-05-20 12:22:22 +03:00
Mikhail Glukhikh
6dd41b617a FIR: position INAPPLICABLE_FILE_TARGET on file use-site (when possible) 2021-05-20 12:22:22 +03:00
Mikhail Glukhikh
6572010eed Introduce use-site annotation target checks for FIR 2021-05-20 12:22:22 +03:00
Mikhail Glukhikh
9a13ec9b76 FIR: report WRONG_ANNOTATION_TARGET on types 2021-05-20 12:22:22 +03:00
Mikhail Glukhikh
2a33a6927c FIR: report WRONG_ANNOTATION_TARGET(_WITH_USE_SITE_TARGET) on declarations 2021-05-20 12:22:21 +03:00
Mikhail Glukhikh
95f2c52659 FirAnnotationHelpers: use KotlinTarget instead of AnnotationTarget 2021-05-20 12:22:21 +03:00
Mikhail Glukhikh
7675ea3c23 Move AnnotationTargetLists & KotlinTarget to common compiler code 2021-05-20 12:22:21 +03:00
Mikhail Glukhikh
d11092ae3c FIR: support WRONG_ANNOTATION_TARGET on expressions 2021-05-20 12:22:21 +03:00
Mikhail Glukhikh
92ab600081 FIR: add check of SOURCE retention for EXPRESSION-targeted annotation 2021-05-20 12:22:21 +03:00
Mikhail Glukhikh
4b00a43b22 FIR: add ANNOTATION_ON_SUPERCLASS diagnostic 2021-05-20 12:22:20 +03:00
Mikhail Glukhikh
0d6bc7e7b2 FIR: report ANNOTATION_CLASS_CONSTRUCTOR_CALL diagnostic 2021-05-20 12:22:20 +03:00
Mikhail Glukhikh
3663884db2 FIR: support CONDITION_TYPE_MISMATCH diagnostic
We report CONDITION_TYPE_MISMATCH on
- loop conditions
- when branch conditions
- binary logic arguments
2021-05-20 12:22:20 +03:00
Mikhail Glukhikh
e85d97b894 FIR: introduce separate THROWABLE_TYPE_MISMATCH 2021-05-20 12:22:20 +03:00
Mikhail Glukhikh
f0ce311fc6 Drop unused ConeTypeMismatchError 2021-05-20 12:22:19 +03:00
Toshiaki Kameyama
b9a4b60b93 Unnecessary local variable: highlight with INFORMATION level when initializer has any multi-line blocks (#3359)
#KT-26752 Fixed
2021-05-20 11:12:41 +02:00
Andrey Zinovyev
e82857996f [lombok] Resolve to absolute path when import from maven
#KT-46723 Fixed
2021-05-20 11:57:07 +03:00
Pavel Kunyavskiy
2680111125 [K/N] Fix order of lowerings to enable when on enum optimisation
EnumWhenLowering searches for pattern, which is destroyed by
BuiltinOperatorLowering, so first one should happen before second.
2021-05-20 08:34:15 +00:00
Pavel Kunyavskiy
43b91589a1 [K/N] Create lowering for optimising when, with lowered enums support 2021-05-20 08:34:14 +00:00
Pavel Kunyavskiy
1dd6dcdeef [K/N] Store ordinal value in lowered enum 2021-05-20 08:34:13 +00:00
Pavel Kunyavskiy
8a418161f6 [K/N] Support pre-creating for objects with only constant properties 2021-05-20 08:29:23 +00:00
Pavel Kunyavskiy
e4ecb3745b [K/N] Debug util for checking if object is global constant 2021-05-20 08:29:22 +00:00
Ilya Goncharov
5d36264660 Add Node.js 14.17.0 with verification metadata 2021-05-19 21:22:32 +03:00
Ilya Goncharov
f0044516d1 [Gradle, JS] Update Node.js version on latest stable (14.17.0)
^KT-46693 fixed
2021-05-19 21:22:31 +03:00
Igor Yakovlev
b0df70dbfe [ULC] Fix delegate field type resolve
Fixed #KT-46519
2021-05-19 20:49:55 +03:00
Alexander Shabalin
a02cecec20 Disable interop_cleaners_leak 2021-05-19 15:51:05 +00:00
Ilya Muradyan
9412fe094b [REPL] Copy findLabelAndCall to scripting-ide-services to fix problems with embeddable artifact 2021-05-19 18:32:50 +03:00
Ilya Muradyan
7caadd87a2 [Scripting] Get rid of unneeded dependencies in Maven resolver 2021-05-19 18:32:48 +03:00
Alexander Udalov
2fe498149e Psi2ir: add file name to exception when generating synthetic declarations 2021-05-19 17:12:12 +02:00
Alexander Udalov
6581d222cd Fix accidental usage of ASM from jdk.internal in jvm-debugger
Similarly to ee6586fe4f.
2021-05-19 17:11:08 +02:00
Dmitriy Novozhilov
99cdb86145 [FIR] Move createSessionWithDependencies to FirSessionFactory 2021-05-19 16:29:20 +03:00
Dmitriy Novozhilov
2ee54c2201 [FIR] Remove way to create FirSession using Module
The problem is that Module may not contain some default dependencies in
  classpath roots, so it's incorrect to take them from it
2021-05-19 16:29:19 +03:00
pyos
b2ef854aa1 JVM_IR: support @JvmStatic transformations in LateinitLowering
#KT-46759 Fixed
2021-05-19 16:23:01 +03:00
pyos
f1f13b6e97 JVM_IR: do not evaluate receiver of static calls if it is pure
#KT-46802 Fixed
2021-05-19 16:22:59 +03:00
Dmitriy Dolovov
ae1590d3cf [Native] Support multiple suspend lambdas as class supertypes
Drop the backend check. Eveything else is already fixed in
3b3318ab06

^KT-46775
2021-05-19 16:09:47 +03:00
Dmitriy Dolovov
896929cb21 [Native] Support suspend functions as supertypes
^KT-46777
2021-05-19 16:09:38 +03:00
Ilmir Usmanov
9fe503eeb3 Minor. Add regression test
#KT-45685 Fixed
2021-05-19 12:45:26 +02:00
Andrey Uskov
41dd6250d4 Implemented collecting use-old-backend flag from Gradle
#KT-46689 Fixed
2021-05-19 13:25:26 +03:00
Alexander Shabalin
3388ca2536 Support ObjC blocks in the new MM 2021-05-19 07:31:12 +00:00
Alexander Shabalin
94076300ec Implement a bit more of GC object interface 2021-05-19 07:29:27 +00:00
Jinseong Jeon
a3105da32e FIR checker: more specific type for CONFLICTIONG_PROJECTION 2021-05-19 01:04:21 +03:00
Jinseong Jeon
8d474c0e7e FIR checker: more specific type for containing class in diagnostics
about abstract members in non-abstract class
2021-05-19 01:04:20 +03:00
Jinseong Jeon
864ab2cadd FIR checker: clearer parameter names in diagnostics 2021-05-19 01:04:19 +03:00
Dmitriy Novozhilov
e08df2c530 [Test] Add diagnostics and codegen tests with hmpp module structure 2021-05-19 00:52:31 +03:00
Dmitriy Novozhilov
73a63359df [Test] Add new directive for specifying target platform for module 2021-05-19 00:52:28 +03:00
Dmitriy Novozhilov
06b2efe65f [Test] Introduce new syntax for dependsOn dependencies 2021-05-19 00:52:27 +03:00
Dmitriy Novozhilov
47e258ef6e [Test] Enable reporting errors from fronted to testdata of codegen tests 2021-05-19 00:52:25 +03:00
Dmitriy Novozhilov
df60e7368a [Test] Fix syntax errors in few boxInline tests 2021-05-19 00:52:24 +03:00
Dmitriy Novozhilov
27f0d938c9 [Test] Add wrapping of failures from different parts of test pipeline 2021-05-19 00:52:22 +03:00
Dmitriy Novozhilov
6aca0bb374 [Test] Add ability to disable DEBUG_INFO diagnostics except explicitly defined 2021-05-19 00:52:21 +03:00
Dmitriy Novozhilov
d44782f49f [Test] Allow to enable/disable all diagnostics with specific severity 2021-05-19 00:52:19 +03:00
Yahor Berdnikau
7fc23a1647 Deprecate 'kotlin.parallel.tasks.in.project' build property.
Default value will use Gradle parallel execution option value.

^KT-46401 Fixed
2021-05-18 21:02:02 +00:00
Dmitry Petrov
851980e36f JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs 2021-05-18 22:20:12 +03:00
pyos
bfb1a06f3d FIR: resolve conflicts between overloads with platform integer types 2021-05-18 22:11:33 +03:00
Victor Petukhov
a27d428573 Regenerate tests 2021-05-18 21:26:10 +03:00
Dmitriy Novozhilov
38fe917141 [FIR] Change order of IC symbol provider and dependency symbol provider
This is semantically incorrect, but current behavior leads to problems
  in FIR bootstrap due to incorrect setup of IC provider. So this ordering
  change is a workaround for now
2021-05-18 20:56:07 +03:00
Dmitriy Novozhilov
7d5fa2830d [FIR] Properly create source search scope in FIR CLI compiler 2021-05-18 20:56:05 +03:00
Dmitriy Novozhilov
dbccd4d459 [FIR] Properly acquire module data in FirSignatureEnhancement 2021-05-18 20:56:04 +03:00
Steven Schäfer
bf7db84451 Parcelize: Handle class hierarchies of Parcelers (KT-46567) 2021-05-18 18:52:15 +02:00
Andrey Zinovyev
709c127f1b [IR] Distinguish super calls from other calls
Otherwise super call and virtual call to the same method get the same
map key in case of Fir2Ir IR generation
2021-05-18 19:32:23 +03:00
Steven Schäfer
60bc0f4baf IR: Lower shared variables in enum entries (KT-46605) 2021-05-18 16:55:38 +02:00
Victor Petukhov
b78c645fb0 Report warnings by enhanced base types 2021-05-18 17:52:39 +03:00
Victor Petukhov
2239404085 Extract type preparation during type checking to a separate component 2021-05-18 17:52:23 +03:00
Victor Petukhov
cba221c18a Add test for enhancement in usages of annotated type parameter 2021-05-18 17:52:21 +03:00
Victor Petukhov
fd6475c804 Update tests 2021-05-18 17:52:19 +03:00
Victor Petukhov
8602d1fcf0 Merge foreign annotation tests for sources and binaries into single directory 2021-05-18 17:52:16 +03:00
Victor Petukhov
df2c95e444 [Jspecify] Use bounds of type parameters for warnings reporting as well 2021-05-18 17:52:14 +03:00
Victor Petukhov
0c4cba549d [Jspecify] Use arguments of enhancement of type instead of arguments of base type during getting enhancement of type deeply 2021-05-18 17:52:12 +03:00
Victor Petukhov
21dada4d2d [Jspecify] Use enhancement of type with enhancement if possible during substitution 2021-05-18 17:52:10 +03:00
Victor Petukhov
12f6146bdf [Jspecify] Substitute enhancement of type instead of type itself directly 2021-05-18 17:52:09 +03:00
Victor Petukhov
2479655708 [Jspecify] Do preserving flexibility when adding equality constraints by taking into account type with enhancement 2021-05-18 17:52:07 +03:00
Victor Petukhov
937e82db46 [Jspecify] Report warnings on violated bounds of method type parameters 2021-05-18 17:52:06 +03:00
Victor Petukhov
0d6764efc5 Process raw types during erasion properly
^KT-46670 Fixed
^KT-46476 Fixed
2021-05-18 17:38:52 +03:00
Svyatoslav Scherbina
570d860217 Native: deprecate SymbolName annotation 2021-05-18 17:29:00 +03:00
Igor Chevdar
3b3318ab06 [K/N][codegen] Refactored interface calls
Removed old impl for debug builds
Fixes https://youtrack.jetbrains.com/issue/KT-44547 as a side effect
2021-05-18 18:58:14 +05:00
Alexander Likhachev
3df45f9651 [Build] Bump kotlin-build-gradle-plugin version to 0.0.29 2021-05-18 16:37:36 +03:00
Alexander Likhachev
8a3a60caae [Build] Bump kotlinx-benchmark version to 0.3.1
kotlinx-benchmark Gradle plugin 0.3.1 now reads system property `idea.active` in compatible with configuration cache way
#KT-44611 In Progress
2021-05-18 16:37:36 +03:00
Alexander Likhachev
cf00bc8243 [Build] Remove outdated IDEA sync detection 2021-05-18 16:37:35 +03:00
Alexander Likhachev
b6670f5cc8 [Build] Replace build scan config script with plugin
See 129e82c556/common-custom-user-data-gradle-plugin
2021-05-18 16:37:35 +03:00
Alexander Likhachev
8ddbf542f3 [Gradle] Declare IDEA-related system properties reads
#KT-44611 In Progress
2021-05-18 16:37:34 +03:00
Alexander Likhachev
091b2129e7 [Build] Make GE build scan configuration compatible with conf cache
#KT-44611 In Progress
2021-05-18 16:37:34 +03:00
Alexander Likhachev
ca2051e1d4 [Build] Disable custom normalization when conf cache is enabled
Custom input normalizations currently isn't supported by Gracle configuration cache
#KT-44611 In Progress
2021-05-18 16:37:34 +03:00
Alexander Likhachev
cc183e96a4 [Build] Fix configuration cache undeclared system property read issues
#KT-44611 In Progress
2021-05-18 16:37:29 +03:00
Andrei Klunnyi
f0a6d9f33f VFS: reset KOTLIN_IS_COMPILED_FILE_ATTRIBUTE
This commit resets mentioned file attribute from Kotlin binary files.
It finalizes the fix 929b6dd9 - users might have mistakenly set 'false'
value left on their file systems.
2021-05-18 15:34:26 +03:00
Vladimir Ivanov
5a0f113e6d [cinterop] Fix type annotation for struct containing anonymous union … (#4289) 2021-05-18 14:34:56 +03:00
Vladimir Dolzhenko
b01478746c Cache all module dependencies to avoid O(n^2) calc complexity
Quite noticeable when there is a big module that has 100+ libraries and many modules depends on it

#KT-46622 Fixed
2021-05-18 09:20:18 +00:00
Andrey Zinovyev
82b7f589ad Add missing base-compiler-plugins-ide-support dependencies 2021-05-18 11:49:04 +03:00
pyos
21f2b3fa2b JVM: expect a continuation parameter in default suspend references 2021-05-18 10:48:31 +02:00
pyos
7eedcf75f9 Add tests for default inline suspend lambdas
Broken on JVM and JVM_IR
2021-05-18 10:48:31 +02:00
pyos
57c934987c JVM_IR: try to load mangled invoke from default lambdas
Old compiler versions still won't be able to load default lambdas
generated by JVM_IR, but this way we avoid incorrect behavior of
function references taking inline class types that unbox to Any.

 #KT-46601 Fixed
2021-05-18 10:48:31 +02:00
pyos
34ac232a82 Add a test for KT-46601 2021-05-18 10:48:31 +02:00
pyos
c32ccbb39a JVM: move descriptors from DefaultLambda to PsiDefaultLambda
Also, produce more correct results in IrDefaultLambda's
`invokeMethodParameters` and `invokeMethodReturnType`. This affects
whether the inliner inserts inline class boxings/unboxings around lambda
calls; while this doesn't matter now due to KT-46601, it would if the
naming was fixed.
2021-05-18 10:48:31 +02:00
pyos
7c168d663a JVM: move PSI-based LambdaInfo to PsiInlineCodegen 2021-05-18 10:48:31 +02:00
pyos
493b4e6c27 JVM: rearrange some LambdaInfo stuff 2021-05-18 10:48:31 +02:00
pyos
14e1417ea8 JVM: expect consistent signatures from LambdaInfo 2021-05-18 10:48:31 +02:00
Yahor Berdnikau
aae5cc5574 Update AGP versions to the latest stable one.
Kotlin Gradle Plugin should run against the latest stable one versions.
2021-05-18 10:37:41 +03:00
Ivan Kochurkin
73fb851864 [FIR] Commit incorrect test data that should be restored after fix of https://youtrack.jetbrains.com/issue/KT-41794 2021-05-17 22:33:19 +03:00
Ivan Kochurkin
c3b8f3e859 [FIR] Add lValueTypeRef to FirVariableAssignment, fix tests with ASSIGNMENT_TYPE_MISMATCH 2021-05-17 22:33:18 +03:00
Ivan Kochurkin
e57108d4e8 [FIR] Implement ASSIGNMENT_TYPE_MISMATCH, RESULT_TYPE_MISMATCH diagnostics, fix tests 2021-05-17 22:33:16 +03:00
Ilya Kirillov
aa70c952eb FIR IDE: fix SOE on opening project
Kotlin library may contain cycles which causes SOE in FirModuleInfoBasedModuleData.dependencies
2021-05-17 20:56:57 +02:00
Ilya Chernikov
d365d7c784 Fix IR compilation for empty script
#KT-46646 fixed
2021-05-17 20:15:14 +03:00
Dmitry Petrov
3a0e3798ec JVM_IR KT-46597 fix receiver type for inlined callable reference
Receiver type is used by SyntheticAccessorLowering to determine class in
which a synthetic accessor should be generated.
2021-05-17 20:12:58 +03:00
Konstantin Tskhovrebov
80ce3a5cf8 Delete umbrella Apple framework tasks and register concrete tasks.
#KT-46680
2021-05-17 19:45:02 +03:00
Ilya Muradyan
55a9f1a910 [Scripting] Make AetherResolveSession internal and do related refactorings 2021-05-17 18:22:29 +03:00
Ilya Muradyan
a0cc88ab5a [Scripting] Add transitive support for Maven Resolver 2021-05-17 18:22:28 +03:00
Ilya Muradyan
b77a822822 [Scripting] Add authorization for Maven Resolver 2021-05-17 18:22:26 +03:00
Ilya Muradyan
78c65ab802 [Scripting] Bump up Maven resolver JARs version 2021-05-17 18:22:25 +03:00
Yahor Berdnikau
800e382ba9 Warn on using 'jdkHome' option in Gradle builds.
User should instead use KotlinJavaToolchain that will take care of
tracking major java version and provide nicer API.

Gradle will still pass jdkHome value to the compiler, but it should
be changed in Kotlin 1.6 release.

^KT-45611 Fixed
2021-05-17 16:57:01 +03:00
Ilya Goncharov
74d1812461 [JS IR] Review remarks
- Move origin to common place
- Add comments and todo about solution
- Remove MODULE directive from tests
- Add test with in-place using of js function
2021-05-17 16:51:22 +03:00
Ilya Goncharov
507516e44d [JS IR] Add tests with reified generic and with KType on DCE to leave class 2021-05-17 16:51:20 +03:00
Ilya Goncharov
f0b3ee0e35 [JS IR] Add test with class reference using from js 2021-05-17 16:51:19 +03:00
Ilya Goncharov
137532bfa6 [JS IR] Use separate origin for class reference to preserve constructors 2021-05-17 16:51:17 +03:00
Leonid Startsev
796d2fd210 Respect explicit api mode state when generating actual declarations
#KT-44067 Fixed
2021-05-17 12:40:49 +00:00
Leonid Startsev
8cd704b6db Exclude public API symbols in explicit mode from unused symbol inspection
#KT-41659 Fixed
2021-05-17 12:40:48 +00:00
Leonid Startsev
19dece01f6 Add support of explicit API mode to 'Make public' intention
#KT-41902 Fixed

Do not check languageVersionSettings for fake elements
because this leads to an exception
2021-05-17 12:40:47 +00:00
Igor Yakovlev
d34c23914a [FIR IDE] Fix invalid designation collecting for local classes 2021-05-14 23:06:04 +03:00
Igor Yakovlev
207bad5d5f [FIR IDE] Implementation of KtUserType resolve 2021-05-14 23:06:03 +03:00
Igor Yakovlev
a5f701bac7 [FIR IDE] OnAir resolve for annotations with file site 2021-05-14 23:06:02 +03:00
Igor Yakovlev
dedcaf1eab [FIR IDE] Fixed annotation application completion 2021-05-14 23:06:00 +03:00
Igor Yakovlev
3275165619 [FIR IDE] Fix resolve for incomplete or invalid references 2021-05-14 23:05:59 +03:00
Igor Yakovlev
2bfacaaed2 [FIR IDE] Rename and move refactorings, codereview refactorings 2021-05-14 23:05:58 +03:00
Igor Yakovlev
c5372be267 [FIR IDE] Move and rename RawFirFragmentForLazyBodiesBuilder into Fir Ide module 2021-05-14 23:05:57 +03:00
Igor Yakovlev
0569f810cf [FIR IDE] Add OnAir resolve tests 2021-05-14 23:05:55 +03:00
Igor Yakovlev
633e03b710 [FIR IDE] LowLevel api refactoring 2021-05-14 23:05:54 +03:00
Igor Yakovlev
445f13d1bf [FIR IDE] Fix invalid body lazy resolve 2021-05-14 23:05:53 +03:00
Igor Yakovlev
cfc0bfd64a [FIR IDE] Refactoring of designated IDE transformers 2021-05-14 23:05:52 +03:00
Igor Yakovlev
384b2ad048 [FIR IDE] Rename refactoring and speed improvements 2021-05-14 23:05:50 +03:00
Igor Yakovlev
966743c704 [FIR IDE] Enable passing completion tests 2021-05-14 23:05:49 +03:00
Igor Yakovlev
37ccab4e23 [FIR] Fixed supertypes resolve for invalid code with class without ClassId 2021-05-14 23:05:48 +03:00
Igor Yakovlev
2e7eedd3f2 [FIR IDE] Correct in-body supertype resolve of fake nodes 2021-05-14 23:05:46 +03:00
Igor Yakovlev
959ff50fa7 [FIR IDE] Collect tower contexts for local declarations 2021-05-14 23:05:45 +03:00
Igor Yakovlev
ae63ad0b6d [FIR] Fix annotations invalid references diagnostics 2021-05-14 23:05:44 +03:00
Igor Yakovlev
261098a122 [FIR IDE] Implement on-air resolve of non-local declarations 2021-05-14 23:05:42 +03:00
Igor Yakovlev
779a06e86f [FIR IDE] Add types, supertypes and status lazy designated transformers 2021-05-14 23:05:41 +03:00
Igor Yakovlev
95acb6121b [FIR IDE] Fixed property and parameter creation/replacement and fixed invalid source on annotation type 2021-05-14 23:05:40 +03:00
Igor Yakovlev
38242bee75 [FIR] Fixed invalid real psi source fir fir annotation name reference 2021-05-14 23:05:38 +03:00
Igor Yakovlev
aaefe94763 [FIR IDE] Refactor low level resolve state for completion
Rename refactorings
Remove redundant methods and implementations
Increase code-logic locality
Removed redundant entities
2021-05-14 23:05:37 +03:00
Alexander Udalov
aa13936cb2 Move GenerateProtoBuf to separate source set with no dependencies
Also move GenerateProtoBufCompare to a new source set with a dependency
only on build-common.

 #KTI-79 Fixed
2021-05-14 21:08:56 +02:00
Ilya Kirillov
8b722cfc47 Separate uast-idea modules into fir and fe10 implementations 2021-05-14 20:57:20 +03:00
Svyatoslav Scherbina
ba6c3c7fe0 Add workaround for KT-35001
Just suppress the warning.
The accident it describes is generally harmless and totally expected.
2021-05-14 20:05:30 +03:00
Svyatoslav Scherbina
48a684c024 Native: implement custom handling for LLVM diagnostics
Apply it when linking LLVM modules, because otherwise LLVM would
terminate the entire compiler process on link errors, which isn't ok,
e.g. when embedding the compiler into Gradle daemon (see KT-46358).
2021-05-14 20:05:29 +03:00
Alexander Udalov
ee6586fe4f Fix accidental usage of ASM from jdk.internal
#KT-46402 Fixed
2021-05-14 15:23:08 +02:00
Dmitry Petrov
d1322280dd JVM_IR KT-46578 resolve fake overrides for fields 2021-05-14 16:20:22 +03:00
Mikhail Glukhikh
a255f44d6e FIR2IR KT-46578 add overridden properties generation 2021-05-14 16:20:20 +03:00
Dmitry Petrov
53c1de172f IR KT-46578 add IrProperty#overriddenSymbols 2021-05-14 16:20:18 +03:00
Andrey Zinovyev
dc9d5cdf35 [FIR] Handle of special getters when there is a kotlin super type
Special getter names (like Collection.size()) can be used only in Java
classes with all-java super-types
Because if there is a kotlin class (not interface) in
 the middle, we 'materialize' special getters to properties.
2021-05-14 15:38:09 +03:00
Dmitriy Novozhilov
7066a5b3dc [FIR-IDE] Questionable testdata update 2021-05-14 14:30:46 +03:00
Dmitriy Novozhilov
c652a9e7b1 [FIR-IDE] Use correct session in member scope provider 2021-05-14 14:30:45 +03:00
Dmitriy Novozhilov
194252e5a1 [FIR-IDE] Properly setup moduleDataProvider for ide library session 2021-05-14 14:30:44 +03:00
Dmitriy Novozhilov
43b075d452 [FIR] Add path normalization to LibraryPathFilter 2021-05-14 14:30:43 +03:00
Dmitriy Novozhilov
cf5af0f7ea [FIR] Add KDoc to FirModuleData 2021-05-14 14:30:42 +03:00
Dmitriy Novozhilov
f02a4a6b1f [FIR-IDE] Add workaround hack for building raw FIR with libraries session 2021-05-14 14:30:41 +03:00
Dmitriy Novozhilov
0427066558 [FIR-IDE] Fix compilation after changes in API of FirSessionFactory 2021-05-14 14:30:40 +03:00
Dmitriy Novozhilov
af307bd55d [FIR] Fix compilation of AbstractFirBaseDiagnosticsTest 2021-05-14 14:30:38 +03:00
Dmitriy Novozhilov
28be3a0dbc [FIR] Replace Path with String in KotlinJvmBinaryClass.containingLibrary
This is needed because :core:deserialization.common.jvm uses JDK 6
2021-05-14 14:30:37 +03:00
Dmitriy Novozhilov
2abed7161b [FIR] Get rid of FirJvmModuleInfo 2021-05-14 14:30:36 +03:00
Dmitriy Novozhilov
28e4721a89 [FIR] Check internal visibility in FirJvmModuleVisibilityChecker using module data 2021-05-14 14:30:35 +03:00
Dmitriy Novozhilov
02c58b7a8f [FIR] Refactor deserialized dependency providers and session factories with FirModuleData 2021-05-14 14:30:33 +03:00
Dmitriy Novozhilov
24f1f7b7b2 [FIR] Unify FirLibrarySession and FirJavaModuleBasedSession into single FirCliSession 2021-05-14 14:30:32 +03:00
Dmitriy Novozhilov
f16194e60d [FIR] Get rid of FirSession.moduleInfo 2021-05-14 14:30:31 +03:00
Dmitriy Novozhilov
57a8642f5a [FIR] Add analyzer services to FirModuleData 2021-05-14 14:30:29 +03:00
Dmitriy Novozhilov
92d6b39ffe [FIR] Add late initialization of session in FirModuleData 2021-05-14 14:30:28 +03:00
Dmitriy Novozhilov
5cfa8694d4 [FIR] Fix all usages of declarationSiteSession 2021-05-14 14:30:27 +03:00
Dmitriy Novozhilov
a15316de24 [FIR] Replace declarationSiteSession with moduleData 2021-05-14 14:30:26 +03:00
Dmitriy Novozhilov
fa8d8ad503 [FIR] Add cache for top-level functions and properties to AbstractFirDeserializedSymbolsProvider 2021-05-14 14:30:25 +03:00
Dmitriy Novozhilov
c523379e6a [FIR] Move out all JVM specific deserialization logic from AbstractFirDeserializedSymbolsProvider 2021-05-14 14:30:23 +03:00
Dmitriy Novozhilov
e8c4b0e947 [FIR] Rename KotlinScopeProvider to FirKotlinScopeProvider 2021-05-14 14:30:22 +03:00
Dmitriy Novozhilov
4ad7a4a2d1 [FIR] Split KotlinDeserializedJvmSymbolsProvider to common and JVM specific parts 2021-05-14 14:30:21 +03:00
Dmitriy Novozhilov
e5b7cf23d6 Drop min functions from addToStdlib.kt 2021-05-14 14:30:20 +03:00
Dmitriy Novozhilov
d114913cd2 Replace usages of addToStdlib.firstNotNullResult with firstNotNullOfOrNull 2021-05-14 14:30:19 +03:00
Dmitriy Novozhilov
24b6c5df56 Add regression test for KT-45905 2021-05-14 14:30:14 +03:00
Anton Yalyshev
c386b10f04 Add change notes for 1.5.20-M1 2021-05-14 14:05:44 +03:00
Tianyu Geng
3c4e3e8db6 FIR: remove obsolete DataFlowVariablev.isStable 2021-05-14 13:34:33 +03:00
Andrey Zinovyev
84a7bdffe5 [FIR] Don't report MUST_BE_INITIALIZED* on unreachable properties 2021-05-14 12:41:18 +03:00
Alexander Udalov
8308f5d7d3 Create array instances of correct types in reflection
Based on #4168.

 #KT-44977 Fixed

Co-authored-by: Arkady Bazhanov <arkady.bazhanov@gmail.com>
2021-05-14 11:16:29 +02:00
Roman Golyshev
ec6c25ef7e FIR IDE: Remove names duplicates in createImportTypeFix 2021-05-13 21:41:57 +03:00
Roman Golyshev
9504488acb FIR IDE: Do not show hint from ImportQuickFix if the PSI have changed
Without this check, the import hint will be available even after the
quickfix is applied; this happens because the element to which the
quickfix is attached is not invalidated by the quickfix execution

Since the quickfix is still considered as available some time after
the import have been added, the hint is also generated. And the hint
stays even after the quickfix itself is discarded

`isOutdated` function prevents this
2021-05-13 21:41:56 +03:00
Alexander Udalov
8991ce53f4 Regenerate tests 2021-05-13 19:16:09 +02:00
Steven Schäfer
b2378620c3 JVM IR: Fix handling of anonymous initializers in inline classes (#4372)
Fixes KT-46554
2021-05-13 18:40:26 +02:00
Yan Zhulanow
cc4c61d2b3 Remove dependency on parcelize-runtime in the Parcelize compiler plugin 2021-05-14 01:06:39 +09:00
Yan Zhulanow
e90cc30edb Remove CLI and some of daemon-related modules from compiler-for-ide
These modules is not required by the plugin, and the plugin verifier
warns about unsatisfied dependencies of the modules.

CLI is needed in tests so a separate artifact is created instead.
2021-05-14 01:06:39 +09:00
Yan Zhulanow
26f71c33c0 IDE: Publish JS IR klib artifact 2021-05-14 01:06:39 +09:00
Andrey Zinovyev
58c7aa9937 [FIR] Don't replace custom compareTo with default one in primitives 2021-05-13 18:04:43 +03:00
Mikhail Glukhikh
1a3aa1bff0 FIR: report ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT 2021-05-13 16:13:44 +03:00
Mikhail Glukhikh
55104a594c FIR: fix WRONG_GETTER(SETTER)_RETURN_TYPE associated PSI types 2021-05-13 16:13:44 +03:00
Mikhail Glukhikh
0f9f63400e FirSupertypesChecker: implement six more diagnostics 2021-05-13 16:13:43 +03:00
Mikhail Glukhikh
db828a6aad Generalize FirInterfaceWithSuperclassChecker to FirSupertypesChecker 2021-05-13 16:13:43 +03:00
Mikhail Glukhikh
632a9d66d1 FIR: introduce isPrimitive / isPrimitiveOrNullablePrimitive helpers 2021-05-13 16:13:42 +03:00
Mikhail Glukhikh
6d82aa0bc9 Drop duplicating FirPropertyAccessorChecker 2021-05-13 16:13:08 +03:00
Mikhail Glukhikh
d2cbf941db Collect all accessor checks in FirPropertyAccessorChecker 2021-05-13 16:13:08 +03:00
Mikhail Glukhikh
243114ef29 FIR: add 'withSuppressedDiagnostics' call to property checkers 2021-05-13 16:13:08 +03:00
Mikhail Glukhikh
6618b4ea57 FirPropertyAccessorChecker: add three new diagnostics 2021-05-13 16:13:07 +03:00
Dmitriy Novozhilov
1a3b5657c7 [FIR] Fix overload conflicts resolution for callable references with defaults 2021-05-13 15:31:18 +03:00
Alexander Udalov
e3b92fd561 Update instructions to run protoc on Windows and Linux 2021-05-13 13:58:43 +02:00
Alexander Udalov
b5af93c8b4 Fix IR proto backward compatibility for InlineClassRepresentation
This is important only if any backend which uses IR serialization will
(accidentally or voluntarily) use `IrClass.inlineClassRepresentation`,
which is missing in IR of klibs serialized with 1.5.20 or earlier.

Note that at the moment only JVM IR is using
`IrClass.inlineClassRepresentation`, but ideally we'd like to change
that (if needed).
2021-05-13 13:58:43 +02:00
Alexander Udalov
0a18174165 IR: remove hack related to inline class representation in lazy IR
This commit effectively reverts changes from
b5f9b1dfc0, fixing the problem from
KT-44723 in a stabler way. It is possible because we now serialize
inline class representation to metadata and after previous changes, we
have that representation as a field in IrClass.
2021-05-13 13:56:59 +02:00
Alexander Udalov
da06faa57e JVM IR: use inlineClassRepresentation in more utilities
Remove any logic related to finding the single parameter of the primary
constructor, and use inlineClassRepresentaton from IrClass or
ClassDescriptor instead.
2021-05-13 13:56:59 +02:00
Alexander Udalov
54befa769f IR: add IrClass.getInlineClassRepresentation, serialize/deserialize it
The change in FirDeclarationUtil is needed because in case of unsigned
types loaded from the standard library, the primary constructor for some
reason is not the first, but the second in the list of constructors.
2021-05-13 13:56:59 +02:00
Alexander Udalov
4c7f207309 Use new getInlineClassRepresentation in some utilities 2021-05-13 13:54:02 +02:00
Alexander Udalov
7fb3f48c67 Add ClassDescriptor.getInlineClassRepresentation
This will be used at least in the JVM backend instead of the current
approach where we're loading the primary constructor's first parameter,
which isn't good enough since primary constructor can be private, and
we can't rely on private declarations in case they're declared in
another module.
2021-05-13 13:54:02 +02:00
Steven Schäfer
6aaff9dfb7 JVM IR: Handle overloaded values functions in MappedEnumWhenLowering
Fixes KT-46579.
2021-05-13 13:24:32 +02:00
Andrey Zinovyev
5d30576d28 [FIR] Report not-a-constant diagnostics inside function calls
When function calls are not fully resolved
2021-05-13 10:15:26 +03:00
Andrey Zinovyev
e74141ded6 [FIR] Properly check spread constant argument 2021-05-13 10:13:21 +03:00
Andrey Zinovyev
07e47140a6 [FIR] Treat unsigned numbers as primitives in constant checker 2021-05-13 10:11:59 +03:00
Roman Golyshev
9cadd1c8a7 Remove IGNORE_FIR from test data of already green test 2021-05-13 03:22:07 +03:00
Pavel Punegov
238ada04c0 Use newer version of Kotlin/Native in the testNativeCompilerDownloading 2021-05-13 03:19:23 +03:00
Yahor Berdnikau
13fd2a24ea Fix exposing provided by Gradle Kotlin dependencies.
Ensure that Gradle plugin dependencies do not include kotlin-stdlib,
kotlin-reflect and other dependencies that are provided by Gradle
runtime.

^KT-41142 Fixed
2021-05-12 23:28:37 +03:00
Steven Schäfer
1198b40c11 Parcelize: Port the fix for KT-41553 to android-extensions
Fixes KT-46590.
2021-05-12 21:18:15 +02:00
Ilya Kirillov
4ef81e93ef FIR IDE: properly implement FirKeywordCompletionContributor.keywordCompletion 2021-05-12 21:40:22 +03:00
Ilya Kirillov
ca320f2f8d FIR IDE: add this labels to keyword completion 2021-05-12 21:40:20 +03:00
Ilya Kirillov
47a596c214 FIR IDE: add return target to tail in keyword completion
The same do FE10 completion and we need it to have consistent tests
2021-05-12 21:40:19 +03:00
Ilya Kirillov
f8fc43f1e9 FIR IDE: add AbstractKeywordCompletionTest 2021-05-12 21:40:18 +03:00
Ilya Kirillov
96117fc1eb FIR IDE: cleanup FirPositionCompletionContextDetector.detect 2021-05-12 21:40:16 +03:00
Ilya Kirillov
597d64b81d FIR IDE: do not ignore passing tests from AbstractFirKeywordCompletionHandlerTest 2021-05-12 21:40:15 +03:00
Ilya Kirillov
f18bcdb88c FIR IDE: add AbstractFirKeywordCompletionHandlerTest 2021-05-12 21:40:14 +03:00
Ilya Kirillov
e5202f44d7 Refactor keyword completion handlers
- Separate completion keyword handlers stuff into files
- Introduce CompletionKeywordHandlerProvider as a common way to provide handlers
- Move CompletionKeywordHandler factory out of companion object
2021-05-12 21:40:12 +03:00
Ilya Kirillov
8983bde73e FIR IDE: implement override completion 2021-05-12 21:40:11 +03:00
Ilya Kirillov
ae212f36f5 FIR IDE: move addElementToCompletion to FirCompletionContributorBase 2021-05-12 21:40:10 +03:00
Ilya Kirillov
e624f2c136 FIR IDE: do not pass resultSet in KotlinWithNameReferenceCompletionProvider as it is already available 2021-05-12 21:40:09 +03:00
Ilya Kirillov
49aba39ae8 Make OverridesCompletionLookupElementDecorator available for FIR IDE 2021-05-12 21:40:07 +03:00
Ilya Kirillov
8f399652d7 FIR IDE: add expressions to return keyword completion
Also, adds return targets for return with labels while FE1.0 plugin don't
2021-05-12 21:40:06 +03:00
Ilya Kirillov
8cfa85df6b FIR IDE: make FirKeywordCompletion to be a completion contributor 2021-05-12 21:40:04 +03:00
Ilya Kirillov
ca1fd185dc FIR IDE: introduce base class for completion provider 2021-05-12 21:40:03 +03:00
Ilya Kirillov
81c6f38f79 FIR IDE: move context creation out of KotlinFirCompletionContributor 2021-05-12 21:40:02 +03:00
Ilya Kirillov
8eff865277 FIR IDE: encapsulate basic completion parameters into class 2021-05-12 21:40:01 +03:00
Ilya Kirillov
a08c267c37 FIR IDE: mute a few completion tests as they now fails because of unexpected keywords 2021-05-12 21:39:59 +03:00
Ilya Kirillov
98becc9a50 FIR IDE: remove FIR_IGNORE from passing completion test after implementing basic keyword completion 2021-05-12 21:39:58 +03:00
Ilya Kirillov
36068d0b94 FIR IDE: reuse keyword completion handlers which do not require resovle 2021-05-12 21:39:57 +03:00
Ilya Kirillov
1f93eb0841 FIR IDE: add basic keyword completion 2021-05-12 21:39:56 +03:00
Ilya Kirillov
62fe3930ff Move keyword completion stuff to frontend-independent module 2021-05-12 21:39:54 +03:00
Roman Golyshev
d7a91cb05e Remove IGNORE_FIR directive from already green tests 2021-05-12 16:28:31 +00:00
Roman Golyshev
4adb291a12 Mute failing AutoImportQuickFix tests 2021-05-12 16:28:30 +00:00
Roman Golyshev
03a1439cc0 Make IgnoreTests fail correctly when directive is outdated
`Outdated` means green test with `IGNORE_FIR` directive, or
red test with `FIR_COMPARISON` directive

Also, invoke directive insertion only when it is appropriate
2021-05-12 16:28:29 +00:00
Roman Golyshev
22db894076 FIR IDE: Add Add Import quickfix
This quickfix can import unresolved types and callables

It currently does not support Java types and is not as advanced as in
the old plugin

Also, enable tests that now pass
2021-05-12 16:28:28 +00:00
Roman Golyshev
3ad9e4cb5c Use Import instead of action FQN
This way test data can be used both in the old plugin and in the
FIR plugin
2021-05-12 16:28:27 +00:00
Roman Golyshev
eadd7ac034 Generate multi-file quickfix tests for FIR plugin
Currently generate only for `Import` quickfix
2021-05-12 16:28:27 +00:00
Roman Golyshev
24642a7c9f Add KtTypeElement.unwrapNullability() extension function
Replace similar functions with its usage
2021-05-12 16:28:26 +00:00
Roman Golyshev
cc41592969 Add possibility to compute additional files for IgnoreTests
It is more flexible then just passing additional prefixes, since in some
cases test data have some weird naming conventions
2021-05-12 16:28:25 +00:00
Roman Golyshev
e50d643213 Add possibility to use ModuleLibrariesSearchScope in other modules
The type is made private to avoid direct usage of it
2021-05-12 16:28:24 +00:00
Ivan Kochurkin
598501aaf0 [FIR] Improve locations for DEPRECATED_SINCE_KOTLIN_WITHOUT_DEPRECATED, DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL, DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE and other diagnostics, refactor 2021-05-12 18:42:44 +03:00
Ivan Kochurkin
52c32d3d85 [FIR] Implement DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE, fix tests 2021-05-12 18:42:43 +03:00
Ivan Kochurkin
177394f6ef [FIR] Implement DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL, fix tests 2021-05-12 18:42:42 +03:00
Ivan Kochurkin
77c137df22 [FIR] Add DEPRECATED_SINCE_KOTLIN_WITHOUT_DEPRECATED diagnostics, fix tests 2021-05-12 18:42:41 +03:00
Ivan Kochurkin
3191e0b925 [FIR] Implement DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS diagnostics, fix tests, merge and refactor annotation checkers 2021-05-12 18:42:40 +03:00
Ivan Kochurkin
dc99a673a5 [FIR] Implement DEPRECATED_SINCE_KOTLIN_WITH_UNORDERED_VERSIONS diagnostics, fix tests 2021-05-12 18:42:38 +03:00
Ivan Kochurkin
5c086e2321 [FIR] Implement NEWER_VERSION_IN_SINCE_KOTLIN diagnostics, fix tests 2021-05-12 18:42:37 +03:00
Ivan Kochurkin
1be02e3ac4 [FIR] Implement ILLEGAL_KOTLIN_VERSION_STRING_VALUE diagnostics, fix tests 2021-05-12 18:42:36 +03:00
Jinseong Jeon
cb0b80253c FIR/UAST: make a fat jar with the base module 2021-05-12 17:36:35 +02:00
Ilya Muradyan
bab5d16001 [REPL] Stop old classpath calculation on the base classloader
The mechanism of the recursive classpath checking is intended
 for the "inner" scripting/REPL classloaders and should not touch
 anything beyond.
2021-05-12 18:30:43 +03:00
Mikhail Glukhikh
4608ca15eb FIR: don't allow SEALED callable modality anymore 2021-05-12 17:50:29 +03:00
Mikhail Glukhikh
67d1c35f19 FIR: report MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED also on interfaces 2021-05-12 17:50:27 +03:00
pyos
3fc2cc410c JVM_IR: propagate reified type parameter usages from inline lambdas
...to whichever class they are inlined into, not the class they are
declared in (which is not the same if the lambda is crossinline).

 #KT-46584 Fixed
2021-05-12 15:09:35 +03:00
Alexander Udalov
e079fb665e JVM IR: fix inheritance from mutable collections of Int
For subclasses of `AbstractMutableList<Int>` which are not inline
classes, the special bridge `remove` had a parameter of type `Int`
(mapped to JVM primitive int) before this fix. The hack in
`MethodSignatureMapper` changed this type to `Int?`, yet the body of the
special bridge still loaded it as non-nullable, which resulted in
incorrect bytecode.

It looks like a part of this hack in `BridgeLowering` was made only for
inline classes which are subclasses of mutable collections. Supposedly
it should be extended to non-inline classes, so that `remove` special
bridge would have consistent IR by the time it reaches codegen.

 #KT-46516 Fixed
2021-05-12 13:58:40 +02:00
Nikolay Krasko
f30980806f Read process streams to avoid hanging on Windows in parcelize tests
Could be reproduced with ParcelizeBoxTestGenerated.testKt36658 test.
2021-05-12 12:58:02 +03:00
Nikolay Krasko
818bbbbb83 Don't print to log in successful parcelize tests 2021-05-12 12:58:01 +03:00
Nikolay Krasko
b41fdd2705 Leave a clue about muted tests with directive for manual processing 2021-05-12 12:57:59 +03:00
Mads Ager
2c5a4dcb98 [JVM IR] Fix constant folding to use basic types always.
Fixes KT-46540.
2021-05-12 11:57:20 +02:00
Svyatoslav Scherbina
ad18d5984b Expand comment for unsupported nested generics when exporting to Swift
Add links to Swift and Kotlin issue trackers.
2021-05-12 09:06:28 +00:00
Elena Lepilkina
18462445b7 [K/N][stdlib] Fixed lookaround regexes (KT-45932) 2021-05-12 09:02:24 +00:00
Ilya Goncharov
d7a87a8552 [Gradle, JS] Fixes after rebase 2021-05-12 11:57:14 +03:00
Ilya Goncharov
9412b7236e [Gradle, JS] Refactor cacheBuilder to reuse one instance 2021-05-12 11:57:14 +03:00
Ilya Goncharov
19393948d7 [Gradle, JS] irBuildCache means ir compiler enabled 2021-05-12 11:57:14 +03:00
Ilya Goncharov
b9fc97b44f [Gradle, JS] Add arguments for building caches 2021-05-12 11:57:14 +03:00
Ilya Goncharov
c23376f040 [Gradle, JS] Use associated compilation's caches 2021-05-12 11:57:14 +03:00
Ilya Goncharov
9723d45d27 [Gradle, JS] Add associateWith compilations to CacheBuilder 2021-05-12 11:57:14 +03:00
Ilya Goncharov
194175d2d0 [Gradle, JS] Use multiple arguments for ignoring 2021-05-12 11:57:14 +03:00
Ilya Goncharov
2d3c13f8a2 [Gradle, JS] Everytime run compiler to build caches 2021-05-12 11:57:13 +03:00
Ilya Goncharov
d66d0fd4e4 [Gradle, JS] CacheBuilder before callCompiler 2021-05-12 11:57:13 +03:00
Ilya Goncharov
249fb8393c [Gradle, JS] Add compiler args serialization to consider in caching 2021-05-12 11:57:13 +03:00
Ilya Goncharov
c283c76130 [Gradle, JS] Add CacheBuilder for precache libraries 2021-05-12 11:57:13 +03:00
pyos
420bc6cbe8 JVM_IR: use correct types for generated inline reference wrappers
Doesn't change anything, but still.
2021-05-12 11:37:49 +03:00
pyos
d5d6736e67 PSI2IR/FIR2IR: do not approximate T!! before translation
This leads to weird effects when it's in a contravariant position,
because it's approximated by Nothing.
2021-05-12 11:37:48 +03:00
pyos
a37db99841 JVM_IR: remove a hack from InlineCallableReferenceToLambda
It breaks other things, the same problem is hit by FunctionReference,
and it's the translation layer's fault anyway.

 #KT-46555 Fixed
2021-05-12 11:37:47 +03:00
pyos
cff74b31d4 JVM_IR: get unbound property reference receiver type from KProperty1 2021-05-12 11:37:45 +03:00
Pavel Punegov
53bf0b1c42 Update Build gradle plugin to 0.0.28 2021-05-12 10:34:36 +03:00
Pavel Punegov
540c69ab89 [native] VersionGenerator: fix error string 2021-05-12 10:34:36 +03:00
Pavel Punegov
86041096fd Return milestone property back to support older versions of plugins
Older gradle plugin's NativeCompilerDownloader uses milestone property.
2021-05-12 10:34:36 +03:00
Pavel Punegov
f82c28bd79 Revert "[kotlin-gradle-plugin] workaround for old k/n artifacts"
This reverts commit 5c80dbfd
2021-05-12 10:34:36 +03:00
Pavel Punegov
a0d35e56a9 Revert "[tests][kotlin-gradle-plugin] workaround for old k/n artifacts"
This reverts commit f051119c to drop obsolete native version support
2021-05-12 10:34:35 +03:00
Pavel Punegov
fa525a8359 [native] Support milestones in meta versions
Add milestones to MetaVersion to replace standalone parameter in
compiler version generator. This makes native version match Kotlin one.
2021-05-12 10:34:35 +03:00
Ilmir Usmanov
c4ddf3530d Use GETFIELD instead of unbox-impl inside inline classes
#KT-36783 Fixed
2021-05-12 06:50:06 +00:00
Jinseong Jeon
e5f3091f2c FIR/UAST: commonize KotlinUFile
We can avoid explicit creation of UAnnotation and UImportStatement if we
use languagePlugin as a UAST element factory.
2021-05-11 21:43:02 +02:00
Jinseong Jeon
5dc0b52e38 FIR UAST: fix/test allCommentsInFile in UFile 2021-05-11 21:43:02 +02:00
Jinseong Jeon
03b5c14944 FIR UAST: enable remaining legacy test data
This should have been part of commit 7f627ab4
2021-05-11 21:43:02 +02:00
Tianyu Geng
302e0fa46b FIR IDE: add quickfix AddWhenElseBranchFix 2021-05-11 21:42:45 +02:00
Jinseong Jeon
8e10b5fdec FIR: introduce FirExpressionWithSmartcastToNull
This new kind of expression encompasses the nullability of the original
expression after null check (or equivalent `is Nothing?` check).

Unlike FirExpressionWithSmartcast, this expression won't be materialized
during conversion to backend IR. Also, Nothing? is discarded when
computing the intersection of possible types from smartcast info.
In that way, Nothing? is not used during resolution, while such
smartcast info is stored in it (and the expression kind itself).
2021-05-11 21:28:44 +03:00
Jinseong Jeon
8da183e4f4 FIR DFA: filter out unwanted implcations from processEqNull
^KT-41015 fixed
2021-05-11 21:28:43 +03:00
Xin Wang
b9209962cd CLI: Add documentation for -J argument in kotlinc -help 2021-05-11 19:50:24 +02:00
Dmitriy Novozhilov
1407af6301 [Test] Sort failed exceptions in JUnit5Assertions.assertAll
This is needed to throw FileComparisonFailure first, because idea
  test UI can not show multiple diff windows for multiple assertions
  and shows only first, which is not useful
2021-05-11 20:07:35 +03:00
Dmitriy Novozhilov
2530ae6b3d [Test] Split IR verification and IR dump to different handlers 2021-05-11 20:07:34 +03:00
Dmitriy Novozhilov
c9cd49d34f [Test] Temporary remove test for KT-22379
This is needed because this test breaks IDE when whit file is indexed.
This test will be returned after release of new kotlin plugins for IDEA
2021-05-11 19:45:43 +03:00
Andrey Zinovyev
89f0a790c9 [lombok] Map lombok MODULE to java PackageVisibility
Because that's what lombok does
#KT-46469 Fixed
2021-05-11 19:18:39 +03:00
Andrey Zinovyev
468fc86a3f [lombok] Fix fallback to config for array annotation's parameter
If annotation's parameter is not explicitly defined, it should be
taken from config
#KT-46529 Fixed
2021-05-11 19:18:37 +03:00
Andrey Zinovyev
57d3f98ece [lombok] Config keys are case-insensitive
#KT-46531 Fixed
2021-05-11 19:18:36 +03:00
Alexander Udalov
c898805ac5 CLI: improve path relativization for compiler messages
On Windows, the absolute file for the root of the drive is `"C:\"`,
which differs from the absolute file for any other directory, which
doesn't end with `\`. This resulted in incorrect trimming of the first
character of the path name in `descendantRelativeTo`.

Also, do not use canonicalPath because there is no point in expanding
symbolic links here.

 #KT-40979 Fixed
2021-05-11 18:44:14 +03:00
Alexander Udalov
f63dac26e6 Minor, extract ProgramWithDependencyOnCompiler for tests
Also use ProcessBuilder instead of GeneralCommandLine for simplicity.
2021-05-11 18:44:12 +03:00
Mads Ager
d397efb2bd [JVM IR] Copy attributes for JVM_STATIC_WRAPPERS. 2021-05-11 16:26:04 +02:00
Mads Ager
3db5ba98ad [JVM IR] Do not insert Nothing handling in JvmStatic wrapper.
Fixes KT-46568.
2021-05-11 16:26:04 +02:00
Dmitriy Novozhilov
3532ce7fbc [Parser] Fix OOM in parsing of incorrect string literals
^KT-46455 Fixed
KT-34410
KT-46564
2021-05-11 16:43:29 +03:00
Mikhail Glukhikh
c284eab2dd FIR / FE 1.0: fix exception for lambda with unresolved name
#KT-46515 Fixed
2021-05-11 15:41:06 +03:00
Stanislav Erokhin
eb4bb9554d Add ReplaceInvoke adn ReplaceCallWithUnaryOperator intention support
Surprisingly all test passed
2021-05-11 12:48:18 +02:00
Stanislav Erokhin
85d9e96632 Partially support call with errors
Cases with no candidates or with Ambiguity is not supported yet
2021-05-11 12:48:17 +02:00
Stanislav Erokhin
080a832605 Fix argument mapping for lambda arguments and default arguments
Maybe for other elements ValueArgument itself used as SourceElement
2021-05-11 12:48:17 +02:00
Stanislav Erokhin
335c5a03b6 Add correct equals/hashCode to KtSymbolBasedAbstractTypeConstructor
Previously there were no equals/hashCode implementation.
Because of that subtyping not working properly. That is because in
subtyping we have checks that type constructors are equals

Also toString was added so now it is a bit easier to debug code
involving the KtSymbolBasedAbstractTypeConstructor
2021-05-11 12:48:16 +02:00
Stanislav Erokhin
dc1ce19db9 Extract some logic from AbstractTypeConstructor to reuse it later
In FE10-binding I would like to re-use equal and hashCode mechanics
that was implemented in AbstractTypeConstructor, but I don't need
the supertype implementation, because it already there in FIR
2021-05-11 12:48:16 +02:00
Nikita Bobko
bee8c0bb90 Publish :compiler:test-infrastructure for ide 2021-05-11 12:36:59 +02:00
Vasily Levchenko
c2a46baa77 [build][kotlin-native][test] fix dist dependencies for test targets 2021-05-11 05:47:17 +00:00
Ilmir Usmanov
640d263ae1 Do not unbox nullable Result, since before usage it is coerced
#KT-46505
2021-05-11 05:49:24 +02:00
pyos
656c2496a6 JVM_IR: omit bound receiver in IrExpressionLambdaImpl parameters
and remove a hack intended to replace the missing type conversions this
caused.

 #KT-46505 Fixed
2021-05-11 05:49:20 +02:00
pyos
614d529168 JVM: remove LambdaInfo.invokeMethodDescriptor 2021-05-11 05:49:17 +02:00
Ilya Kirillov
47dc524763 FIR IDE: remove KtUnsubstitutedScope/KtSubstitutedScope as it designed wrong 2021-05-11 01:36:13 +03:00
Ilya Kirillov
90798d8857 FIR IDE: add KDoc for KtScope, choose better names for KtScope members 2021-05-11 01:36:11 +03:00
Ilya Kirillov
f9087a8ab1 FIR IDE: update testdata after changes in symbols 2021-05-11 01:36:10 +03:00
Ilya Kirillov
accc0e3761 FIR IDE: make KtCallableSymbol to be always KtPossiblyExtensionSymbol 2021-05-11 01:36:09 +03:00
Ilya Kirillov
0ba6412f96 FIR IDE: remove KtTypedSymbol interface as all its inheritors are KtCallableSymbol 2021-05-11 01:36:07 +03:00
Jinseong Jeon
bbe5cf0a70 FIR/UAST: clarify what module we should not depend on 2021-05-10 20:23:19 +02:00
Ilya Kirillov
e14848740a FIR IDE: forbid executing write action inside analyse call 2021-05-10 20:44:23 +03:00
Ilya Muradyan
626c1d3b48 [Scripting] Fix repository ID generation for Maven resolver 2021-05-10 19:40:32 +03:00
Ilya Muradyan
7cea639209 chore: fix typo in comment 2021-05-10 19:40:31 +03:00
Dmitry Petrov
ac0aaff611 JVM_IR KT-46562 don't use LambdaMetafactory for Serializable SAMs
TODO support serializable lambdas creation with LambdaMetafactory
2021-05-10 14:54:14 +03:00
Jinseong Jeon
bdfc879f00 FIR checker: report UNINITIALIZED_PARAMETER 2021-05-10 14:26:14 +03:00
Stanislav Erokhin
d2f831b635 Handle exception during intention background computation in tests
Our test infrastructure (in particular, muting mechanics) rely on
thrown exception during doTestFor function call. But if the
exception happened on background thread, then here we'll get only
TimeOutException but the actual exception won't be reported during
doTestFor call. It would be reported later by the common IDEA test
framework and bypass our mute mechanics
2021-05-10 14:04:04 +03:00
Stanislav Erokhin
7ac599520e Add first prototype of BindingContext implementation by FIR
Add ImportMemberIntention intention as a test.
In this commit all failed test were disabled, necessary fixes will be
added in the following commits
2021-05-10 14:04:03 +03:00
Stanislav Erokhin
6919f3dbb5 Move KotlinCacheServiceImpl to plugin-common.xml
This was done to prevent fir plugin from loading FE 1.0 services
2021-05-10 14:04:02 +03:00
Jinseong Jeon
bf85b110da FIR DFA: remove updatedAliasDiff from PersistentFlow
It is no longer used after element-wise join (a5389b06)
2021-05-10 12:16:04 +03:00
Mikhael Bogdanov
cd7841ceed Generate type annotations on class type parameters bounds
#KT-13228
 #KT-46539 Fixed
2021-05-10 12:12:21 +03:00
Mikhael Bogdanov
f574f89f78 Generate class annotation in AbstractAsmLikeInstructionListingTest 2021-05-10 12:12:20 +03:00
Mikhael Bogdanov
40eeee48b6 Extract generation of type parameters annotations and annotation on their bounds into utils 2021-05-10 12:12:19 +03:00
Mikhael Bogdanov
cbe3c66156 Generate function type parameter annotations and type annotations on their bounds into bytecode
Generate type parameter annotation by default for `-Xjvm-target 1.8` and above

 #KT-46539
 #KT-13228
 #KT-46545 Fixed
2021-05-10 12:12:18 +03:00
Mikhael Bogdanov
209ec68591 Make copy for disabled ir tests 2021-05-10 12:12:16 +03:00
Mikhael Bogdanov
5ff4d648f4 Render generic signature in type parameters tests 2021-05-10 12:12:15 +03:00
Mikhael Bogdanov
6182228de8 Render all annotations in type parameters tests 2021-05-10 12:12:14 +03:00
Vladimir Dolzhenko
c98dba6aea Do not set diagnostics callback if it is already set
Relates to #KT-37702
2021-05-10 09:59:16 +02:00
Vladimir Dolzhenko
cf5e6b242b Wrap exception with file details
Relates to #KT-39776
2021-05-07 23:48:12 +02:00
Ilya Muradyan
e9af2849ef Add Kotlin DeprecationLevel into the REPL completion 2021-05-07 19:56:21 +03:00
Mads Ager
6bc4e124fb [JVM_IR] Guard against infinite recursion in JvmIrCodegenFactory.
Fixed KTIJ-11580.
2021-05-07 17:58:49 +02:00
n-p-s
d70b889004 Update declarations to be searchable by their JvmName annotation
Relates to #KT-23653
2021-05-07 17:43:26 +03:00
pyos
36a25353e9 JVM_IR: permit @NoArg if super constructor is already zero-argument
#KT-46537 Fixed
2021-05-07 16:22:30 +02:00
Mikhail Glukhikh
ac9e8f667d Simplify code in Fir2IrConversionScope.returnTarget 2021-05-07 17:06:34 +03:00
Mikhail Glukhikh
05872fc6a8 Support captured types in ConeTypeCompatibilityChecker 2021-05-07 17:06:34 +03:00
Mikhail Glukhikh
df815a64cf FirEqualityCompatibilityChecker: rename file 2021-05-07 17:06:34 +03:00
Mikhail Glukhikh
6a51ddf755 FirEqualityCompatibilityChecker: add exception wrapper 2021-05-07 17:06:34 +03:00
Andrei Klunnyi
b7eded6e48 KT-46146 no 'protected' for final classes
Intention to change final class constructor visibility to 'protected'
was erroneous. This commit removes it.
2021-05-07 12:47:40 +00:00
Andrei Klunnyi
e56a3b3c30 KT-46146 'protected' and 'private' only for sealed constructors
Prior to this commit we suggested two invalid intentions for sealed
class constructors: change visibility to 'public' and 'internal'.

^KT-46146 Fixed
2021-05-07 12:47:39 +00:00
Andrei Klunnyi
686368749a KT-46146 'protected' is unavailable for primary constructors
Prior to this commit intention to change primary constructor visibility
to 'protected' was filtered out.
2021-05-07 12:47:38 +00:00
Alina Dolgikh
7388e60869 Add link to Kotlin 1.5 Event registration
As an experiment, we would like to try promotion in the Github repository.
2021-05-07 14:40:14 +02:00
Ilya Muradyan
042ac5555c Merge pull request #4342 from JetBrains/rr/ileasile/completion-for-function-params
[REPL] Add completion for the call named parameters
2021-05-07 15:11:12 +03:00
Mikhail Glukhikh
27903b4cd6 Configuration fix: make fir2ir tests depend on 'dist' 2021-05-07 10:32:47 +03:00
Alexander Udalov
d306d8a90e JVM IR: cast indy-SAM receiver type from KFunctionN to FunctionN
#KT-46512 Fixed
2021-05-07 00:53:31 +03:00
Ilya Kirillov
124bd559de FIR IDE: fix failing AbstractOverrideImplementTest tests on Windows
Before the System.lineSeparator() was used for splitting KtFile.text into lines.
In IJ all lines has UNIX file endings, so it failed on Windows TC agent
2021-05-07 00:40:52 +03:00
Mikhail Glukhikh
f83841a34f Cleanup FirHelpers (inline / remove / reduce visibility) 2021-05-07 00:40:51 +03:00
Tianyu Geng
9273c6326e FIR IDE: workaround deadlock when resolving class members
When listing members in a class, we need to resolve super types. But if
a super type is defined in another file, this file may not have been
resolved. In this case, listing the members would require resolving the
unresolved file, which can only be done in a write lock.

Before this change, KtFirScopeProvider only acquire the read lock, which
then causes read/write deadlock when the logic tries to further resolve
super types defined in other files. This change makes KtFirScopeProvider
acquire a write lock in the beginning so resolving can happen correctly
later.
2021-05-07 00:40:50 +03:00
Tianyu Geng
7a745cfe5c FIR IDE: Remove unnecessary renderAnnotations option 2021-05-07 00:40:48 +03:00
Tianyu Geng
417c841f77 FIR IDE: Move write actions out of analyze block 2021-05-07 00:40:47 +03:00
Tianyu Geng
e56b39bbd8 FIR IDE: fix typo in package name 2021-05-07 00:40:46 +03:00
Tianyu Geng
d09be811f0 FIR: make class delegation field a fake source
Previously, the FirFieldImpl generated from class delegation has a real
source. This causes troubles in the IDE. This change adds a new fake
source kind for class delegation fields.
2021-05-07 00:40:44 +03:00
Tianyu Geng
0b8b20eda0 FIR IDE: fix KtFirScopeProvider
Currently FIR IDE throws exceptions when enumerating members in this
scope if the class has delegate super types.

java.lang.IllegalStateException: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl Tjava.lang.IllegalStateException: java.lang.IllegalStateException: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl T
	at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$runTestWithThrowable$3(KotlinTestUtils.java:498)
	at org.jetbrains.kotlin.test.MuteWithDatabaseKt.runTest(muteWithDatabase.kt:96)
	at org.jetbrains.kotlin.test.KotlinTestUtils.runTestWithThrowable(KotlinTestUtils.java:493)
	at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase.runTest(KotlinLightCodeInsightFixtureTestCaseBase.java:93)
	at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:394)
	at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
	at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
	at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$1.run(EdtTestUtil.kt:50)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:475)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:126)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:971)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:841)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:452)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:451)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:499)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.IllegalStateException: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl T
	at org.jetbrains.kotlin.fir.types.FirTypeUtilsKt.getConeType(FirTypeUtils.kt:33)
	at org.jetbrains.kotlin.fir.scopes.KotlinScopeProviderKt.scopeForSupertype(KotlinScopeProvider.kt:111)
	at org.jetbrains.kotlin.fir.scopes.KotlinScopeProvider.getUseSiteMemberScope(KotlinScopeProvider.kt:42)
	at org.jetbrains.kotlin.fir.scopes.KotlinScopeProviderKt.unsubstitutedScope(KotlinScopeProvider.kt:83)
	at org.jetbrains.kotlin.idea.frontend.api.fir.components.KtFirScopeProvider$getMemberScope$lambda-3$lambda-2$$inlined$withFirForScope$1.invoke(FirRefWithValidityCheck.kt:83)
	at org.jetbrains.kotlin.idea.frontend.api.fir.components.KtFirScopeProvider$getMemberScope$lambda-3$lambda-2$$inlined$withFirForScope$1.invoke(FirRefWithValidityCheck.kt:41)
	at org.jetbrains.kotlin.idea.fir.low.level.api.api.LowLevelFirApiFacadeKt.withFirDeclaration(LowLevelFirApiFacade.kt:209)
	at org.jetbrains.kotlin.idea.frontend.api.fir.components.KtFirScopeProvider.getMemberScope(KtFirScopeProvider.kt:323)
	at org.jetbrains.kotlin.idea.frontend.api.components.KtScopeProviderMixIn$DefaultImpls.getMemberScope(KtScopeProvider.kt:34)
	at org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession.getMemberScope(KtAnalysisSession.kt:26)
	at org.jetbrains.kotlin.idea.core.overrideImplement.KtOverrideMembersHandler.getOverridableMembers(KtOverrideMembersHandler.kt:54)
	at org.jetbrains.kotlin.idea.core.overrideImplement.KtOverrideMembersHandler.collectMembers(KtOverrideMembersHandler.kt:35)
	at org.jetbrains.kotlin.idea.core.overrideImplement.KtOverrideMembersHandler.collectMembersToGenerate(KtOverrideMembersHandler.kt:28)
	at org.jetbrains.kotlin.idea.codeInsight.AbstractOverrideImplementTest.doMultiOverrideImplement(AbstractOverrideImplementTest.kt:141)
	at org.jetbrains.kotlin.idea.codeInsight.AbstractOverrideImplementTest.doMultiFileTest(AbstractOverrideImplementTest.kt:98)
	at org.jetbrains.kotlin.idea.codeInsight.AbstractOverrideImplementTest.doMultiOverrideFileTest(AbstractOverrideImplementTest.kt:54)
	at org.jetbrains.kotlin.idea.codeInsight.OverrideImplementTest.testDelegatedMembers(OverrideImplementTest.kt:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at com.intellij.testFramework.UsefulTestCase.lambda$runTest$9(UsefulTestCase.java:331)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:462)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:480)
	at com.intellij.testFramework.UsefulTestCase.invokeTestRunnable(UsefulTestCase.java:378)
	at com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:350)
	at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase.lambda$runTest$0(KotlinLightCodeInsightFixtureTestCaseBase.java:93)
	at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$runTestWithThrowable$3(KotlinTestUtils.java:495)
	... 36 more
.. 112 more
2021-05-07 00:40:42 +03:00
Tianyu Geng
53aafbd7d9 FIR IDE: enable override implement test for FIR 2021-05-07 00:40:41 +03:00
Tianyu Geng
00031c8eb1 FIR IDE: add action to override/implement missing members
This commit adds the following actions:

- quickfix to implement missing members
- quickfix to implement missing members as constructor parameters
- action to implement members (Code - Generate - Implement)
- action to override members (Code - Generate - Override)

The current implementation is still missing some pieces, which will be
addressed in future changes.

- fully qualified names are not shorten
- some Kotlin types are not rendered correctly
2021-05-07 00:40:40 +03:00
Tianyu Geng
34387e228f FIR IDE: extract common logic idea.core.overrideImplement
Also rename OverrideImplementMemberHandler to GenerateMemberHandler to
align with the naming of its member functions.
2021-05-07 00:40:38 +03:00
Tianyu Geng
06ba143afe FIR IDE: quickfix to make class abstract if member not implemented 2021-05-07 00:40:37 +03:00
Alexander Udalov
6e3009b82e JVM IR: generate adapted callable references as synthetic
As well as suspend conversion adapters, which are unsupported by default
right now.

 #KT-46259 Fixed
2021-05-06 22:58:18 +03:00
Leonid Startsev
d60a8f9baa Use correct type in KClassReference
Make sure that writeSelf function remains static
2021-05-06 19:53:21 +00:00
Leonid Startsev
a58f29aa06 Remove unnecessary ignoreIndexTo outside writeSelf
It never worked: descriptor.declaresDefaultValue used by property.isOptional
works only for current module
(since it looks up psi), so we never access default value initializers
outside current module
2021-05-06 19:53:21 +00:00
Leonid Startsev
66f39ca185 Use SerializerFactory interface and generate function
for sealed and abstract serializable classes.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1116
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1078
2021-05-06 19:53:20 +00:00
Jinseong Jeon
ebbef484ad FIR UAST: add utils to clean up identical render/log files 2021-05-06 20:19:29 +02:00
Jinseong Jeon
1385a4690e Revert "UAST Kotlin: update test data"
This reverts commit 291cd842

A directive to ignore FIR UAST is removed after facade support.
2021-05-06 20:19:29 +02:00
Jinseong Jeon
7f627ab480 FIR UAST: track all legacy test data since facade class is converted
These are mostly mechanical changes.
2021-05-06 20:19:29 +02:00
Jinseong Jeon
939740d26e FIR UAST: convert (light) class for facade 2021-05-06 20:19:29 +02:00
Ilya Goncharov
9baa24e626 [Gradle, JS] Fix with beta version of webpack-dev-server to work with webpack 5
^KT-46162 fixed
^KT-46331 fixed
2021-05-06 18:45:45 +03:00
Mads Ager
b6fa28ea81 [JVM_IR] Deal with inline-class arguments in large arity lambdas.
FunctionNVarargBridgeLowering checked the name of the method instead
of whether the method overrides an invoke method. That doesn't work
when the name of the function gets mangled because of inline class
arguments.

Fixed KT-45084.
2021-05-06 17:27:59 +02:00
pyos
1181854bd6 Add a couple more tests for array constructors and references 2021-05-06 18:25:56 +03:00
pyos
a30cfc332d JVM_IR: remove JvmArrayConstructorLowering
ExpressionCodegen already spills the stack before any loop, so it has
no effect.
2021-05-06 18:25:55 +03:00
pyos
9f53d70109 JVM_IR: move ArrayConstructor below function reference phases
This allows taking function references to inline array constructors.

Also, redundant classes are no longer generated when function references
are passed as arguments to the array constructors.

 #KT-46426 Fixed
2021-05-06 18:25:53 +03:00
Mikhail Glukhikh
776920f77d Cleanup code in FirAnnotationArgumentChecker 2021-05-06 17:51:24 +03:00
Mark Punzalan
18f617a582 FIR: Make FirAnnotationArgumentChecker a FirAnnotationCallChecker, to
run on all annotation calls, including those inside type annotations.
2021-05-06 17:51:22 +03:00
Mikhail Glukhikh
87d05bcf83 Fix spec test data after rebase 2021-05-06 17:50:37 +03:00
Mikhail Glukhikh
e451ecf000 Regenerate FIR IDE tests 2021-05-06 17:50:36 +03:00
Mikhail Glukhikh
1936a815e2 ConeTypeCompatibilityChecker: add temporary workaround for KT-46383 2021-05-06 17:50:35 +03:00
Tianyu Geng
db55a973d4 FIR: fix infinite recursion with equality operator checker 2021-05-06 17:50:34 +03:00
Tianyu Geng
d4717569b9 Fix inferred type of FirGetClassCall
The inferred type should be `KClass<out Blah>` for `FirGetClassCall`
invoked on expressions.
2021-05-06 17:50:33 +03:00
Tianyu Geng
7bb81ef157 FIR: add equality call checker
Added checker for FirEqualityOperatorCall. It's surfaced as one of the
following diagnostics depending on the PSI structure and types under
comparison:

* INCOMPATIBLE_TYPES(_WARNING)
* EQUALITY_NOT_APPLICABLE(_WARNING)
* INCOMPATIBLE_ENUM_COMPARISON_ERROR

Comparing with FE1.0, the current implementation is more conservative
and only highlights error if the types are known to follow certain
contracts with `equals` method. Otherwise, the checker reports warnings
instead.

However, the current checker is more strict in the following situations:
1. it now rejects incompatible enum types like `Enum<E1>` and
  `Enum<E2>`, which was previously accepted
2. it now rejects incompatible class types like `Class<String>` and
  `Class<Int>`, which was previously accepted
3. the check now takes smart cast into consideration, so
  `if (x is String) x == 3` is now rejected
2021-05-06 17:50:32 +03:00
Andrey Zinovyev
787c743333 [FIR] Syntax checkers
Introduce base class for checkers that dive into source trees.
2021-05-06 17:38:04 +03:00
Ilya Matveev
1be39cb505 [K/N] Replace thread_local with THREAD_LOCAL_VARIABLE
For some reason using C++'s thread_local modifier
causes crashes during TLS access on runtime initialization
Kotlin dlls on Windows. This patch replaces the thread_local
modifier with __thread which doesn't have this problem
2021-05-06 14:10:22 +00:00
Ilya Matveev
e2e173b92c [K/N][New MM] Disable tests for ObjC interop 2021-05-06 14:10:22 +00:00
Ilya Matveev
4d346d3735 [K/N][New MM] Support thread state switching
Including

* Support thread state switching in codegen
* Introduce and use GCUnsafeCall annotation
* Switch thread state in C++ runtime code

Also

* Register current thread in Mark&Sweep tests
* Store MemoryState in Worker instance
* Set worker tid in WorkerInit
2021-05-06 14:10:21 +00:00
Ilya Matveev
0b46ed3cde [K/N][New MM] Add thread state asserts to reference updates 2021-05-06 14:10:20 +00:00
Ilya Matveev
08688670b1 [K/N] Adjust repository root in K/N's .idea directory 2021-05-06 14:10:19 +00:00
Yahor Berdnikau
c6fc393417 Enable kotlin java toolchain support for kapt task.
With this change 'KaptWithoutKotlincTask' will also support overriding
default Gradle JDK to run kapt. In such case only 'in-process' kapt
 worker isolation mode is supported.

If user does not provide custom JDK, kapt worker isolation mode will
be 'no-isolation' as before.

^KT-45611 In Progress
2021-05-06 16:04:23 +02:00
Mads Ager
afa1b8bfdc [JVM] Extend boxing/unboxing optimizations to coroutine boxing. 2021-05-06 15:35:49 +02:00
Ivan Gavrilovic
4994cb3774 [Gradle] Create kotlinOptions during task init and keep outputFile for js
This is so that existing build scripts using
withType() do not break. Also, fix the failing
test.

It was necessary to keep outputFile for the js compile task
as it was accessed from the build scripts. Instead, a new
property is introduced which uses Gradle lazy properties.
2021-05-06 13:54:18 +03:00
Ivan Gavrilovic
80181c1091 [Gradle] Add Android bootclasspath lazily 2021-05-06 13:54:17 +03:00
Ivan Gavrilovic
1c0d40055e [Gradle] Support getting the sourceSet name from tasks when...
...Gradle property is being used, instead of the direct String
value.
2021-05-06 13:54:16 +03:00
Ivan Gavrilovic
98cc99e36b [Gradle] Fix adding KAPT generated classess to the compilation classes output 2021-05-06 13:54:15 +03:00
Ivan Gavrilovic
f5caa49c31 [Gradle] Use Gradle properties for KAPT tasks
Use lazy properties to configure KAPT tasks and in the model builder.
Also, avoid eager dependency resolution of the kaptExternalClasspath
file collection.
2021-05-06 13:54:14 +03:00
Ivan Gavrilovic
0882da1788 [Gradle] Introduce classes to configure KAPT tasks
Avoid storing references to KotlinCompile task and use lazy properties
to configure task. Values are kept in-sync with the
Kotlin compile task (for the stub generation) using this mechanism.
2021-05-06 13:54:13 +03:00
Ivan Gavrilovic
01dd15cc3e [Gradle] Use task properties to modify task configuration
This change migrates to using properties of KGP tasks and Gradle
built-in tasks. Also, in TaskProvider class, Configurator instances are
created to configure KGP tasks.
2021-05-06 13:54:12 +03:00
Ivan Gavrilovic
ad9f6e63b6 [Gradle] Extract configuration of KotlinJsIrLink to a class
Migrate KotlinJsIrLink to properties create Configurator class
to configure the task properties.
2021-05-06 13:54:11 +03:00
Ivan Gavrilovic
5eed9a4e6e [Gradle] Extract configuration of KotlinCompileCommon to a class
Migrate KotlinCompileCommon to properties create Configurator class
to configure the task properties.
2021-05-06 13:54:10 +03:00
Ivan Gavrilovic
ff27a61252 [Gradle] Use ConfigurableFileCollection for task local state
Use ConfigurableFileCollection so that tasks can simply append to the
file collection and tasks that do not need this, can simply do nothing.
2021-05-06 13:54:09 +03:00
Ivan Gavrilovic
571c9c10d4 [Gradle] Update compile tasks to use properties and clean up code
Update AbstractKotlinCompile, KotlinCompile, and Kotlin2JsCompile to
use Gradle properties, and introduce Configurator classes that are
using configuration-time data to configure task. Also, introduce
TaskConfigurator interface that should be implemented by classes that
are used to configure tasks.
2021-05-06 13:54:08 +03:00
Ivan Gavrilovic
56cad96718 [Gradle] Remove KotlinCompileTaskData
When getting the incremental compilation information use the
task graph which processes all tasks present in it. Tasks have
all information that is needed to get IncrementalModuleInfo for all
compilations.
2021-05-06 13:54:06 +03:00
Ivan Gavrilovic
b3d8187df4 [Gradle] Remove deprecated ways to specify compiler classpath
This change removes options to specify compiler classpath using
deprecated properties that were deprecated for more than 2 years.
2021-05-06 13:54:05 +03:00
Jinseong Jeon
61e21ef6a2 FIR: ensure the absence of FirResolvedTypeRef with erroneous type 2021-05-06 12:22:40 +03:00
Andrey Zinovyev
cba21c68a3 [lombok] Actualize README 2021-05-06 11:27:51 +03:00
Jinseong Jeon
e2dc21da90 FIR checker: warn useless as and is 2021-05-05 18:20:51 +03:00
Jinseong Jeon
19d939c36e TEST: remove redundant diagnostic directive (w/ syntax error) 2021-05-05 18:20:50 +03:00
Mikhail Glukhikh
7ee6597873 FIR: make inference context mandatory in withNullability() etc. 2021-05-05 17:35:50 +03:00
Jinseong Jeon
bb37728e4f FIR: use withNullability with type context whenever possible
It could simplify flexible type cases.
2021-05-05 17:35:48 +03:00
Anton Lakotka
f94ed1a00c Fail only when KotlinPm20ProjectExtension is passed
to buildKotlinProjectStructureMetadata
#Fixes KTIJ-11586
2021-05-05 16:53:20 +03:00
Jinseong Jeon
291cd842b9 UAST Kotlin: update test data
Addition of directive IGNORE_FIR alters synthetic local variable names.
2021-05-05 14:22:40 +02:00
Jinseong Jeon
dad198cb67 UAST Kotlin: make super type lookup test robust
Newly added directive IGNORE_FIR bothers lookup for object "O".
2021-05-05 14:22:40 +02:00
Jinseong Jeon
03d4cb0dfa FIR UAST: use uast-kotlin/testData for legecy tests 2021-05-05 14:22:40 +02:00
Jinseong Jeon
eac875b5d6 FIR UAST: commonize utils from UAST Kotlin 2021-05-05 14:22:40 +02:00
Jinseong Jeon
f37c722c76 UAST Kotlin: fix typos 2021-05-05 14:22:40 +02:00
Jinseong Jeon
40eaabdbb5 FIR UAST: prototype plugin entrypoint, declarations, test infra 2021-05-05 14:22:40 +02:00
Jinseong Jeon
225e3a747c LC: introduce light class interface for facade
so that FIR-based light class for facade can work well in LC utils
2021-05-05 14:11:48 +02:00
Jinseong Jeon
efba90c6f1 LC: rename KtLightClassForFacade to ...Impl
before introducing a common interface for light class for facade

This is a mechanical refactoring.
2021-05-05 14:11:48 +02:00
Alexander Udalov
c14a890e7e IR: fix capturing of type parameters in local functions
collectPotentiallyCapturedTypeParameters no longer stops on the first
class when going through parents. This is needed because otherwise type
parameters of the containing class, and its outer classes, were never
considered "captured", and thus not duplicated/remapped later in
LocalDeclarationsLowering.

This led to the IR where a local function referenced generic type
parameters of the outer class. On JVM, local function is generated into
a private static function in that container class, and static functions
can't use generic type parameters, which crashed some bytecode
processing tools.

Also, add another explicit call to `seeType` to cover references to
generic type parameters in function return types.

 #KT-45941 Fixed
2021-05-04 21:10:56 +02:00
Vasily Levchenko
b389fd6667 [performance][build][kotlin-build-gradle-plugin] version 0.0.27 (fix) 2021-05-04 15:44:19 +00:00
Stanislav Erokhin
d9be05fea8 Support getContainer for the synthetic it value parameter
Also fixed incorrect KtSymbolOrigin:
it was SOURCE instead of SOURCE_MEMBER_GENERATED
2021-05-04 17:25:34 +02:00
Stanislav Erokhin
c24ad0ba51 Use KtFunctionLiteral as key for KtAnonymousFunctionSymbol retrieving
It seems logical to do, because KtFunctionLiteral is KtDeclaration
and KtLambdaExpression is not. Also FirAnonymousFunction use it as
realPsi reference
2021-05-04 14:01:30 +02:00
Dmitriy Dolovov
75d2e415e1 [K/N][IR] Generate missing return statement, p. 2
^KT-42832
2021-05-04 13:26:02 +03:00
Alexander Shabalin
5e456ed82b Put GC implementations into separate modules.
The mm module now compiles separately for each GC implementation.
2021-05-04 10:23:16 +00:00
Ilya Kirillov
41ab97ff1f FIR IDE: introduce single function for checking if declaration can be lazily resolved 2021-05-04 08:19:50 +02:00
Ilya Kirillov
babf079c31 FIR IDE: fix resolving of inner type aliases 2021-05-04 08:19:50 +02:00
Ilya Kirillov
9e1bc5680d FIR IDE: do not consider KtEnumEntry as ktClassOrObject 2021-05-04 08:19:50 +02:00
Ilya Kirillov
ef5f0e77ec FIR IDE: use KtClassLikeDeclaration.classId instead of hacks 2021-05-04 08:19:50 +02:00
Ilya Kirillov
aff807e3af Stubs: bump stubs version 2021-05-04 08:19:50 +02:00
Ilya Kirillov
4942f5eb66 Stubs: add classId to KtTypeAlias stubs 2021-05-04 08:19:50 +02:00
Ilya Kirillov
fdb091d98e Stubs: add classId to KtClassOrObject stubs 2021-05-04 08:19:49 +02:00
Ilya Kirillov
09a94f3200 FIR IDE: ignore non-passing tests in compiler based tests 2021-05-04 08:19:49 +02:00
Ilya Kirillov
3503a54437 FIR IDE: run tests in parallel in module idea-fir-low-level-api 2021-05-04 08:19:49 +02:00
Ilya Kirillov
65ce641b22 FIR IDE: introduce diagnostics tests bases on FIR diagnostics tests 2021-05-04 08:19:49 +02:00
Ilya Muradyan
b771f9eea4 [REPL] Add completion for the call named parameters 2021-05-04 04:40:00 +03:00
Mads Ager
0c77565104 JVM_IR: Add more local variable tests for finally code. 2021-05-03 07:43:38 +02:00
Mads Ager
6095d8a7fa [JVM] Split the variable range for external finally blocks in inliner
When external finally blocks are inlined none of the current locals
are in scope of the finally block.
2021-05-03 07:43:37 +02:00
Mads Ager
6d9f02cfc6 [JVM_IR] Fix range of locals in connection with finally blocks.
For code such as:

```
try {
  var y = "y"
  for (i in 0 until 1) {
    return y
  }
} finally {
  println("finally")
}
```

The local variables `y` and `i` ended up covering the finally block as
well in the debugger.

This change splits the range of the locals so that they do
not cover the finally block.

This change does not change the inliner to do similar transformations,
so the range of locals is still wrong win finally blocks when inlined
into an inline function. Added a failing test to that effect.
2021-05-03 07:43:37 +02:00
Mikhail Glukhikh
0764a0601c Fix FIR IDE test data broken by 80a44986 2021-05-01 19:12:05 +03:00
sebastian.sellmair
a1ed81146e [Commonizer] Logging: NativeDistributionCommonizationCache: Log in level 'quite' on cache misses
^KT-36679 Verification Pending
2021-05-01 14:36:18 +03:00
sebastian.sellmair
b48850c993 [Commonizer] Logging: Implement CommonizerLogLevel and hide verbose output by default
^KT-36679 Fixed
2021-05-01 14:36:18 +03:00
sebastian.sellmair
7349ec8f2f [Commonizer] Logging: Implement ProgressLogger.fork
^KT-36679
2021-05-01 14:36:16 +03:00
sebastian.sellmair
ec440aecf6 [Commonizer] Logging: Remove 'COMMONIZATION' prologue
^KT-36679
2021-05-01 14:36:15 +03:00
sebastian.sellmair
9d9e11d6d8 [Commonizer] Logging: 'Preparing commonized Kotlin/Native libraries': show outputTarget instead of flat list of targets
^KT-36679
2021-05-01 14:36:14 +03:00
sebastian.sellmair
0d9e32f963 [Commonizer] Logging: Show [Step x of y] only when more than one task is scheduled
^KT-36679
2021-05-01 14:36:13 +03:00
Victor Petukhov
9eaec8d919 Use platform-independent line separator in jspecify tests handler 2021-05-01 13:39:28 +03:00
Nikolay Krasko
2a2fa31577 Allow emulate sonatype publishing when publishing to folder (KTI-552) 2021-05-01 01:41:30 +03:00
Nikolay Krasko
624740a80a Force usage of passed deploy url for sonatype publication (KTI-552) 2021-05-01 01:41:28 +03:00
Nikolay Krasko
2eda82f178 Allow in memory signing (KTI-552) 2021-05-01 01:41:27 +03:00
Nikolay Krasko
8f97d8a78e Drop legacy publishing 2021-05-01 01:37:09 +03:00
Mads Ager
df225c0c7f [JVM] Fix uninitialized locals after coroutine transformation.
The coroutine transformation would leave locals in the local
variable table across the code that reloads local variables from
the continuation on reentry. However, when reentering the function
the local has no value until after the reloads from the
continuation.

This change splits the locals in the local variable table to
avoid such uninitialized locals. A local alive across a
suspension point has its range split in two. One that goes
from the original start to the state label for the restart
after the suspension. The other goes from after the local
has been reloaded from the continuation until the previous
end of the local.
2021-04-30 22:24:03 +02:00
Dmitry Petrov
83e3a702c5 JVM_IR KT-46408 properly map fake overrides in method handles 2021-04-30 22:24:02 +03:00
Vasily Levchenko
ef2c2c2c9e [kotlin][tests][compiler/testData/debug/stepping] kt-42208 test added. 2021-04-30 18:44:55 +00:00
Vasily Levchenko
3160fc84fa [kotlin-native][tests] kt-42208 test added. 2021-04-30 18:44:54 +00:00
Vasily Levchenko
a6a7da31c9 [IR][provisional function expression] do generate function reference with offset of call site. 2021-04-30 18:44:54 +00:00
Tianyu Geng
b6bd4ae8e6 FIR: check DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH 2021-04-30 19:58:50 +03:00
Mikhael Bogdanov
84e67da2af Mute test on JDK 6 2021-04-30 18:24:10 +02:00
Mikhael Bogdanov
95d95f9a9b Put reification markers came from super object signature
#KT-44770 Fixed
  #KT-30696 Open
2021-04-30 17:34:16 +02:00
Sergey Shanshin
8dd307573a Fix IR compilation of external serializers in native 2021-04-30 18:17:08 +03:00
Mikhail Glukhikh
80a449862e FIR: implement diagnostics for qualifier as stand-alone expression case 2021-04-30 17:59:45 +03:00
Mikhail Glukhikh
84ccf7bbb1 FIR: use Java 8 rules in not implemented checker 2021-04-30 17:59:38 +03:00
Mikhail Glukhikh
5de8401494 Reset FirQualifiedNameResolver properly 2021-04-30 17:59:32 +03:00
Victor Petukhov
4fb78fab93 Temporary disable failing jspecify tests on Windows 2021-04-30 17:50:56 +03:00
Victor Petukhov
c9568c0744 Fix FIR tests 2021-04-30 16:49:56 +03:00
Victor Petukhov
7c62e9aecd Introduce warnings reporting by missed constraints because of incorrect optimization in the constraints processor 2021-04-30 15:46:04 +03:00
Victor Petukhov
e110b49cab Revert "Don't stop constraints processing if all type variables have proper equality constraints"
This reverts commit b87c2a15
2021-04-30 15:46:03 +03:00
Andrey Zinovyev
287ff3ed55 [FIR] Fix for AugmentedArraySetCall expression type
Hacky fix so it's type is Unit and not error
2021-04-30 15:25:44 +03:00
Simon Ogorodnik
6365164c21 FIR: Fix gradle integration tests broken by c6fa3634 2021-04-30 15:19:58 +03:00
Sergey Bogolepov
13464cce68 [Native] Adapt Skia interop to ClangArgs refactoring. 2021-04-30 12:07:46 +00:00
Victor Petukhov
f330d67740 Mute foreign annotations tests with compiled java through psi class files reading 2021-04-30 14:43:28 +03:00
Victor Petukhov
78ffefe107 Add jspecify license 2021-04-30 14:43:27 +03:00
Victor Petukhov
909f0d8bdb Implement caching module annotations per class id 2021-04-30 14:43:27 +03:00
Victor Petukhov
2e57ff25ee Leave KotlinCliJavaFileManager::findClass only passing JavaClassFinder.Request 2021-04-30 14:43:27 +03:00
Victor Petukhov
072bba109f Move foreign annotations logic into the corresponding configurator for the tests 2021-04-30 14:43:27 +03:00
Victor Petukhov
e93133a28f Implement jspecify marks processing in the tests properly, by adding specific handler and cleanuper 2021-04-30 14:43:27 +03:00
Victor Petukhov
b9536a25d6 Support type enhancement on freshly supported module level annotations
^KT-45189 Fixed
2021-04-30 14:43:27 +03:00
Victor Petukhov
bc5e92033b Support reading annotations on java 9 module on sources and binaries 2021-04-30 14:43:27 +03:00
Victor Petukhov
24685ee9d6 Add directive ALL_JAVA_AS_BINARIES and use it explicitly for foreign annotations tests with compiled java 2021-04-30 14:43:27 +03:00
Victor Petukhov
89270399db Update some third-party annotations 2021-04-30 14:43:26 +03:00
Victor Petukhov
cdcde634e8 Add basic Java 9 module tests 2021-04-30 14:43:26 +03:00
Victor Petukhov
757fdb2b32 Add Java 9 jspecify annotations including module level ones 2021-04-30 14:43:26 +03:00
Victor Petukhov
71755b7a5e Support java 9 modules in the diagnostic tests both in sources and binaries 2021-04-30 14:43:26 +03:00
Victor Petukhov
1f0616439c Introduce special common directives for tests based on foreign annotation tests 2021-04-30 14:43:26 +03:00
Victor Petukhov
6065f0e2d0 [Jspecify] Move diagnostic tests against compiled java under the new tests infrastructure 2021-04-30 14:43:26 +03:00
Victor Petukhov
8f097b14cc [Jspecify] Move jspecify test runner under the new tests infrastructure 2021-04-30 14:43:26 +03:00
Victor Petukhov
6f9694174f Move foreign annotation tests into diagnostics folder 2021-04-30 14:43:25 +03:00
Victor Petukhov
57bd4d3a98 [Jspecify] Remove Kotlin use sites generator: consider manually picking changes from the jspecify repo 2021-04-30 14:43:25 +03:00
Victor Petukhov
49e838781c Clean-up JavaModuleInfo.kt 2021-04-30 14:43:25 +03:00
Vasily Levchenko
788d3c022a [build][kotlin-build-gradle-plugin] version 0.0.27
- reading konanVersion and konanMetaVersion from project properties
2021-04-30 10:26:36 +00:00
Vasily Levchenko
9cbcafa8d1 [dependencies][kotlin-build-gradle-plugin] version 0.0.27
- reading konanVersion and konanMetaVersion from project properties
2021-04-30 10:26:35 +00:00
Dmitry Petrov
72804d2e8c JVM_IR KT-45779 don't generate intrinsic method refs via invokedynamic 2021-04-30 12:45:11 +03:00
Sergey Bogolepov
f3a935adb9 Support explicit C++ flags in run_konan tool 2021-04-30 08:39:27 +00:00
Sergey Bogolepov
25ebb3fa75 Remove obsolete Gradle native plugin configuration 2021-04-30 08:39:27 +00:00
Sergey Bogolepov
274d18a141 [Kotlin/Native] Add a workaround for Xcode 12.5
SDKs from Xcode 12.5 contain C++ stdlib and it
breaks compilation of C++ parts of compiler.
Mitigate this problem by explicitly specifying
path to C++ stdlib.
2021-04-30 08:39:26 +00:00
Victor Petukhov
8dd71ec5c8 Build recursive raw types and raw types which contain type parameters properly
1) Substitute erasure of other type parameters
2) Use star projection at top level for recursive raw types

^KT-46126 Fixed
2021-04-30 10:49:47 +03:00
Andi Wenger
f9d2ca68ce KJS IR: Fix KT-45738 - Consider recursive checkForPrimitiveOrPattern
Recursive results from checkForPrimitiveOrPattern were ignored. If it found a case/condition that could not be optimized the resulting "false" was not propagated. This would lead to a "optimized" when without all conditions.
- see KT-45738
- The return is now lifted out of the when to make it more obvious what is going on.
- New test for mixed multiple conditions in when
2021-04-29 23:52:01 +03:00
Ilya Kirillov
caff279255 FIR IDE: add missing binary extensions
This also reveals and error in find usages for fir: it does not work for library source files
So, corresponding tests are muted
2021-04-29 23:31:05 +03:00
Andrey Zinovyev
e4a5775570 Remove duplicated code in annotation-based-compiler-plugins-ide-support 2021-04-29 23:14:16 +03:00
Andrey Zinovyev
8afb6d2761 [lombok] Support import from gradle to IDE
Introduce base module for ide compiler plugins
2021-04-29 23:14:15 +03:00
Andrey Zinovyev
b58bea6fa1 [lombok] IDE plugin with maven import handler 2021-04-29 23:14:14 +03:00
Andrey Zinovyev
07daf2165a [lombok] Rename maven subplugin to 'lombok' 2021-04-29 23:14:13 +03:00
Andrey Zinovyev
b88f54b31a [lombok] Add maven plugin integration test with kapt 2021-04-29 23:14:12 +03:00
Andrey Zinovyev
3e883120dd [lombok] Simple maven plugin to enable lombok support 2021-04-29 23:14:11 +03:00
Ivan Kochurkin
7ec709cf46 FIR: fix incorrect reporting of underscores, simplify code, fix test data file 2021-04-29 22:31:39 +03:00
Jinseong Jeon
9b39a8abc2 FIR: avoid wrapping an erroneous type as FirResolvedTypeRef
Instead, use FirErrorTypeRef, a subtype of FirResolvedTypeRef
2021-04-29 22:31:38 +03:00
Alexander Gorshenev
887032667d [Kotlin/Native][Interop] Skia interop plugin for cinterop 2021-04-29 21:43:26 +03:00
Vladimir Ivanov
5f582ad28a [Kotlin/Native][Interop] Provide pure c wrappers over cpp for skia interop 2021-04-29 21:43:25 +03:00
Yahor Berdnikau
61825e9aec Made GradleCompileTaskProvder compative with configuration cache.
After moving compilerRunner() method evaluation into execution phase,
creation of GradleCompileTaskProvider class started to violate
configuration cache.

^KT-45611 In Progress
2021-04-29 20:43:59 +03:00
Yahor Berdnikau
816e955c61 Introduce KotlinJavaToolchain compile tasks input.
This task input provides a way to set different from current Gradle
JDK and use it for Kotlin files compilation. By default it provides
current Gradle JDK.

Provided JDK major version is used as task input, so on providing
different JDK user will see cache miss.

All required interfaces are located inside api module.

^KT-45611 In Progress
2021-04-29 20:43:58 +03:00
Yahor Berdnikau
201b6dfa60 Print path to java executable Kotlin daemon was started with.
Useful for tests to validate toolchain correct behaviour.

^KT-45611 In Progress
2021-04-29 20:43:57 +03:00
Yahor Berdnikau
85456bd6d8 Add helper methods simplifying working with lazy properties from Kotlin.
Just allow to write Kotlin code easier and nicer when using Gradle
lazy properties.

^KT-45611 In Progress
2021-04-29 20:43:55 +03:00
Yahor Berdnikau
007f11e22e Add initial test setup to enable and test Gradle build cache.
This will allow to write JUnit5 tests to verify tasks are re-using
build cache on rebuilding same project from clean state.

^KT-45611 In Progress
2021-04-29 20:43:54 +03:00
Ilya Kirillov
ddf451739b FIR IDE: add member type-alias test for FileStructureTest 2021-04-29 17:51:28 +02:00
Ilya Kirillov
d438d2db40 FIR IDE: do not remove duplicated diagnostics
This hides the real problem why diagnostics are duplicated
2021-04-29 17:51:28 +02:00
Ilya Kirillov
77ae1fa1f2 FIR IDE: run lazy resolve phases in ContextIndependent ResolutionMode 2021-04-29 17:51:28 +02:00
Ilya Kirillov
663c0d975d FIR IDE: add cases for diagnostics traversal test 2021-04-29 17:51:27 +02:00
Ilya Kirillov
602be42b24 FIR IDE: fix lazy resolve for generated synthetic accessors 2021-04-29 17:51:27 +02:00
Nikolay Krasko
66683d2952 Unwrap both parts of light element in KtLightElementBase.isEquivalentTo
Even if origins are same, wrapped light elements are not equivalent.

Revealed by running bunch of JavaAgainstKotlinBinariesCheckerTestGenerated
tests.

com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: Non-idempotent computation:
it returns different results when invoked multiple times or on different threads:

  KtLightMethodForDecompiledDeclaration of KtLightClassForDecompiledDeclaration of PsiFile:A.class != KtLightMethodForDecompiledDeclaration of KtLightClassForDecompiledDeclaration of PsiFile:A.class
2021-04-29 18:20:38 +03:00
Andrey Zinovyev
c8a81911c0 [lombok] Add message about experimental status of the plugin 2021-04-29 18:05:27 +03:00
Ivan Gavrilovic
f0199d7277 [Gradle] Simplify Parcelize Gradle plugin
Do not iterate over all configurations, just
add the dependency to the compile and runtime classpath.
2021-04-29 17:26:36 +03:00
Ilmir Usmanov
cb89bd0e13 Generate SuspendFunction marker interface if supertype is suspend
Otherwise, is/as checks will not work.
 #KT-18707
2021-04-29 17:11:31 +03:00
Margarita Bobova
5d296a01c2 Add changelog for 1.4.31 and 1.4.32 2021-04-29 16:13:13 +03:00
Dmitriy Novozhilov
dbaaf081d7 Fix warning in Kotlin/Native build 2021-04-29 16:07:24 +03:00
Dmitriy Novozhilov
df51856e65 Advance bootstrap to 1.5.20-dev-5753 2021-04-29 16:07:22 +03:00
Mikhail Glukhikh
8147a88353 Cleanup: OverrideResolver.kt 2021-04-29 15:24:57 +03:00
Mikhail Glukhikh
cc05d91bda FE 1.0: add deprecation ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED_WARNING
#KT-45508 Fixed
2021-04-29 15:24:49 +03:00
Svyatoslav Scherbina
59b5475350 Fix WITH_COROUTINES tests compilation on Native after 5617d83c 2021-04-29 11:16:02 +00:00
Steven Schäfer
84d78035e4 JVM IR: Avoid double mangling of function reference invoke methods 2021-04-29 13:10:43 +02:00
Alexander Udalov
276ffd5a4b JVM IR: fix ::class reference and type mapping for scripts
#KT-46284 Fixed
2021-04-29 00:33:34 +03:00
Alexander Udalov
d10f734594 Fix warnings after making getKotlinPluginVersion non-null
See 4cb6303fa8.
2021-04-29 00:18:07 +03:00
Ilya Kirillov
7149d08995 FIR IDE: resolve supertypes before retrieving them 2021-04-28 22:11:05 +03:00
Ilya Kirillov
cccf9b7d54 FIR IDE: add JVM checkers 2021-04-28 17:57:45 +02:00
Ilya Kirillov
81a7271009 FIR: Decouple AbstractDiagnosticCollectorComponent and AbstractDiagnosticCollector 2021-04-28 17:57:45 +02:00
Nikolay Krasko
e43835c9f5 Bump konanVersion: 1.5.30 2021-04-28 17:58:40 +03:00
Ivan Kochurkin
525cc6df97 [FIR] Implement MANY_LAMBDA_EXPRESSION_ARGUMENTS diagnostics, fix tests 2021-04-28 16:21:48 +03:00
Udi Cohen
b8002cb54f [Kapt] Support dumping processors stats to a file
Using the option -Kapt-dump-processor-timings
2021-04-28 11:48:19 +03:00
sebastian.sellmair
beba85a848 [Commonizer] Calculate 'commonModuleNames' in hierarchical context
^KT-46330 Verification Pending
2021-04-28 02:03:20 +03:00
Nikolay Krasko
f7fdffefd6 Add an explicit dependency on dist for UAST tests 2021-04-27 22:00:18 +03:00
Dmitry Petrov
b34e2c1474 JVM_IR KT-36646 fuze primitive equality with safe call 2021-04-27 19:41:31 +03:00
Dmitry Petrov
72849a3dc3 JVM_IR update test for KT-36637 2021-04-27 19:41:29 +03:00
Dmitry Petrov
bdf914e8d5 JVM_IR use static 'hashCode' for boxed primitives on JVM 1.8+ 2021-04-27 19:41:28 +03:00
Dmitriy Novozhilov
07b15f9de6 [FIR] Support effective visibility with @PublishedApi
#KT-46270 Fixed
2021-04-27 18:39:10 +03:00
Dmitriy Novozhilov
32c3f85679 [FIR] Add inline checker for bodies of inline functions
This checker doesn't support `@PublishedAPI` yet, so some BB tests for it
 were muted. #KT-46270
2021-04-27 18:39:09 +03:00
Dmitriy Novozhilov
7e052c1eb1 [FIR] Fix suppressing diagnostics for some expressions 2021-04-27 18:39:07 +03:00
Dmitriy Novozhilov
2a08923c51 [FIR] Add more utilities for builtin functional types 2021-04-27 18:39:06 +03:00
Dmitriy Novozhilov
8925b8c922 [FIR] Fix leaking mutable map type of resolved argument mapping 2021-04-27 18:39:05 +03:00
Dmitriy Novozhilov
1afb844e1a [FIR] Fix FirExpressionWithSmartcastImpl.acceptChildren 2021-04-27 18:39:03 +03:00
Dmitriy Novozhilov
12331cb10c [FIR] Build resolved declaration status for all non-raw declarations 2021-04-27 18:39:02 +03:00
Ivan Kochurkin
d54808e33f [FIR] Implement CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS diagnostics, fix tests 2021-04-27 18:27:39 +03:00
Alexander Likhachev
f2f2df90aa [Gradle] Prevent early resolve of compiler classpath
#KT-45834 Fixed
2021-04-27 18:21:19 +03:00
Dmitry Petrov
660208740e PSI2IR KT-44013 WA: function interface constructor call accepted by FE 2021-04-27 17:35:37 +03:00
Ivan Kochurkin
704b5a0e13 [FIR] Implement UNDERSCORE_IS_RESERVED, UNDERSCORE_USAGE_WITHOUT_BACKTICKS diagnostics (lighttree) 2021-04-27 17:03:53 +03:00
Ivan Kochurkin
ea2d9f7c0c [FIR] Implement UNDERSCORE_IS_RESERVED, UNDERSCORE_USAGE_WITHOUT_BACKTICKS diagnostics (psi only) 2021-04-27 17:03:52 +03:00
Sergey Bogolepov
cc4adb798f Add cacheable targets for macos_arm64 host. 2021-04-27 13:47:20 +00:00
Andrey Zinovyev
0c6066db74 [KAPT] Don't fail on illegal delegate
Kapt ignores error diagnostics, but backend can't
 compile such code at all
This is workaround so backend won't fail.
#KT-46176 Fixed
2021-04-27 16:18:44 +03:00
Ilmir Usmanov
0c0710bb79 Fix outer class accesses inside suspendImpl functions
We need to generate this$0 fields to get to the outer class and generate
accesses to these fields inside suspendImpl function.
 #KT-46214 Fixed
2021-04-27 10:44:18 +02:00
Pavel Kirpichenkov
71365d2452 [IDE] Move library dependency filtering to dependencies cache
The primary client of LibraryDependenciesCache is LibraryInfo,
but it is also used for maintaining modification trackers of
source-dependent libraries. Moving dependency filtering to
cache allows keeping all client in sync.

^KT-45908 In Progress
2021-04-27 10:14:13 +03:00
Mikhael Bogdanov
dfc6d85aee Enable runtime string concatenation by default (for -Xjvm-target=9 or greater)
#KT-42522 Fixed
2021-04-27 09:08:28 +02:00
Ilmir Usmanov
dc2485ae71 Support suspend functions as superinterfaces
Forbid mixing suspend and non-suspend functional supertypes.
Since JVM BE generates suspend functional types as non-suspend ones
with SuspendFunction marker interface, there is not way to distinguish
non-suspend functional type from suspend one if they are mixed.
 #KT-18707 Fixed
2021-04-26 22:14:32 +02:00
Alexander Udalov
37ccd82b6c Fix some warnings in kotlin-gradle-plugin 2021-04-26 22:02:26 +03:00
Alexander Udalov
19a5c2f1c8 Fix warnings related to appendln in kotlin-gradle-plugin
`appendln` is deprecated, but its replacement `appendLine` can't be used
yet in kotlin-gradle-plugin because it's compiled with API version 1.3.
2021-04-26 22:02:25 +03:00
Alexander Udalov
e5128a8772 Improve generated code for Gradle properties
Fix warnings about double nullability and useless elvis.
2021-04-26 22:02:24 +03:00
Svyatoslav Kuzmich
ccc27b6a0c [IR] Add module property to IrFile 2021-04-26 18:52:42 +03:00
Vasily Levchenko
6f2af740cb [kotlin-native][tests][lldb] adds possibility to run simple lldb scenarious with simulator 2021-04-26 14:46:51 +00:00
Ilya Gorbunov
ed3542cdf5 Support covariant MutableMap.entries.remove in JS/IR
Workaround for KT-43321
Follow up to KT-41278
2021-04-26 17:45:27 +03:00
Anton Yalyshev
666ad1f9d5 1.5.0 Change-notes correction. Restore excessively removed items 2021-04-26 16:23:11 +03:00
Anton Yalyshev
ea7ea979ee 1.5.0 Change-notes correction according to KT-42522 2021-04-26 16:01:00 +03:00
Ilya Kirillov
e2acc507d4 FIR IDE: fix inconsistency in element collecting in DiagnosticTraversalCounterTest 2021-04-26 15:11:47 +03:00
Dmitriy Novozhilov
9cb740bfdb Fix tests broken in c6fa3634 2021-04-26 15:11:46 +03:00
Steven Schäfer
a1c1a32515 JVM: Fix unsigned literals in API version < 1.5 2021-04-26 15:11:45 +03:00
Mark Punzalan
af2d0ad36f FIR: Properly set light-tree source for all nested types (e.g.,
nullable function type) and error type refs.
2021-04-26 15:11:44 +03:00
Mark Punzalan
1835185b16 FIR: Remove duplicated diagnostics on annotations on types. 2021-04-26 15:11:43 +03:00
Mark Punzalan
edb6b337dc FIR: Resolve anonymous function bodies during
IMPLICIT_TYPES_BODY_RESOLVE phase.

This fixes an issue where some FirAnnotationCalls can be left with some
implicit type refs if they have anonymous functions in the arguments.
2021-04-26 15:11:42 +03:00
Mark Punzalan
e69b729e21 FIR checker: Create a new kind of checker FirTypeChecker and add
FirSuspendModifierChecker to report WRONG_MODIFIER_TARGET for `suspend`
on  non-functional types.
2021-04-26 15:11:41 +03:00
Dmitriy Novozhilov
4282d17467 [FIR] Optimize imports 2021-04-26 15:11:40 +03:00
Mark Punzalan
b88913af1d FIR checker: Report WRONG_MODIFIER_TARGET for suspend on
non-functional types.
2021-04-26 15:11:39 +03:00
Mark Punzalan
9a4742c08d FIR: Properly build nullable suspend function types, and aggregate
modifiers and annotations within KtTypeReference/REFERENCE_TYPE nodes.
2021-04-26 15:11:38 +03:00
Mark Punzalan
9cf5ac1fbd FIR: Render "?" on nullable function types. 2021-04-26 15:11:37 +03:00
Ilya Gorbunov
a9cc046ec9 Add missing constructor for expect annotation class JvmRecord
KT-46280
2021-04-26 10:41:49 +00:00
Alexander Dudinsky
2c29957cb8 Move tests from GradleImportingTestCase to MultiplePluginVersionGradleImportingTestCase 2021-04-26 13:20:00 +03:00
Alexander Dudinsky
e96f64e6c9 Refactor MultiplePluginVersionGradleImportingTestCase
By this commit:
- Used `isTeamcityBuild` flag for a separating local run of the tests from CI
  For local run by default uses master version of gradle-plugin and
  LATEST_SUPPORTED_GRADLE_VERSION of the Gradle.
  But you can specify versions for local run by overriding sysenv
  `IMPORTING_TESTS_LOCAL_RUN_PARAMS`.
  For example: export IMPORTING_TESTS_LOCAL_RUN_PARAMS=6.7.1:1.4.30
- Moved main logic from `GradleImportingTestCase` to
  `MultiplePluginVersionGradleImportingTestCase` for removing the first one later
- Removed `AbstractModelBuilderTest` as useless only
 `DistributionLocator` left from this class.
2021-04-26 13:19:59 +03:00
Ilya Gorbunov
b59f668a50 Change the way kotlin.js source map paths are postprocessed
The idea is that we do no longer use `sourceMapBaseDirs` parameter
of `compileKotlin2Js` task to remove prefix from source paths,
but instead preserve the full paths relative to the output directory.
This allows us to avoid duplicate file names and to identify
source files more reliably.
Then, after sources have been embedded in the source map, we remove
several relative prefixes from source paths.
2021-04-26 13:13:21 +03:00
Mikhail Glukhikh
29d2a6acee FIR: fold String arguments inside string concatenation call
Related to KT-28006
2021-04-26 12:50:57 +03:00
Mikhail Glukhikh
f278de8768 FIR: don't call toString() inside string concatenations 2021-04-26 12:50:55 +03:00
Igor Chevdar
7dcdbf283b [box-tests] Added test 2021-04-26 11:53:27 +05:00
Igor Chevdar
eb1dcdb344 [K/N][IR] Fixed bug with enum companion init
Fixes https://youtrack.jetbrains.com/issue/KT-46048
2021-04-26 11:53:27 +05:00
Igor Chevdar
476b3befaf [K/N][IR] Refactored enums lowering a bit 2021-04-26 11:53:26 +05:00
Andrey Zinovyev
01dd3d6ed4 [lombok] Refactoring, cleaning, better tests
Add assertions to tests
Add lombok license
Provide String.[de]capitalize() implementation
Get rid of weak map because it seems it is useless here
2021-04-25 18:18:18 +03:00
Andrey Zinovyev
c4147bc2fd [lombok] Add integration test for gradle plugin 2021-04-25 18:18:17 +03:00
Andrey Zinovyev
5a6819daa8 [lombok] Check that nullability actually works 2021-04-25 18:18:16 +03:00
Andrey Zinovyev
1fb4590978 [lombok] Some cleaning and docs 2021-04-25 18:18:15 +03:00
Andrey Zinovyev
9ebce7849c [lombok] Skip generation with AccessLevel.NONE 2021-04-25 18:18:15 +03:00
Andrey Zinovyev
be4a518a25 [lombok] Support for lombok.accessors.prefix config 2021-04-25 18:18:14 +03:00
Andrey Zinovyev
17e4a6142c [lombok] Strip prefixes defined in @Accessors 2021-04-25 18:18:13 +03:00
Andrey Zinovyev
f2c0b8c68d [lombok] Strip 'is' prefix in boolean properties 2021-04-25 18:18:12 +03:00
Andrey Zinovyev
8a2279de2b [lombok] Use config values as default in annotation parsing 2021-04-25 18:18:11 +03:00
Andrey Zinovyev
c7b2c731af [lombok] Basic @Value support 2021-04-25 18:18:11 +03:00
Andrey Zinovyev
97fc187e77 [lombok] @Data support 2021-04-25 18:18:10 +03:00
Andrey Zinovyev
99f9b79c87 [lombok] Add simple way to use lombok plugin in one project with kapt 2021-04-25 18:18:09 +03:00
Andrey Zinovyev
79d49e6dbd [lombok] Gradle sublugin for no-kapt project 2021-04-25 18:18:08 +03:00
Andrey Zinovyev
8011452c28 [lombok] Don't generate members that already exist 2021-04-25 18:18:07 +03:00
Andrey Zinovyev
d459cde010 [lombok] Run compiled code 2021-04-25 18:18:06 +03:00
Andrey Zinovyev
411441c332 [lombok] Generic classes support 2021-04-25 18:18:06 +03:00
Andrey Zinovyev
afcb2ca904 [lombok] Support @RequiredArgsConstructor 2021-04-25 18:18:05 +03:00
Andrey Zinovyev
b336a335bf [lombok] Support @AllArgsConstructor 2021-04-25 18:18:04 +03:00
Andrey Zinovyev
59f936fdef [lombok] Generate no-arg static factory method 2021-04-25 18:18:03 +03:00
Andrey Zinovyev
37926f333e [lombok] Generate no-arg constructor 2021-04-25 18:18:03 +03:00
Andrey Zinovyev
e9a33e0335 [lombok] Introduce synthetic constructors generation 2021-04-25 18:18:02 +03:00
Andrey Zinovyev
e0216cc9f4 [lombok] Add readme with (not) supported features 2021-04-25 18:18:01 +03:00
Andrey Zinovyev
e0a95ff556 [lombok] @With support 2021-04-25 18:18:00 +03:00
Andrey Zinovyev
7fd8f7b3bc [lombok] @Setter support 2021-04-25 18:17:59 +03:00
Andrey Zinovyev
70e3877efc [lombok] Basic config support 2021-04-25 18:17:57 +03:00
Andrey Zinovyev
5ceefa3e3b [lombok] Support for class level @Getter 2021-04-25 18:17:56 +03:00
Andrey Zinovyev
e4bd33eb4f [lombok] Support for fluent getters 2021-04-25 18:17:55 +03:00
Andrey Zinovyev
f71e08df4d [lombok] Experimental lombok plugin prototype
Add extension point for java descriptors
Add simple usage of this point to generate getter method
Add simple test infrastructure to test compilation with lombok plugin
2021-04-25 18:17:53 +03:00
Yahor Berdnikau
ac86ad252f Optionally make java executable path contribute to the daemon id.
This change will allow to start Kotlin daemon instances using different
from the current user JDK version and use it to compile Kotlin files.
Old behaviour, when java executable path is not set, is still working
 and still,by default, using current user JDK version.

For example, user for some reason wants to use JDK 1.8 as active one,
 but compile current project using JDK 16.

Main goal is to support Gradle toolchains.

^KT-45611 In Progress
2021-04-24 11:12:47 +03:00
Yahor Berdnikau
1d47f4ad2b Consolidate compiler id digest.
Change all calculations of compiler id digest to use
 'CompilerId#digest()' method.

^KT-45611 In Progress
2021-04-24 11:12:46 +03:00
Simon Ogorodnik
c6fa363487 [FIR] Add warning if FIR is used 2021-04-23 19:49:46 +03:00
Victor Petukhov
7a81d0de8a Regenerate tests 2021-04-23 19:28:26 +03:00
sebastian.sellmair
7be48a0b4b CommonizerHierarchicalIT: Enable test commonizeHierarchicallyMultiModule
^KT-46107 Fixed
2021-04-23 16:25:59 +00:00
sebastian.sellmair
63e5298be9 Update 'versions.kotlin-native' to 1.5.20-dev-5613
^KT-46107
2021-04-23 16:25:59 +00:00
Konstantin Tskhovrebov
b894b7df6e Add integration tests for "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks. 2021-04-23 19:23:58 +03:00
Konstantin Tskhovrebov
c8ef0715b9 Register "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks when gradle is run from Xcode.
#KT-27240
2021-04-23 19:23:57 +03:00
Alexander Udalov
0c3f2eefe0 Migrate bytecodeListing tests to new test infrastructure 2021-04-23 17:58:16 +02:00
Alexander Udalov
7e170770ea Minor, move around bytecode listing tests 2021-04-23 17:58:16 +02:00
sebastian.sellmair
28690b7f32 KotlinToolRunner: Add "java.system.class.loader" to execSystemPropertiesBlacklist
IDE integration tests will forward an unvailable intellij classloader
which will fail the execution.
2021-04-23 14:34:17 +00:00
sebastian.sellmair
7b8926f85b [Commonizer] Allow propagation of leaf targets
^KT-46248 Verification Pending
2021-04-23 14:34:17 +00:00
sebastian.sellmair
7c1520a424 [Commonizer] Implement SingleTargetPropagationTest to cover KT-46248
^KT-46248
2021-04-23 14:34:16 +00:00
sebastian.sellmair
965e328766 CommonizerIT: implement test KT-46248 single supported native target dependency propagation to cover KT-46248
^KT-46248
2021-04-23 14:34:15 +00:00
Mikhail Glukhikh
683872ecbf FIR: use more precise checkers when possible 2021-04-23 17:29:43 +03:00
Mikhail Glukhikh
5c224ad17c FIR: fix positioning in fun interface checker 2021-04-23 17:29:34 +03:00
Артём
393a19db54 FIR: introduce FunInterfaceDeclarationChecker 2021-04-23 17:29:25 +03:00
Victor Petukhov
867d7b5bca Allow type variable fixation into intersection type if it isn't meaningless (i.e. has one or more final classes, or two or more open classes)
^KT-46186 Fixed
2021-04-23 15:12:13 +03:00
Victor Petukhov
310d98c4f7 Don't require existence of the corresponding type argument during computing target type to apply type use annotation loaded from class file
^KT-46131 Fixed
2021-04-23 15:12:12 +03:00
sebastian.sellmair
13b1664edf CommonizerIT: Implement additional test KT-46142 standalone native source set
^46142
Before this test, the behaviour was tested as integration test in the IDE.
This Gradle integration test will detect issues even earlier.
2021-04-23 15:02:15 +03:00
Konstantin Tskhovrebov
ee4a1d173d Revert "Add integration tests for "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks."
This reverts commit 6db3960d
2021-04-23 12:11:42 +03:00
Konstantin Tskhovrebov
8840a9ecd1 Revert "Register "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks when gradle is run from Xcode."
This reverts commit c2cdf9c7
2021-04-23 12:11:19 +03:00
Ilmir Usmanov
f7a9bc3521 Minor. Make test actually suspend and add a test without suspension 2021-04-23 03:50:08 +02:00
pyos
23ffbe4d9e JVM_IR: do not box inline classes in suspend multifile bridges 2021-04-23 03:49:47 +02:00
pyos
7d95943b8b JVM_IR: do not box inline classes in suspend synthetic accessors 2021-04-23 03:49:43 +02:00
Alexander Likhachev
857bee6ced [Build] Remove empty source directories warning
There're should be no more cache misses on empty directories with Gradle 6.8. See https://docs.gradle.org/6.8/release-notes.html#more-cache-hits-when-empty-directories-are-present
2021-04-23 03:52:45 +03:00
Alexander Likhachev
03f9d78eb3 [Build] Add workaround to make local publishing serializable
Also signing plugin now being applied only when signing is required.
#KT-44611 In Progress
2021-04-23 03:52:41 +03:00
Sergey Igushkin
4e6c483ccc Add a final override for project in KotlinGradleFragmentInternal 2021-04-23 00:43:14 +03:00
Sergey Igushkin
bb35d9271f Minor fix: don't use lazy in KotlinPm20ProjectExtension.modules 2021-04-23 00:43:14 +03:00
Sergey Igushkin
53f02a53f0 Add caching to dependency resolvers in PM20 + some refactoring 2021-04-23 00:43:13 +03:00
Sergey Igushkin
1f0089c5de Refactor the dependency graph resolver to be more readable 2021-04-23 00:43:13 +03:00
Sergey Igushkin
d07c76fca4 Add kotlin-project-model artifacts to the set of trusted artifacts 2021-04-23 00:43:12 +03:00
Sergey Igushkin
6be33448d6 Rework adding sources to FilteringSourceRootsContainer in JVM tasks
Support adding lazily-evaluated file collections (i.e. tracking their
source roots lazily, as opposed to eagerly evaluating the source roots.
2021-04-23 00:43:12 +03:00
Sergey Igushkin
e59a57d11c Add ":kotlin-project-model" to the list of modules installed for tests 2021-04-23 00:43:11 +03:00
Sergey Igushkin
e7b81c52a7 Get rid of DependencyDiscovery in favor of DependencyGraphResolver 2021-04-23 00:43:11 +03:00
Sergey Igushkin
d602470027 Fix compilation of the tests in kotlin-project-model 2021-04-23 00:43:10 +03:00
Sergey Igushkin
fe351f26ef For now, publish the sources elements variant with usage=kotlin-sources 2021-04-23 00:43:10 +03:00
Sergey Igushkin
a94597d85a Experimental sources publication in the PM2.0 prototype 2021-04-23 00:43:10 +03:00
Sergey Igushkin
44fcd7e891 Use KotlinCompilationTaskConfigurator for metadata compilation tasks 2021-04-23 00:43:09 +03:00
Sergey Igushkin
4cb6303fa8 Get rid of kotlinPluginVersion in the constructors throughout the plugin
We passed the kotlinPluginVersion which was only used for a single
purpose in countless constructors.

In fact, the plugin version is easy to load at the call site, as it gets
loaded from the plugin's resources.

So rework the plugin version loading code so that it doesn't rely on the
applied plugin, and don't pass the plugin version in all those
constructors.
2021-04-23 00:43:09 +03:00
Sergey Igushkin
2a5d511b66 Minor fix: handle kotlinOptions more carefully, store them where needed 2021-04-23 00:43:08 +03:00
Sergey Igushkin
00e5e462ea Further refactor compile task configuration: extract the configurator 2021-04-23 00:43:08 +03:00
Anton Lakotka
1a85da5ff8 Make language settings nullable in KotlinModuleFragment
There is no lang settings when importing from klibs (yet)
2021-04-23 00:43:07 +03:00
Anton Lakotka
c3264a2979 Add language consistency checks for fragments
Migrate exiting consistency checker for source sets to be generic
and reuse it for fragments
2021-04-23 00:43:07 +03:00
Anton Lakotka
de4221afd8 Add immutable LanguageSettings interface and apply it to compilation
LanguageSettingsBuilder extends LanguageSettings
2021-04-23 00:43:06 +03:00
Sergey Igushkin
54c6ae2cce (minor) Rename modelClasses.kt -> KotlinJvmVariantFactory.kt 2021-04-23 00:43:06 +03:00
Sergey Igushkin
3be2734c63 Refactor the setup of compilation in the PM20 implementation prototype 2021-04-23 00:43:05 +03:00
Sergey Igushkin
c1fe0d7158 Add publishing configurator, call it from the variant factories 2021-04-23 00:43:05 +03:00
Sergey Igushkin
1271fabffa Fix Maven scope mapping for the runtime dependencies in PM20 publishing 2021-04-23 00:43:04 +03:00
Sergey Igushkin
27015a657c Don't pass the IDE paths to the extracted klibs that don't exist 2021-04-23 00:43:04 +03:00
Sergey Igushkin
470103bfac Don't rely on the current project in dep-resolution if module is given 2021-04-23 00:43:04 +03:00
Sergey Igushkin
f029179fe0 Add basic support for Kotlin/Native variants to the PM20 Gradle plugin 2021-04-23 00:43:00 +03:00
Sergey Igushkin
401fbae8d8 Handle dependency module IDs more carefully in dependency resolution 2021-04-23 00:42:37 +03:00
Sergey Igushkin
ea458e6848 Add some API interfaces for Gradle PM20 entities in the API module 2021-04-23 00:42:37 +03:00
Sergey Igushkin
a52c6858a9 Minor fixes in exposed configurations 2021-04-23 00:42:37 +03:00
Sergey Igushkin
134fb7741e Fix getChosenVariant implementation for project(...) dependencies 2021-04-23 00:42:36 +03:00
Sergey Igushkin
ec3fa2610e Support basic publishing with maven-publish in the PM20 plugin 2021-04-23 00:42:36 +03:00
Sergey Igushkin
0bf408e147 (minor) Add isAllowCommonizer stub to the PM2.0 project extension
This prevents the IDE from failures during Gradle project sync
2021-04-23 00:42:35 +03:00
Sergey Igushkin
4e0485c523 Expose compiled metadata for project deps, set capabilities on elements 2021-04-23 00:42:35 +03:00
Sergey Igushkin
147fd22cfb (minor) Fix static init issue with Gradle multi-threaded resolve 2021-04-23 00:42:35 +03:00
Sergey Igushkin
f1f97b4104 Support published MPP consumption with PM2.0 projects 2021-04-23 00:42:34 +03:00
Sergey Igushkin
70b88ada93 Gradle plugin prototype that uses the project model 2.0 2021-04-23 00:42:34 +03:00
Sergey Igushkin
d66f95b80e Resolve dependencies as graph, support multiple modules in a project 2021-04-22 23:42:06 +03:00
Sergey Igushkin
f1fb438d00 Refactor: make fragments resolver consistent with variant resolver 2021-04-22 23:42:05 +03:00
Sergey Igushkin
7103aa3100 ModuleOrigin -> ModuleIdentifier 2021-04-22 23:42:04 +03:00
Sergey Igushkin
66b8a444c2 Add a basic markdown doc explaining dependency resolution. 2021-04-22 23:42:02 +03:00
Sergey Igushkin
6aee396e4b Build PM2.0 in o.j.k.multiplatform (+ dependency resolution API) 2021-04-22 23:42:01 +03:00
Sergey Igushkin
994f940a31 Dependency resolution API in PM2.0 2021-04-22 23:42:00 +03:00
Sergey Igushkin
f189ebc983 Project Model 2.0 initial commit: core entities 2021-04-22 23:41:59 +03:00
Konstantin Tskhovrebov
6db3960d56 Add integration tests for "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks. 2021-04-22 20:33:20 +03:00
Konstantin Tskhovrebov
c2cdf9c796 Register "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks when gradle is run from Xcode.
#KT-27240
2021-04-22 20:33:20 +03:00
Alexander Udalov
99e022d023 IR: minor, remove duplicate visibility field 2021-04-22 17:42:18 +02:00
Dmitriy Novozhilov
d4162f876f [FIR] Fix some warnings 2021-04-22 14:32:06 +03:00
Dmitriy Novozhilov
234ab3b35d [FIR] Fix all illegal usages of declarationSiteSession in compiler
There are still some usages in IDE which should be investigated
2021-04-22 14:32:04 +03:00
Dmitriy Novozhilov
f98f41bbc3 [FIR] Rename session to declarationSiteSession in declaration builders 2021-04-22 14:32:03 +03:00
Dmitriy Novozhilov
c3b1be1a39 [FIR] Rename FirDeclaration.session to declarationSiteSession 2021-04-22 14:32:02 +03:00
Dmitriy Novozhilov
46f5c2073d [FIR] Make most of declarations a sealed classes/interfaces 2021-04-22 14:32:00 +03:00
Dmitriy Novozhilov
7f7373dad2 [FIR] Support sealed classes and interfaces in FIR tree generator 2021-04-22 14:31:59 +03:00
Dmitriy Novozhilov
951daeea3a [FIR] Add typealias to AbstractFirBasedSymbol<*> in FirDiagnosticsList 2021-04-22 14:31:58 +03:00
Vasily Levchenko
1ae41443a2 [kotlin-native][build] clean task fix 2021-04-22 11:16:55 +00:00
Jinseong Jeon
24d792fb49 FIR checker: warn useless elvis 2021-04-22 13:10:54 +03:00
Alexander Udalov
b2005302dc JVM, JVM IR: erase generic SAM supertypes
Also, do not try to use invokedynamic on SAM calls with intersection
types, because intersection type is not allowed as an immediate type
projection of a supertype, and constructing a fake override in
LambdaMetafactoryArgumentsBuilder led to an exception. This fixes the
problem which was worked around earlier in e6c089ef, effectively
reverting that commit.

The main motivation for this change is that LambdaMetafactory also
doesn't generate generic signature for SAM wrapper classes at runtime.
Since these classes are synthetic, nobody should rely on the fact that
they have generic supertypes, which was observable only via Java
reflection.

 #KT-46149 Fixed
 #KT-46238 Fixed
2021-04-22 10:53:15 +02:00
Andrey Zinovyev
1093bffc62 [KAPT] Cache annotation processors' classloaders
Adds experimental feature to cache annotation processors' classloaders
It should increase speed of KAPT for consecutive runs
Works for gradle only (it stores cl in gradle daemon)
#KT-28901 Fixed
2021-04-22 11:51:14 +03:00
Mikhail Glukhikh
e6b9935df9 FIR: drop source-based check from InferenceUtils 2021-04-22 10:26:47 +03:00
sebastian.sellmair
75d9cd3814 [Minor] KotlinLibraryResolverImpl: Improve readability in resolveDependencies 2021-04-21 20:05:57 +00:00
sebastian.sellmair
3c4d0a1814 CInteropCommonizerTask: Mark dependency on commonized native distribution as @Classpath 2021-04-21 20:05:56 +00:00
sebastian.sellmair
f4617b2c03 Do not forward external dependencies on c-interop commonization.
^KT-46109
^KT-46107 Fixed
2021-04-21 20:05:56 +00:00
sebastian.sellmair
22ea5c7de4 Demote fatal error to warning on unresolved libraries mentioned in Klib's manifest 'depends' for metadata compilation
^KT-46107
2021-04-21 20:05:55 +00:00
sebastian.sellmair
95a1a4e66a CommonizerHierarchicalIT: Implement test commonizeHierarchicallyMultiModule
^KT-46107
2021-04-21 20:05:54 +00:00
sebastian.sellmair
5fb30b05ff Implement CommonizerIT.test KT-46234 intermediate source set with only one native target to cover KT-46234
^KT-46234
2021-04-21 20:05:06 +00:00
Ilya Kirillov
e2786197ff FIR IDE: support reporting of FirLightSourceElement based diagnostics 2021-04-21 22:22:32 +03:00
Ilya Kirillov
47e8b2f9dc FIR IDE: remove copy-pasted code from DeclarationCopyBuilder 2021-04-21 21:17:00 +03:00
Ilya Kirillov
a76c5d66eb FIR: introduce FirDeclarationBuilder as a base class for all FIR declaration builders 2021-04-21 21:16:58 +03:00
Ilya Kirillov
da6c5e13d5 FIR IDE: add completion support to classes and to type aliases 2021-04-21 21:16:56 +03:00
Ilya Kirillov
a5c33c8d42 FIR IDE: simplify completion context retrieving 2021-04-21 21:16:55 +03:00
Mikhail Zarechenskiy
f8efe3b5df Make function open to overrie it IDE specific part
Namely, this function is overrided in 211 & 212 platforms, see ScriptDefinitionsManager
2021-04-21 20:00:22 +03:00
Dmitry Petrov
5324cbe729 Minor: update tests 2021-04-21 19:10:32 +03:00
Steven Schäfer
8c9ad81c76 Psi2Ir: Fold constants when generating IR
This is necessary to avoid stack overflow errors on large constant
expressions.
2021-04-21 19:10:31 +03:00
Steven Schäfer
e87d816994 Psi2Ir: Remove unused code 2021-04-21 19:10:31 +03:00
Steven Schäfer
d3d4e94cd6 JVM: Fix constant folding for unsigned values 2021-04-21 19:10:31 +03:00
Dmitry Petrov
732405895f Add tests for KT-45308 2021-04-21 17:36:12 +03:00
Dmitry Petrov
f228c3bb04 Add tests for KT-45236 2021-04-21 17:24:41 +03:00
Yahor Berdnikau
4f352950d9 Include Dukat generated sources into generic 'sourcesJar' output.
Gradle 7 complains that "sourcesJar" task uses inputs from Dukat
generate task outputs directory, but this tasks does not have explicit
dependency.

^KT-46006 Fixed
2021-04-21 16:48:16 +03:00
Mikhail Glukhikh
a097a58edf Introduce helper FirExpression.unwrapArgument() in fir:tree 2021-04-21 16:19:09 +03:00
pyos
e6d923f65c FIR: rename HIDDEN to INVISIBLE_REFERENCE
Some of them should be INVISIBLE_MEMBER though
2021-04-21 16:18:21 +03:00
pyos
f1cf6b54e7 FIR2IR: convert some error calls to non-error IR
This allows suppressing "invisible reference"-type errors, which some
people do in production code.
2021-04-21 16:02:01 +03:00
Mikhail Glukhikh
6833e83a6f Minor fix in FirInlineClassDeclarationChecker 2021-04-21 16:01:51 +03:00
Alexander Udalov
7fe10e27a1 Minor, fix failing codegen tests on different JDKs
#KT-46238
2021-04-21 14:43:10 +02:00
Anton Yalyshev
fe5e968896 Add change-notes for 1.5.0 release 2021-04-21 14:13:46 +03:00
Vladimir Dolzhenko
590a8d088d Refine locking to avoid dead lock
#KT-46215 Fixed
2021-04-21 11:01:12 +00:00
Mikhail Glukhikh
6ae4c3f281 Drop state from FirMethodOfAnyImplementedInInterfaceChecker 2021-04-21 13:22:14 +03:00
Mikhail Glukhikh
e0fe122ee9 Drop stored types from FirInlineClassDeclarationChecker 2021-04-21 13:22:13 +03:00
Mikhail Glukhikh
9bc3404833 Drop state from FirInapplicableLateinitChecker 2021-04-21 13:22:11 +03:00
Mikhail Glukhikh
e0c8a6658b FIR: handle annotations on non-containers more precisely 2021-04-21 13:22:10 +03:00
Mikhail Glukhikh
04daf8fce8 FIR: add messages for two accessor diagnostics 2021-04-21 13:22:09 +03:00
Julia
387dafb8c5 [FIR] Introduce AnnotationUsedAsAnnotationArgumentChecker 2021-04-21 13:22:07 +03:00
Alexander Udalov
27ddc31f15 Ignore codegen test using streams on Android 2021-04-21 11:39:08 +02:00
Dmitry Petrov
59de12c609 Minor: mute bytecode text check in some box tests failing in FIR 2021-04-21 11:27:12 +03:00
Dmitry Petrov
f519150c08 JVM_IR KT-46189 lower tailrec functions after local declarations 2021-04-21 11:27:11 +03:00
Sergey Bogolepov
645014092c Add a mention of KT-46231. 2021-04-21 15:14:33 +07:00
Ilya Gorbunov
4ae5efd6da Prevent calling AssertContentEquals with two Set arguments
It's unclear whether these sets are intended to be compared with
the unordered Set equality, or with the ordered Iterable equality.

KT-32996
2021-04-21 03:08:35 +03:00
Alexander Udalov
21e9bd7ea2 Add regression tests for obsolete issues
#KT-9304
 #KT-14961
 #KT-16549
 #KT-21080
 #KT-28234
 #KT-30102
 #KT-31994
 #KT-34291
 #KT-38099
 #KT-41174
 #KT-44622
 #KT-44701
 #KT-44781
 #KT-44849
 #KT-44978
 #KT-45081
 #KT-45286
 #KT-45383
 #KT-45444
 #KT-45907
2021-04-20 21:24:29 +02:00
Ivan Gavrilovic
2666a93e6a [Gradle] Avoid using dependsOn and add output provider to the file collection 2021-04-20 22:13:25 +03:00
Alexander Udalov
e6c089ef40 IR: fix SAM conversion for types with contravariant intersection argument type
In the added test, the problem was that the SAM type as computed by
`SamTypeFactory.createByValueParameter` was `Consumer<{BaseClass &
BaseInterface}>`, which was latter approximated in psi2ir during the
KotlinType->IrType conversion to `Consumer<out Any?>` (here:
3034d9d791/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt (L606)),
because intersection type argument is approximated to `out Any?`.

To avoid this, replace intersection type in immediate arguments of a SAM
type with the common supertype of its components at the same place where
we're getting rid of projections.

 #KT-45945 Fixed
2021-04-20 17:31:14 +02:00
Andrey Zinovyev
ac0af39660 [FIR][LT] Enable parallel execution for LT tests 2021-04-20 18:13:07 +03:00
Andrey Zinovyev
0a811bdd1a [FIR][LT] Don't store lexer in static context 2021-04-20 18:13:06 +03:00
Andrey Zinovyev
5fc1514104 [FIR][LightTree] Better expression identification
And some refactoring
Regenerate IDE parts
2021-04-20 18:13:06 +03:00
Andrey Zinovyev
2f7d6da22f [FIR][LightTree] Generate and fix missing tests
Add TYPE_PARAMETERS_LIST positioning
Use whole branch as source in when branches
2021-04-20 18:13:05 +03:00
Andrey Zinovyev
b9ae22207e [FIR] Fix tests data for diagnostic tests
For tests failed after light tree changes
2021-04-20 18:13:03 +03:00
Andrey Zinovyev
ee48fc320d [FIR][LightTree] Mark fake nodes in FOR loop
+ fix bunch of tests
2021-04-20 18:13:02 +03:00
Andrey Zinovyev
0a68edf3bd [FIR][LightTree] More fixes in diagnostic positioning
Keep tree padding for modifiers
More REFERENCE_EXPRESSIONS kinds
Fix source for some call expressions
2021-04-20 18:13:01 +03:00
Andrey Zinovyev
f3dc8dfb21 [FIR][LightTree] Use same fake elements kinds as in psi
Otherwise type resolution(!) for empty lambda works differently
2021-04-20 18:13:00 +03:00
Andrey Zinovyev
e8e9f67069 [FIR][LightTree] Enum and property source fixes
Also set dispatchReceiverType for properties from value params
2021-04-20 18:12:59 +03:00
Andrey Zinovyev
1fb8c3b1d7 [FIR][LightTree] Properly unwrap function inside parentheses 2021-04-20 18:12:58 +03:00
Andrey Zinovyev
05f0507cbb [FIR][LightTree] Proper source for enum constructor call 2021-04-20 18:12:57 +03:00
Andrey Zinovyev
bed45affe1 [FIR][LightTree] Don't report diagnostics on some nameless declarations 2021-04-20 18:12:56 +03:00
Andrey Zinovyev
684c4c2825 [FIR][LightTree] Don't position on trailing comments 2021-04-20 18:12:55 +03:00
Andrey Zinovyev
0d99b01dcb [FIR][LightTree] Pass source elements in FOR loop parts 2021-04-20 18:12:54 +03:00
Andrey Zinovyev
8bbdc20809 [FIR][LightTree] Pass source elements in when conditions 2021-04-20 18:12:54 +03:00
Andrey Zinovyev
9c8e92f5af [FIR][LightTree] Fix DEFAULT positioning strategy for object literals 2021-04-20 18:12:53 +03:00
Andrey Zinovyev
70f9b77cce [FIR][LightTree] Keep source in FOR loop elements 2021-04-20 18:12:52 +03:00
Andrey Zinovyev
27766c2575 [FIR] Consistent isLocal for objects inside Enum entries 2021-04-20 18:12:51 +03:00
Andrey Zinovyev
7084fec651 [FIR][LightTree] Position strategies fixes
Skip leading comments in DEFAULT strategy
Keep node offset 'padding' when getting child
2021-04-20 18:12:50 +03:00
Andrey Zinovyev
8ea3b52454 [FIR][LightTree] Fix finding error nodes in tree
When there are links to to 'upper levels' lt elements in fir tree
2021-04-20 18:12:49 +03:00
Andrey Zinovyev
dc19e39dd2 [FIR][LightTree] Properly locate return keyword 2021-04-20 18:12:47 +03:00
Andrey Zinovyev
088db0e138 [FIR] Report SEALED_CLASS_CONSTRUCTOR_CALL on expression 2021-04-20 18:12:46 +03:00
Andrey Zinovyev
48994976d4 [FIR][LightTree] Skip comments and whitespaces when marking elements 2021-04-20 18:12:45 +03:00
Andrey Zinovyev
dcbb1fb22b [FIR][LightTree] Extract syntax errors from subtrees 2021-04-20 18:12:45 +03:00
Andrey Zinovyev
7dedd04ed9 [FIR] Add SYNTAX diagnostics for light tree 2021-04-20 18:12:43 +03:00
Dmitriy Novozhilov
3e0eb06e3e [FIR] Add FirOldFrontendDiagnosticsWithLightTreeTestGenerated 2021-04-20 18:12:42 +03:00
Igor Yakovlev
e4870740e1 [LC] Fixed light classes nullability for Kotlin 1.5
Fixed #KT-44472
2021-04-20 15:21:12 +02:00
Igor Yakovlev
63160293fb [LC] Fix invalid nullability for properties
Fixed #KT-46097 and #KT-41671
2021-04-20 15:21:12 +02:00
Andrey Zinovyev
8071a1e246 [KAPT] Keep constant references in annotations with array values
#KT-29929 Fixed
2021-04-20 15:47:03 +03:00
Yahor Berdnikau
9e9450caa2 Fix adding associated compilation for Kotlin Native.
Kotlin native does not support 'compileOnly' or 'runtimeOnly'
configurations. In this case associated compilations are added as
'implementation'.

^KT-45911 Fixed
2021-04-20 10:15:15 +02:00
Abduqodiri Qurbonzoda
57c4f79c1c Update Char.digitToInt documentation 2021-04-20 04:36:05 +03:00
Ilya Kirillov
26e39b3d2a FIR IDE: do not resolve all members for getting inner classes for light classes 2021-04-20 01:32:26 +03:00
Ilya Kirillov
051310124b FIR IDE: do not fail duplicating classes with members 2021-04-20 01:32:25 +03:00
Mark Punzalan
73b796f184 FIR IDE: Enable RemoveExclExclCallFix for UNNECESSARY_NON_NULL_ASSERTION. 2021-04-19 22:29:07 +02:00
Mark Punzalan
34609b264d FIR IDE: Move RemoveExclExclCallFix to idea-frontend-independent. 2021-04-19 22:29:07 +02:00
Alexander Udalov
4fffed4165 Improve test on equals/hashCode for KProperty accessors
Remove duplication & unnecessary checks, check equality in both
directions, check hashCode, add more cases, rename variables for
clarity.

 #KT-13490
2021-04-19 20:39:54 +02:00
Xin Wang
c959b271a4 Override "hashCode" and "equals" for Getter and Setter to fix KT-13490 2021-04-19 20:39:54 +02:00
Dmitry Petrov
46d5e974df JVM_IR KT-46160 don't use LambdaMetafactory for mutifile class members 2021-04-19 19:32:34 +03:00
yantimirov-timur
1dfc3c0520 FIR: add getter visibility and setter return type checks 2021-04-19 19:21:09 +03:00
Abduqodiri Qurbonzoda
eedc4d8c3f [K/N] Fix measureTimeMillis and measureNanoTime doc 2021-04-19 19:14:34 +03:00
Abduqodiri Qurbonzoda
aa04f60df4 [K/N] Fix Floating.toInt/toLong doc 2021-04-19 19:14:33 +03:00
Abduqodiri Qurbonzoda
4c66c1c137 [K/N] Fix Primitive.shl/shr/ushr doc 2021-04-19 19:14:32 +03:00
Abduqodiri Qurbonzoda
19ecb78531 [K/N] Fix Primitive.rem doc 2021-04-19 19:14:30 +03:00
Abduqodiri Qurbonzoda
2cfbad9477 [K/N] Fix Primitive.div doc 2021-04-19 19:14:29 +03:00
Abduqodiri Qurbonzoda
b5e3dc414f Fix Array.iterator doc 2021-04-19 19:14:28 +03:00
Abduqodiri Qurbonzoda
8a1855e4da [K/N] Fix Range.isEmpty doc 2021-04-19 19:14:27 +03:00
Abduqodiri Qurbonzoda
71c5c8b20a Fix Range.isEmpty doc 2021-04-19 19:14:25 +03:00
Abduqodiri Qurbonzoda
fb4ddd2f6e [K/N] Fix StringBuilder.deleteRange doc 2021-04-19 19:14:23 +03:00
Abduqodiri Qurbonzoda
76b297fd73 [K/N] Fix StringBuilder.clear doc 2021-04-19 19:14:21 +03:00
Abduqodiri Qurbonzoda
597b18582a [K/N] Fix Char.isISOControl doc 2021-04-19 19:14:19 +03:00
Abduqodiri Qurbonzoda
bb2a50a4eb Fix Char.isISOControl doc 2021-04-19 19:14:17 +03:00
Abduqodiri Qurbonzoda
d1f18c4651 Add @see doc references to java isUpperCase and isLowerCase 2021-04-19 19:14:14 +03:00
Abduqodiri Qurbonzoda
22dcc92951 Fix Char.isTitleCase doc 2021-04-19 19:14:13 +03:00
Abduqodiri Qurbonzoda
e83ceb9d40 [K/N] Fix String.replace doc 2021-04-19 19:14:11 +03:00
Abduqodiri Qurbonzoda
36aee8f2b4 Fix String.replace doc 2021-04-19 19:14:10 +03:00
Abduqodiri Qurbonzoda
dab09e7052 Fix CharSequence.repeat doc 2021-04-19 19:14:08 +03:00
Ilya Goncharov
c73dadbcdf [Gradle, JS] Install dukat only if there is dependency with generateExternals
^KT-46178 fixed
2021-04-19 17:29:51 +03:00
pyos
dab693b075 Revert "JVM IR: Implement CHECK_NOT_NULL as a lowering"
This reverts commit dcd72b06d8.

Using a temporary variable has an effect on casts and GC.
2021-04-19 16:05:12 +02:00
Ilmir Usmanov
f5379c5a04 Add @JvmInline annotation in common code if JVM target is present
#KTIJ-8863 Fixed
 #KT-46088 Fixed
2021-04-19 16:56:31 +03:00
Ivan Kochurkin
00bc04b3df [FIR] Implement ELSE_MISPLACED_IN_WHEN diagnostics, fix tests 2021-04-19 15:46:38 +03:00
Dmitry Petrov
7f4da93cc3 JVM_IR KT-45998 protected companion object member accessors with indy 2021-04-19 15:41:21 +03:00
Dmitry Petrov
9a4a39e680 JVM_IR KT-45998 fix protected companion object member accessors
Also, make sure it works with indy-based SAM conversions.
2021-04-19 15:41:19 +03:00
Mikhail Glukhikh
b1fb0ba9e1 Fix FirDiagnosticsList (remove earlier dropped FirSourceElements) 2021-04-19 15:29:07 +03:00
Mikhail Glukhikh
8a2cab346a Fix FIR IDE tests (EXPRESSION_EXPECTED, ITERATOR_MISSING, etc.) 2021-04-19 15:11:17 +03:00
Tianyu Geng
b5caa658d6 FIR: introduce delegate diagnostics
This commit adds diagnostics for the following

* DELEGATE_SPECIAL_FUNCTION_MISSING
* DELEGATE_SPECIAL_FUNCTION_AMBIGUITY
* DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE
2021-04-19 15:11:16 +03:00
Tianyu Geng
454ae3b17a FIR checker: report UNSAFE_CALL for overloaded function calls
Previously if an unsafe call is to an overloaded function, FIR checkers
report NONE_APPLICABLE. This change instead report them as UNSAFE_CALL
or its variants.
2021-04-19 15:11:13 +03:00
Mikhail Glukhikh
92df1f575a Fir2IrVisitor: simplify creating for-loop blocks due to changed FIR side 2021-04-19 15:11:13 +03:00
Tianyu Geng
6a03f31e50 FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00
Mikhail Glukhikh
43a2ad0467 FIR: don't flatten for loop blocks in raw FIR builder 2021-04-19 15:11:12 +03:00
Mikhail Glukhikh
a736d62edd FirForLoopChecker: report also OPERATOR_MODIFIER if appropriate + minor
This commits checks iterator/hasNext/next functions whether they are
declared as operator or not. Also, it changes logic of hasNext/next
error reporting, now we're able to report errors about both these
functions.
2021-04-19 15:11:10 +03:00
Mikhail Glukhikh
2e14b65644 Introduce FirForLoopChecker 2021-04-19 15:10:58 +03:00
Mikhail Glukhikh
4ddc0ed3fe FIR: introduce block checkers 2021-04-19 15:10:39 +03:00
Mikhail Glukhikh
eb831b9afc FIR: support separate ANONYMOUS_FUNCTION_WITH_NAME 2021-04-19 15:10:38 +03:00
Mikhail Glukhikh
6b95bcdbdb FIR: support separate ASSIGNMENT_IN_EXPRESSION_CONTEXT 2021-04-19 15:10:18 +03:00
Mikhail Glukhikh
9894b97058 FIR: rename EXPRESSION_REQUIRED to EXPRESSION_EXPECTED 2021-04-19 15:09:50 +03:00
Ilya Kirillov
26ea0be635 FIR IDE: temporary update testdata until diagnostic collection for delegated objects is fixed 2021-04-19 13:52:47 +02:00
Ilya Kirillov
f40f506852 FIR: move components from AbstractDiagnosticCollectorVisitor to CheckerRunningDiagnosticCollectorVisitor 2021-04-19 13:52:46 +02:00
Ilya Kirillov
ea233cddf8 FIR: rename goToNestedDeclarations -> visitNestedElements 2021-04-19 13:52:46 +02:00
Ilya Kirillov
eed143d17b FIR: remove beforeRunningAllComponentsOnElement/beforeRunningSingleComponentOnElement from AbstractDiagnosticCollectorVisitor 2021-04-19 13:52:45 +02:00
Ilya Kirillov
41e822e8cb FIR IDE: fix duplicated diagnostic collection 2021-04-19 13:52:44 +02:00
Ilya Kirillov
5829f1a6e7 FIR IDE: add more test cases to TraversalCounterTestGenerated 2021-04-19 13:52:43 +02:00
Ilya Kirillov
e78e8f8c79 FIR IDE: fix behaviour of DiagnosticTraversalCounterTest 2021-04-19 13:52:43 +02:00
Ilya Kirillov
32c1101959 FIR IDE: introduce tests for checking diagnostic visitor context collection 2021-04-19 13:52:42 +02:00
Ilya Kirillov
ac993754e1 FIR IDE: collect diagnostics context under read lock 2021-04-19 13:52:41 +02:00
Ilya Kirillov
ce62348709 FIR IDE: do not report suppressed diagnostics 2021-04-19 13:52:41 +02:00
Ilya Kirillov
fd082b1574 FIR IDE: get rid of DiagnosticCollectorDeclarationAction 2021-04-19 13:52:40 +02:00
Ilya Kirillov
e79c133331 FIR IDE: separate diagnostics collection and checker context collection 2021-04-19 13:52:39 +02:00
Ilya Kirillov
29a0c448a6 FIR IDE: remove FirIdeFileDiagnosticsCollector as unused 2021-04-19 13:52:38 +02:00
Ilya Kirillov
023f4e9f46 FIR: extract DiagnosticCollectingVisitor to separate file 2021-04-19 13:52:38 +02:00
Ilya Kirillov
f9d415eda6 FIR: make AbstractDiagnosticCollector.Visitor non-inner 2021-04-19 13:52:37 +02:00
Ilya Kirillov
284e828cd6 FIR: extract context related functions from AbstractDiagnosticCollector.Visitor to super class 2021-04-19 13:52:36 +02:00
Dmitriy Novozhilov
e3b5cc491d [Test] Throw exception from compiler at a first place 2021-04-19 14:32:37 +03:00
Dmitriy Novozhilov
7fb2bf00c5 Force resolve annotations in annotation checker
#KT-46173 Fixed
2021-04-19 14:32:36 +03:00
Dmitriy Novozhilov
83bae89ed8 [Test] Show diff between fir file and testdata text if FE 1.0 and FIR test files don't match 2021-04-19 14:32:35 +03:00
Ivan Kochurkin
4353365968 [FIR] Implement NULL_FOR_NONNULL_TYPE diagnostics, fix tests 2021-04-19 12:46:08 +03:00
sebastian.sellmair
9336e4b09b HierarchicalKotlinNativePlatformDependencies: Provide platform dependencies to source sets not participating in any commonization
^KT-46142 Verification Pending
2021-04-17 14:58:15 +00:00
Aleksei.Cherepanov
b5ef6c9316 Add tests for SAM conversions
Add tests for KT-45191 [JPS] Marking method as "default" in Java SAM interface doesn't affect dependencies, which was fixed in intlellij(212): cbad0d91 support kotlin-generated lambda usage

#KT-45191 Fixed
2021-04-17 03:36:17 +03:00
Andrei Klunnyi
81a5ae7780 KT-44431 Quickfix to move to sealed: suggests tests source root
From now on we display the source root matching the target directory.

^KT-44431 Fixed
2021-04-16 19:38:52 +02:00
Andrei Klunnyi
eed4cb4f00 KT-44431 Quickfix to move to sealed: refactoring
Sealed super class directory is now calculated in a more
straightforward way.
2021-04-16 19:38:52 +02:00
Abduqodiri Qurbonzoda
3a8d1c4b5e Remove redundant @OptIn 2021-04-16 19:01:28 +03:00
Abduqodiri Qurbonzoda
f253b1fb15 Incorrect description for JVM toUpperCase method #KT-45884 2021-04-16 19:01:09 +03:00
Ilmir Usmanov
7b14975740 Add 'value' modifier to modifier order
Otherwise, there will be unfixable 'non-canonical modifier order'
warning
 #KT-46088
 #KTIJ-5636 Fixed
2021-04-16 18:51:44 +03:00
sebastian.sellmair
7525d9a1ce KotlinNativeTest: Append stdOut and stdErr to failure message 2021-04-16 14:56:33 +00:00
sebastian.sellmair
05a6d89151 [Minor] Re-format :kotlin-klib-commonizer and :kotlin-klib-commonizer-api 2021-04-16 14:56:32 +00:00
sebastian.sellmair
f893709e5b [Commonizer] CommonizeLibcurlTest: Add commonizeSuccessfully with unsupported targets
This test will assert behaviour on 'unsupported' targets requested from the commonizer

^KT-46077
2021-04-16 14:56:31 +00:00
sebastian.sellmair
bbcfde7231 [Commonizer] Add 'commonizer_target' and 'commonizer_native_targets' to commonized klib's manifest
^KT-46077 Fixed
2021-04-16 14:56:31 +00:00
Alexander Likhachev
6f96c225d7 [Gradle, K/N] Prefer injection over lateinit vars for task configuration
#KT-45801 Fixed
2021-04-16 17:39:53 +03:00
Dmitriy Novozhilov
b530427bb2 Fix substitution of generic types in contracts
#KT-41078 Fixed
2021-04-16 17:23:24 +03:00
Dmitriy Novozhilov
91fedd6a12 [FIR] Substitute types from arguments in evaluating of contract
#KT-41078
2021-04-16 17:23:22 +03:00
Anton Lakotka
80f95528c2 [MPP] Always use native plugin artifact for native compilations
#KT-46122 Fixed
2021-04-16 16:25:06 +03:00
Anton Lakotka
d75d42da9d [MPP] Test that native common compilation uses native plugin artifacts
#KT-46122 In Progress
2021-04-16 16:25:04 +03:00
Dmitriy Novozhilov
c65553bb8a [FIR] Get rid of source element type parameter from diagnostic factories 2021-04-16 14:08:11 +03:00
Dmitriy Novozhilov
4133f38c8c [FIR] Transform annotations of property receiver type 2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
564de2790f [FIR] Resolve array literals in independent context 2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
cc0f28b698 [FIR] Store type of function call and qualified access from error reference 2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
e869f8091a [FIR] Properly handle callable references which were resolved with error 2021-04-16 11:12:55 +03:00
Dmitriy Novozhilov
450fb5e915 [Test] Add handler to detect implicit types which were left in resolved FIR 2021-04-16 10:52:58 +03:00
Ilya Gorbunov
ce7092a638 More efficient Char(Int) in common, JS, and JS-IR 2021-04-16 03:58:34 +03:00
Ilya Gorbunov
8041c3aa1d Support Char.code in constant evaluator, KT-46036
But do not consider Char.code a pure integer constant.
2021-04-16 03:58:34 +03:00
Alexander Udalov
0a446230f7 Reorder LanguageFeature entries according to sinceVersion 2021-04-15 21:41:17 +02:00
Alexander Udalov
168d8b07a8 Minor, fix warnings on new stdlib API
In modules where allWarningsAsErrors is not yet enabled.
2021-04-15 18:39:06 +02:00
Dmitry Petrov
e89ab71bf8 JVM_IR KT-45934 don't generate declaration stubs for delegates 2021-04-15 17:59:19 +03:00
Dmitry Petrov
cc415f62b5 JVM_IR KT-46092 fix array spread operator in Kotlin->Java call 2021-04-15 17:11:21 +03:00
Pavel Punegov
b5fae96934 [native][tests] Fix incorrect enum in ExecutorService 2021-04-15 16:54:25 +03:00
Pavel Punegov
5903d015b8 [native][tests] Change architecture requirements in simulator executor
This requirement doesn't work for watchos_x86 on macos_x64 so create
a list of compatible requirements.
2021-04-15 13:34:00 +00:00
Mikhail Glukhikh
9b3f1b9b8a Inference: handle Exact constraints with captured types properly
#KT-41818 Fixed
2021-04-15 15:55:41 +03:00
Mikhail Glukhikh
51d348d5fa FIR: report FUN_INTERFACE_CONSTRUCTOR_REFERENCE on deserialized properly
This fixes KT-46100 for FIR
2021-04-15 15:54:18 +03:00
Ilya Kirillov
676e29e96e fix up: do not read declaration phase without read lock hold 2021-04-15 15:24:04 +03:00
Ilya Kirillov
d7e3c65c45 FIR: add renderDeclarationOrigin to FirRender 2021-04-15 15:24:02 +03:00
Ilya Kirillov
0e98480be3 FIR: update resolve phase for declaration when visiting with FirContractResolveTransformer 2021-04-15 15:24:01 +03:00
Ilya Kirillov
5de4c5fc28 FIR: allow declaring specific set of parameters for FirRenderer 2021-04-15 15:24:00 +03:00
Ilya Kirillov
fee83051e9 FIR: encapsulate creating of cli-only session components into single function 2021-04-15 15:23:59 +03:00
Ilya Kirillov
0a80fbb078 FIR IDE: do not read declaration phase without read lock hold 2021-04-15 15:23:57 +03:00
Ilya Kirillov
0cf00d0f72 FIR: fix FirDefaultPropertyAccessor phase to BODY_RESOLVE 2021-04-15 15:23:56 +03:00
Ilya Kirillov
39b2cd1027 FIR: do not provide symbols with different ClassId in JavaSymbolProvider
JavaSymbolProvider uses KotlinPsiElementFinderWrapper for finding classes.
CliFinder looks for Java classing assuming that class with ClassId=a/b/C
lives in directory a/b and do not look into real package name of Java class.
This causes that we may find some classes which we should not see from current scope.

Also, the IDE implementation works correctly here (it also checks file package)
which cause different behaviour of FIR IDE and FIR

This change also requires to fix testdata and make Java classes live
in directory consistent with file package
2021-04-15 15:23:53 +03:00
pyos
82cadba80b FIR: report errors on FirResolvedTypeRef with ConeClassErrorType
Not sure what the difference from FirErrorTypeRef is.
2021-04-15 14:59:30 +03:00
pyos
474d1d48f7 FIR: allow fun T.() = ... as an instance of (T) -> ...
It was already done by the previous commit by mistake, but it broke if
there are other value parameters because the type of the first parameter
would be inferred to be same as the type of the receiver.
2021-04-15 14:59:29 +03:00
pyos
0a25550fc2 FIR: allow fun (x: T) ... as an instance of T.() -> ...
and disallow > 1 implicit parameters in lambdas.
2021-04-15 14:59:28 +03:00
pyos
354acc1fd5 FIR: permit * as FunctionN type argument
`() -> *` is not valid, but `F<*>` where `typealias F<T> = () -> T` is.
2021-04-15 14:59:27 +03:00
Denis.Zharkov
32dacc37c0 FIR: Fix OverloadResolutionByLambdaReturnType case 2021-04-15 14:48:20 +03:00
Ilmir Usmanov
1c48fb28db Generate return when generating continuation class for expression body
Otherwise, the function will return Unit instead of correct value.
 #KT-46007 Fixed
2021-04-15 13:54:45 +03:00
Simon Ogorodnik
539d3e5df2 Add full-pipeline modularized tests for old frontend 2021-04-15 13:36:00 +03:00
Ivan Gavrilovic
11b92bc597 [Gradle] Fix init script for coroutines
Use doFirst instead of beforeTask to add javaagent args for coroutines debugging.
2021-04-15 12:39:25 +03:00
Andrei Klunnyi
2bb7f6a168 KT-45347 Quickfix to move to sealed parent: do not suggest for binaries
^KT-45347 Fixed
2021-04-15 11:17:36 +02:00
Svyatoslav Scherbina
d531df1643 Native: add KotlinThrowable.asError() to the generated Obj-C framework
This method can be useful when overriding a throwing Kotlin method in
Swift or Obj-C. In this case, a user can call asError to wrap Kotlin exception
to (NS)Error and then throw it to Kotlin, which will unwrap it back.

^KT-45127 Fixed
2021-04-15 08:21:30 +00:00
Pavel Punegov
c988ecf59b Ignore test in native backend due to the KT-44037 (KT-38181) 2021-04-15 07:59:26 +00:00
Pavel Punegov
d07c990fc2 Add test to native ignore list due to the KT-44571 2021-04-15 07:59:25 +00:00
Pavel Punegov
0f5edaa02f Ignore test in the native backend. It redefines JvmInline class 2021-04-15 07:59:24 +00:00
Pavel Punegov
ca4cebf3e3 Exclude test in native backend due to KT-42020.
Also return back two tests for fixed KT-42684 and KT-45139
2021-04-15 07:59:23 +00:00
Pavel Punegov
6aa7628808 Fixes to Kotlin/Native test directives infrastructure.
* parse files and modules separately
* fix default and support modules usage
* add another way to ignore backend (new directive)
* add new test to exclude list
2021-04-15 07:59:22 +00:00
Alexander Gorshenev
7d13aaad24 Native klib testing: a binary compatibility tweak.
Link versioned libraries against dependencies of the same version.
2021-04-15 07:59:21 +00:00
Tianyu Geng
4d2e3a2379 FIR: Fix resolving += to ignore + if it doesn't return correct type
This is the FIR fix of the FE change tracked by
https://youtrack.jetbrains.com/issue/KT-45503

Consider the following code:

```
fun foo() {
  var l = mutableListOf("")
  l += ""
}
```

The above code used to be considered invalid due to ambiguous `+=`. But
after KT-45503, it's now considered valid code because `plus` is not
really a valid option for this code. This is because the return type
of `plus` for `List` is `List`, which does not match the type of
variable `l`.

As for now, FIR rejects the above code due to ambiguous `+=`. This
change fixes that by also consider the return type when resolving `+=`.
2021-04-15 10:34:05 +03:00
Tianyu Geng
c43faa2ada FIR: refactor FirExpressionsResolveTransformer#transformAssignmentOperatorStatement
No logic change. This commit only rearrange stuff to make it cleaner
2021-04-15 10:34:04 +03:00
Dmitriy Novozhilov
861f69822b [FIR] Fix infinite recursion of ConeDefinitelyNotNullType 2021-04-15 10:30:29 +03:00
Dmitriy Novozhilov
7c6a9aa963 [FIR] Store cachedExpandedType in WeakPair instead of usual Pair
WeakPair is a renamed OneElementWeakMap
2021-04-15 10:30:29 +03:00
Dmitriy Novozhilov
dd96c3b56e [FIR] Turn some checkers into classes to prevent memory leaks
This is temporary solution until those checkers will be fixed
#KT-46058
2021-04-15 10:30:29 +03:00
Dmitriy Novozhilov
085bddbfc0 [FIR] Force checker components to create checkers sets on each access
This is needed to add ability to recreate checkers which are not objects
  for each session
2021-04-15 10:30:26 +03:00
Dmitriy Novozhilov
1f62a2d8cc [FIR] Add disposing of FirJavaElementFinder in FIR compiler entrypoint 2021-04-15 10:30:09 +03:00
Mark Punzalan
957f6ddafd FIR checker: Enable ReplaceWithDotCallFix for UNNECESSARY_SAFE_CALL. 2021-04-14 22:30:42 +02:00
Dmitry Petrov
f1eeb72c01 PSI2IR KT-46069 resolve IR-based type parameter descriptors to symbols 2021-04-14 21:27:01 +03:00
Anton Bannykh
ba80086ae3 JS PIR generator: eliminate deprecated String.capitalize 2021-04-14 21:04:39 +03:00
Mikhail Glukhikh
4c13fe5631 FIR: handle SAM constructor properly in visibility checker
#KT-46074 Fixed
2021-04-14 20:50:54 +03:00
ebukreev
d8a2f82cbd FIR: inroduce FirFunInterfaceConstructorReferenceChecker 2021-04-14 19:53:43 +03:00
Dmitry Petrov
531a0de399 JVM_IR KT-46060 'contains' operator without receiver is non-optimizable 2021-04-14 19:18:42 +03:00
Mark Punzalan
21a3a14289 FIR: Use intersection of all upper bounds for parameterized types in
ConeKotlinType.canBeNull.

^KT-45903 In progress
2021-04-14 19:17:10 +03:00
Andrei Klunnyi
ac85f9d983 KT-45348 Sealed Inheritors Inspection: binary Kotlin parent is ignored
^KT-45348 Fixed
2021-04-14 18:12:28 +02:00
Ilya Kirillov
0051451ed7 FIR: add error message when FirBasedSymbol.fir is not initialized 2021-04-14 18:37:35 +03:00
Dmitriy Novozhilov
69ff45971f Suppress HIDDEN diagnostics from FIR to fix FIR bootstrap compilation 2021-04-14 18:30:56 +03:00
Dmitriy Novozhilov
1f0ecade34 [FIR] Transform annotations of type refs in body resolve stage
Also fix building CFG for annotation calls
2021-04-14 18:30:56 +03:00
Dmitriy Novozhilov
aec13defc4 [Test] Add proper annotation target in SupertypesAndBounds test 2021-04-14 18:30:55 +03:00
Dmitriy Novozhilov
0b2943d34c Prohibit using annotations without TYPE target in several type positions
#KT-8325 Fixed
#KT-19455 Fixed
#KT-25876 Fixed
#KT-28449 Fixed
2021-04-14 18:30:54 +03:00
Dmitriy Novozhilov
1cff17bb58 Cleanup ConstantExpressionEvaluator 2021-04-14 18:30:53 +03:00
Dmitriy Novozhilov
bee2a69e21 Implement new logic of approximation of integer literals in position of receiver
#KT-38895 In Progress
2021-04-14 18:30:52 +03:00
Dmitriy Novozhilov
6afb905ad6 Add deprecation warning about new integer operators on literals resolution
#KT-38895
2021-04-14 18:30:51 +03:00
Dmitriy Novozhilov
53b6d6f767 Prohibit references to members of containing class in super constructor of nested object
#KT-25289 In Progress
2021-04-14 18:30:49 +03:00
Andrey Zinovyev
3c093f57ba [FIR] Add DYNAMIC_UPPER_BOUND check
+Fix some failing diagnostic tests
+Use PositioningStrategy to locate reified modifier
2021-04-14 18:11:18 +03:00
Andrey Zinovyev
0d525bbe85 [FIR] Add MISPLACED_TYPE_PARAMETER_CONSTRAINTS check 2021-04-14 18:11:17 +03:00
Andrey Zinovyev
412b941486 [FIR] Add DEPRECATED_TYPE_PARAMETER_SYNTAX check 2021-04-14 18:11:16 +03:00
Andrey Zinovyev
2b8c22c08a [FIR] Add CYCLIC_GENERIC_UPPER_BOUND check 2021-04-14 18:11:14 +03:00
Andrey Zinovyev
03215f4e0a [FIR] Add TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER check 2021-04-14 18:11:13 +03:00
Andrey Zinovyev
470993ac07 [FIR] Add TYPE_PARAMETERS_NOT_ALLOWED check 2021-04-14 18:11:12 +03:00
Andrey Zinovyev
5ff82addc9 [FIR] Add REIFIED_TYPE_PARAMETER_NO_INLINE check 2021-04-14 18:11:10 +03:00
Andrey Zinovyev
14fe570a00 [FIR] Add more type params checks
VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED
BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED
2021-04-14 18:11:09 +03:00
Andrei Klunnyi
fb1b253d1e KT-46063 Quick fix: remaining when branches for 'expect' sealed
'List<WhenMissingCase>.hasUnknown' property was changed in 4222bb9a.
As a result quickfix's AddWhenRemainingBranchesFix.Companion.isAvailable
started responding 'no'.
This commit restores original property and provides a separate one for
compiler needs.

^KT-46063 Fixed
2021-04-14 15:57:15 +02:00
Alexander Udalov
005aa57f6d Remove obsolete module cli-js-klib
It's no longer used anywhere in the build.
2021-04-14 13:47:02 +02:00
Alexander Udalov
988d1365a8 Remove dependency of backend.wasm on ir.tree.impl and ir.tree.persistent 2021-04-14 13:47:02 +02:00
Alexander Udalov
643c3f26c1 Remove dependency of backend.js on ir.tree.impl
By taking the instance of IrFactory either from SymbolTable, or passing
it from cli-js which depends on both ir.tree.impl and
ir.tree.persistent, and can choose the appropriate implementation.
2021-04-14 13:47:02 +02:00
Alexander Udalov
9aed55a1f4 IR: minor, improve toString for IrBasedTypeParameterDescriptor
The motivation is that in the "Unbound symbols are not allowed" error
message like the one in KT-46069, the type parameter is rendered via
`render()`, and that contains only its name/variance, and doesn't help
in finding where the member with that type parameter is declared.
2021-04-14 13:16:05 +02:00
Ting-Yuan Huang
6c989bfd4b Support array of annotation in KotlinJvmBinaryClass
KotlinJvmBinaryClass.AnnotationArrayArgumentVisitor didn't cover the
case when the element type is an Annotation. Therefore, when the
compiler read an array of annotations from JVM binary classes built from
Kotlin sources, it got an empty array regardless of what was written in
the bytecode.

For example, Foo.value below is read as an empty array when SomeClass
resides in another Kotlin module.

  @Foo(
    value = [Bar(1), Bar(2)]
  )
  class SomeClass
2021-04-14 13:14:26 +02:00
Dmitriy Dolovov
5e392a511f [K/N][IR] Generate missing return when using Nothing-returning safe call as lambda result or function expression body
^KT-42832
2021-04-14 13:20:41 +03:00
Ilya Kirillov
b4813d31e6 Mute FirKotlinHighlightingPassTestGenerated.Checker.testResolveTypeInAnnotationArgumentRuntime as flaky 2021-04-14 11:48:41 +02:00
Ilmir Usmanov
74b1fdcc60 Minor. Add regression test
#KT-45991
2021-04-14 10:48:59 +02:00
Ilmir Usmanov
29c975fc43 Minor. Add regression test
#KT-45539 Obsolete
2021-04-14 10:48:57 +02:00
Ilmir Usmanov
19b1b48e87 Minor. Add tests to check returning inline class from default method
#KT-45539 Obsolete
2021-04-14 10:48:54 +02:00
Andrey Zinovyev
8c464b4de5 [KAPT] Bring back properties resolution in light analysis
Because kapt fails on evaluation constant expressions of SomeType::class
2021-04-14 07:50:22 +00:00
Nikolay Krasko
9bbfe5a7a2 Add dependencies verification for prepareSonatypeStaging.gradle
File is applied conditionally when sonatype publication is enabled.
2021-04-14 00:53:02 +03:00
Steven Schäfer
7a9ff15d73 JVM IR: Handle suspend interface default methods with generic types (KT-45166) 2021-04-13 23:04:32 +02:00
Dmitry Petrov
7d62f0b5aa JVM_IR KT-45187 use Arrays.copyOf to copy an array in spread operator
Creating a new array (and copying data into it with System.arraycopy)
doesn't work in generic case, because the actual array class depends on
call site.
2021-04-13 22:27:37 +03:00
zadorotskas
334d0a8b5a FIR: introduce three diagnostics for const val 2021-04-13 21:36:46 +03:00
Mikhail Glukhikh
cc106085e2 FIR: add minor TODO / comments to mismatch checkers 2021-04-13 21:36:44 +03:00
Mikhail Glukhikh
b8af3d79d4 FIR: minimize explicit use of <destruct> name 2021-04-13 21:36:43 +03:00
Mikhail Glukhikh
78fc87ffb1 FIR: apply minor test data fixes around type mismatch problems 2021-04-13 21:36:41 +03:00
Mikhail Glukhikh
9accd8c9ad FIR: use unsafe .coneType in type mismatch checkers when possible 2021-04-13 21:36:40 +03:00
Mikhail Glukhikh
b58e5b182c FIR: add test fixing builder inference case 2021-04-13 21:36:38 +03:00
Mikhail Glukhikh
f7147dc6f3 CoroutineTransformerMethodVisitor: fix potential type mismatch
The fixed code compiles properly only due to null smart cast.
Without it, e.g. in FIR, we'd have type mismatch error for this return.
2021-04-13 21:36:37 +03:00
Mikhail Glukhikh
69d1ef423a FIR initializer: don't report type mismatch on incompatible extensions
This commit suppresses type mismatch error from KT-45989
2021-04-13 21:36:36 +03:00
Mikhail Glukhikh
fa4d664a18 FIR initializer: don't report type mismatch in SomeInt = Int case 2021-04-13 21:36:34 +03:00
vldf
57d2eb5da2 Introduce FirFunctionReturnTypeMismatchChecker 2021-04-13 21:36:33 +03:00
vldf
24f1f1221e Introduce FirInitializerTypeMismatchChecker 2021-04-13 21:36:31 +03:00
Ilya Chernikov
7ed35e5c2b FIR: Introduce smart containers in supertypes search
assuming that we may have quite many searches resulting
in a single supertypes, smart containers here reduce
allocations.
2021-04-13 16:18:41 +02:00
Ilya Chernikov
038a8af80e FIR: convert some hot void visitors to any
reduces call indirection (Nothing -> Void bridges) and therefore
callstack depth
2021-04-13 16:18:41 +02:00
Ilya Chernikov
34694cbec5 FIR: get rid of transformSingle in the generated code
further reduce of the callstack depth
2021-04-13 16:18:40 +02:00
Ilya Chernikov
9d557c8b79 FIR: reduce visitor/transformer indirection
performance: do not route transform calls via
visitors, reduce call stack depth on transformations
2021-04-13 16:18:40 +02:00
Ilya Chernikov
dfd5e80ce9 FIR: Get rid of CompositeTransformResult 2021-04-13 16:18:39 +02:00
Yahor Berdnikau
00df2c4a9e Fix failing non-JUnit5 tests.
They have failed due to migration to new plugin api in test projects.

^KT-45744 Fixed
2021-04-13 16:48:20 +03:00
Yahor Berdnikau
9ef5817f8b Update SimpleKotlinGradleIT.kt tests to use new DSL.
^KT-45744 In Progress
2021-04-13 16:48:19 +03:00
Yahor Berdnikau
aabb05104e Extract common versions to the separate file.
^KT-45744 In Progress
2021-04-13 16:48:18 +03:00
Yahor Berdnikau
8db67ec24b Add file system watching option to build options.
Default build option value - disabled.

In Gradle 7 it is enabled by default, and I suspect it causes flaky
build failure when 'TempDir' tries to delete test project.

^KT-45744 In Progress
2021-04-13 16:48:17 +03:00
Yahor Berdnikau
81621a79a6 Add flag to enable Gradle process debugging.
^KT-45744 In Progress
2021-04-13 16:48:16 +03:00
Yahor Berdnikau
9ae47004d0 Append by default heap dump options.
^KT-45744 In Progress
2021-04-13 16:48:15 +03:00
Yahor Berdnikau
ffa11eacca Add task to run only JUnit 5 KGP tests.
^KT-45744 In Progress
2021-04-13 16:48:14 +03:00
Yahor Berdnikau
34f1c58f1e Add Gradle task to clean test kit cache dir.
Always run it on CI when tests will finish.
^KT-45744 In Progress
2021-04-13 16:48:13 +03:00
Yahor Berdnikau
644882df61 Set default max Gradle version to '7.0'.
^KT-45744 In Progress
2021-04-13 16:48:11 +03:00
Yahor Berdnikau
93230d72f5 Add build option to control Gradle parallelism.
Limit workers count, so when running tests parallel, they will not
compete over CPU usage.

^KT-45744 In Progress
2021-04-13 16:48:10 +03:00
Yahor Berdnikau
3c78c94fb1 Add configuration cache support to the default build options.
^KT-45744 In Progress
2021-04-13 16:48:08 +03:00
Yahor Berdnikau
8b393910d3 Add support for tests mute-in database in JUnit 5.
^KT-45744 In Progress
2021-04-13 16:48:07 +03:00
Yahor Berdnikau
7ffdafe791 Enable forwarding successful Gradle test output on demand.
^KT-45744 In Progress
2021-04-13 16:48:05 +03:00
Yahor Berdnikau
5b218bdad2 Set tests lifecycle to be 'PER_CLASS'.
Usually Gradle tests should be pretty isolated between each other to use
'PER_METHOD' lifecycle.

^KT-45744 In Progress
2021-04-13 16:48:03 +03:00
Yahor Berdnikau
40c525c4a6 Add '.testKitDir/' to '.gitignore' file.
^KT-45744 In Progress
2021-04-13 16:48:02 +03:00
Yahor Berdnikau
35a020340c Don't share temp directory between tests.
Apparently this causes problems on Windows CI runners.

^KT-45744 In Progress
2021-04-13 16:48:00 +03:00
Yahor Berdnikau
0ca4254cba Setup running tests against different Gradle versions.
^KT-45744 In Progress
2021-04-13 16:47:59 +03:00
Yahor Berdnikau
4583cd3634 Allow to add jupiter-params dependency.
^KT-45744 In Progress
2021-04-13 16:47:58 +03:00
Yahor Berdnikau
3dcac00aec Add basic file content transformations.
^KT-45744 In Progress
2021-04-13 16:47:57 +03:00
Yahor Berdnikau
f5dfe7ce95 Automatically add 'pluginManagement' block to settings.gradle file.
Only in the case when it does not exist.
^KT-45744 In Progress
2021-04-13 16:47:56 +03:00
Yahor Berdnikau
9e2cdc7337 Add file or directory exists/does not exist assertions.
^KT-45744 In Progress
2021-04-13 16:47:55 +03:00
Yahor Berdnikau
710287920b Add initial setup to build common options.
^KT-45744 In Progress
2021-04-13 16:47:54 +03:00
Yahor Berdnikau
7549d14a36 Add Gradle output assertions.
^KT-45744 In Progress
2021-04-13 16:47:53 +03:00
Yahor Berdnikau
b7864c1e43 Add tasks assertions.
^KT-45744 In Progress
2021-04-13 16:47:51 +03:00
Yahor Berdnikau
e13f21e461 Add basic DSL based on Gradle TestKit for KGP integration tests.
^KT-45744 In Progress
2021-04-13 16:47:50 +03:00
Ivan Kochurkin
847ab40707 [FIR] Implement DIVISION_BY_ZERO diagnostics, fix tests 2021-04-13 16:22:08 +03:00
Ivan Kochurkin
964bba3530 [FIR] Implement FLOAT_LITERAL_OUT_OF_RANGE diagnostics, fix tests 2021-04-13 16:22:06 +03:00
Ivan Kochurkin
4cf30cd1fa [FIR] Implement INT_LITERAL_OUT_OF_RANGE diagnostics, fix tests 2021-04-13 16:22:05 +03:00
Ivan Kochurkin
fb06da2d75 [FIR] Implement WRONG_LONG_SUFFIX diagnostics, fix tests 2021-04-13 16:22:03 +03:00
Vasily Levchenko
62ffc0033d [kotlin-native][test][dynamic test] tests provoking generating empty structs kt-42796 2021-04-13 12:10:58 +00:00
Vasily Levchenko
2adea2122e [kotlin-native][build][test infrostructure] don't ignore compiler exit code 2021-04-13 12:10:57 +00:00
Vasily Levchenko
c68ac4f6b6 [interop][c][reverse] avoid generating empty structures for leaf packages without exportable declations
- fixes KT-42796
2021-04-13 12:10:57 +00:00
Roman Golyshev
0d7eb971ca Fix test data 2021-04-13 11:40:24 +00:00
Roman Golyshev
e0fca9d2f6 FIR IDE: Add visibility checks to the completion
Visibility checks currently do not work in some cases, for example:

- public nested class of private class is seen globally
- private_for_this does not work
- some other cases I am not yet aware of

If `FirVisibilityChecker.isVisible` fix those issues, they will be fixed
automatically in the completion
2021-04-13 11:40:23 +00:00
Roman Golyshev
78b2324a51 Refactor KotlinFirCompletionContributor
Replace extensions checking lambdas with `ExtensionApplicabilityChecker`
type
2021-04-13 11:40:22 +00:00
Roman Golyshev
86348ed981 Refactor KotlinFirCompletionContributor
Remove some code duplication
2021-04-13 11:40:22 +00:00
Roman Golyshev
ff71dda065 FIR IDE: Add KtVisibilityChecker component 2021-04-13 11:40:21 +00:00
Roman Golyshev
28d8d2d903 FIR IDE: Search for the first non-local declaration in EnclosingDeclarationContext::detect
Local declarations do not have a stable `ClassId`, which is used in
`declarationUtils.collectDesignation`. Local classes will always have
`outerClassId.isLocal = true`, even when it is not true (see
`org.jetbrains.kotlin.fir.builder.Context.currentClassId` for why this
happens)
2021-04-13 11:40:20 +00:00
Roman Golyshev
0d2158325a Remove redundant ticks from test data 2021-04-13 11:40:19 +00:00
Roman Golyshev
fcd0168381 Refactor AbstractHighLevelMultiFileJvmBasicCompletionTest
Use `KotlinFixtureCompletionBaseTestCase` base because it can override
`getProjectDescriptor`, so the tests will see full JDK

Without it, there were problems when classes from JDK appeared in the
completion (`Serialization`, for example)
2021-04-13 11:40:18 +00:00
pyos
cc7187e49b JVM_IR: cast argument of enumValueOf to String in bytecode
Generic functions and implicit casts may return a supertype instead.

 #KT-45865 Fixed
2021-04-13 13:24:24 +02:00
Anton Bannykh
afaf3b5e28 JS PIR: replace deprecated toLowerCase with lowercase 2021-04-13 14:20:00 +03:00
Andrei Klunnyi
73d2e1a42d KT-46049 Java-Kotlin sealed inheritors inspection: refactoring 2021-04-13 12:34:07 +02:00
Andrei Klunnyi
2fce968de0 KT-46049 Java-Kotlin sealed inheritors inspection: false positive for type parameter
^KT-46049 Fixed
2021-04-13 12:34:07 +02:00
pyos
85b4668b7c JVM_IR: optimize more if-null chains
1. consider reads of fields from the same file "stable" just like
    functions, i.e. assume their nullability information is correct
 2. apply if-null fusion repeatedly until the subject is no longer a
    nested if-null expression
2021-04-13 11:48:36 +03:00
Denis.Zharkov
0b0a6d6ede Fix false positive ENCLOSING_SUSPEND_FUNCTION_FOR_SUSPEND_FUNCTION_CALL
Previously added additional processing at findEnclosingSuspendFunction
seems unnecessary anymore

^KT-43258 Fixed
2021-04-13 11:47:05 +03:00
Dmitriy Novozhilov
803d47daaa Distinguish classes from different sourcesets in SealedInheritorInSameModuleChecker
#KT-45848 Fixed
#KT-46031
2021-04-13 11:21:58 +03:00
Dmitriy Novozhilov
66e4d5664a [Test] Properly setup KtFile.isCommonSource in tests 2021-04-13 11:21:57 +03:00
Jinseong Jeon
619360fe4d FIR checker: report UNINITIALIZED_ENUM_(ENTRY|COMPANION) 2021-04-13 08:25:16 +03:00
Ivan Kochurkin
ad9b962536 [FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE) 2021-04-12 23:49:55 +03:00
Ivan Kochurkin
4ffab5fe5a [FIR] Add new test argParamTypeMismatch.kt for ARGUMENT_TYPE_MISMATCH diagnostics 2021-04-12 23:49:54 +03:00
Ivan Kochurkin
a09b836334 [FIR] Add new ARGUMENT_TYPE_MISMATCH diagnostics and related classes, throw it in corresponding cases 2021-04-12 23:49:52 +03:00
Dmitry Petrov
7e03f8ea80 JVM_IR KT-45853 include return type into Java method IdSignature
This is a hack required to accept [potentially] incorrect input
provided by the front-end; see KT-46042.
2021-04-12 22:52:08 +03:00
Matthew Gharrity
5ce746f1ec ULC field has null nameIdentifier
KtUltraLightFieldForSourceDeclaration implements PsiField, for which
getNameIdentifier() is marked @NonNull, so some clients expect a
non-null return value.

#KT-45629 Fixed
2021-04-12 21:41:54 +03:00
Nikolay Krasko
6cbdcbe53b Trust zip with gradle sources 2021-04-12 20:10:42 +03:00
Jinseong Jeon
9af108df77 FIR LT: set source for destructured value parameter of lambda 2021-04-12 19:20:03 +03:00
Yahor Berdnikau
c6aa5d1495 Fix plugin is using deprecated method that is removed in AGP 7.0.
^KT-45950 Fixed
2021-04-12 18:20:42 +03:00
Yahor Berdnikau
9100be4566 Set Android Gradle Plugin dependency version to 3.4.0.
This is required to get method deprecations and new proposed methods.
2021-04-12 18:20:41 +03:00
Dmitry Petrov
f59b49db68 JVM_IR KT-45967 generate accessor for argument of indy intrinsic
TODO handle inaccessible constructors gracefully
2021-04-12 17:36:24 +03:00
Sergey Shanshin
5f9fe8e5de Fix IR compilation of kotlix.serialization runtime in native 2021-04-12 17:08:08 +03:00
Abduqodiri Qurbonzoda
39731fd493 Merge Stdlib generators 2021-04-12 16:51:24 +03:00
Alexander Udalov
e9a969875c Minor, fix typo in the issue reference in comment 2021-04-12 15:43:35 +02:00
Dmitry Petrov
162363a324 JVM: CHECK_BYTECODE_TEST directive + use it in INVOKEDYNAMIC tests 2021-04-12 16:43:15 +03:00
Ilya Chernikov
ca352c9556 Fix jvm method reading when descriptor and signature do not match
#KT-38325 fixed
2021-04-12 16:23:53 +03:00
Mikhail Glukhikh
c75331bf2a Implicit nothing type argument: handle nullable case properly
#KT-41620 Fixed
2021-04-12 15:51:46 +03:00
Alexander Udalov
115e2673ae Minor, fix javac deprecation warning in DynamicBundle 2021-04-12 14:38:09 +02:00
Yahor Berdnikau
2d9a3f364c Update advance Gradle version to 7.0 for KGP tests.
^KT-44949 Fixed
2021-04-12 15:02:02 +03:00
Victor Petukhov
73a2838555 Do substitution captured type's super types as well
^KT-45982 Fixed
2021-04-12 14:00:40 +03:00
Victor Petukhov
e8275d2527 Complete old inference's callable references properly, by updating descriptor, resolved call and recorded expression's type
^KT-45721 Fixed
^KT-44994 Fixed
2021-04-12 14:00:38 +03:00
Victor Petukhov
d804e73c22 Avoid subtype checking between type variable of self type and captured star projection only for invariant positions
Subtyping with non-invariant positions may produce useful constraints

^KT-46001 Fixed
2021-04-12 13:44:09 +03:00
Ilya Chernikov
0274c41919 [minor] FIR: fix deprecation in test 2021-04-12 10:08:54 +02:00
Alexander Likhachev
9e78e43c49 [Gradle] Always declare system property reads for compile tasks
When Kotlin plugin is applied in buildSrc or included build that defines Gradle plugins it can cause Gradle to report undeclared system property reads at configuration time. Declaring all system properties reads through Gradle providers to cover all these cases.
#KT-45910 Fixed
2021-04-12 03:15:10 +03:00
Andrey Zinovyev
47407c4445 [FIR] Add NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER check 2021-04-11 16:18:07 +00:00
Alexander Udalov
ea22f4b681 IR: check absence of extension receiver in isMethodOfAny
Otherwise extension methods named toString/equals/hashCode were
generated incorrectly on JVM IR, which could result in
AbstractMethodError at runtime.

 #KT-45963 Fixed
2021-04-11 13:54:13 +02:00
Abduqodiri Qurbonzoda
98d31a1813 Expand KDoc of inc() and dec() operators #KT-43701 2021-04-10 03:23:04 +03:00
sebastian.sellmair
b311820159 [Minor] Fix CommonizerDependencyTest.sample identityString on Windows 2021-04-09 23:36:02 +02:00
Dmitriy Dolovov
14838a6b7b Update Kotlin/Native: 1.5.20-dev-4865 2021-04-09 23:36:02 +02:00
sebastian.sellmair
6d31750673 [Commonizer] assembelCirTree: Supoprt TypeAlias -> Class commonization 2021-04-09 23:36:02 +02:00
sebastian.sellmair
28adf6345d [Minor] Optimize imports of CirProperty.kt 2021-04-09 23:36:02 +02:00
sebastian.sellmair
9c1c506b21 [Minor] Move ClassesToProcess into .tree.deserializer package 2021-04-09 23:36:02 +02:00
sebastian.sellmair
d0f8395556 [Commonizer] Remove old mergers 2021-04-09 23:36:01 +02:00
sebastian.sellmair
14161c8250 [Commonizer] Prevent copying missing modules that are already present in destination 2021-04-09 23:36:01 +02:00
sebastian.sellmair
02c1d7fad3 [Gradle] HierarchicalNativeDistributionCommonizerTask: Ensure that native distribution commonization tasks can't run in parallel 2021-04-09 23:36:01 +02:00
sebastian.sellmair
c4562fd1db [Gradle] GetCommonizerTargetOfSourceSet: Gracefully handle common non-hmpp workaround 2021-04-09 23:36:01 +02:00
sebastian.sellmair
2aeb08e245 [Gradle] Implement internal intransitiveMetadataConfiguration
- Implemented additional intransitiveMetadataConfiguration to support
dependencies that shall not be added transitively to dependsOn edges
2021-04-09 23:36:00 +02:00
sebastian.sellmair
4e40bd6371 [Minor] Make CInteropProcess cacheable 2021-04-09 23:36:00 +02:00
sebastian.sellmair
ce0fdbd2df [Minor] Make CInteropCommonizerTask cacheable 2021-04-09 23:36:00 +02:00
sebastian.sellmair
9ac7b61094 [Gradle] HierarchicalNativeDistributionCommonizerTask: Implement project global caching
- Implement NativeDistributionCommonizationCache which will act similar
to the 'SuccessMarker' used in the non hierarchical commonization task.

- Implement 'kotlin.mpp.enableNativeDistributionCommonizationCache'
Gradle property to disable project global caching. The cache is
turned on by default.
2021-04-09 23:36:00 +02:00
sebastian.sellmair
50d0439af3 [Minor] Share 'Test: Commonizer' run configuration 2021-04-09 23:36:00 +02:00
sebastian.sellmair
2bb0dbaf38 [Gradle] Implement CommonizerHierarchicalIT integration test 2021-04-09 23:36:00 +02:00
sebastian.sellmair
d9eb130f82 [Gradle] Enable hierarchical commonization by default 2021-04-09 23:35:59 +02:00
sebastian.sellmair
933c52d470 [Commonizer] Gracefully handle absent targets for hierarchical commonization 2021-04-09 23:35:59 +02:00
sebastian.sellmair
bbe499c1b6 [Commonizer] Re-introduce node builders 'parentCommonDeclaration' context 2021-04-09 23:35:59 +02:00
sebastian.sellmair
947dc71bda [Gradle] Leave native source sets: Add expect parts explictely 2021-04-09 23:35:59 +02:00
sebastian.sellmair
9cb67e06e3 [Commonizer] Only serialize common or LeafCommonizerTargets 2021-04-09 23:35:59 +02:00
sebastian.sellmair
10692b5b7c [Minor] Add commonizer classpath to HierarchicalNativeDistributionCommonizerTask 2021-04-09 23:35:58 +02:00
sebastian.sellmair
88a913c7dc [Commonizer] NativeLibraryLoader: Improve error message when loading a library fails 2021-04-09 23:35:58 +02:00
sebastian.sellmair
250915f377 [Commonizer] Implement AbstractInlineSourcesCommonizationTest and hierarchical commonization tests 2021-04-09 23:35:58 +02:00
sebastian.sellmair
a2436699ea [Commonizer] Implement basic tests for CirTree merging 2021-04-09 23:35:58 +02:00
sebastian.sellmair
f252c3e2c1 [Commonizer] Implement CirTreeDependenciesDeserializerTest 2021-04-09 23:35:57 +02:00
sebastian.sellmair
c03d995e07 [Commonizer] Implement basic tests for CirTree deserializers 2021-04-09 23:35:57 +02:00
sebastian.sellmair
8c941fc203 [Gradle] Implement support for hierarchical commonization 2021-04-09 23:35:57 +02:00
sebastian.sellmair
68c3e39058 [Commonizer] Implement support for hierarchical commonization 2021-04-09 23:35:57 +02:00
sebastian.sellmair
46a20c81cc Implement CommonizerTarget.allLeaves 2021-04-09 23:35:56 +02:00
sebastian.sellmair
a78645e858 Implement CommonizerTarget.withAllAncestors 2021-04-09 23:35:56 +02:00
sebastian.sellmair
47f36c04fc Move transitiveClosure into :commonizer-api 2021-04-09 23:35:56 +02:00
sebastian.sellmair
35e1f8a520 Implement CommonizerTarget isAncestorOf and isDescendentOf 2021-04-09 23:35:56 +02:00
sebastian.sellmair
108debdcc9 [Commonizer] Implement CirTree and CirTree deserializers and CirTree merging 2021-04-09 23:35:56 +02:00
sebastian.sellmair
cb1f3c3e32 [Commonizer] Make nodeBuilders contextless 2021-04-09 23:35:55 +02:00
sebastian.sellmair
66bc751407 [Commonizer] Inline 'hasAnythingToCommonize' 2021-04-09 23:35:55 +02:00
sebastian.sellmair
0a35d75039 [Commonizer] CommonizerParameters: Require TargetProviders as constructor argument 2021-04-09 23:35:55 +02:00
sebastian.sellmair
79c6b406ba [Commonizer] Allow empty SharedCommonizerTarget 2021-04-09 23:35:55 +02:00
sebastian.sellmair
cdbede09df Move 'TargetDependent' into commonizer module make it an interface 2021-04-09 23:35:55 +02:00
Ilmir Usmanov
bce92d824a Minor. Add tests to check returning Result from functions
Mainly, that virtual functions, returning Result, are mangled.
 #KT-45855
2021-04-09 22:09:03 +03:00
Vladimir Dolzhenko
613eda5016 Fix PackageFragmentProvider#isEmpty(FqName) for REPL 2021-04-09 21:06:32 +03:00
Anton Bannykh
bcaad7487f JS PIR: regenerate .proto 2021-04-09 19:54:24 +03:00
Anton Bannykh
923303c2c1 JS PIR: move PIR proto messages to a separate file 2021-04-09 19:54:23 +03:00
Anton Bannykh
8fe8419ad4 JS IR: serialize declarations without mutable state 2021-04-09 19:54:21 +03:00
Anton Bannykh
1e822aa28a JS PIR: carrier serializer implementation 2021-04-09 19:54:20 +03:00
Anton Bannykh
c97066527c JS PIR: carrier serializer / deserializer 2021-04-09 19:54:19 +03:00
Anton Bannykh
030498c5e1 JS IR: updated .proto 2021-04-09 19:54:18 +03:00
Anton Bannykh
5de04f49ca JS PIR: updated declarations 2021-04-09 19:54:17 +03:00
Anton Bannykh
1f0d83b420 JS PIR: update the generator
- Use symbols in carriers
- .proto messages for carriers
- carrier serializer/derserializer
2021-04-09 19:54:16 +03:00
Anton Bannykh
c224dd4cb1 JS IR: JsMapping serialization 2021-04-09 19:54:15 +03:00
Anton Bannykh
ba5582de99 IntArray and LongArray serialization 2021-04-09 19:54:14 +03:00
Anton Bannykh
387b84b37c JS IR: simplify DCE root calculation 2021-04-09 19:54:13 +03:00
Mads Ager
b27a109a1e [JVM] Fix shrinking of local range for dead variables.
Coroutine transform would occasionally *extend* the range of a
local instead of shrinking it (if the next suspension point
is after the end point for the local). That leads to the local
variable table having a local that covers code where it is not
defined. That is invalid and leads to D8 removing the locals
table from the code.
2021-04-09 19:06:13 +03:00
Ilya Kirillov
ebdbcbb7b6 FIR IDE: encapsulate designation into class 2021-04-09 17:49:43 +02:00
Ilya Kirillov
aff1788a4c FIR IDE: initialize FirSession with correct language settings 2021-04-09 17:48:48 +02:00
Ilya Kirillov
9c6445d863 FIR IDE: add more test cases to file FileStructureTest 2021-04-09 17:48:48 +02:00
Ilya Kirillov
fc2bb2e3e6 FIR IDE: fix resolve in case of duplicating classes 2021-04-09 17:48:47 +02:00
Ilya Kirillov
73c175213c FIR IDE: fix lazy resolve of type aliases 2021-04-09 17:48:47 +02:00
Ilya Kirillov
0ad64b2113 FIR IDE: fix recursive supertypes resolve in light classes 2021-04-09 17:48:47 +02:00
Ilya Kirillov
60ea64143c FIR IDE: reuse scope session between different resolve calls for the same file 2021-04-09 17:47:05 +02:00
Ilya Kirillov
a9fc3dd1ea FIR IDE: fix unresolved file annotations arguments 2021-04-09 17:46:24 +02:00
Ilya Kirillov
790cafa671 FIR IDE: fix deadlock in symbol providers 2021-04-09 17:46:23 +02:00
Ilya Goncharov
266daed2cb [Gradle, JS] Mark visited dependencies inside dependency graph traversing 2021-04-09 17:32:44 +03:00
Vasily Levchenko
fd17e5e700 [build][kotlin-native][clean] adds kotlin-native/build to clean 2021-04-09 14:14:32 +00:00
Vasily Levchenko
3192b05586 [build][kotlin-native][g/c] drop unused hacks 2021-04-09 14:14:31 +00:00
Vladimir Dolzhenko
3034d9d791 Temporary (partial) rollback optimize in PackageFragmentProvider#isEmpty(FqName) 2021-04-09 15:10:47 +02:00
Vladimir Dolzhenko
0761c4bf94 Optimize KtFile.getScript 2021-04-09 14:45:20 +02:00
Mikhail Glukhikh
254e41b70d FIR: apply bad test data changes related to ABSTRACT_*_NOT_IMPLEMENTED 2021-04-09 14:52:41 +03:00
Mikhail Glukhikh
818c54e3a6 FIR: report ABSTRACT_*_NOT_IMPLEMENTED on appropriate intersections 2021-04-09 14:52:34 +03:00
Sergey Bogolepov
0fa2821ac1 Add missing targetToolchain.macos_arm64-linux_arm32_hfp property 2021-04-09 18:26:23 +07:00
Vladimir Dolzhenko
04268a720f Optimize KtFile.isScript 2021-04-09 12:17:51 +02:00
Denis.Zharkov
37813d9d82 Add version requirements for declarations with !! types
^KT-26245 Related
2021-04-09 13:06:40 +03:00
Denis.Zharkov
403406f92d Ignore not-null assertion test related to T!! on JVM_IR
^KT-45935 Related
2021-04-09 13:06:39 +03:00
Denis.Zharkov
16ca8ddbbd Do not parse !! as part of annotation type
^KT-26245 Related
2021-04-09 13:06:38 +03:00
Denis.Zharkov
37f923a98f Do not approximate DefinitelyNotNullType in public declarations
Because since 1.6 they become normal denotable types

^KT-26245 Fixed
2021-04-09 13:06:37 +03:00
Denis.Zharkov
e74a0c7ef7 Pass languageVersionSettings to AbstractTypeApproximator 2021-04-09 13:06:35 +03:00
Denis.Zharkov
59372fd15f Enable ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated since 1.6
^KT-36770 Fixed
2021-04-09 13:06:34 +03:00
Denis.Zharkov
bd05ef19de Add blackbox test for definitely-not-null types
^KT-26245 Fixed
2021-04-09 13:06:32 +03:00
Denis.Zharkov
30eb9ad32f Add serialization/deserialization of definitely-not-null types
^KT-26245 In Progress
2021-04-09 13:06:31 +03:00
Denis.Zharkov
6ca6bb2d45 Load configuration for FirLoadCompiledKotlin 2021-04-09 13:06:29 +03:00
Denis.Zharkov
b9d2a1842a Support definitely-not-null generic T!! types in Parsing and FE1.0
^KT-26245 In Progress
2021-04-09 13:06:28 +03:00
Jinseong Jeon
5a0b75bd89 FIR checker: warn unnecessary safe calls 2021-04-09 12:32:45 +03:00
Jinseong Jeon
2ecb6733ed FIR checker: warn unnecessary non-null assertions 2021-04-09 12:32:45 +03:00
Mikhail Glukhikh
5229d4e4f4 Apply bad LT test changes related to COMPONENT_FUNCTION_..._MISMATCH 2021-04-09 12:32:44 +03:00
Jinseong Jeon
87c50235ed FIR checker: report COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH 2021-04-09 12:32:44 +03:00
Vladimir Dolzhenko
e511eec90e Added optimized PackageFragmentProvider#isEmpty(FqName) 2021-04-09 09:27:39 +00:00
Andrey Zinovyev
37055c5a09 [FIR] Add REPEATED_BOUND, CONFLICTING_UPPER_BOUNDS diagnostics 2021-04-09 07:38:39 +00:00
Sergey Bogolepov
81d4c19d8b Fix Android NDK targets
Android NDK dirs omit vendor part of triple,
so we have to respect its decision.
2021-04-09 13:11:14 +07:00
Mikhail Glukhikh
3e9ef56c31 Forbid using ext.property type parameter also for delegate ext.receiver 2021-04-09 07:56:35 +03:00
Mikhail Glukhikh
e2cc0510de Rewrite FirDeclarationDataRegistry.data to avoid type parameter problems 2021-04-09 07:56:35 +03:00
Mikhail Glukhikh
0c17ce2f44 Suppress DELEGATE_USES_EXTENSION_PROPERTY_TYPE_PARAMETER in code 2021-04-09 07:56:35 +03:00
Mikhail Glukhikh
fcbab45a88 FE 1.0: introduce DELEGATE_USES_EXTENSION_PROPERTY_TYPE_PARAMETER error
#KT-24643 Fixed
2021-04-09 07:56:35 +03:00
Ilya Gorbunov
d062f54360 Remove test exclusions after KT-45136 is fixed 2021-04-09 06:45:11 +03:00
Dmitry Petrov
ed88aa43a4 JVM_IR KT-45868 look for parent for delegating lambda in scope stack 2021-04-08 23:49:59 +03:00
Dmitry Petrov
c2a5b0b6e2 JVM_IR KT-45920 don't add special bridge if it clashes with known method 2021-04-08 23:48:39 +03:00
Yahor Berdnikau
92d200e093 Update advance Gradle version to 7.0-rc-2.
^KT-44949 In Progress
2021-04-08 21:24:43 +03:00
Ilya Goncharov
583dba51c1 [Gradle, JS] Initialize File hasher service during IDEA import 2021-04-08 20:24:43 +03:00
Nikolay Krasko
7d78e610b1 Allow ProtoBufCompareConsistencyTest to work on teamcity 2021-04-08 18:51:12 +03:00
Nikolay Krasko
14ead33db6 Add teamcity problems when generating files instead of exception 2021-04-08 18:51:10 +03:00
Nikolay Krasko
3757bd0c1f Use environment variable for getting TEAMCITY_VERSION 2021-04-08 18:51:09 +03:00
Nikolay Krasko
02e37dceeb Regenerate LightAnalysisModeTestGenerated.java 2021-04-08 18:51:08 +03:00
Abduqodiri Qurbonzoda
46338224e1 Remove deprecated JQuery 2021-04-08 18:43:16 +03:00
Sergey Bogolepov
6ab38c1ff8 Add support for Apple Silicon simulators 2021-04-08 16:51:51 +03:00
Sergey Bogolepov
3718907c6a Use -target instead of -arch in ClangArgs
Explicit target selection helps Clang to
 correctly set things up in case of Apple Silicon
 simulator target.
2021-04-08 16:51:49 +03:00
Sergey Bogolepov
79bf2a1f14 Drop useless bitness property from Architecture 2021-04-08 16:51:48 +03:00
Sergey Bogolepov
9b1498abad Use runtime bitcode to get size of primitive types
As an alternative to explicitly setting type size in konan.properties or
backend code we can "ask" LLVM about it.
Unfortunately, there is no Clang/LLVM API for it,
so we use a trivial workaround:
Create dumb function in runtime code, and then extract info about
return type size using LLVM.
2021-04-08 16:51:47 +03:00
Sergey Bogolepov
790fea635d Avoid explicit native targets enumerations 2021-04-08 16:51:45 +03:00
Sergey Bogolepov
15dcb36f47 Use TargetTriple in backend to simplify code. 2021-04-08 16:51:44 +03:00
Leonid Startsev
f94e8f95d1 Support new inline(value) class syntax in serialization plugin
Use .isInlineClass() instead of .isInline + .isValue

#KT-45783 Fixed
2021-04-08 11:52:18 +00:00
Alexander Likhachev
16dc0a7d29 [Gradle] Read more system properties through Gradle providers
Related to #KT-43605
2021-04-08 14:28:05 +03:00
Alexander Likhachev
ccfc16c84a [Gradle] Add IT for configuration cache on project with buildSrc
Related to #KT-43605
2021-04-08 14:28:05 +03:00
Alexander Likhachev
c44d83c6ba [Gradle] Move Kotlin daemon system properties read to build service
Instead of having a copy of those properties in each task move them into single build service
Related to #KT-43605
2021-04-08 14:28:00 +03:00
Elena Lepilkina
5f2095217d [Native] Removed slack reports for benchmarks 2021-04-08 10:39:16 +00:00
Jinseong Jeon
20c095a4f4 FIR IDE: Remove the redundant dependency in :idea:idea-frontend-api 2021-04-08 11:30:50 +02:00
Dmitriy Dolovov
caee17fddb [IR] Bump ABI version due to string serialization format change 2021-04-08 12:22:48 +03:00
Pavel Punegov
afdecef112 Use minOrNull instead of deprecated min in the interop_objc_test 2021-04-08 11:57:34 +03:00
Elena Lepilkina
512010046f [K/N] Replaced sumBy with sumOf 2021-04-08 11:57:33 +03:00
Elena Lepilkina
53c80cf03b [K/N] Replaced usage of minBy/maxBy in samples and benchmarks 2021-04-08 11:57:33 +03:00
Vasily Levchenko
d2d324797b [build][xcode][warning][todo] suppress deprecation warning with todo till bootstrap bump 2021-04-08 10:42:44 +02:00
Dmitriy Dolovov
1fa0ba987b Revert "[IR] Bump ABI version due to string serialization format change"
This reverts commit 4df5dcdf
2021-04-08 09:46:12 +03:00
Mikhail Glukhikh
9af1de272e FIR: support private-in-file effective visibility 2021-04-08 09:41:26 +03:00
Mikhail Glukhikh
6ee169c01e Rename EffectiveVisibility.Private to PrivateInClass 2021-04-08 09:41:26 +03:00
Mikhail Glukhikh
3c9f0e4775 Add PrivateInFileEffectiveVisibility language feature (1.6) 2021-04-08 09:41:26 +03:00
Mikhail Glukhikh
7f092264f7 FE 1.0: introduce deprecation EXPOSED_FROM_PRIVATE_IN_FILE
#KT-20094 Fixed
2021-04-08 09:41:25 +03:00
Mikhail Glukhikh
4bd44fa61b FE 1.0: introduce PrivateInFile effective visibility #KT-20094 Fixed 2021-04-08 09:41:25 +03:00
Mikhail Glukhikh
addfa27980 Fix various EXPOSED_FROM_PRIVATE_IN_FILE deprecations 2021-04-08 09:41:25 +03:00
pyos
1b1949d242 FIR: generate destructurings for more than one parameter 2021-04-08 09:41:23 +03:00
Dmitriy Dolovov
4df5dcdf75 [IR] Bump ABI version due to string serialization format change
^KT-33175
2021-04-08 09:40:22 +03:00
Dmitriy Dolovov
8d4d9a1f0b [K/N][IR] Re-enable string_builder0 and utf8 tests in 2-stage mode
^KT-33175
2021-04-08 09:40:16 +03:00
Dmitriy Dolovov
2e96a6c63c [K/N][IR] Re-enable Harmony regex tests
^KT-33175
2021-04-08 09:40:12 +03:00
Dmitriy Dolovov
eb0f47b04e Include tests from :kotlin-util-io and :kotlin-util-klib into :miscCompilerTest
^KT-33175
2021-04-08 09:40:07 +03:00
Dmitriy Dolovov
50326f019b [IR] Use the proper encoding for string serialization
^KT-33175
2021-04-08 09:40:02 +03:00
Sergey Bogolepov
7272e5dcad Unify checks for iOS device in backend.native tests 2021-04-08 09:18:30 +03:00
Sergey Bogolepov
316d62a72f Perform codesign in tests for all simulators 2021-04-08 09:18:29 +03:00
Sergey Bogolepov
7b06249e7f Fix clang usage in backend.native:tests
For Apple Silicon targets we need to call Clang
1. From toolchain because the one from our distro is too old.
2. With appropriate flags for setting the sysroot.
2021-04-08 09:18:28 +03:00
Sergey Bogolepov
437a0aa450 Prepare test infrastructure for Apple Silicon simulators.
* Get rid of explicit target enumerations by using TargetTriple.
* Remove some code duplication with `project.testTargetConfigurables`
2021-04-08 09:18:27 +03:00
Sergey Bogolepov
cebf815fed Introduce a proper TargetTriple class.
Target triple (like `arm64-apple-ios-simulator`) is a common
way to represent any target platform.
One of many useful properties: it allows to explicitly
distinguish iOS arm64 simulator target and a real device.
2021-04-08 09:18:25 +03:00
Abduqodiri Qurbonzoda
19116e5623 Migrate compiler and others from sumBy to sumOf 2021-04-08 03:48:02 +03:00
Abduqodiri Qurbonzoda
33b44585c4 Deprecate sumBy and sumByDouble with WARNING 2021-04-08 03:48:01 +03:00
Abduqodiri Qurbonzoda
983985bc68 [K/N] Migrate compiler, interop and others to new case conversion api 2021-04-08 03:22:05 +03:00
Abduqodiri Qurbonzoda
a4839b8548 [K/N] Migrate runtime to new case conversion api 2021-04-08 03:22:04 +03:00
Abduqodiri Qurbonzoda
40d1849f33 Migrate compiler, idea and others to new case conversion api 2021-04-08 03:22:02 +03:00
Abduqodiri Qurbonzoda
aa543c6631 Migrate stdlib, tests and samples to new case conversion api 2021-04-08 03:22:01 +03:00
Abduqodiri Qurbonzoda
a697bc43b9 [K/N] Remove redundant @OptIn targeting new case conversion api 2021-04-08 03:22:00 +03:00
Abduqodiri Qurbonzoda
f99c72cc98 Remove redundant @OptIn targeting new case conversion api 2021-04-08 03:21:59 +03:00
Abduqodiri Qurbonzoda
7f0e1ac08d [K/N] Deprecate old Char and String case conversion api #KT-43023 2021-04-08 03:21:58 +03:00
Abduqodiri Qurbonzoda
cbef9dad36 Deprecate old Char and String case conversion api #KT-43023 2021-04-08 03:21:57 +03:00
Igor Yakovlev
7a3781ec14 [FIR IDE] Use raw fir for modality and visibility in KtFirNamedClassOrObjectSymbol 2021-04-07 23:23:03 +02:00
Ilya Gorbunov
7cd306950a Deprecate Char-to-Number conversions in stdlib (Native)
- Synchronize code of Ranges, Progressions, ProgressionIterators
- Suppress deprecations in regex implementation code

KT-23451
2021-04-07 18:30:21 +03:00
Ilya Gorbunov
833955e56d Migrate deprecations in Native compiler
Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
2021-04-07 18:30:21 +03:00
Ilya Gorbunov
e450a6494a Migrate deprecations in core, compiler, idea, tests
Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
2021-04-07 18:30:20 +03:00
Ilya Gorbunov
b64b96eee6 Deprecate Char-to-Number conversions in stdlib (JVM and JS)
- Int.toChar was left non-deprecated because the replacement is not intrinsic yet.
- Number.toChar was left non-deprecated because otherwise the deprecation propagates to the override, Int.toChar.

KT-23451
2021-04-07 18:30:20 +03:00
Ilya Goncharov
b976cd812a [IR] Use extractTypeParameter instead of collectTypeParameters
^KT-45866 fixed
2021-04-07 18:13:08 +03:00
Ilya Goncharov
5955faecec [IR] Ignore WASM and FIR for tests
^KT-45866 fixed
2021-04-07 18:13:07 +03:00
Ilya Goncharov
b82c9225c8 [IR] Fix copying of default argument from expect to actual with type parameter
^KT-45866 fixed
2021-04-07 18:13:06 +03:00
Vasily Levchenko
d870876822 [kotlin/native][test] test for KT-33055 2021-04-07 15:04:57 +00:00
Vasily Levchenko
ef712f8f97 [kotlin/native][test] enabled stack_trace_inline back 2021-04-07 15:04:56 +00:00
Vasily Levchenko
a11b07f6c3 [codegeneration][debug info] generates marker of inlined function body on call site
- makes debuger breakpoint resolution more accurate
- restore expected behavior stack_trace_inline test
- fixes kt-33055
2021-04-07 15:04:56 +00:00
Victor Turansky
585e4254a0 Gradle 7.0 support update. com.gradle.plugin-publish 0.13.0 -> 0.14.0. 2021-04-07 18:01:23 +03:00
Vladimir Ivanov
61883ee878 Exclude kdoc related stuff from proto comparison in IC (#4283) 2021-04-07 17:16:06 +03:00
Sergey Bogolepov
9e6cf11026 Drop LLVM profiling frags from Clang invocation
It is not needed in most cases, but may affect profile
when running compiler with -Xprofile-phases.
2021-04-07 12:48:20 +00:00
Abduqodiri Qurbonzoda
b18cd24b81 [K/N] Advance deprecation level of FP to lesser than Int types to ERROR #KT-30360 2021-04-07 15:43:06 +03:00
Ilya Gorbunov
22ca412dd2 Fix case-insensitive character-wise comparison KT-45496
- Step 1: add failing tests
- Step 2: fix common case insensitive Char.equals
- Step 3: fix case insensitive String.equals in K/JS
- Step 4: enable unicode case folding in K/JS Regexes and
  string replacement (KT-45928)
- Step 5: fix case insensitive char comparison in K/N in String functions
  String.replace, equals, compareTo with ignoreCase
2021-04-07 14:43:41 +03:00
Andrey Zinovyev
fc8b75be80 [FIR] Add ONLY_ONE_CLASS_BOUND_ALLOWED diagnostic 2021-04-07 11:31:08 +00:00
Alexander Likhachev
68f39768ae [Gradle, JS] Fix KotlinPackageJsonTask's dependent tasks finder
Throw IllegalStateException instead of adding faulty dependency
2021-04-07 14:18:38 +03:00
Alexander Likhachev
bad33ac820 [Gradle, JS] Make Dukat tasks really compatible with conf cache
Related to #KT-42911
2021-04-07 13:23:59 +03:00
Alexander Likhachev
4416f2eb3f [Gradle, JS] Use file hasher for ProcessedFilesCache
Gradle's FileHasher can cache calculated hashes saving execution time
#KT-45774 In Progress
2021-04-07 13:23:59 +03:00
Alexander Likhachev
6e333c4f3f [Gradle, JS] Store RootNpmResolver's heavy state in build service params
That heavy state was duplicated in serialized state of each task that has access to it transitively.
#KT-45294 Fixed
2021-04-07 13:23:58 +03:00
Alexander Likhachev
14f6e5db6d [Gradle, JS] Optimize JS tasks serialized size
Tasks are serialized by Gradle's configurations cache. Each referenced object by task is also serialized. Reduce task's size by narrowing referenced objects.
#KT-45294 In Progress
2021-04-07 13:23:57 +03:00
Alexander Likhachev
072492386d [Gradle, JS] Return back package.json handlers 2021-04-07 13:15:10 +03:00
Igor Yakovlev
39edcb0f29 [FIR IDE] Fix invalid caches reset for Fir Renderer tests 2021-04-07 11:25:22 +02:00
Igor Yakovlev
7d3be9eafa [FIR IDE] Implement fir renderer for IDE 2021-04-07 11:25:22 +02:00
Igor Yakovlev
f2e02c2d50 [FIR IDE] Fixed invalid type parameters for inner classes 2021-04-07 11:25:22 +02:00
Igor Yakovlev
ea8858e694 [FIR] Add contaning class lookup element for local FirRegular classes 2021-04-07 11:25:22 +02:00
Igor Yakovlev
a428cc6eb4 [FIR IDE] Add symbol kind to Kt accessor symbols 2021-04-07 11:25:22 +02:00
Igor Yakovlev
ff9edb8776 [FIR IDE] Fixed getting symbols for lambda literal 2021-04-07 11:25:22 +02:00
Igor Yakovlev
d05ef3a635 [FIR] Move standard class id's into common module 2021-04-07 11:25:21 +02:00
Alexander Likhachev
df8682650a [Build] Enable Gradle file system watching by default 2021-04-07 12:23:39 +03:00
Alexander Likhachev
cc722d0a2c [Build] Bump Gradle to v6.8.3
#KTI-542 Fixed
2021-04-07 12:23:32 +03:00
Andrey Zinovyev
0f04fac5b2 [FIR] Add BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER diagnostic 2021-04-07 08:19:31 +00:00
Abduqodiri Qurbonzoda
b0f1ddc91e Advance max/min(By/With) deprecation level to ERROR 2021-04-07 07:49:23 +03:00
Ilya Gorbunov
d70edeb38b Hide deprecated JS Math object from public API and rename to JsMath
KT-41318

- Rename Math to JsMath and remove unused functions
- Fix return types, remove duplicating JsMath from longjs.kt

Co-authored-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2021-04-07 00:39:47 +03:00
Abduqodiri Qurbonzoda
d9ab96126d Advance deprecation level of mixed Int/FP overloads of ClosedRange.contains to HIDDEN KT-22423 2021-04-07 00:23:34 +03:00
Abduqodiri Qurbonzoda
7a6cddf6fe [K/N] Advance String(CharArray) deprecation level to ERROR 2021-04-07 00:23:32 +03:00
Abduqodiri Qurbonzoda
d28d0a6321 Advance String(CharArray) deprecation level to ERROR in Common and JS 2021-04-07 00:23:29 +03:00
Abduqodiri Qurbonzoda
29040d6f53 Remove deprecated Clock and ClockMark 2021-04-07 00:23:28 +03:00
Abduqodiri Qurbonzoda
abcc572b97 Remove deprecated scanReduce and scanReduceIndexed 2021-04-07 00:23:26 +03:00
Abduqodiri Qurbonzoda
8300180261 [K/N] Remove AfterEach and BeforeEach typealiases in kotlin-test 2021-04-07 00:23:24 +03:00
Abduqodiri Qurbonzoda
c46d71d4ac Remove DefaultAsserter() constructor-like function in kotlin-test 2021-04-07 00:23:22 +03:00
Abduqodiri Qurbonzoda
968099fbec Advance deprecation level of FP to lesser than Int types to ERROR #KT-30360 2021-04-07 00:23:20 +03:00
Ivan Kochurkin
404c69ded7 [FIR] Implement INCORRECT_CHARACTER_LITERAL, EMPTY_CHARACTER_LITERAL, TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL, ILLEGAL_ESCAPE, ILLEGAL_ESCAPE_SEQUENCE diagnostics, fix tests 2021-04-06 20:44:32 +03:00
Abduqodiri Qurbonzoda
91d42fe345 [K/N] Advance deprecation level of subarrayContentToString to ERROR 2021-04-06 18:44:22 +03:00
Abduqodiri Qurbonzoda
7fdf7c6175 [K/N] Move declarations from Text.kt to Strings.kt and StringBuilder.kt 2021-04-06 18:44:20 +03:00
Abduqodiri Qurbonzoda
71afd112c6 [K/N] Remove old String and utf8 conversion api #KT-31343 2021-04-06 18:43:41 +03:00
Abduqodiri Qurbonzoda
e8992c5d19 Advance deprecation level of InputStream.readBytes(estimatedSize) to ERROR 2021-04-06 18:42:53 +03:00
Renee Vandervelde
d520c37454 Add assertEquals and assertNotEquals for floating point numbers to kotlin-test #KT-8364 2021-04-06 18:37:09 +03:00
Abduqodiri Qurbonzoda
ff59b1c2ef Introduce assertContains in kotlin-test #KT-45582 2021-04-06 18:36:56 +03:00
Alexander Likhachev
8440c5722f [Gradle] Read property idea.active in tests registry via Gradle provider 2021-04-06 18:17:34 +03:00
Ivan Gavrilovic
4e5f6492d9 [Gradle, MPP] Make init script for tests compatible w/ conf cache
Avoid using `beforeTask` API and switch to ones that are
compatible with Gradle configuration cache.
2021-04-06 18:17:34 +03:00
Svyatoslav Scherbina
df77cd303f Don't use exitProcess to indicate a failure in Native library resolver
If Native compiler performs exitProcess, it crashes Gradle daemon that
runs the compiler.
2021-04-06 13:18:07 +00:00
Ilya Gorbunov
f1cdd0e2ed Add description for kotlin.io.path package 2021-04-06 14:24:43 +03:00
Ilya Gorbunov
81f2aea316 Stabilize existing Path API and annotate with @Throws where appropriate
KT-45913
2021-04-06 14:24:42 +03:00
Tianyu Geng
1496c82108 FIR IDE: add TypeInfoProvider and mixin to host type utils 2021-04-06 13:19:00 +02:00
Tianyu Geng
4d505f4393 FIR IDE: add intention to add custom accessor to uninitliazed property 2021-04-06 13:19:00 +02:00
Tianyu Geng
78f450a6ef FIR IDE: move common logic in add accessor intention to idea-frontend-independent 2021-04-06 13:19:00 +02:00
Tianyu Geng
7713d05272 FIR IDE: move some common action classes to idea-frontend-independent 2021-04-06 13:19:00 +02:00
Tianyu Geng
6d69959bfd FIR IDE: register quickfix to add lateinit modifier 2021-04-06 13:19:00 +02:00
Tianyu Geng
d5ea68c585 FIR IDE: add quick fix to add initializer for MUST_BE_INITIALIZED_OR_BE_ABSTRACT 2021-04-06 13:19:00 +02:00
Tianyu Geng
72f7405e4a FIR IDE: add quickfix to add abstract modifier for MUST_BE_INITIALIZED_OR_BE_ABSTRACT 2021-04-06 13:19:00 +02:00
Ilya Kirillov
638e192f8c FIR IDE: add // FIR_IDENTICAL to Jet53.kt 2021-04-06 13:13:21 +02:00
Ilya Kirillov
ed0f2751d1 FIR IDE: fix invalid isTeamCityBuild in tests 2021-04-06 13:13:21 +02:00
Pavel Punegov
e23d09beb6 [Native] Return kotlinCompilerRepo parameter back
This parameter is used to specify maven path in case of kotlin_version
rewriting that happens during Nightly test runs.
2021-04-06 09:59:08 +00:00
Dmitriy Novozhilov
3ef87d0265 [FIR] Add effective visibility to resolved status
This commit includes:
- introduce FirResolvedDeclarationStatus.effectiveVisibility
- replace FirEffectiveVisibility with EffectiveVisibility
- move calculation of effective visibility from FirEffectiveVisibilityResolver
  (which is deleted) to FirStatusResolver and FirDeserializer
2021-04-06 12:30:46 +03:00
Dmitriy Novozhilov
a600d18396 [FIR] Resolve statuses of all classes on path in FirDesignatedStatusResolveTransformer
This is required for calculating of effective visibility, because it
  depends on effective visibility of outer class (those changes are
  added in next commit)
Also fix incorrect designation building for local classes
2021-04-06 12:30:45 +03:00
Dmitriy Novozhilov
220f8a9169 Make EffectiveVisibility methods take typeContext instead initializing it in constructor
This is needed to reuse EffectiveVisibility in FIR, because typeContext
  in it is used to call `isSubtypeOf`, and in FIR it's required to use
  context from use site session (to see all declaration which are
   available in module)
2021-04-06 12:30:44 +03:00
Dmitriy Novozhilov
d7cd9e4c44 [FIR] Cleanup FirStatusTransformerExtension 2021-04-06 12:30:43 +03:00
Dmitriy Novozhilov
66668b2294 [FIR] Support resolve of local typealiases 2021-04-06 12:30:42 +03:00
Dmitriy Novozhilov
3cb17ac2f0 [FIR] Implement FirReturnAllowedChecker
Supported diagnostics:
- RETURN_NOT_ALLOWED
- RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY
2021-04-06 12:30:41 +03:00
Dmitriy Novozhilov
254ff77977 [FIR] Fix creating source for return expressions in light tree fir builder 2021-04-06 12:30:39 +03:00
Dmitriy Novozhilov
22cbb8720a [FIR] Fix computing labels of anonymous functions (not lambdas) 2021-04-06 12:30:38 +03:00
Dmitriy Novozhilov
8a549cafec [FIR] Cleanup CheckerContext.kt 2021-04-06 12:30:37 +03:00
Dmitriy Novozhilov
2271bb5d61 [FIR] Add positioning strategy for return keyword 2021-04-06 12:30:36 +03:00
Dmitriy Novozhilov
76f2e349cc [FIR] Introduce FirReturnExpressionChecker 2021-04-06 12:30:35 +03:00
Dmitriy Novozhilov
5ebd24eac5 [FIR] Save inline status of lambda after resolution 2021-04-06 12:30:34 +03:00
Svyatoslav Scherbina
a4b9e2502c Native: don't use frame pointer in leaf functions on ARM64 targets
Clang 8 and Clang 11 both have this optimization, but it was moved
from LLVM to Clang:

c5b890e922...a0aa58dad5

So Kotlin/Native compiler now has to enable this optimization explicitly.
2021-04-06 08:44:12 +00:00
Svyatoslav Scherbina
2b6d8ab975 Native: replace no-frame-pointer-elim* LLVM attributes by frame-pointer
LLVM 8 and LLVM 11 understand both, but *frame-pointer-elim*
are obscure and obsolete.
2021-04-06 08:44:12 +00:00
Him188
f90cbb0ce7 Support properties from primary constructor in JvmFieldApplicabilityChecker
#KT-32753 In progress
2021-04-06 11:40:44 +03:00
Dmitriy Novozhilov
e4ebeec275 Build: explicitly disable -Xuse-fir arg for some modules 2021-04-06 11:40:43 +03:00
Dmitriy Novozhilov
99e681ec1d [NI] Assume that ILT is number type in inference
#KT-41679 Fixed
2021-04-06 11:40:42 +03:00
Dmitriy Novozhilov
a107e3d160 Support actualization of expect sealed class with typealias in CliSealedClassInheritorsProvider 2021-04-06 11:40:40 +03:00
Dmitriy Novozhilov
fe81078366 Allow sealed inheritors for expect sealed classes in MPP submodules
KT-45842 Fixed
KTIJ-7068
2021-04-06 11:40:39 +03:00
Dmitriy Novozhilov
1633190478 Refine expect classes in CliSealedClassInheritorsProvider
KT-45796 Fixed
2021-04-06 11:40:36 +03:00
Mikhail Glukhikh
2ee8ac2e15 FirPropertyAccessorChecker: extract checkSetter, suppress properly 2021-04-06 11:13:17 +03:00
Jinseong Jeon
68fb15f9a4 FIR checker: consolidate property accessor checks 2021-04-06 11:13:16 +03:00
Elena Lepilkina
85cb8eb959 [Native][perf] Increase heap space for K/N compiler in performance project 2021-04-06 09:27:28 +03:00
nataliya.valtman
bce677f7f7 Generate tests for companion constant changes 2021-04-06 07:13:13 +03:00
Leonid Startsev
70fa6d50d3 Prohibit serializable inner classes
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1101
2021-04-05 18:26:25 +03:00
Leonid Startsev
c66cddc442 Prohibit serializable annotation on local classes and anonymous objects
#KT-45541 Fixed
2021-04-05 18:26:24 +03:00
Leonid Startsev
3b789448a3 Support static final write$Self method inside serializable classes on IR
to properly serialize class hierarchies with/or private fields.
JVM only for now, because Native/JS do not have private fields.
Update tests and test data and rebase fix.
Unify formEncodeDecodePropertyCall functions.
Fix incorrect reference to object in writeSelf,
so properties dependent on other properties would be correctly compared
with defaults.
2021-04-05 18:25:46 +03:00
Leonid Startsev
9be5421e7c Use .nullable extension instead of NullableSerializer() constructor
Use correct projection in createClassReference()
so primitive-boxes arrays behave correctly on JVM
2021-04-05 18:25:45 +03:00
Dmitry Petrov
120eba8d3d Minor: add tests for KT-45893 2021-04-05 17:50:43 +03:00
Andrey Zinovyev
e10df86037 [FIR] Add UPPER_BOUND_IS_EXTENSION_FUNCTION_TYPE diagnostic 2021-04-05 17:15:32 +03:00
Alexander Shabalin
451fc8e9df Fix enum isFrozen for wasm 2021-04-05 14:07:29 +00:00
yantimirov-timur
9e7f6332d1 [FIR] Complete WRONG_SETTER_TYPE_PARAMETER checker 2021-04-05 16:17:34 +03:00
Julia
5472199bb1 [FIR] Introduce supertypes-for-annotation-class checker 2021-04-05 15:54:57 +03:00
Mikhail Glukhikh
caeb0b43be FIR: introduce JvmPlatformOverloadsConflictResolver
The added here JvmPlatformOverloadsConflictResolver prefers Java field
to property in case of conflicts.
2021-04-05 15:54:49 +03:00
Ilya Goncharov
9b3c154bef [Gradle, JS] Remove source maps flags in IR 2021-04-05 15:12:53 +03:00
Andrey Zinovyev
67505a0071 [FIR] Add FINAL_UPPER_BOUND checker 2021-04-05 14:51:44 +03:00
Elena Lepilkina
d0513c9ece [Native][perf] Removed unneeded workaround 2021-04-05 10:52:55 +00:00
Elena Lepilkina
1fea08aac1 [Native][Performance server] Fix request for new composite build numbers 2021-04-05 10:52:54 +00:00
Denis.Zharkov
0637748f10 FIR: Introduce NAMED_PARAMETER_NOT_FOUND diagnostic 2021-04-05 12:58:07 +03:00
Jinseong Jeon
2d42e64c17 FIR: prefer flexible type over other equal types when computing intersection 2021-04-05 10:39:51 +03:00
Jinseong Jeon
0d3969597c FIR: more accurate nullability of intersection of flexible types 2021-04-05 10:39:51 +03:00
Jinseong Jeon
871b5a2174 FIR: fix nullability computation of intersection of flexible types
Without this, currently,

  it(ft(J..J?), ft(J..J?) => J

which should be ft(J..J?) instead.
2021-04-05 10:39:51 +03:00
Dmitriy Novozhilov
0cb039eea7 Fix compilation of :kotlin-gradle-plugin:functionalTest 2021-04-03 17:04:27 +03:00
Dmitriy Novozhilov
f1cef0fc95 Update testdata 2021-04-03 16:52:05 +03:00
Dmitriy Novozhilov
13d9520a4a Revert "[TMP] Add -Xskip-prerelease check to maven projects"
This reverts commit 57929ab5
2021-04-03 14:31:46 +03:00
Dmitriy Novozhilov
9c4d35747a Revert "[TMP] Disable maven itnegration tests"
This reverts commit 4a10de0c
2021-04-03 14:31:40 +03:00
Dmitriy Novozhilov
e10792e1c6 Advance bootstrap to 1.5.20-dev-4401 2021-04-03 14:31:34 +03:00
Dmitriy Novozhilov
e97140a4a7 Advance bootstrap to 1.5.20-dev-4399 2021-04-03 13:52:47 +03:00
Dmitriy Novozhilov
4a10de0ce3 [TMP] Disable maven itnegration tests
This commit will be reverted after bootstrap to stable stdlib
2021-04-03 13:31:34 +03:00
Dmitriy Novozhilov
57929ab587 [TMP] Add -Xskip-prerelease check to maven projects
This commit will be reverted after bootstrap to stable stdlib
2021-04-03 13:31:33 +03:00
Dmitriy Novozhilov
69aef01b25 Switch IS_PRE_RELEASE flag to false 2021-04-03 13:13:32 +03:00
Ilya Gorbunov
35ae913a5e Stabilize new string and char case conversion API KT-45873 2021-04-03 10:39:17 +03:00
Ilya Gorbunov
256f634e61 Support all digit chars in digitToInt on JVM KT-23451 2021-04-03 10:30:50 +03:00
Ilya Gorbunov
8b85bae020 Stabilize Char-to-Int conversions KT-45874 2021-04-03 10:30:50 +03:00
Vladimir Ivanov
c5f06d6e3f Patch expectedLazyNoGenerics.h to corresond with new test (#4271) 2021-04-02 19:38:22 +03:00
Ilya Kirillov
5f9d18d8bc FIR IDE: resolve argument type super types & type args when checking for overridden
When we check overrides from IDE, we need to check argument types for subtyping.
When checking for subtyping, we need type parameters declared
in defining classes to be resolved to TYPES phase
and super types to be resolved to SUPER_TYPES phase.
Otherwise, they will be resolved to RAW_FIR and subtyping will throw
"ISE Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl"
2021-04-02 17:24:27 +02:00
Ilya Kirillov
5ceec858aa FIR IDE: do not search for sealed class inheritors on every class resolve 2021-04-02 17:15:30 +02:00
Ilya Gorbunov
0e93924ff3 Duration: inWholeUnits properties instead of inUnits
Introduce conversion properties returning Long values,
deprecate the old ones returning Doubles.
2021-04-02 17:44:10 +03:00
Ilya Gorbunov
11d15f3343 Make Duration storage ranges symmetric and non-overlapping
Increase accuracy of multiplication and division.
2021-04-02 17:44:10 +03:00
Ilya Gorbunov
4fd2254f3f Advance TestTimeSource more precisely
Change durations in its test so that they hold precise number
of nanoseconds
2021-04-02 17:44:08 +03:00
Ilya Gorbunov
fa7460ba48 Store Duration value as a multi-range Long
Now precision loss happens at bigger durations.

This changes the binary API due different underlying type of Duration.
2021-04-02 17:43:20 +03:00
Tianyu Geng
3f4fa7eb98 FIR checker: make FirFunctionNameChecker a subclass of FirSimpleFunctionChecker 2021-04-02 17:32:22 +03:00
Tianyu Geng
d7cae63cb0 FIR checker: fix UPPER_BOUND_VIOLATED
The diagnostics accepts one parameter for the expected upper bound for
the type parameter.
2021-04-02 17:32:22 +03:00
Tianyu Geng
bd64237519 FIR checker: fix checker registration
Previously, composed checker passes the `allXXX` flavor of checkers to
each category of checkrs. This makes the composed checkers
non-transparent: behavior changes after composing. In addition, nested
composing would create redundant checkers.

As a result, some checkers registered in the IDE mode
(org.jetbrains.kotlin.idea.fir.low.level.api.diagnostics.AbstractFirIdeDiagnosticsCollector)
are not invoked with the FIR plugin.

This change does two things:
1. pass on checkers to composed checkers without combining
2. use combined checkers in DeclarationCheckersDiagnosticComponent and
   ExpressionCheckersDiagnosticComponent
2021-04-02 17:32:22 +03:00
Svyatoslav Scherbina
65fa2f62bd Fix :kotlin-native:**:nativelibs Gradle tasks
These tasks did copy all files from build to build/nativelibs, thus
causing up-to-date checks to fail, and native libs and temporary build
files to be accumulated in recursive directories like
nativelibs/nativelibs/... in both build dirs and dist.

Fix this by copying only relevant files.
2021-04-02 14:13:48 +00:00
Mikhail Glukhikh
f0ff9ad5a7 FIR: rename AMBIGUITY to OVERLOAD_RESOLUTION_AMBIGUITY to match FE 1.0 2021-04-02 16:22:01 +03:00
Alexander Shabalin
71397a06fb Add Stop-the-World Mark & Sweep GC for single-threaded programs.
GC implementation for testing purposes

* Only works for a single mutator
* Runs on the same thread as the mutator
* Runs every nth checkpoint and after every m bytes are allocated
* Runs finalizers after sweeping on the mutator thread.
2021-04-02 12:13:44 +00:00
Mikhail Glukhikh
e7102cd63f FIR: fix FQ_NAMES_IN_TYPES renderer 2021-04-02 15:11:02 +03:00
Tianyu Geng
761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +03:00
Tianyu Geng
fc8d0e3ee0 FIR checkers: report VAL_REASSIGNMENT for assignment operators
Currently VAL_REASSIGNMENT are only reported on direct assignments.
Reassignments in the form of, for example, `+=` are reported as
`VARIABLE_EXPECTED`, which differs from FE1.0.
2021-04-02 13:33:52 +03:00
Vladimir Ivanov
b87a943efd [Native] Add test for -Xexport-kdoc (#4249)
(*) Fix exported kdoc indentation and extra blank lines
2021-04-02 12:10:09 +03:00
Dmitry Petrov
eefb6e94a9 Minor: update tests to pass on Android 2021-04-02 10:53:30 +03:00
Mikhail Glukhikh
42d53dd954 FIR: introduce delegated & overridden conflict checks 2021-04-02 10:24:20 +03:00
Mikhail Glukhikh
566dc434cc FIR: introduce MANY_*_MEMBER_NOT_IMPLEMENTED diagnostic 2021-04-02 10:24:20 +03:00
Mikhail Glukhikh
9f27362ee1 Match triangle & diamond intersections in FirTypeIntersectionScope 2021-04-02 10:24:20 +03:00
Anton Yalyshev
a7a1b678bd Enable for AS possibility to collect FUS data 2021-04-02 10:03:38 +03:00
Dmitriy Dolovov
003d07b51e [K/N][IR] Ref to expect property in actual declaration is not remapped
^KT-36880
2021-04-02 09:35:46 +03:00
Elena Lepilkina
393aaac2b9 [Native] Removed old gradle properties for kotlin repo and versions 2021-04-02 05:42:13 +00:00
Dmitry Petrov
19fb7ebfd5 JVM_IR fix local class names for files with @JvmPackageName 2021-04-02 00:08:55 +03:00
Alexander Udalov
c4b2b7e0da Add underlying property name & type for inline class to kotlinx-metadata
#KT-45635 Fixed
2021-04-01 22:34:53 +02:00
Alexander Udalov
9b5bbb95e7 Refactor CirConstantValue similarly to KmAnnotationArgument
Introduce LiteralValue with generic value, and remove `value` from
enum/array/null subclasses.
2021-04-01 22:34:53 +02:00
Alexander Udalov
5f7f4a4ac8 Improve API of annotation arguments in kotlinx-metadata
See changes in ChangeLog.md for more information
2021-04-01 22:34:53 +02:00
Alexander Udalov
1a82158472 Fix array of KClass annotation arguments in kotlinx-metadata-jvm
#KT-45594 Fixed
2021-04-01 22:34:53 +02:00
Ilya Kirillov
e2084a180b FIR IDE: fix invalid FirSessionWithModificationTracker.isValid 2021-04-01 21:16:18 +02:00
Ilya Kirillov
ea451fa7ae Revert: "FIR IDE: do not run STATUS phase under lock" 2021-04-01 21:16:17 +02:00
Ilya Kirillov
5f4b42a309 FIR IDE: temporary do not fail on non-resolved reference while resolving calls 2021-04-01 21:16:17 +02:00
Alexander Udalov
ce0c0ad2e3 JVM IR: get rid of toIrBasedKotlinType in MethodSignatureMapper
Commonize (in terms of TypeSystemCommonBackendContext implementations
for KotlinType/IrType) code that computes optimal TypeMappingMode to
apply to different positions where inline class types can be present.
2021-04-01 20:17:45 +02:00
Alexander Udalov
b59ac5d8f6 JVM IR: do not use old KotlinTypeMapper when coercing inline classes
KotlinTypeMapper.mapInlineClassTypeAsDeclaration and
mapUnderlyingTypeOfInlineClassType invoked mapType which is defined in
descriptorBasedTypeSignatureMapping.kt and works on KotlinType.

It didn't lead to any problems, other than the fact that we were
constructing IrBasedClassDescriptor in JVM IR, and then KotlinType to
pass it to mapType, on each call to StackValue.boxInlineClass or
unboxInlineClass, which seems wasteful.

Instead of this, refactor these utilities to use type markers instead,
pass IrType and IrTypeMapper directly from JVM IR, and move the "static
type mapper" logic (which is used only in the old backend) out of
KotlinTypeMapper.
2021-04-01 20:17:45 +02:00
Ilmir Usmanov
b5ecccb610 Enable suspend in fun interfaces by default
#KT-45836 Fixed
2021-04-01 20:26:42 +03:00
Jinseong Jeon
572c0b2ade Raw FIR: make sure loop target preparation and loop configuration match
by using the generated loop target during preparation in a message
passing fashion
2021-04-01 20:07:53 +03:00
Jinseong Jeon
bb242f022f FIR renderer: avoid StackOverflow when rendering loop jump condition
For example,
```
do {
  ...
} while(
    when (...) {
      ... -> break
    }
)
```
That `break` condition is `when` expression, and while visiting its
branch result, we will see the same `break` again.
2021-04-01 20:07:52 +03:00
Jinseong Jeon
b4a5eec5f4 Raw FIR: correct loop target for break/continue in do-while loop condition
As shown in KT-44412 (or KT-45319 or KT-17728):
```
fun test5() {
    var i = 0
    Outer@while (true) {
        ++i
        var j = 0
        Inner@do {
            ++j
        } while (if (j >= 3) false else break) // break@Inner
        if (i == 3) break
    }
}
```

To properly set the loop target for `break` in do-while loop condition,
the loop target for that do-while loop should be ready before parsing
the loop condition.

Previously, Raw FIR loop building configures loop target after visiting
loop conditions. This commit splits the configuration and lets the
builders prepare the loop target for do-while loop only.
2021-04-01 20:07:50 +03:00
Jinseong Jeon
81999117dc FIR2IR: force return type of loop body block as Unit 2021-04-01 20:07:49 +03:00
Jinseong Jeon
7898d167f3 FIR2IR: wrap do-while loop in IrBlock
"so that variables declared in loop body are not visible outside of the
loop" (from commit d096f1d)
2021-04-01 20:07:47 +03:00
Ilya Kirillov
08670114c8 Remove old j2k tests 2021-04-01 18:27:20 +02:00
Ilya Kirillov
9eb6b785c6 FIR IDE: encapsulate isInsideAnalysisContext check into ReadActionConfinementValidityTokenFactory 2021-04-01 18:26:40 +02:00
Ilya Kirillov
0d12110112 FIR IDE: introduce ValidityToken for light classes
To make all light classes stuff available from EDT
2021-04-01 18:26:39 +02:00
Stanislav Erokhin
8ffb822c3c Add way to create the FirAnalysisSession with custom token
This way should be used only for old FE wrappers.
It is important that Fir session with custom token should be cached,
because otherwise session with incorrect validity token could be
returned from cache inside analyze call
2021-04-01 18:26:38 +02:00
Ilya Kirillov
29bebae37d FIR IDE: add validity check of analysis component that it is valid only in analysis context 2021-04-01 18:26:38 +02:00
Ilya Kirillov
bd38363077 FIR IDE: use IGNORE_FIR instead of FIR_COMPARISON in hl quick fix tests
To explicitly specify which test are failing
2021-04-01 18:24:17 +02:00
Ilya Kirillov
18ab9c7b25 Move HLApplicator from fir ide module to frontend-independent 2021-04-01 18:24:17 +02:00
Denis.Zharkov
5cbfb172a4 Ignore new FIR box test on android 2021-04-01 14:52:05 +03:00
sebastian.sellmair
3f3e51f36e CInteropCommonization: Filter out illegal dependencies
^KT-45832 Fixed
2021-04-01 10:30:23 +00:00
Ilya Kirillov
c775508f64 FIR IDE: cache function symbols in FirIdeBuiltinSymbolProvider 2021-04-01 11:31:43 +02:00
Ilya Kirillov
d5951bc97d FIR IDE: use EntityWasGarbageCollectedException instead of ISE in ReadOnlyWeakRef 2021-04-01 11:31:43 +02:00
Denis.Zharkov
d685e2aac7 FIR2IR: Fix inheritance case from built-in interface with default methods 2021-04-01 12:11:37 +03:00
Alexander Shabalin
e5ea7f5b4e Do not freeze enum in new MM 2021-04-01 08:41:08 +00:00
Ilmir Usmanov
786999bcfe Minor. Add regression tests
#KT-44143
2021-04-01 00:51:08 +03:00
Ilya Goncharov
03fed85447 [IR] Change copy method into shallowCopy in Native 2021-03-31 20:14:56 +03:00
Ilya Goncharov
368ac36204 [IR] Remove IrExpressionWithCopy and replace with shallowCopy method 2021-03-31 20:14:55 +03:00
Ilya Goncharov
084d824984 [IR] Use deepCopyWithSymbols in IrTypeOperatorCall 2021-03-31 20:14:54 +03:00
Ilya Goncharov
7046f9badd [IR] canHaveSideEffects more robust
By default copyable (IrExpressionWithCopy) declarations is considered as side-effects.

^KT-45655 fixed

[IR] isTrivial more robust

By default copyable (IrExpressionWithCopy) declarations is considered as trivials.

[IR] Use one source of truth for triviality of IrExpression
2021-03-31 20:14:53 +03:00
Ilya Goncharov
47f1a8a0bb [IR] Make IrTypeOperatorCall copyable
^KT-45655 fixed
2021-03-31 20:14:52 +03:00
Ivan Kylchik
2a5153f0fd Move visualizer black box tests generator to separate class 2021-03-31 19:46:23 +03:00
Ilya Gorbunov
94240f7b21 Stabilize unsigned types KT-45653
Deprecate specialized unsigned iterators for removal.

Fix compiler tests:
- drop unsignedLiteralsOn1_2 because apiVersion 1.2 is no longer supported
- drop experimental unsigned literals diagnostic test
2021-03-31 19:05:04 +03:00
Yahor Berdnikau
768c165a72 Fix Gradle 7 deprecation on adding associated compilation dependencies.
^KT-45787 Fixed
2021-03-31 18:23:53 +03:00
Nikolay Krasko
7f60cd81fe CodeConformanceTest for no Bintray except jcenter (KTI-528) 2021-03-31 17:38:59 +03:00
Nikolay Krasko
b48ede4a62 Drop scripts for uploading to plugin repository (KTI-528) 2021-03-31 17:38:58 +03:00
Nikolay Krasko
35ad28c372 Bintray dukat -> Space kotlin/kotlin-dependencies (KTI-528) 2021-03-31 17:38:56 +03:00
Nikolay Krasko
d10f4ad718 Drop Bintray from maven inspections tests (KTI-528) 2021-03-31 17:38:55 +03:00
Nikolay Krasko
03c0a81a33 Stop using Bintray in ignored test in MavenResolverTest (KTI-528) 2021-03-31 17:38:54 +03:00
Dmitry Petrov
9bf7f3af04 JVM_IR KT-45697 reference classes from sources before IR generation 2021-03-31 16:40:49 +03:00
Denis.Zharkov
7d211d0d9a Regenerate VisualizerBlackBoxTestGenerated 2021-03-31 15:57:03 +03:00
Denis.Zharkov
fa65081878 Revert "FIR2IR: minimize scope processing in fake override generation"
This reverts commit 9934cfbb00.

See the tests added: Subclass may have private same-name method that
should not be a reason to avoid generating fake overrides
2021-03-31 15:57:03 +03:00
Denis.Zharkov
55e5af1111 FIR: Add workaround for flatMap issue 2021-03-31 15:57:03 +03:00
Denis.Zharkov
4d3825a824 FIR: Serialize members originated from delegation 2021-03-31 15:57:03 +03:00
Denis.Zharkov
a130b110f1 FIR2IR: Fix incorrect conversion of adapted callable references with receiver 2021-03-31 15:57:02 +03:00
Denis.Zharkov
1f074326bf FIR: Fix Java scope in case of accessor with getter signature from supertype
^KT-45584 Fixed
2021-03-31 15:57:02 +03:00
Denis.Zharkov
24f35ef281 FIR: Minor. Extract FirDeclarationStatus.copy 2021-03-31 15:57:02 +03:00
Victor Petukhov
f80b98cd0e Assert that the separation of two annotations on function type during rendering it, is any whitespace-like symbol, not only whitespace itself
E.g. in quick doc mode (HTML), it may be line break

^KT-38747 Fixed
2021-03-31 11:37:16 +03:00
Ilmir Usmanov
cf73f182c7 Minor. Change warning message 2021-03-31 09:04:35 +03:00
Alexander Udalov
1f7cef6f13 Minor, add a bit more tests for KT-12063 2021-03-31 00:08:52 +02:00
pyos
66429cfb43 JVM_IR: do not inline @JvmStatic into their static proxies 2021-03-31 00:08:40 +02:00
pyos
a518a9407d JVM_IR: remap calls to protected @JvmStatic in companions
Protected functions on unrelated classes cannot be called from outside
the current package, so in general, we can only call the static proxy,
not the original companion method.

This has an ABI compatibility implication in that removing `@JvmStatic`
from a protected companion method will require recompiling Kotlin use
sites (of course, this is already source- and binary-incompatible from
Java perspective).

 #KT-12063 Fixed
2021-03-31 00:08:40 +02:00
pyos
85aa6383ad JVM_IR: cast bound property receivers to original type
Because the receiver type is used for determining where to put
accessors, and the type of fake overrides' receivers is the same as for
the original declaration, casting to the type of the parameter leads to
assertion errors.

 #KT-44658 Fixed
2021-03-30 23:09:28 +02:00
Svyatoslav Scherbina
1d96f810da Native: fix target for ReturnsRetained and ConsumesReceiver annotations
These annotations can be used on Objective-C property accessors imported
to Kotlin.
Note: the annotations aren't used in source code, only generated
directly to metadata by cinterop. So this commit doesn't in fact fix
anything but rather makes the implementation less fragile.

See https://github.com/JetBrains/kotlin-native/issues/3336.
2021-03-30 20:23:59 +00:00
Svyatoslav Scherbina
107129679e Native: fix interop_objc_tests after recent frontend change
b60056f11e raises a warning to an error,
fixing this error here.
2021-03-30 15:32:46 +00:00
Mikhail Glukhikh
bf2e83f64c Make same tests FIR_IDENTICAL 2021-03-30 18:06:06 +03:00
Shagen Ogandzhanian
e0e2715864 [js] Fix constant folding for unsigned aithmetic in IR
this resolves KT-44138
2021-03-30 16:53:12 +02:00
Pavel Kirpichenkov
36bc71121a [IDE] Optimize stdlib cache for non-JVM modules
Consider only dependencies of JVM modules.
Cache found/missing stdlib dependencies for modules.

As of now, non-JVM platforms use default builtins in IDE.
For any non-JVM module indexed stdlib dependency is guaranteed
to be missing, searching for it is useless and costly.

^KTIJ-5666 Fixed
See also KT-44552
2021-03-30 17:28:08 +03:00
pyos
6c11751c55 FIR: infer non-error types for unnamed annotation arguments 2021-03-30 16:20:01 +03:00
Vyacheslav Gerasimov
f2a892a972 Cleanup 201 and as41 bunch files 2021-03-30 14:23:43 +03:00
Mikhail Zarechenskiy
943f03e55f Fix add import quick fix for delegated property and missing extension
^KT-39199 Fixed
2021-03-30 13:58:41 +03:00
Mikhail Glukhikh
f453649d0b FIR: report NO_TYPE_ARGUMENTS_ON_RHS properly 2021-03-30 12:52:13 +03:00
Ilmir Usmanov
5617d83c6b Remove coroutinesPackage from tests, since it is kotlin.coroutines
anyway.
Simplify createTextForHelpers: remove experimental coroutines version.
2021-03-30 12:41:40 +03:00
Nikolay Krasko
c868116535 Drop Bintray from wizards (KTI-528) 2021-03-30 12:34:08 +03:00
Nikolay Krasko
c74a3bd2b1 Move testResolveDependencyOnMppInCustomConfiguration to library from maven central (KTI-528) 2021-03-30 12:34:07 +03:00
Nikolay Krasko
1547d4f516 Drop bintray from Gradle inspections and fixes tests (KTI-528) 2021-03-30 12:34:06 +03:00
Nikolay Krasko
7a9c2c1d17 Drop bootstrap mentioning from CodeConformanceTest 2021-03-30 12:34:05 +03:00
Nikolay Krasko
529fc352b3 Drop custom private Bintray Android Studio repository (KTI-528) 2021-03-30 12:34:04 +03:00
Nikolay Krasko
5631481747 Drop bintray kotlin-dev (KTI-528) 2021-03-30 12:34:03 +03:00
Nikolay Krasko
1cedc7e93e Drop bintray jetbrains markdown (KTI-528) 2021-03-30 12:34:02 +03:00
Nikolay Krasko
832523e23f Replace intellij-third-party-dependencies repository (KTI-528) 2021-03-30 12:34:01 +03:00
Nikolay Krasko
87d509a7aa Rearrange list of repositories - move jcenter to the end 2021-03-30 12:34:00 +03:00
Nikolay Krasko
818855d6f0 Update cache redirector for more complex aliases
For example:
"https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" to "https://cache-redirector.jetbrains.com/intellij-dependencies",
2021-03-30 12:33:59 +03:00
Alexander Udalov
6e86df2f6d Workaround illegal access to JDK internals in DynamicBundle
This is basically a manual cherry-pick of
https://github.com/JetBrains/intellij-community/commit/547caebd980d.

 #KT-44624 Fixed
2021-03-30 11:33:07 +02:00
Alexander Udalov
8e1a70cff6 Copy com.intellij.DynamicBundle to compiler/cli
This is needed to fix KT-44264 without updating the whole project to
intellij 203, which might take significant time.

In this commit, the file is copied as is from
27837dd8e6/platform/core-api/src/com/intellij/DynamicBundle.java.
2021-03-30 11:33:07 +02:00
Dmitriy Novozhilov
d0a148074f [FIR2IR] Fix generating body for for-loop 2021-03-30 12:28:15 +03:00
Victor Petukhov
5d78b0a962 Report resolution ambiguity on '+=' by taking into account full resolution result including post type checking for '+'
^KT-45503 Fixed
2021-03-30 12:12:56 +03:00
Mark Punzalan
1da35029a6 Restore UNUSED_* diagnostics to relevant tests. 2021-03-30 09:57:56 +03:00
Pavel Punegov
303d5ece96 Use iPhone 11 as a default target for ios simulator tests.
iPhone 12 isn't available on the xcode 12 without updates.
2021-03-30 06:47:01 +00:00
Ting-Yuan Huang
17ba350868 AnalysisHandlerExtensionTest: set output dir for JVM 2021-03-29 20:41:09 +03:00
Ting-Yuan Huang
0dee48781c Tests for AnalysisHandlerExtension
Add two common use cases of AnalysisHandlerExtension:
1. repeated analysis with new source roots.
2. frontend only mode
2021-03-29 20:41:08 +03:00
Ting-Yuan Huang
dba127a4d8 Add AnalysisHandlerExtension extension point for K2Native
frontendPhase is moved out of back phases to allow frontend only mode.

AnalysisHandlerExtension allows compiler plugins to:
1. Intercept and override the default analysis.
2. Utilize the compiler infrastructure to do custom analysis.

A well know plugin on the JVM platform is KAPT.
2021-03-29 20:41:06 +03:00
Ting-Yuan Huang
8e7b561b10 Add AnalysisHandlerExtension extension point for K2JsCompiler
AnalysisHandlerExtension allows compiler plugins to:
1. Intercept and override the default analysis.
2. Utilize the compiler infrastructure to do custom analysis.

A well know plugin on the JVM platform is KAPT.
2021-03-29 20:41:05 +03:00
Ting-Yuan Huang
4db79285c1 Add AnalysisHandlerExtension extension point for K2MetadataCompiler
AnalysisHandlerExtension allows compiler plugins to:
1. Intercept and override the default analysis.
2. Utilize the compiler infrastructure to do custom analysis.

A well know plugin on the JVM platform is KAPT.
2021-03-29 20:41:03 +03:00
Ting-Yuan Huang
e0c28e27d2 Move AnalysisHandlerExtension out of frontend.java
A dummy AnalysisHandlerExtension that extends the new extension is kept
in frontend.java for backward compatbility.
2021-03-29 20:41:01 +03:00
Elena Lepilkina
510e38b791 [K/N][performance] Adopted performance service to work with new configurations and build numbers 2021-03-29 17:10:18 +00:00
Elena Lepilkina
d709df9d8d [K/N][performance] Removed analyzer dependencies and fixed running benchmarks 2021-03-29 17:10:18 +00:00
Ilya Goncharov
30a024d05d [JS IR] Add test with member with JsName and default argument
^KT-44796 fixed
2021-03-29 19:58:15 +03:00
Steven Schäfer
a7f8f0d903 JVM IR: Avoid IndexOutOfBounds exceptions in TypeOperatorLowering
The code didn't account for SYNTHETIC_OFFSETs (KT-45688) and could
throw on IR containing broken line numbers (KT-44910).
2021-03-29 19:44:11 +03:00
Ilya Goncharov
6567b0e8ad [Gradle, JS] Remove supporting source maps for IR until it exists
^KT-45754 fixed
2021-03-29 19:36:17 +03:00
Dmitry Petrov
466e7b60b0 JVM_IR fix receiver type for fake overrides 2021-03-29 19:04:42 +03:00
Ilya Muradyan
92b99b140e [Scripting] Fix Bintray-dependent test 2021-03-29 18:36:50 +03:00
Ilya Muradyan
d40ada5d07 [REPL] Fix syntax errors analysis and incompleteness detection 2021-03-29 18:36:49 +03:00
Ivan Kylchik
736efe0403 [VISUALIZER] Edit black box test to run visualizer on all modules 2021-03-29 18:11:24 +03:00
Ivan Kylchik
097b5a74fb [VISUALIZER] Rewrite black box runner using callback to TestRunner 2021-03-29 18:11:23 +03:00
Ivan Kylchik
dbf1f54c3f Add possibility to run callback lambda before dispose test project 2021-03-29 18:11:22 +03:00
Ivan Kylchik
0f70ec032d [VISUALIZER] Add new visualizer tests processing codegen box test data 2021-03-29 18:11:21 +03:00
Ivan Kylchik
427a1295c8 Allow to create sub folders for expected data file that did not exist 2021-03-29 18:11:21 +03:00
Ivan Kylchik
29920d729f [VISUALIZER] Remove unnecessary abstract property frontendFacade
Right frontend facade will be chosen by frontendKind
2021-03-29 18:11:20 +03:00
Ivan Kylchik
e19514f1dc [VISUALIZER] Render original symbols/descriptors in fir/psi 2021-03-29 18:11:19 +03:00
Ivan Kylchik
869585870d [VISUALIZER] Rewrite getSymbolId method
For now it is more clear that id means. It is a combination
of package name and class name with additional local path
2021-03-29 18:11:18 +03:00
Ivan Kylchik
6d08ef2f41 [VISUALIZER] Allow to render arrayOf call for fir 2021-03-29 18:11:17 +03:00
Ivan Kylchik
74c19807b8 [VISUALIZER] Replace get with getOrNull to avoid NullPointerException 2021-03-29 18:11:16 +03:00
Ivan Kylchik
f32f61a950 [VISUALIZER] Remove all usages of fir native renderer 2021-03-29 18:11:15 +03:00
Ivan Kylchik
30bd39aabf [FIR] Allow to render function type with custom cone type renderer 2021-03-29 18:11:14 +03:00
Ivan Kylchik
13d8b10be0 Extract some cone type utils properties to reuse them in visualizer 2021-03-29 18:11:13 +03:00
Victor Petukhov
bbf5c4412e Do subtyping between self types with captured type in special way 2021-03-29 16:30:58 +03:00
Victor Petukhov
7f2c5cde55 Propagate input type position across incorporation properly
^KT-45719 Fixed
2021-03-29 16:17:31 +03:00
Victor Petukhov
d06031ece3 Approximate types when only input types check is done. Otherwise given types are inconsistent with types obtained by ResultTypeResolver
^KT-45714 Fixed
2021-03-29 16:17:30 +03:00
Victor Petukhov
cc1cb463b2 Remove NonStrictOnlyInputTypesChecks LF and introduce opposite – StrictOnlyInputTypesChecks, set default as strict 2021-03-29 16:17:30 +03:00
Victor Petukhov
b60056f11e Turn only input type warning to error
^KT-45482 Fixed
2021-03-29 16:17:22 +03:00
Dmitriy Novozhilov
c73c73e85e [Test] Simplify DiagnosticsService 2021-03-29 16:12:29 +03:00
Dmitriy Novozhilov
cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Dmitriy Novozhilov
85949b387e [Test] Explicitly enable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:28 +03:00
Dmitriy Novozhilov
a9ff030c73 [Test] Add ability to configure tests by negative test location regex 2021-03-29 16:12:27 +03:00
Matthew Gharrity
2cb9d1f287 KT-45676: fix backing field annotation resolve 2021-03-29 15:36:05 +03:00
Yahor Berdnikau
6a586fb731 Ensure Android SDK license files always have all license.
Sometime on CI it may happen that file already exists, but does not
contain all required licenses.
2021-03-29 13:59:05 +03:00
Ilya Kirillov
75bf5fdbfe FIR IDE: replace custom KtSymbolModality with compiler Modality 2021-03-29 12:22:20 +02:00
Tianyu Geng
253c389f4a FIR checker: fix failed test files after sync 2021-03-29 12:45:27 +03:00
Tianyu Geng
ae902e6fe5 FIR: fix source of callee reference in delegated constructor call
Previously the callee reference of a delegated constructor call is
always the same as the call itself. This violates the contract that no
two FIR elements can have identical sources.  In addition, this sets the
entire call expression as the source of the callee expression.

This change instead sets the proper constructor ref as the callee.

Also fixed EXPLICIT_DELEGATION_CALL_REQUIRED type. It should be an error
instead of a warning.
2021-03-29 12:45:27 +03:00
Tianyu Geng
fb14b03824 FIR checker: skip error named reference if receiver is unresolved
Currently, FIR reports errors caused by previous resolution failure. For
example with unresolved `a` and `b` in code `a.b`, both `a` and `b` are
highlighted. FE1.0 only highlights `a` since it's the root cause. This
change applies this heuristics when reporting FirDiagnostics.
2021-03-29 12:45:27 +03:00
Tianyu Geng
d6907222cd FIR: pass the qualified access source when reporting ErrorNamedReference
Currently if there is an error in a function call, FIR would report the
entire expression if this call is qualified, but *only* the name if it's
not qualified. For example, assume the following two calls are all
contains some errors.

```
a.foo(1,2,3)
^^^^^^^^^^^^
bar(1,2,3)
^^^
```

The entire call of `foo` is reported since it's qualified. But only the
reference `bar` is reported since it's not qualified. This limits the
usage of position strategies because the IDE does not allow position
strategies to go outside of the initially reported PSI element
(org.jetbrains.kotlin.idea.fir.highlighter.KotlinHighLevelDiagnosticHighlightingPass#addDiagnostic).

This change passes both the original error named reference and the
surrounding qualified access expression and defer the decision of which
to use to the reporting logic.

For unresolved reference and checks on `super` keyword, the position
strategy should not highlight the surrounding parentheses. Hence a new
position strategy `REFERENCED_NAME_BY_QUALIFIED` is added.

In addition, this change also has the following side effect

* some diagnostics are no longer reported when there is a syntax error
  since the higher level structure does not exist when there is a syntax
  error
2021-03-29 12:45:27 +03:00
Tianyu Geng
8805675539 FIR IDE: Enforce an order on subclasses of sealed class
Currently the order is non-determinstic, causing non-determinstic
behavior in the IDE diagnostics. This change enforces an alphabetic
order.
2021-03-29 12:45:27 +03:00
Tianyu Geng
c198c57e62 FIR checker: fix diagnostic parameter renderer
Some of the current renderer is fallbacking to `toString` and output the
fully qualified class name with hash code.
2021-03-29 12:45:27 +03:00
Tianyu Geng
f38c0cf348 FIR IDE: run FIR highlighting test on all test data
Similarly to FIR diagnostic tests. This commit enable all available test
data and check the reported error messages by FIR. This helps identify
some issues in formatting of FIR diagnostics.

The changes on the test file are mechanically generated. Failed tests
are disabled with `// IGNORE_FIR` and are re-enabled in the second
commit.
2021-03-29 12:45:27 +03:00
Dmitriy Novozhilov
6592407492 [Test] Fix jdk target for BB test 2021-03-29 12:42:54 +03:00
Dmitriy Novozhilov
051e2b0869 [FIR] Update diagnostic test forgotten in dd20dd98 2021-03-29 11:14:53 +03:00
Dmitriy Novozhilov
a9399535fb [FIR2IR] Change receiver of field of base class in derived class in property reference 2021-03-29 11:14:52 +03:00
Dmitriy Novozhilov
38ab37d7eb [FIR2IR] Properly handle callable references to static functions 2021-03-29 11:14:52 +03:00
Dmitriy Novozhilov
37db27da58 Add dependency on :compiler:visualizer to generate-all-tests module 2021-03-29 10:25:51 +03:00
Sergey Bogolepov
f1280a63d3 Remove -target-cpu flag from Mac targets
Because this option is unsupported in
bitcode embedding.
2021-03-29 12:17:12 +07:00
Mark Punzalan
dd20dd9806 Report WRONG_MODIFIER_TARGET on the modifier instead of the declaration
in ExternalFunChecker.

This allows RemoveModifierFix to provide a quickfix to remove it.
2021-03-27 22:27:36 +01:00
Nikolay Krasko
c680ee8525 Fix build of benchmarks module
Fix after 998a65d1cb
2021-03-27 17:33:25 +03:00
Tianyu Geng
0d9991ebcd FIR IDE: allow HLDiagnosticFixFactory creating any intention
It seems unnecessary to force all quickfixes to fit the `HLQuickfix`
API, especially for those existing trivial fixes that simply modifies
PSI tree. This change further loosen the API of `HLDiagnosticFixFactory`
to allow it to create arbitrary `IntentionAction` objects. This also
avoids code duplication (for example, specify the family name again in
`ReplaceCallFixFactories`).

`HLQuickfix` and the input/target paradighm can still be used where
applicable.
2021-03-27 13:44:41 +01:00
Tianyu Geng
5609645156 FIR IDE: tweak nullability of applyTo
It looks like `project` can never be null
2021-03-27 13:44:41 +01:00
Tianyu Geng
f795a9c4ff FIR IDE: remove type parameter DIAGNOSTIC_PSI
This information is already determined by `DIAGNOSTIC` so there is no
need to repeat it.
2021-03-27 13:44:41 +01:00
Tianyu Geng
6c52d95342 FIR IDE: remove type parameter TARGET_PSI and INPUT
The factory does not need to care about what target PSI and input a
quick fix should need. We only need to ensure these two types match when
an `HLQuickfix` is created. With this constraint loosened, now one
factory can register multiple quickfixes applied on different targets
and different input. This makes it much more flexible when implementing
quickfixes.
2021-03-27 13:44:41 +01:00
Nikolay Krasko
a5e445492f Move Bintray js-externals to Space (KTI-528) 2021-03-26 21:08:46 +03:00
Nikolay Krasko
b903f87704 Drop kotin/kotlinx and kotlin/kotlinx.html bintray usages (KTI-528) 2021-03-26 21:08:45 +03:00
Nikolay Krasko
998a65d1cb Bump version of kotlinx.benchmark plugin 0.2.0-dev-7 -> 0.3.0 (KTI-528) 2021-03-26 21:08:43 +03:00
Nikolay Krasko
455773299b Minor: investigate j2objc-annotations:1.1 verification trace 2021-03-26 21:08:41 +03:00
Alexander Udalov
c17b6c59f8 JVM IR: add isInlineClassType, use it instead of isInlined 2021-03-26 18:57:01 +01:00
Alexander Shabalin
770401801b Implement freezing in the new MM
Currently, it uses suboptimal storage for the freeze bit. This'll be revised later when we finalize stack objects handling in the new MM.
2021-03-26 15:00:14 +00:00
Mikhail Glukhikh
295858cf5c Rename FIR diagnostic to METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE 2021-03-26 17:06:00 +03:00
Mikhail Glukhikh
7d4b8587a3 Unite checks around supertypes in FirPrimaryConstructorSuperTypeChecker 2021-03-26 17:05:58 +03:00
Mikhail Glukhikh
221b6bd184 Drop usages of FirErrors.TYPE_PARAMETER_AS_SUPERTYPE 2021-03-26 17:05:57 +03:00
Aleksei.Cherepanov
c74f471a82 Fix performance problem in KotlinTargetsIndex creation
Creation of KotlinTargetsIndex takes too long,
even if Java project doesn't have any Kotlin files.
Remove function hasJsStdLib, as it takes too much time
because of recursively checking all dependencies (migrate to facets)
Also fix tests: Add Kotlin JS facet, where its needed

#KT-34351 Fixed
2021-03-26 15:46:56 +03:00
Jinseong Jeon
bfc7eb7bab FIR checker: fix REFERENCE_BY_QUALIFIED positioning strategy to consider callable reference 2021-03-26 15:19:10 +03:00
Jinseong Jeon
8d8ed4cc18 FIR checker: check if callable reference targets are allowed members 2021-03-26 15:19:10 +03:00
Tianyu Geng
6769ce0e2b FIR checker: check TOPLEVEL_TYPEALIASES_ONLY 2021-03-26 15:19:10 +03:00
Tianyu Geng
6ca005cd70 FIR IDE: fix IDE exception in presence of non-top-level type alias
Finding type alias doesn't work if it's not top level because the class
ID doesn't match. There doesn't seem to be a easy way to make it work
so this commit simply makes the IDE tolerate it.
2021-03-26 15:19:09 +03:00
Ivan Gavrilovic
19708cfa87 KAPT: Avoid evaluating apOptions from AGP too early
This is causing issues such as https://issuetracker.google.com/183423660.
Annotation processor options that are provided by the Android Gradle plugin
may contain references to files and file collections that are safe to
evaluate only at execution time. This change avoids eagerly creating
compiler plugin options for these options, as they are already a task input.

Test: AbstractKotlinAndroidGradleTests.testAgpNestedArgsNotEvaluatedDuringConfiguration

^KT-39715 In Progress
2021-03-26 15:14:35 +03:00
Ilya Kirillov
1123f97a15 FIR: ensure declaration is resolved to types in FirStandardOverrideChecker 2021-03-26 12:54:28 +01:00
Anton Yalyshev
f7829d0bea Add change-notes for 1.5-M2 release 2021-03-26 14:08:58 +03:00
sebastian.sellmair
e232a2be6c CommonizeLibcurlTest: Provide necessary native distribution dependencies 2021-03-26 10:55:25 +00:00
sebastian.sellmair
2b7866402d [Commonizer] Move KonanDistribution to :native:kotlin-klib-commonizer-api 2021-03-26 10:55:24 +00:00
sebastian.sellmair
6e3b1fd919 [Commonizer] RootMerger: Change priorities for typeResolver
This will prioritize classifiers from the following sources
in the provided order

1) Classifiers from the target's modulesProvider
2) Classifiers from the traget's direct dependencies
3) Classifiers from the more common dependencies
2021-03-26 10:55:24 +00:00
sebastian.sellmair
914ce22f6b [Minor] CommonizerIT: Optimize imports 2021-03-26 10:55:23 +00:00
sebastian.sellmair
a0557ad937 CommonizerIT: Implement test commonizeInterop using posix APIs
^KT-45497
2021-03-26 10:55:22 +00:00
sebastian.sellmair
7f9fe6b332 [Commonizer] CInteropCommonizerTask: Provide custom/commonized native distribution dependencies
^KT-45497 Fixed
2021-03-26 10:55:22 +00:00
sebastian.sellmair
e44877f562 [Commonizer] LibraryCommonizer: Allow passing dependencies for a shared target 2021-03-26 10:55:21 +00:00
sebastian.sellmair
096e715652 [Commonizer] Split CirTreeMerger into composable 'Mergers' 2021-03-26 10:55:21 +00:00
Ilya Chernikov
2f49e8e0af Fix parameter index on IR script generation in REPL scenario
Before it, the wrong index lead to the validation error when repl
script definition had c-tor parameters (see test)
2021-03-26 11:41:24 +01:00
Mikhail Glukhikh
648bf99842 FIR: temporarily drop parent manipulation code around super type entries 2021-03-26 13:05:42 +03:00
Jinseong Jeon
ff4d193891 FIR checker: utilize unsubstitutedScope creation 2021-03-26 13:05:41 +03:00
Jinseong Jeon
9934cfbb00 FIR2IR: minimize scope processing in fake override generation 2021-03-26 13:05:41 +03:00
Jinseong Jeon
c830aed946 FIR2IR: minimize scope processing in data class synthetic member generation 2021-03-26 13:05:41 +03:00
Ilya Matveev
22d6433cf6 [K/N][Gradle plugin] Do not propagate user.dir property to tools
In a Gradle process, the user.dir property is set to the directory
where the build was started. By default, if we start a child process
via project.javaexec, Gradle sets its working directory to the
directory of the current project. But passing Gradle's value of user.dir
to that process overrides this setting.

This makes tools started in a such way sensitive to directory the build
is started from.

This patch fixes this issue for K/N-related tools started
out-of-process by the MPP Gradle plugin. But this issue is still
relevant to in-process tool execution.
2021-03-26 12:38:28 +03:00
Ilya Matveev
e56ac775ca [K/N][tests] Do not propagate user.dir property to compiler/cinterop
In a Gradle process, the user.dir property is set to the directory
where the build was started. By default, if we start a child process
via project.javaexec, Gradle sets its working directory to the
directory of the current project. But passing Gradle's value of user.dir
to that process overrides this setting.

This makes tools started in a such way sensitive to directory the build
is started from. Thus a test using relative paths may fail if it is
started from a wrong directory.

This patch fixes this issue for Kotlin/Native tests.
2021-03-26 12:38:27 +03:00
Victor Petukhov
9c38db754e Add compiler flag to enable strict mode for improvements in the type enhancement
^KT-45674 Fixed
2021-03-26 11:04:01 +03:00
Victor Petukhov
731e3ebae1 Rename LV ImprovementsAroundTypeEnhancement into TypeEnhancementImprovementsInStrictMode 2021-03-26 11:03:49 +03:00
nataliya.valtman
df08ed2ac0 Recompile files which import companion constant
#KT-44741 Fixed
2021-03-26 10:27:52 +03:00
Ilya Kirillov
5485c372e8 FIR IDE: stop on fist exception in project perf tests 2021-03-25 20:53:53 +01:00
Ilya Kirillov
211ddd307c FIR IDE: highlight file before completion in perf test 2021-03-25 20:53:52 +01:00
Ilya Kirillov
49a4ec7f92 FIR IDE: add perf tests for completion 2021-03-25 20:53:51 +01:00
Ilya Kirillov
a4cf21adef Add perf the same project perf tests used for FIR for fe10 plugin 2021-03-25 20:53:50 +01:00
Roman Golyshev
a22a6b4338 FIR IDE: add basic project performance test 2021-03-25 20:53:49 +01:00
Ilya Kirillov
baad0d698f FIR IDE: do not create KtFunctionalType by type-aliased functional type 2021-03-25 20:53:29 +01:00
Nikolay Krasko
ddc12834cb Add dependency verification description to ReadMe.md 2021-03-25 21:53:27 +03:00
Vladimir Dolzhenko
51393d2d0f Fix compilation 2021-03-25 16:23:01 +01:00
Ilmir Usmanov
5e6f52009f JVM IR: IC coroutines: return boxed type from suspend function if
the function overrides function, returning type argument
 #KT-45451 Fixed
2021-03-25 16:21:55 +01:00
Simon Ogorodnik
0aca68e7c7 FIR: Add init time measurement to full pipeline 2021-03-25 18:05:51 +03:00
Pavel Punegov
991e5210ba Simplify further support for simulators by using target family 2021-03-25 13:06:13 +00:00
Pavel Punegov
5acd72d5a5 Update simulators: use fresh targets 2021-03-25 13:06:13 +00:00
Pavel Punegov
39b11f6ef0 Create simulator device in case it is missing on the host 2021-03-25 13:06:12 +00:00
sebastian.sellmair
ad7c8b7a07 KotlinToolingMetadata: Disable 'kotlin.mpp.enableKotlinToolingMetadataArtifact' by default 2021-03-25 15:16:08 +03:00
sebastian.sellmair
37aedba7ef KotlinToolingMetadata: Handle incompatible schemaVersions during json parsing 2021-03-25 15:16:07 +03:00
sebastian.sellmair
0406659ac8 BuildKotlinToolingMetadataTask: Strip _Decorated classes from target name 2021-03-25 15:16:06 +03:00
sebastian.sellmair
24ce6957a9 testProject/new-mpp-published: Replace jcenter with mavenCentral 2021-03-25 15:16:05 +03:00
sebastian.sellmair
0a732869e9 KotlinToolingMetadata: Add schemaVersion property 2021-03-25 15:16:04 +03:00
sebastian.sellmair
0119541462 KotlinToolingMetadata: Use Project property accessor for task 2021-03-25 15:16:03 +03:00
sebastian.sellmair
0a59301f8a KotlinToolingMetadata: Add stronger typing for target extras 2021-03-25 15:16:01 +03:00
sebastian.sellmair
896e77cd32 KotlinToolingMetadata.json: Add konanVersion and abiVersion as extras to KotlinNativeTarget 2021-03-25 15:16:00 +03:00
sebastian.sellmair
ac8b4c1b79 Implement kotlin-tooling-metadata.json artifact
- Introduce new :kotlin-tooling-metadata project
- Create new buildKotlinToolingMetadata task by default
- Add `kotlin-tooling-metadata.json` to root mpp publications
- Add kotlin.mpp.enableKotlinToolingMetadataArtifact flag to disable kotlin-tooling-metadata.json artifact

^KT-44584 Verification Pending
2021-03-25 15:15:58 +03:00
Vladimir Dolzhenko
88058ca2c8 Fix non-default constructors for service and extension class violation 2021-03-25 12:57:07 +01:00
Svyatoslav Scherbina
7b639235a2 Update Kotlin/Native: 1.5.20-dev-3553 2021-03-25 12:43:02 +03:00
Vladimir Dolzhenko
ae4dd80254 Regenerate missed test
Relates to #KT-45339
2021-03-25 10:19:24 +01:00
Ilya Chernikov
9ac6d30953 Fix arguments processing with scripting with old backend by default 2021-03-24 22:38:59 +01:00
Ilya Chernikov
bcd7bc5fd7 Fix arguments processing with scriting with old backend by default 2021-03-24 21:26:57 +01:00
Ilya Chernikov
c3ec94ff82 FIR: copied 2 more gradle incremental IT for FIR
temporary, we need a proper test infrastructure to run all gradle IT
with FIR
2021-03-24 21:24:20 +01:00
Ilya Chernikov
2d9c0e137f Add gradle ITs witn IC and FIR 2021-03-24 21:24:20 +01:00
Ilya Chernikov
a11f6d2e50 Add support for gradle option useFir and appropriate property...
`kotlin.useFir`
2021-03-24 21:24:20 +01:00
Ilya Chernikov
3400911d97 [minor] unmute fixed FIR tests 2021-03-24 21:24:20 +01:00
Ilya Chernikov
4a79f544f7 FIR: Mute IC test due to java tracking peculiarities
should be fixed after implementing proper java tracking for FIR
2021-03-24 21:24:20 +01:00
Ilya Chernikov
7e08820009 FIR: Mute IC tests with missing FIR diagnostics 2021-03-24 21:24:20 +01:00
Ilya Chernikov
14121a1d9a FIR: Disable java tracking in FIR IC
until it is properly implemented,
fixes some IC tests for now, making it less pecise
2021-03-24 21:24:19 +01:00
Ilya Chernikov
20fdad87ec FIR: support direct use of typealias with friend-paths
also fixes one IC test
2021-03-24 21:24:19 +01:00
Ilya Chernikov
ef2bb48706 FIR: fix fir-specific incremental compilation testdata 2021-03-24 21:24:19 +01:00
Ilya Chernikov
51a1cec08b FIR: Reimplement conflicts checker to detect conflicts in different files
also pass correct ScopeSession to checkers
fixes some IC tests
2021-03-24 21:24:19 +01:00
Ilya Chernikov
3e458a1efb FIR: Add IncrementalPackagePartsProvider usage in cli...
also refactor IncrementalPackagePartsProvider and parents to simplify
usage
2021-03-24 21:24:18 +01:00
Ilya Chernikov
f8d50d585d FIR: Implement lookup tracking 2021-03-24 21:24:18 +01:00
Ilya Chernikov
7d29ae7cce FIR: add incremental compilation tests 2021-03-24 21:24:18 +01:00
Ilya Chernikov
6cc39788fd FIR: Fix main fn mangling (without proper detection)
proper main function detector has to be implemented in addition
to that
2021-03-24 21:24:18 +01:00
Ilya Chernikov
88e7ba2a3b FIR: Report syntax errors in cli compilation 2021-03-24 21:24:18 +01:00
Ilya Chernikov
ed78183dbd FIR: use more specific cone error for unresolved user type ref
replaces diagnostic with <No name> with specific qualifier
2021-03-24 21:24:18 +01:00
Ivan Kylchik
77539fe2db Add visitExpressionBody method to IrCompileTimeChecker
This method is needed to explicitly indicate that IrExpressionBody can
be interpreted in any evaluation mode.
2021-03-24 21:24:17 +01:00
Ilya Chernikov
e0297cf207 [minor] implement automatic stdlib-jdkX jars handling in KotlinPaths
fixes some local testing scenarios
2021-03-24 21:24:17 +01:00
Ilya Chernikov
76b2ca2e96 [minor] FIR: add missing error message 2021-03-24 21:24:17 +01:00
Alexander Udalov
81a8566763 Fix verification-metadata.xml after updating r8 to 2.1.96 2021-03-24 20:16:16 +01:00
Mads Ager
41f5ac393a Update D8 used for dexing tests to version 2.1.96. 2021-03-24 20:16:15 +01:00
Yahor Berdnikau
48599e3768 Bump advance Gradle version in tests to '7.0-rc-1'.
- Add missing dependency on ':kotlin-serialization' required
 by some tests.
- Add additional location for libcurl on Linux machines.
2021-03-24 21:14:48 +03:00
Ilya Kirillov
6e31ff4fb1 Introduce CallableId.asSingleFqName and use it instead CallableId.asFqNameForDebugInfo 2021-03-24 18:13:21 +01:00
Ilya Kirillov
6f887896ff FIR IDE: use CallableId for KtCallableSymbol instead of FqName 2021-03-24 18:13:04 +01:00
Ilya Kirillov
f66a155683 FIR IDE: use common spelling for analyse functions family 2021-03-24 18:12:25 +01:00
Igor Chevdar
a618791ff0 [K/N][IR] Removed unnecessary hack
The hack has been rendered redundant due to the recent fixes in psi2ir
2021-03-24 20:42:40 +05:00
Igor Chevdar
246a907753 [FE][PSI2IR] Generalized SamType
Operations regarding <fun interface> are common for all backends
2021-03-24 20:42:40 +05:00
Tianyu Geng
56bec6997c FIR checker: report SUPERTYPE_NOT_INITIALIZED
Combined this and the checker of
SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR together.

Also fixed SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR incorrectly
repoted as warning instead of error.
2021-03-24 17:48:39 +03:00
Tianyu Geng
6134c00698 FIR: track KtSuperTypeCallEntry in FirDelegatedConstructorCall
In PSI world, a call to super type constructor is represented by a
KtSuperTypeCallEntry. Currently FIR tracks the callee reference to this
constructor call.

This is undesirable because

1. We may want to report issues on the call arguments, so FIR must track
   the entire call rather than just the callee reference

2. Light tree actually reports the KtSuperTypeCallEntry.

3. Both the FirDelegatedConstructorCall and its `calleeReference` are
   currently referencing the same KtConstructorCalleeExpression PSI
   element as the source.

This change makes FirDelegatedConstructorCall track the entire
KtSuperTypeCallEntry as the source, if possible.
2021-03-24 17:48:39 +03:00
Sergey Bogolepov
5243720043 Add support for android and wasm on macos_arm64 2021-03-24 17:37:51 +03:00
Sergey Bogolepov
3a008f6236 Cleanup ClangArgs.kt a little bit 2021-03-24 17:37:50 +03:00
Sergey Bogolepov
273b43d227 Simplify setting apple os version in ClangArgs
Use `osVersionMinFlagClang` from konan.properties
instead of manual setup in ClangArgs.
This simplification will make it easier to add support
for future targets.
2021-03-24 17:37:49 +03:00
Sergey Bogolepov
51d3d1f1a8 ClangArgs: Set stdlib for apple targets in a single place 2021-03-24 17:37:48 +03:00
Sergey Bogolepov
f339e9cc66 ClangArgs: Set arch for apple targets in a single place 2021-03-24 17:37:47 +03:00
Sergey Bogolepov
30863cd184 Support the rest of Linux targets on macos_arm64 2021-03-24 17:37:45 +03:00
Sergey Bogolepov
0e1276fc6c Support the rest of Apple targets on macos_arm64 2021-03-24 17:37:44 +03:00
Sergey Bogolepov
58e0cc1c7c Specify linker for macos_arm64-linux_x64 2021-03-24 17:37:42 +03:00
Sergey Bogolepov
579c1eb7db Remove libffi from target dependencies
Technically, it is a dependency of a compiler itself.
Thus, we can simplify konan.properties a little bit
by applying the same approach as we did for LLVM.
2021-03-24 17:37:40 +03:00
Tianyu Geng
e1c80ac75c FIR checker: introduce NO_(GET|SET)_METHOD
Besides introducing new diagnostics, this commit unifies source usages
for array accesses in PSI & LT.
2021-03-24 16:25:01 +03:00
pyos
651fd4ad9f FIR: load Java annotation defaults after binding the class symbol
as they can refer to the class itself.
2021-03-24 16:09:25 +03:00
Mikhail Glukhikh
449a79151a FirNotImplementedOverrideChecker: check also anonymous objects / enums 2021-03-24 16:07:30 +03:00
Mikhail Glukhikh
82b8cc333e FIR: introduce INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER 2021-03-24 16:07:28 +03:00
Mikhail Glukhikh
47d2a914bc FIR: add bad test data changes related to not implemented checker 2021-03-24 16:07:26 +03:00
Mikhail Glukhikh
9ce8420491 FIR: introduce not implemented checker 2021-03-24 16:07:25 +03:00
Mikhail Glukhikh
9ae41f5c07 FIR: store substitution for properties with implicit return type 2021-03-24 16:07:21 +03:00
Mikhail Glukhikh
4768700600 FIR error repro: property type mismatch in override from light classes 2021-03-24 16:07:20 +03:00
Mikhail Glukhikh
b6f1a442fb FIR checkers: use ScopeSession from resolve when possible 2021-03-24 16:07:19 +03:00
Mikhail Glukhikh
a26a195c35 Add FIR_IDENTICAL to some tests 2021-03-24 16:02:09 +03:00
Jinseong Jeon
c6298398ef FIR checker: rework VAL_REASSIGNMENT_VIA_BACKING_FIELD(_ERROR) 2021-03-24 16:02:08 +03:00
Victor Petukhov
4f1ed2f112 Don't generate tests on top-down completion of the builder inference for WASM 2021-03-24 15:57:48 +03:00
Victor Petukhov
178910a2e5 Proper taking top level trace to pass it into completion 2021-03-24 15:57:47 +03:00
Victor Petukhov
e0a8e9a664 Do updating calls for all nested builder inference sessions including at the same level 2021-03-24 15:57:47 +03:00
Victor Petukhov
999d1f982e Introduce hierarchy of inference sessions 2021-03-24 15:57:47 +03:00
Victor Petukhov
80ac62864d Don't lose inference session in all the possible locations 2021-03-24 15:57:47 +03:00
Victor Petukhov
b5d3f9ee31 Rename CoroutineInferenceSession to BuilderInferenceSession 2021-03-24 15:57:46 +03:00
Victor Petukhov
7a66e22bb2 Implement top-down completion for nested builder inference calls
^KT-42742 Fixed
2021-03-24 15:57:36 +03:00
Vladimir Dolzhenko
8068a5439f Fix handling non ctor elements in SECONDARY_CONSTRUCTOR_DELEGATION_CALL
#KT-45339 Fixed
2021-03-24 12:27:53 +00:00
Vladimir Dolzhenko
3d236b7171 Simplify reportOnElement
Relates to #KT-38959
2021-03-24 12:27:52 +00:00
Ilya Goncharov
b385650bf0 [Gradle, JS] Use patch only for webpack 5
^KT-45621 fixed
2021-03-24 15:17:12 +03:00
Ilya Goncharov
4107378d2c [Gradle, JS] Add workaround for debugging with webpack 5
^KT-45621 fixed
2021-03-24 15:17:11 +03:00
Ilya Goncharov
fef1892219 [Gradle, JS] Changed API for warnings filter in Webpack 5
^KT-45621 fixed
2021-03-24 15:17:10 +03:00
Ilya Goncharov
a113df8c43 [Gradle, JS] Use karma 6.0 API to set ping timeout
^KT-45621 fixed
2021-03-24 15:17:09 +03:00
Ilya Goncharov
f318951b64 [Gradle, JS] Fix packages with hardcoded display name
^KT-45621 fixed
2021-03-24 15:17:07 +03:00
Dmitriy Novozhilov
fae0aa42c4 [FIR] Update testdata broken in de03124f 2021-03-24 14:11:11 +03:00
Svyatoslav Scherbina
940774caaf Native: remove README.md from binary distributions
It is outdated, and the presumed contents are covered by other docs.
2021-03-24 10:56:35 +00:00
Ilya Muradyan
14d386223b [REPL] Fix unresolved imports caching
Before this fix, if some imports were not resolved during compilation,
this result had been saved in caches, and this import couldn't been
resolved during following compilations even if it was added to the
module dependencies. This commit adds special handling of resolution
caches for the REPL compiler.
2021-03-24 13:35:33 +03:00
Ilya Muradyan
ae5fefce51 [REPL] Fix performance problem
Configuration updating was done incorrectly,
and it led to performance degradation.
2021-03-24 13:35:33 +03:00
Dmitriy Novozhilov
e00e726bcb [FIR] Add test for KT-45584 2021-03-24 12:56:17 +03:00
Dmitriy Novozhilov
f4afc2ef44 [FIR] Map dispatch receiver type of function in JvmMappedScope 2021-03-24 12:56:16 +03:00
Dmitriy Novozhilov
b0969f626e [FIR] Rename SyntheticPropertySymbol to FirSyntheticPropertySymbol 2021-03-24 12:56:15 +03:00
Dmitriy Novozhilov
714871e4a5 [FIR2IR] Add proper toString to Fir2IrBindableSymbol 2021-03-24 12:56:15 +03:00
Dmitriy Novozhilov
7dc3be3b9b [FIR2IR] Replace star projections with upper bounds for SAM conversion types 2021-03-24 12:56:15 +03:00
Dmitriy Novozhilov
50f2666eba [IR] Properly render type arguments in error messages 2021-03-24 12:56:14 +03:00
Dmitriy Novozhilov
ee7c90791e Add workaround for KT-45553
This is needed to compile this code with FIR
2021-03-24 12:56:14 +03:00
Dmitriy Novozhilov
de03124f50 [FIR] Fix reporting EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR warning 2021-03-24 12:56:14 +03:00
Dmitriy Novozhilov
21b1d97b30 Add predefined run configuration for FIR tree generation 2021-03-24 12:56:13 +03:00
Dmitriy Novozhilov
3b6d3e5a08 [FIR] Don't record isFromVararg attribute to all properties from constructor 2021-03-24 12:56:13 +03:00
Dmitriy Novozhilov
094287741c [FIR] Add FirSourceElement.text extension for debug purposes 2021-03-24 12:56:13 +03:00
Dmitriy Dolovov
9aa16faa27 Test integer overflow on div/rem of Int.MIN_VALUE by -1
^KT-45136
2021-03-24 09:55:52 +03:00
Dmitriy Dolovov
dfd3b54ee4 Native: Handle integer overflow on div/rem of Int.MIN_VALUE by -1
^KT-45136
2021-03-24 09:55:46 +03:00
Vyacheslav Gerasimov
7fe0df2816 Build: Drop include/* project previously used in composite build 2021-03-23 22:52:40 +03:00
Dmitry Petrov
4f250ed498 JVM_IR KT-45377 rewrite constants again after AddContinuationLowering 2021-03-23 16:05:24 +03:00
Ilya Kirillov
0f2aca3280 FIR: use session symbolProvider from symbol for getting it's file 2021-03-23 13:41:03 +01:00
Yahor Berdnikau
d46ad6c0ad Fix kapt creates output directories on configuration phase.
Gradle will create such directories itself. Also it should fix build
cache issue with kapt tasks - build cache was disabled
 due to the 'overlapping outputs'.

 ^KT-45532 Fixed
2021-03-23 15:20:35 +03:00
Ilmir Usmanov
5abc45e6ff IC IDE: Add description of intention to add @JvmInline to value class
#KTIJ-5663
2021-03-23 12:13:05 +01:00
Ilmir Usmanov
823d2d0748 IC IDE: Add intention to add @JvmInline annotation to value class on JVM
#KTIJ-5663 Fixed
2021-03-23 12:13:03 +01:00
Alexander Udalov
ea01c97a8e Write underlying property name & type for inline class to metadata
This will be used in the compiler starting from 1.5.20 instead of the
currently used approach of looking for the single value parameter of the
primary constructor. The problem with the current approach is that
primary constructor can be private (since 1.4.30) and the property could
always be private. Relying on private declarations from metadata is
dangerous; for example lazy IR doesn't usually create stubs for private
declarations, and it didn't create stubs for private inline class
constructors before b5f9b1df, which led to the problem reported in
KT-44723.
2021-03-23 11:45:22 +01:00
Mark Punzalan
5baa2e0e7c FIR IDE: Simplify the diagnosticFixFactory() API by removing
HLApplicatorWithTargetAndInput and making HLQuickFix public.
2021-03-23 11:04:33 +01:00
Mark Punzalan
062adf21de FIR IDE: Use KtFirExpressionTypeProvider.getExpectedType() in
ReplaceCallFix.
2021-03-23 11:04:33 +01:00
Mark Punzalan
e9298d1d71 FIR IDE: Allow FIR-specific "after" files for
AbstractHighLevelQuickFixTest.
2021-03-23 11:04:33 +01:00
Mark Punzalan
14ca2d207d FIR IDE: Additional support for
KtFirExpressionTypeProvider.getExpectedType():

- Infix function parameter
- Variable assignment
- Property declaration
- Function expression body
2021-03-23 11:04:33 +01:00
Mark Punzalan
164d7d80b6 FIR IDE: Enable ReplaceCallFix for UNSAFE_CALL. 2021-03-23 11:04:33 +01:00
Mark Punzalan
3ebdfa3850 FIR IDE: Implement applicatorByQuickFix() to re-use quick fix actions
from idea-frontend-independent.
2021-03-23 11:04:33 +01:00
Mark Punzalan
1b649fa4cb FIR IDE: Generate quickfix tests related to ReplaceCallFix. 2021-03-23 11:04:33 +01:00
Mark Punzalan
05deecaafa FIR IDE: Move ReplaceCallFix to idea-frontend-independent. 2021-03-23 11:04:33 +01:00
Andrei Klunnyi
482c677274 KT-44299 [Sealed Interfaces]: when exhaustiveness in IDE considers java inheritor
^KT-44299 fixed
2021-03-23 10:55:20 +01:00
hungvietnguyen
7c4225b9d1 [Kapt] Ensure flag names and default values are consistent
Group flag names and default values in one place to make the code easier
to read and prevent mistakes and inconsistencies.
2021-03-23 10:41:28 +03:00
Igor Chevdar
752be27557 [K/N][tests] Disabled failing test for now 2021-03-23 11:57:56 +05:00
Svyatoslav Scherbina
818659f2bb Native: fix bug in KType support affecting only stdlib
Don't use IrClass.declarations to find enum entries during lowerings,
because this enum might already be lowered and thus have all entries
removed.
2021-03-23 09:45:40 +03:00
Ilmir Usmanov
886e3e6655 Update tests, which check -X... flag in LauncherScriptTest
Previously, -Xallow-result-return-type was used to test, whether the
launcher parses -X... flags correctly, however, it has no effect -
returning Result is allowed anyway. So, instead, use -Xno-inline and
check runtime behavior.
2021-03-22 23:14:23 +00:00
Vyacheslav Karpukhin
499ffd610a AndroidDependencyResolver: codestyle fixes after review 2021-03-22 22:29:12 +01:00
Vyacheslav Karpukhin
ac8d135a21 AndroidDependencyResolver:
1. Correctly process project dependencies
2. Don't include variant-specific dependencies into more generic sourcesets
2021-03-22 22:29:12 +01:00
Vyacheslav Karpukhin
3ce00f6eb4 AndroidDependencyResolver: when operating without Android IDE plugin, don't duplicate dependencies for Android sourcesets 2021-03-22 22:29:12 +01:00
Alexander Udalov
b5f9b1dfc0 JVM IR: support inline classes with private constructors from other modules
#KT-44723 Fixed
2021-03-22 21:57:07 +01:00
Alexander Udalov
dac218dc39 Minor, regroup compileKotlinAgainstKotlin tests on inline classes 2021-03-22 21:57:04 +01:00
Ilmir Usmanov
3124a4ddae Minor. Update test data 2021-03-22 17:35:08 +01:00
Mads Ager
571971c5db JVM: Fix local variable ranges in state machine transform.
When a suspension point is inlined, the inlining local spans
unspilling code where the local slot has not been initialized.

The transformer already inserted initialization code for the local,
however, it did not split the local variable table. Therefore,
the inlining local is defined on instructions where the local
slot has no value (namely the instructions that initialize
the local slot on the unspilling path).

This change adds splitting of the local variable table as well.
When updating to a new version of D8, the uninitialized local
slot showed up. D8 will repair it in this case, but it is
better to not generate such code.
2021-03-22 17:35:06 +01:00
Aleksei.Cherepanov
911c24d594 Additional trust artifacts for JPS build 2021-03-22 19:08:36 +03:00
Svyatoslav Scherbina
0730833135 Remove kotlin-native/common/src/hash
It is no longer used.
2021-03-22 16:03:31 +00:00
Svyatoslav Scherbina
ce239ccc3e Native runtime: remove unused dependency on common/src/hash
No longer required after c8633d8bda.
2021-03-22 16:03:30 +00:00
Svyatoslav Scherbina
2a7ccb11e8 Native compiler: remove unused dependency on common/src/hash 2021-03-22 16:03:29 +00:00
Svyatoslav Scherbina
a471bbc185 Native compiler: remove unused hashing code
It was used to compute hashes for class names, but this is no longer
required after c6ac807034.
2021-03-22 16:03:28 +00:00
Svyatoslav Scherbina
39d748dbbb Native compiler: replace C++ CityHash64 impl by Kotlin one 2021-03-22 16:03:28 +00:00
Ilya Kirillov
32be3cc703 FIR IDE: do not require read action to collect diagnostics 2021-03-22 16:18:24 +01:00
Ilya Kirillov
58a5f4f90b FIR IDE: do not fail on building anonymous function symbol 2021-03-22 16:15:33 +01:00
Ilmir Usmanov
b838ba8c62 Check whether backend is IR instead of distinct ones 2021-03-22 15:08:59 +00:00
Ilmir Usmanov
9c97f1ce35 Allow Result return type and nullability operators on Result type
by default
2021-03-22 14:56:16 +00:00
Yahor Berdnikau
6473d2a7c8 Bump advanced Gradle version to 7.0-milestone-3.
Fixed test setup that causes test failures.

^KT-44949 In Progress
2021-03-22 17:02:27 +03:00
Ilya Kirillov
c38a793352 FIR IDE: replace custom KtSymbolVisibility with compiler common Visibility 2021-03-22 14:02:20 +01:00
Ilya Kirillov
3154234107 FIR IDE: do not run STATUS phase under lock 2021-03-22 14:02:20 +01:00
Ivan Gavrilovic
093c8bfbb6 Register KAPT incremental apt cache as local state
This is so that incremental caches are removed on
non-incremental task run.
2021-03-22 15:59:20 +03:00
Br0mm
75e4c74256 [FIR] Add FirConstValWithGetterOrDelegateChecker 2021-03-22 15:05:40 +03:00
Ilya Kirillov
93f711e2b8 FIR: extract initializing of containingClassAttr into fun 2021-03-22 12:30:59 +01:00
Ilya Kirillov
9f0af3faba FIR: fix containigClassAttr for property accessor without body in light tree builder 2021-03-22 12:30:58 +01:00
Ilya Kirillov
801d4a0c77 FIR: initialize containingClassAttr in light tree builder to match RawFirBuilder 2021-03-22 12:30:58 +01:00
Ilya Kirillov
dcf64779a9 FIR: add declaration attributes checking to rawFirBuilder/lightTree tests 2021-03-22 12:30:58 +01:00
Ilmir Usmanov
3bcc2fe476 Minor. Add IDE MPP test 2021-03-22 11:13:14 +00:00
Ilmir Usmanov
164e9034d1 IC MPP: Allow expect value classes without @JvmInline
#KT-45525 Fixed
2021-03-22 11:13:13 +00:00
Sergey Bogolepov
8ba4f060f0 Enable linuxX64 target on macOsArm64 host
Because tests for Gradle plugin assumes that linuxX64
is available on all hosts.
2021-03-22 14:02:43 +03:00
Sergey Bogolepov
7e18b69e7d Add initial support for macos_arm64 host 2021-03-22 14:02:41 +03:00
Sergey Bogolepov
4222fb9629 Remove unused filterGradleNativeSoftwareFlags method 2021-03-22 14:02:40 +03:00
Sergey Bogolepov
ec23ebd1c5 Fix workerAutoreleasePool test on macos_arm64 using __autoreleasing
Also merge `createAutorelease` and `create. There is no need in
such separation since it was originally added to prevent
optimization `result`'s lifetime.
Turned out, it was still happening on Apple Silicon,
and only addition of __autoreleasing attribute solves the problem.
2021-03-22 14:02:39 +03:00
Ilya Kirillov
4826e3278f FIR IDE: get rid of constructor value parameter symbols 2021-03-22 11:27:31 +01:00
Ilya Kirillov
7b482bf70a FIR IDE: merge symbol building tests and symbol restoring tests 2021-03-22 11:27:30 +01:00
Ilya Kirillov
1d63dccfae FIR IDE: fix symbol pointer creation for non direct member symbols 2021-03-22 11:27:29 +01:00
Ilya Kirillov
a7b0c6c821 FIR IDE: fix symbol pointer creation for KtAnonymousObjectSymbol 2021-03-22 11:27:28 +01:00
Ilya Kirillov
0bb37db4bf FIR IDE: introduce AbstractSymbolByReferencePointerRestoreTest 2021-03-22 11:27:27 +01:00
Ilya Kirillov
846dc1b9b9 FIR IDE: add more info to require calls KtSymbolByFirBuilder 2021-03-22 11:27:26 +01:00
Ilya Kirillov
ae6eeb2501 FIR IDE: introduce KtBackingFieldSymbol 2021-03-22 11:27:25 +01:00
Ilya Kirillov
443a14756f FIR IDE: change KtPropertySymbol inheritors cratePointer to return specific symbols 2021-03-22 11:27:25 +01:00
Ilya Kirillov
ceed3e7355 FIR IDE: separate KtSymbolByFirBuilder.buildVariableSymbol into functions 2021-03-22 11:27:24 +01:00
Ilya Kirillov
010f1cb634 FIR IDE: build KtJavaFieldSymbol only for Java fields 2021-03-22 11:27:22 +01:00
Ilya Kirillov
8bf339a7cf FIR IDE: refactor, extract throwing unexpected element error into function 2021-03-22 11:27:20 +01:00
Ilya Kirillov
502087a3c7 FIR IDE: extract KtType building from KtSymbolByFirBuilder 2021-03-22 11:27:19 +01:00
Ilya Kirillov
b6d334b303 FIR IDE: extract callable symbol building from KtSymbolByFirBuilder 2021-03-22 11:27:19 +01:00
Ilya Kirillov
c06bcbad39 FIR IDE: extract variable-like symbol building from KtSymbolByFirBuilder 2021-03-22 11:27:18 +01:00
Ilya Kirillov
bafc61b56f FIR IDE: extract function-like symbol building from KtSymbolByFirBuilder 2021-03-22 11:27:17 +01:00
Ilya Kirillov
db64884bd0 FIR IDE: refactor callable symbol building in KtSymbolByFirBuilder 2021-03-22 11:27:16 +01:00
Ilya Kirillov
439e54aee6 FIR IDE: extract class-like symbol building to separate class 2021-03-22 11:27:15 +01:00
Ilya Kirillov
cf30be5957 FIR IDE: make KtAnonymousObject symbol to extend KtClassObjectSymbol 2021-03-22 11:27:14 +01:00
Ilya Kirillov
08433b9ac9 FIR IDE: fix constructor symbol building for type alias constructors 2021-03-22 11:27:13 +01:00
Ilya Kirillov
4d5da26696 FIR IDE: get rid of KtFirSetterParameterSymbol 2021-03-22 11:27:12 +01:00
Ilya Kirillov
5e14aa34ec FIR IDE: add more info to CCE in symbol builder 2021-03-22 11:27:12 +01:00
scaventz
0dc5ed53f8 Provide sensible toString for getter/setter in reflection. 2021-03-22 11:21:54 +01:00
Svyatoslav Scherbina
8b3ff11a2b Provide CName annotation in common stdlib as optional 2021-03-22 09:20:05 +00:00
Svyatoslav Scherbina
552bd108a9 stdlib: rename NativeAnnotationsH.kt -> NativeConcurrentAnnotations.kt
Also move it from libraries/stdlib/common/src/kotlin
to libraries/stdlib/src/kotlin/annotations
2021-03-22 09:20:05 +00:00
Igor Yakovlev
25929b50d9 [FIR IDE] RawFirBuilder for lazy bodies 2021-03-21 10:42:29 +01:00
Nikolay Krasko
1558bd7373 Trust all module metadata till Gradle 6.8 update (KTI-493)
There's and issue with absent module files in the cache that leads to
"Artifact has been deleted from dependency cache" that can be resolved
by cleaning caches. It should be fixed in Gradle 6.8

https://github.com/gradle/gradle/issues/12713
2021-03-21 00:05:54 +03:00
Nikolay Krasko
73bc16896d Trust all poms till Gradle 6.8 update (KTI-493)
There's and issue with absent poms in the cache that leads to
"Artifact has been deleted from dependency cache" that can be resolved
by cleaning caches. It should be fixed in Gradle 6.8

https://github.com/gradle/gradle/issues/12713
2021-03-21 00:05:54 +03:00
Nikolay Krasko
efcb071f24 Trust javadoc and sources artifacts as the shouldn't be used in builds (KTI-493) 2021-03-21 00:05:53 +03:00
Nikolay Krasko
fd921f1dc0 Trust kotlin-native-prebuild-* (KTI-493)
Need more investigation for this artifact
2021-03-21 00:05:53 +03:00
Nikolay Krasko
fae1215881 Trust kotlin artifacts for bootstrapping (KTI-493)
Can't predict exact version after build
2021-03-21 00:05:53 +03:00
Nikolay Krasko
4bbba74360 Trust ivy xml files as they are constantly regenerated (KTI-493) 2021-03-21 00:05:52 +03:00
Nikolay Krasko
8240f5e459 Add dependencies lock with md5 and sha256 (KTI-493)
Initial commit without explicit check or cleanup.

Includes Kotlin Native dependencies.
2021-03-21 00:05:52 +03:00
Keegan Witt
a1ceaa9e44 Change pronoun in execption from "his" to "its" 2021-03-19 23:36:53 +01:00
Ilya Goncharov
f85ad41674 [IR] Check pureness in inlining lowering after transformation 2021-03-19 21:52:51 +03:00
Ilya Goncharov
8ac8dbdab8 [JS IR] Type operator call pureness 2021-03-19 21:52:51 +03:00
Ilya Goncharov
47d050c420 [JS IR] Correct pureness of expressions for arrayLiteral 2021-03-19 21:52:50 +03:00
Ilya Goncharov
f890156dde [JS IR] arrayConcat not use additional slice 2021-03-19 21:52:50 +03:00
Ilya Goncharov
76005813ff [JS IR] Fix for pureness of vararg 2021-03-19 21:52:50 +03:00
Ilya Goncharov
278a8c27fc [JS IR] Not create temporary variable for pure expressions on inline 2021-03-19 21:52:50 +03:00
Ilya Goncharov
ece0e200d5 [JS IR] Not nullize external varargs if it is not on the end of call 2021-03-19 21:52:50 +03:00
Ilya Goncharov
b8d5712bc0 [JS IR] Not use double slice for external varargs 2021-03-19 21:52:50 +03:00
Ilya Goncharov
120b5b9e05 [JS IR] Move isPure check to backend.common and add platform-specific check on calls with side effects 2021-03-19 21:52:50 +03:00
Ilya Goncharov
7bbb5b77db [JS IR] Concat varargs with non varargs on compile time for function w/o receiver 2021-03-19 21:52:50 +03:00
Ilya Goncharov
fc559ab0cd [JS IR] Unite varargs and non varargs before vararg 2021-03-19 21:52:49 +03:00
Dmitry Petrov
9e30ddd12e JVM_IR KT-45581 generate H_INVOKEINTERFACE for interface method handles 2021-03-19 18:57:21 +03:00
Dmitry Petrov
73d4fa65ea JVM_IR KT-45431 don't optimize out $$delegatedProperties in companion
Corresponding delegates are initialized in the host class, using
'$$delegatedProperties'.
TODO figure out proper code generation scheme for delegated properties
in companions (KT-45580)
2021-03-19 18:54:01 +03:00
Dmitry Petrov
f6baabd98e JVM_IR KT-45408 rewrite static calls recursively 2021-03-19 18:53:59 +03:00
Alexander Udalov
e5f218859b JVM IR: minor, improve error messages for inline classes
It will help in diagnosing problems like KT-44723.
2021-03-19 16:33:42 +01:00
Ivan Kylchik
65fcd72ce1 [VISUALIZER] Add handler for dot qualified expression in fir
For some reason source element of such expression in fir
was changed, so to get FirFunctionCall we should seek it
in KtDotQualifiedExpression
2021-03-19 18:30:35 +03:00
Ivan Kylchik
0160174c7a Extract VisualizerDirectives to separate file 2021-03-19 18:30:34 +03:00
Ivan Kylchik
de351d8bd3 Extract output handlers in visualiser's tests to separate files 2021-03-19 18:30:33 +03:00
Ivan Kylchik
6a439ad186 Add Test postfix to Abstract(Psi|Fir)Visualizer classes 2021-03-19 18:30:31 +03:00
Ivan Kylchik
5efa00821d Replace junit dependencies with single testApiJUnit5 call 2021-03-19 18:30:30 +03:00
Ivan Kylchik
6f639a39a7 Remove unnecessary dependencies on visualizer module 2021-03-19 18:30:28 +03:00
Ivan Kylchik
13ef126d4c [VISUALIZER] Remove ignore directive from correct test files 2021-03-19 18:30:27 +03:00
Ivan Kylchik
59416f447e [VISUALIZER] Change rendering of equals call 2021-03-19 18:30:26 +03:00
Ivan Kylchik
dd8a7010f0 [VISUALIZER] Forbid to render unary minus for integer literals 2021-03-19 18:30:25 +03:00
Ivan Kylchik
685f599c82 [VISUALIZER] Allow to render all calls at unary expresion in fir 2021-03-19 18:30:23 +03:00
Ivan Kylchik
84d4a0609f [VISUALIZER] Fix typealias rendering in fir 2021-03-19 18:30:22 +03:00
Ivan Kylchik
c94a4e7baf [VISUALIZER] Fix class literals rendering 2021-03-19 18:30:21 +03:00
Ivan Kylchik
fb654ce09b [VISUALIZER] Fix extension types rendering in fir 2021-03-19 18:30:20 +03:00
Ivan Kylchik
9e5645777d [VISUALIZER] Add annotation text for backing field in fir 2021-03-19 18:30:19 +03:00
Ivan Kylchik
813e48ffb4 [VISUALIZER] Replace rendering of class with no name to anonymous 2021-03-19 18:30:18 +03:00
Ivan Kylchik
ca424a94ef [VISUALIZER] Add local path to local declarations in fir 2021-03-19 18:30:16 +03:00
Ivan Kylchik
607c7b3e82 [VISUALIZER] Add implicit receiver rendering in fir 2021-03-19 18:30:15 +03:00
Ivan Kylchik
0ca0304865 [VISUALIZER] Fix render of null constant in fir 2021-03-19 18:30:14 +03:00
Ivan Kylchik
a497a2fa9b [VISUALIZER] Forbid to render type of single underscore variable 2021-03-19 18:30:13 +03:00
Ivan Kylchik
48ee4791b6 [VISUALIZER] Fix rendering of enum class and enum entry in fir 2021-03-19 18:30:12 +03:00
Ivan Kylchik
e2a7da25b0 [VISUALIZER] Rewrite fir symbol's rendering 2021-03-19 18:30:10 +03:00
Ivan Kylchik
4259ad2d84 [VISUALIZER] Change result of psi render according to new test data 2021-03-19 18:30:09 +03:00
Ivan Kylchik
3e66d12bef [FIR] Change some raw-fir test files to make them correct
"correct" means that these files can be compiled. This change is
necessary for visualizer. Don't want to ignore these test files,
so they must not produce errors.
2021-03-19 18:30:08 +03:00
Ivan Kylchik
951d607445 [VISUALIZER] Forbid to walk inside type reference children in psi 2021-03-19 18:30:07 +03:00
Ivan Kylchik
cc7d82ab7b [VISUALIZER] Change rendering of equality operator 2021-03-19 18:30:06 +03:00
Ivan Kylchik
c678ad9eb9 [VISUALIZER] Fix superTypes test 2021-03-19 18:30:05 +03:00
Ivan Kylchik
05efb8c129 [VISUALIZER] Add possibility to render callable reference in fir part 2021-03-19 18:30:04 +03:00
Ivan Kylchik
ce844a9bba [VISUALIZER] Disable rendering of value arguments in psi part
For now instead of arguments will be rendered parameters
2021-03-19 18:30:03 +03:00
Ivan Kylchik
f2cf86a3ae [VISUALIZER] Fix package rendering 2021-03-19 18:30:02 +03:00
Ivan Kylchik
c4be67b518 [VISUALIZER] Change rendering of constructors in fir part 2021-03-19 18:30:01 +03:00
Ivan Kylchik
945cc36ce3 [VISUALIZER] Add annotation at Array.set method 2021-03-19 18:30:00 +03:00
Ivan Kylchik
ca1b20c7f4 [VISUALIZER] Add some tests to ignore list 2021-03-19 18:29:58 +03:00
Ivan Kylchik
919591909e Update test data for compiler visualizer 2021-03-19 18:29:56 +03:00
Ivan Kylchik
4ac38e5f29 Rewrite compiler visualizer tests using new test infrastructure 2021-03-19 18:29:55 +03:00
Roman Golyshev
4c0cab4756 FIR IDE: Always insert additional spaces into lambda brackets
The customization of this with
`INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD` will be supported later
2021-03-19 17:44:15 +03:00
Alexander Udalov
415d52fe54 Deprecate KotlinJvmOptions.useIR
Starting from language version 1.5, JVM IR is enabled by default, so
this option has no effect. To rollback to the old JVM backend, the new
option useOldBackend can be used.

 #KT-45504 Fixed
2021-03-19 14:57:55 +01:00
Alexander Udalov
a10ebcea51 Minor, add -Xopt-in=kotlin.RequiresOptIn to kotlin-test-js
To prevent compilation warning on usages of OptIn in new
assertContentEquals functions.
2021-03-19 14:56:37 +01:00
Alexander Udalov
b33d245dfb Do not print stdlib version substitution message if nothing changed 2021-03-19 14:56:14 +01:00
Alexander Udalov
ec3799a696 Do not print total bytes written in :core:builtins:serialize
To reduce the amount of output on a clean build. Will have effect after
the next bootstrap update.
2021-03-19 14:56:14 +01:00
Anastasiya Shadrina
94c4d1c23e Specify when the range is empty in KDoc 2021-03-19 20:40:06 +07:00
Victor Petukhov
60f2f85be7 Process captured types with type variable inside properly, in the operations related with the type variables fixation 2021-03-19 16:16:11 +03:00
Victor Petukhov
a2b1aa753b Substitute captured types with type variables properly
^KT-44687 Fixed
2021-03-19 16:16:09 +03:00
Sergey Bogolepov
d276d583ba Keep host_os and host_arch methods for backward-compatibility
Because it is still used by IDE plugin
2021-03-19 15:24:45 +03:00
Sergey Bogolepov
af3ff6c4d6 Revert "Revert "Remove unused protobuf from backend.native""
This reverts commit c4182c82
2021-03-19 15:24:44 +03:00
Sergey Bogolepov
bba82c0d60 Revert "Revert "Remove obsolete bc.frontend module""
This reverts commit e7a385f9
2021-03-19 15:24:43 +03:00
Sergey Bogolepov
30e9c645f8 Revert "Revert "Cleanup TargetManager.kt a little bit""
This reverts commit 3dd25e49
2021-03-19 15:24:42 +03:00
Sergey Bogolepov
1d8d76eb7f Revert "Revert "Cleanup HostManager.kt a little bit""
This reverts commit 98b2c000
2021-03-19 15:24:41 +03:00
Roman Golyshev
184838ae35 FIR IDE: Fix import of properties; also fix bug in alreadyHasImport 2021-03-19 12:37:43 +03:00
Roman Golyshev
054d6ccdfb FIR IDE: Refactor KotlinFirLookupElementFactory 2021-03-19 12:37:43 +03:00
Roman Golyshev
9db8bd8d38 FIR IDE: Refactor variables insertion handlers 2021-03-19 12:37:43 +03:00
Roman Golyshev
84386237a6 FIR IDE: Refactor classifiers insertion handlers 2021-03-19 12:37:42 +03:00
Roman Golyshev
fe921b98ce FIR IDE: Refactor functions insertion handler 2021-03-19 12:37:42 +03:00
Roman Golyshev
43b829b1f0 Fix test data
We do not need to check the imports order in this particular test
2021-03-19 12:37:42 +03:00
Roman Golyshev
7b7ba717d0 FIR IDE: Add more correct importing of the callables
Now we use scopes to decide if the callable really needs to be inserted
2021-03-19 12:37:42 +03:00
Roman Golyshev
76ff106458 FIR: Add collecting top-level scopes of the file
It will be useful in the completion when we need to dicide if we
need to import FQN or not
2021-03-19 12:37:42 +03:00
Roman Golyshev
3427e0aebb FIR IDE: Add extensions function completion from indices
The insertion handling test is not correct, we need to check file
imports before adding new ones
2021-03-19 12:37:41 +03:00
Roman Golyshev
8396e17c52 Improve test data (to avoid clash with stdlib) 2021-03-19 12:37:41 +03:00
Roman Golyshev
83a9b4fb87 FIR IDE: Only insert FqNames for non-extension non-members properties
This is not completely correct, will be fixed later
2021-03-19 12:37:41 +03:00
Roman Golyshev
bf52417268 Add test for synthetic java property completion to multi-file tests 2021-03-19 12:37:41 +03:00
Roman Golyshev
d955f8e0d3 FIR IDE: Add simple shortening completion handler for properties 2021-03-19 12:37:41 +03:00
Roman Golyshev
8392b36964 FIR IDE: Add more accurate shortening for properties 2021-03-19 12:37:41 +03:00
Roman Golyshev
03a1c6fcca Add multi-file completion handler tests for FIR code completion
This is a temporary (and dirty) solution to start using those tests as
fast as possible. We certainly need to refactor them so they can be
generated from the testData
2021-03-19 12:37:40 +03:00
Roman Golyshev
73e623b5ac Generate multi-file completion tests for FIR completion
Also remove `MultiFilePrimitiveJvmBasicCompletionTestGenerated` tests
2021-03-19 12:37:40 +03:00
Roman Golyshev
abeff5d5c5 Enable passing tests 2021-03-19 12:37:40 +03:00
Roman Golyshev
d6d3d3a6ad FIR IDE: Add completion for top level functions and properties 2021-03-19 12:37:40 +03:00
Roman Golyshev
62389bad0b FIR IDE: Add more useful Lookup Objects
Main purpose of those lookup objects for now is to allow same lookup
elements to merge
2021-03-19 12:37:40 +03:00
Roman Golyshev
ab191925cb FIR IDE: Update test data for completion handlers test 2021-03-19 12:37:39 +03:00
Roman Golyshev
9896512eda FIR IDE: Collect scopes information in reanalyze
It is needed for the completion, so after the changes in method bodies
all contexts are correctly collected
2021-03-19 12:37:39 +03:00
Roman Golyshev
f641466f70 FIR IDE: Fix searching for the closest function to re-resolve
If the function is local, there would be errors related to its
unresolved body and receiver type
2021-03-19 12:37:39 +03:00
Roman Golyshev
1d64c0789f FIR IDE: Add implementation of classifiers completion from indices 2021-03-19 12:37:38 +03:00
Alexander Shabalin
5b1c30c198 Extract initializing singleton marker
* Extract kInitializingSingleton marker
* Extract isNullOrMarker helper function
2021-03-19 08:19:10 +00:00
Vasily Levchenko
b3ae30fdea [llvm][context util] make error more readable 2021-03-19 08:04:00 +00:00
Sergey Bogolepov
e320f7efc3 Add libffi buildscript for Apple Silicon 2021-03-19 07:21:39 +00:00
Svyatoslav Scherbina
a9d0409f2e Don't use Function.reflect() in kotlin-native/Interop on JVM
Use inline functions and typeOf<T>() instead
2021-03-19 06:53:09 +00:00
Alexander Likhachev
008e2636b7 [Gradle] Prevent early capturing of project build dir in KotlinCompile
#KT-45301 Fixed
2021-03-18 19:51:08 +00:00
Ilya Gorbunov
42648d55a0 kotlin-test: make assertIs<T> returning value cast to T KT-45296 2021-03-18 21:57:16 +03:00
Ilya Goncharov
2fd8620551 [Gradle, JS] Support custom display name in npm versions generator
^KT-42921 fixed
2021-03-18 21:32:15 +03:00
Ilya Goncharov
a291895ebe [Gradle, JS] Add compatibility with webpack 4
^KT-42921 fixed
2021-03-18 21:32:14 +03:00
Ilya Goncharov
a1a01a1428 [Gradle, JS] Use compatible node version
^KT-42921 fixed
2021-03-18 21:32:12 +03:00
Ilya Goncharov
b2a2616c10 [Gradle, JS] Fix of using format-util
^KT-42921 fixed
2021-03-18 21:32:11 +03:00
Ilya Goncharov
965426bbd9 [Gradle, JS] Webpack serve for webpack-dev-server
^KT-42921 fixed
2021-03-18 21:32:10 +03:00
Ilya Goncharov
5827ed3f05 [Gradle, JS] Update versions with karma-webpack 5.0.0
^KT-42921 fixed
2021-03-18 21:32:08 +03:00
Ilya Goncharov
1b8c74337e [Gradle, JS] Adopt Gradle plugin to webpack 5
^KT-42921 fixed
2021-03-18 21:32:07 +03:00
Ilya Goncharov
a06feaf819 Add possibility to hardcode version
^KT-42921 fixed
2021-03-18 21:32:05 +03:00
Ilya Goncharov
88abb3d6c9 [JS IR] Fix creating of classes extended from nested one
[JS IR] Extract getClassRef method

 ^KT-44950 fixed
2021-03-18 21:14:00 +03:00
Ilya Goncharov
a61312120b [Gradle, JS] WA for tests with multiple binaries 2021-03-18 20:07:48 +03:00
Ilya Goncharov
8ffe70cb4d [Gradle, JS] Use one folder for sync tasks 2021-03-18 20:07:47 +03:00
Dmitry Petrov
17da240910 JVM_IR KT-45195 generate non-static annotation members as ACC_ABSTRACT 2021-03-18 19:41:24 +03:00
Dmitry Petrov
2fd69a5718 Add bytecode listing tests for 'allopen' plugin with JVM_IR 2021-03-18 19:41:23 +03:00
Victor Turansky
e4d98d4e39 Gradle 7.0 support. com.gradle.plugin-publish 0.12.0 -> 0.13.0
[With Gradle 7+ support](https://plugins.gradle.org/plugin/com.gradle.plugin-publish/0.13.0)
2021-03-18 19:11:26 +03:00
Steven Schäfer
d0424465b8 JVM IR: Resolve fake overrides when calculating return types (KT-44867) 2021-03-18 16:02:35 +01:00
Pavel Punegov
cae95b1ba0 [native] Fix kotlin.native.home properties order. 2021-03-18 14:41:03 +00:00
Roman Artemev
44d03bc727 [Psi2Ir] Fix generation of property references for synthetic java props
- Declare it on use-site
 - Fix export checker for that case
 - Fix KT-45297
2021-03-18 16:50:31 +03:00
Roman Artemev
9632839253 [JVM IR] Add jvm box test for KT-45297 2021-03-18 16:50:27 +03:00
Roman Artemev
0a4f2bc39c [IR] Add irText test for KT-45297 2021-03-18 16:50:22 +03:00
Mikhail Zarechenskiy
78a0d7b5bb Disable check about unimplemented check for real defaults
Now we can generate proper defaults and there is no need in additional
 checks about unimplemented methods

 #KT-41130 Fixed
2021-03-18 16:38:55 +03:00
Mikhail Zarechenskiy
641f08d561 Use compiler arguments for Java against Kotlin highlighting tests
This is needed for the next commit to check jvm-default options

 #KT-41130 In Progress
2021-03-18 16:38:54 +03:00
Mikhail Zarechenskiy
111e54c8c1 Do not generate DefaultImpls for light classes if not needed
#KT-41130 In Progress
2021-03-18 16:38:52 +03:00
Dmitry Petrov
ac6232b4ba JVM_IR KT-36853 patch parents after tailrecPhase 2021-03-18 15:19:24 +03:00
Dmitriy Novozhilov
34f8c7a68b [TEST] Add ability to register compiler extensions in EnvironmentConfigurator 2021-03-18 14:00:38 +03:00
Ivan Gavrilovic
875ef73371 KT-45519: Get AGP version only once per classloader
Memoize AGP version per classloader, instead of computing
it once per project.

Fixes #KT-45519
2021-03-18 12:08:04 +03:00
Dmitriy Novozhilov
fc2d294b6c [FIR] Fix tower priorities for invoke resolve
#KT-45316 Fixed
2021-03-18 10:24:57 +03:00
Sergey Shanshin
cfca7183e5 Add inspections and quickfixes of redundant Json format instantiation
Resolves KT-45075
2021-03-18 05:44:03 +03:00
Alexander Udalov
27174de891 Add JVM target bytecode version 16
#KT-45515 Fixed
2021-03-17 21:31:08 +01:00
Andrei Klunnyi
09f9489619 [FIR]: sealed hierarchy processor for IDE
From now on sealed declarations get resolved with the help of
FirIdeSealedHierarchyProcessor. This change entails correct IDE side
check for sealed when exhaustiveness.
2021-03-17 19:43:49 +01:00
Nikolay Krasko
98b2c00083 Revert "Cleanup HostManager.kt a little bit"
This reverts commit 9d957f68
2021-03-17 20:40:48 +03:00
Nikolay Krasko
3dd25e4965 Revert "Cleanup TargetManager.kt a little bit"
This reverts commit a4010c7a
2021-03-17 20:40:29 +03:00
Nikolay Krasko
e7a385f9da Revert "Remove obsolete bc.frontend module"
This reverts commit b48a42a5
2021-03-17 20:40:00 +03:00
Nikolay Krasko
c4182c8269 Revert "Remove unused protobuf from backend.native"
This reverts commit 7a526a85
2021-03-17 20:39:35 +03:00
Ilya Gorbunov
85a0538f0a Compile and run common tests of kotlin-test in kotlin-test-js-ir build 2021-03-17 17:53:54 +03:00
Ilya Gorbunov
e66eeefe2a kotlin-test: assertIs and assertIsNot KT-45296
- Rename assertNotIs to assertIsNot
- Extract parts of implementation to helper internal PublishedApi
functions in order to inline minimum amount of code at use sites
- Remove PublishedApi from messagePrefix, no longer needed
2021-03-17 17:53:54 +03:00
Ben Asher
3a0219d84c kotlin-test: add assertIs and assertNotIs assertions KT-45296 2021-03-17 17:53:54 +03:00
Svyatoslav Scherbina
542518f290 Remove contents of kotlin-native/CHANGELOG.md
Keep only links to old and new changelogs.
2021-03-17 13:53:05 +00:00
Svyatoslav Scherbina
8a940fc075 Update kotlin-native/BUILDING_LLVM.md after build rework
Running `dependencies:update` task is no longer required.
2021-03-17 13:53:04 +00:00
Svyatoslav Scherbina
1f5830404c Native: remove documents that were migrated to kotlin-web-site
These documents were moved from kotlin-native repo to kotlin-web-site.
So copies that got merged into kotlin repo are unused.
2021-03-17 13:53:03 +00:00
Sergey Bogolepov
7a526a852f Remove unused protobuf from backend.native 2021-03-17 13:44:05 +00:00
Sergey Bogolepov
b48a42a5a6 Remove obsolete bc.frontend module 2021-03-17 13:44:04 +00:00
Sergey Bogolepov
a4010c7abe Cleanup TargetManager.kt a little bit 2021-03-17 13:44:03 +00:00
Sergey Bogolepov
9d957f686a Cleanup HostManager.kt a little bit 2021-03-17 13:44:03 +00:00
Sergey Bogolepov
d7bd3d671c Fix formatting of HostManager.kt 2021-03-17 13:44:02 +00:00
Dmitry Petrov
7fabc19326 JVM_IR KT-45446 don't erase captured var if it's dead code 2021-03-17 15:37:35 +03:00
Svyatoslav Kuzmich
6bd34db725 [JS IR] Fix kotlin.js.js with complex constant expressions
Use IR interpreter to evaluate complex constexprs
2021-03-17 15:12:18 +03:00
Jinseong Jeon
93289aa899 FIR checker: report VAL_REASSIGNMENT_VIA_BACKING_FIELD(_ERROR) 2021-03-17 15:04:44 +03:00
Mikhail Glukhikh
a6d11b8914 FirFunctionParameterChecker: use reportOnWithSuppression 2021-03-17 15:04:44 +03:00
Tianyu Geng
94de193993 FIR: introduce VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION check
Besides adding VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION,
we remove here NO_TYPE_FOR_TYPE_PARAMETER since it doesn't exist in FE1.0.
The name also doesn't make much sense.
From the usage it looks like it should have been
VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION instead.
2021-03-17 15:04:43 +03:00
sebastian.sellmair
f4b840467f CommonizerIT: Mark Windows as non-executable target 2021-03-17 10:55:46 +00:00
Dmitriy Dolovov
5a35018a88 [Commonizer] Move source code to the folder that corresponds package name 2021-03-17 13:34:14 +03:00
Dmitriy Dolovov
fc4f66b702 [Commonizer] Change the main package name
org.jetbrains.kotlin.descriptors.commonizer -> org.jetbrains.kotlin.commonizer
2021-03-17 13:34:06 +03:00
Alexander Dudinsky
28e4ce191b [Test] Add 'kotlin-stdlib-jdk7' to dependency for publishing KGP 2021-03-17 13:12:57 +03:00
Mark Punzalan
10d16d10d5 Raw FIR: Fix downward propagation of external and inline from
property to default accessors for light-tree.
2021-03-17 10:45:26 +01:00
Mark Punzalan
7d31ea3e8f FIR checker: Add utility functions for FirModifierList. 2021-03-17 10:45:26 +01:00
Mark Punzalan
315047b164 FIR checker: Make FirJvmExternalDeclarationChecker a
FirMemberDeclarationChecker.

Set isExternal in status for FirRegularClass. Invoke member declaration
checkers for FirRegularClass.
2021-03-17 10:45:26 +01:00
Mark Punzalan
cef26a043e FIR checker: Merge FirConstDeclarationChecker with
FirConstPropertyChecker.
2021-03-17 10:45:26 +01:00
Mark Punzalan
beaeb74a26 FIR checker: Separate FirExternalDeclarationChecker as it is
JVM-specific.
2021-03-17 10:45:26 +01:00
Mark Punzalan
c3d2ce0c1f FIR checker/IDE: Add checker and quickfix for WRONG_MODIFIER_TARGET.
There are only simple checks for `external` and `const` for now. The
rest of the checks (see ModifiersChecker in FE1.0) will be added later.
2021-03-17 10:45:26 +01:00
Mikhail Glukhikh
ebfc431733 FIR body resolve context: fix accessor scope handling 2021-03-17 12:13:23 +03:00
Mikhail Glukhikh
ca15df7815 FIR: introduce separate containingClass in BodyResolveContext 2021-03-17 12:13:23 +03:00
Mikhail Glukhikh
f9618db9e2 FIR: rearrange functions in BodyResolveContext 2021-03-17 12:13:23 +03:00
Mikhail Glukhikh
d30299c29e FIR: introduce BodyResolveContext.forBlock, withWhenExpression 2021-03-17 12:13:22 +03:00
Mikhail Glukhikh
6ae948b655 FirAbstractBodyResolveTransformer: drop some unused context functions 2021-03-17 12:13:22 +03:00
Mikhail Glukhikh
cbf38b119c FIR: introduce BodyResolveContext.storeCallableReferenceContext 2021-03-17 12:13:22 +03:00
Mikhail Glukhikh
8b7b15f02b FIR: refactor delegating constructors resolve 2021-03-17 12:13:22 +03:00
Mikhail Glukhikh
8a9be56d07 FIR: introduce BodyResolveContext.forFunctionBody 2021-03-17 12:13:22 +03:00
Mikhail Glukhikh
b4cec3fb5d FIR: introduce BodyResolveContext.forEnumEntry 2021-03-17 12:13:22 +03:00
Mikhail Glukhikh
2db413d535 FIR: enhance (using mode inside) BodyResolveContext.withAnonymousFunction 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
798d848a91 FirReturnsImpliesAnalyzer: find receiver/variable of accessor properly 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
a345b81f2a Use BodyResolveContext.with* functions in FirContractResolveTransformer 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
4d519f646e FIR: extract BodyResolveContext.withAnonymousInitializer, withParameter 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
4235075f35 FIR: extract BodyResolveContext.withAnonymousFunction 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
d7b2ab6b99 FIR: extract BodyResolveContext.withConstructor in variations 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
bd2cdf2ec9 FIR: extract BodyResolveContext.withField 2021-03-17 12:13:21 +03:00
Mikhail Glukhikh
64353f34e9 FIR: extract BodyResolveContext.withProperty 2021-03-17 12:13:20 +03:00
Mikhail Glukhikh
06b3a0d57b FIR: extract BodyResolveContext.withSimpleFunction 2021-03-17 12:13:20 +03:00
Mikhail Glukhikh
db2b6e92e5 FIR: extract BodyResolveContext.withAnonymousObject 2021-03-17 12:13:20 +03:00
Mikhail Glukhikh
e5325e70fc FIR: extract BodyResolveContext.withRegularClass 2021-03-17 12:13:20 +03:00
Mikhail Glukhikh
4cff6d93be Get rid of containingClass storage in FirDeclarationsResolveTransformer 2021-03-17 12:13:20 +03:00
Mikhail Glukhikh
91607044d0 FIR: extract BodyResolveContext.withFile 2021-03-17 12:13:20 +03:00
Andrey
b7dc1e64b1 [KAPT] Disable JPMS when running annotation processing
If sources contain module-info.java javac tries to validate modules existence/visibility during AP phase and fails, because we don't specify modules-path/patch-module. All these checks will be done in kotlin compiler and in javac for java classes. And it is not necessary to do it in AP too.
So we go for easiest path possible - disable jpms for AP. 

#KT-32202 Fixed
2021-03-17 11:10:27 +03:00
Ilmir Usmanov
a90a5f6dd4 Check for backend when checking for suspend in fun interfaces 2021-03-16 22:37:44 +01:00
Steven Schäfer
bf2942b5cc JVM IR: Add Object.clone to JvmSymbols
The `clone` function is not available in the builtin classes created
from fir.
2021-03-16 21:30:18 +01:00
Steven Schäfer
99a4779c6b JVM IR: Don't produce line numbers in synthetic Enum members 2021-03-16 21:30:18 +01:00
Steven Schäfer
5be00cfa04 JVM IR: Don't use null checks in Enum.valueOf 2021-03-16 21:30:18 +01:00
Steven Schäfer
bea1a8c422 JVM IR: Use Object.clone in Enum.values 2021-03-16 21:30:18 +01:00
Ilmir Usmanov
e47715f52b Minor. Add tests with returning inline class from SAM adapter 2021-03-16 20:57:05 +01:00
Nikolay Krasko
aff25b3666 Remove jcenter usages 2021-03-16 22:24:10 +03:00
Nikolay Krasko
74dd8726c0 Update repositories in kotlin/buildSrc 2021-03-16 22:24:08 +03:00
Mikhail Glukhikh
0e8f8362da FIR checkers: use isNullableType() instead of isSubtypeOfAny() 2021-03-16 21:56:11 +03:00
Mikhail Glukhikh
599a0d9c2b Minor fixes in FirTypeParameterInQualifiedAccessChecker 2021-03-16 21:56:10 +03:00
Mikhail Glukhikh
0b9598d880 Minor fixes around FirKClassWithIncorrectTypeArgumentChecker 2021-03-16 21:56:10 +03:00
Jinseong Jeon
4c08d10cce FIR checker: report expression of nullable type parameter as LHS of class literals 2021-03-16 21:56:10 +03:00
Jinseong Jeon
26441ed64f FIR IDEA: avoid unnecessary type casting 2021-03-16 21:56:10 +03:00
Jinseong Jeon
7fff4108b6 FIR checker: report KClass with incorrect type argument 2021-03-16 21:56:10 +03:00
Jinseong Jeon
bc2228d434 FIR checker: don't report errors on type parameter as LHS of class literals
If a type paramter is not reified or nullable, different errors will
be reported by FirGetClassCallChecker.

When determining whether type parameter wrapped in qualified access is a
standalone expression or not, we examine whether the checker context has
other qualified accesses in stack. Class literals (::class) is desugared
to FirGetClassCall, and thus not stacked as qualified access. Since
class literals are a special type of callable reference (a subtype of
qualified access), we should keep track of FirGetClassCall in a similar
way.
2021-03-16 21:56:09 +03:00
Jinseong Jeon
e29b40b07f FIR checker: report TYPE_PARAMETER_AS_REIFIED 2021-03-16 21:56:09 +03:00
Jinseong Jeon
5ba5b63dee FIR checker: report nullable expression as LHS of class literals 2021-03-16 21:56:09 +03:00
Jinseong Jeon
33c5b49632 FIR checker: report non-typed LHS of callable references 2021-03-16 21:56:08 +03:00
scaventz
329be4f906 Add a test to for the situation where pathname of destination does not name a parent. 2021-03-16 18:44:12 +01:00
Georgy Bronnikov
bff6e9b972 IR: document lock priority. 2021-03-16 19:49:31 +03:00
Georgy Bronnikov
60f38369f1 JVM_IR: synchronize binary class reloading 2021-03-16 19:49:30 +03:00
Georgy Bronnikov
42279c3b5b IR: introduce IrLock
Use a single lock object for synchronization to avoid deadlocks.
2021-03-16 19:49:30 +03:00
Georgy Bronnikov
215556511e JVM_IR: synchronization in InlineCodegen 2021-03-16 19:49:30 +03:00
Georgy Bronnikov
be67dacef1 JVM_IR: synchronized getOrPut for SLRUMap 2021-03-16 19:49:30 +03:00
Georgy Bronnikov
78d62dcb1e JVM_IR: use ConcurrentHashMap in codegen where appropriate 2021-03-16 19:49:30 +03:00
Georgy Bronnikov
c36bc9f312 JVM_IR: use synchronized map in ClassFileFactory 2021-03-16 19:49:30 +03:00
Georgy Bronnikov
3a10ea4f88 JVM_IR: synchronize code generation for inline functions 2021-03-16 19:49:29 +03:00
Georgy Bronnikov
c7feaee8ae IR: make copying optional in performByIrFile
For codegen phases, input files are readonly data. There is no need to
copy them.
2021-03-16 19:49:29 +03:00
Georgy Bronnikov
1383c31caf JVM_IR: use threadLocal in GlobalInlineContext 2021-03-16 19:49:29 +03:00
Georgy Bronnikov
fe4d33dcb1 JVM_IR: make codegen a phase 2021-03-16 19:49:29 +03:00
sebastian.sellmair
b68fee9cbc CliCommonizer: Guard input- and dependency- libraries 2021-03-16 15:47:29 +00:00
sebastian.sellmair
d03a85525d [Commonizer] DependencyLibrariesOptionType: Make option optional (default: empty) 2021-03-16 15:47:28 +00:00
sebastian.sellmair
73222fbc4f [Commonizer] Add more verbose debugging information when failing to parse a task 2021-03-16 15:47:28 +00:00
sebastian.sellmair
f6e8afcbcc Move Gradle property 'kotlin.commonizer.jvmArgs' to 'kotlin.mpp.commonizerJvmArgs' 2021-03-16 15:47:27 +00:00
sebastian.sellmair
56661068bd CommonizerIT: Reuse DISABLED_NATIVE_TARGETS_REPORTER_WARNING_PREFIX instead of hardcoded string 2021-03-16 15:47:26 +00:00
sebastian.sellmair
5a10cb6a3e CommonizerIT: Add integration tests for user defined c-interop commonization 2021-03-16 15:47:25 +00:00
sebastian.sellmair
80e964c166 [Commonizer] NativeKlibCommonize: Remove optimization for only loading dependencies from native distribution
This is removed for now, because of test failures on Windows.
It seems like the dependencies in the klib produced by Windows are not
correct.

See: https://youtrack.jetbrains.com/issue/KT-45471
^KT-45471
2021-03-16 15:47:25 +00:00
sebastian.sellmair
b777c89bc8 [Commonizer] NativeKlibCommonize: Only load dependencies from native distribution 2021-03-16 15:47:24 +00:00
sebastian.sellmair
97a57a7d93 Forward dependencies from CInteropCommonizerTask to commonizer 2021-03-16 15:47:23 +00:00
sebastian.sellmair
49cf386258 Limit CInteropCommonizerTask to only one level of commonization
See ^KT-39324
2021-03-16 15:47:23 +00:00
sebastian.sellmair
261934d881 Implement CopyCommonizeCInteropForIdeTask to survive build folder cleaning 2021-03-16 15:47:22 +00:00
sebastian.sellmair
a53df56781 Implement CInteropIdentifier.Scope 2021-03-16 15:47:21 +00:00
sebastian.sellmair
6efd04edc0 Implement CInteropCommonizerTask to support commonization of user-defined cinterops
^KT-40975 Verification Pending
2021-03-16 15:47:20 +00:00
sebastian.sellmair
7cf8e9ec58 CInteropProcess: Promote settings to constructor
This enforces that the specified c-interop settings cannot be re-set on
a CInteropProcess.
2021-03-16 15:47:20 +00:00
sebastian.sellmair
be84b7b419 Rename 'getSourceSetHierarchy' to 'withAllDependsOnSourceSets' and lift the previous Deprecation 2021-03-16 15:47:19 +00:00
sebastian.sellmair
7da7dd92d6 Deprecate KotlinSourceSet.getSourceSetHierarchy in favour of 'resolveAllDependsOnSourceSets' and general purpose 'transitiveClosure' 2021-03-16 15:47:18 +00:00
sebastian.sellmair
4e07dcf2d8 Minor: Add dictionaries/sebastiansellmair.xml 2021-03-16 15:47:17 +00:00
Ilya Matveev
6643119f08 [K/N][New MM] Move ThreadStateGuard to the main Memory.h
Integrating the stdlib with the thread states machinery requires
accessing to some parts of the new MM. This patch provides this
access by moving these parts to the main Memory.h header.
2021-03-16 17:04:26 +03:00
Ilya Matveev
482305cfb2 [K/N][New MM] Move RunInNewThread to the main ThreadSupport.hpp
Some of unit-tests for the C++ part of the stdlib will require
thread state switching. In the new MM, we already have a helper
function that allows us to scopely initialize the memory subsystem
for a separate thread. This patch makes this helper available
for tests in the main runtime module by moving it to the main
ThreadSupport.hpp.
2021-03-16 17:04:25 +03:00
Ilya Matveev
fc43fbf578 [K/N][New MM] Move MemoryState conversions to separate header 2021-03-16 17:04:23 +03:00
Nikolay Krasko
da6440c59e Add heap-dumps collection to BaseGradleIT.kt for TC investigations
Disable in daemon tests that checks defaults of -XX:MaxMetaspaceSize as
it looks like settings any jvm options reset defaults.
2021-03-16 15:55:01 +03:00
Nikolay Krasko
48f2db51d2 Stop polluting output for successful Gradle tests 2021-03-16 15:55:00 +03:00
Dmitry Petrov
decfaa3ba5 JVM_IR KT-44993 preserve inner expression type when fusing if-null 2021-03-16 15:30:45 +03:00
Jinseong Jeon
922419efb8 FIR CFG: route to exit of try main for throw in try main
to make the remaining part of try main marked as dead.

^KT-45475 Fixed
2021-03-16 15:11:56 +03:00
Jinseong Jeon
7a7114f896 FIR CFG: create TryMainBlockExitNode before visiting try main block
so that a node that returns Nothing inside try main block can route to
the exit of try main block, instead of exit target for try directly.
2021-03-16 15:11:55 +03:00
Jinseong Jeon
7e5b562b33 Reproduce KT-45475: no smartcast after conditional throw in try expression 2021-03-16 15:11:53 +03:00
Svyatoslav Scherbina
1f6f996faf kotlin-native/samples: workaround build for linuxArm32Hfp
libSDL2.so is missing in new sysroot (since 1.5), use one from
the old sysroot as a workaround.
2021-03-16 11:58:56 +00:00
Yan Zhulanow
1dad549c81 All-open: Add Micronaut preset (KT-26325) 2021-03-16 19:21:50 +09:00
Yan Zhulanow
69fedd9791 Avoid serializing non-serializable properties (EA-253232) 2021-03-16 19:21:50 +09:00
Yan Zhulanow
0fb57d7253 Pill: Exclude native-commonizer from JPS modules 2021-03-16 19:21:50 +09:00
Yan Zhulanow
5fca37fa0f Pill: Do not delete existing artifacts for JPS build 2021-03-16 19:21:49 +09:00
Yan Zhulanow
cfd585e221 Pill: Remove 'kotlin-coroutines-experimental-compat' from mapped libraries 2021-03-16 19:21:49 +09:00
Yan Zhulanow
4e8ec69ca7 Pill: Support kotlinx.serialization plugin 2021-03-16 19:21:49 +09:00
Yan Zhulanow
bcce187e3f Pill: Import kotlinx-metadata only in FULL mode 2021-03-16 19:21:49 +09:00
Yan Zhulanow
cc41ccc3b9 Pill: Disable all compiler plugins by default 2021-03-16 19:21:48 +09:00
Yan Zhulanow
61cd97b340 Pill: Remove unused EmbeddedComponents class 2021-03-16 19:21:48 +09:00
Yan Zhulanow
a00f3b97c5 Pill: Move utility classes to util package 2021-03-16 19:21:48 +09:00
Yan Zhulanow
6da03c0cda Pill: Move project model out of parser file 2021-03-16 19:21:48 +09:00
Yan Zhulanow
e4ce48d9ef Pill: Extract artifact-related components to their own package 2021-03-16 19:21:47 +09:00
Yan Zhulanow
901bfbb3c7 Pill: Create KotlinArtifact only for variants that include BASE 2021-03-16 19:21:47 +09:00
Yan Zhulanow
6ff68311c1 Pill: Support module prefixes 2021-03-16 19:21:47 +09:00
Yan Zhulanow
a561fb85ad Pill: minor, fix inspection warnings 2021-03-16 19:21:47 +09:00
Yan Zhulanow
4708525b9a Pill: Refactor Pill variants, replace DEFAULT variant with nullable value 2021-03-16 19:21:46 +09:00
Yan Zhulanow
51a23b7aeb Pill: Always import Pill importer module for debugging purposes 2021-03-16 19:21:46 +09:00
Yan Zhulanow
c2cbbc5aba Pill: Removed unused NONE variant 2021-03-16 19:21:46 +09:00
Yan Zhulanow
a355d82b37 Pill: Fix warnings in PillExtension 2021-03-16 19:21:46 +09:00
Yan Zhulanow
f84c1d7354 Pill: Fix warnings in PillExtensionMirror 2021-03-16 19:21:45 +09:00
Yan Zhulanow
880067946e Pill: Do not import kotlin-serialization library as dist dependency as it doesn't exist in dist/kotlinc 2021-03-16 19:21:45 +09:00
Yan Zhulanow
38d88877a3 Pill: Map kotlin-coroutines-experimental-compat library 2021-03-16 19:21:45 +09:00
Yan Zhulanow
cc56511585 Pill: Map 'java9' source sets of standard library and tests 2021-03-16 19:21:45 +09:00
Zac Sweers
12a6352bef Fix NPE in KaptJavaLog
See https://issuetracker.google.com/issues/162446295 for more context, but in short: this will fail if the project:
* targets java 8
* consumes external libraries targeting a higher version (java 9+). This includes Android SDK 30's android.jar, which targets java 9
* has `mapDiagnosticLocations` enabled for kapt

targetElement is a nullable type, so this seems like a pretty cut-and-dry NPE fix
2021-03-16 19:21:44 +09:00
Vladimir Dolzhenko
462b752763 Mark flaky test 2021-03-16 11:03:05 +01:00
Dmitriy Novozhilov
cef859fced Fix exponential pseudocode size on incorrect prefix increments and decrements
#KT-44153 Fixed
2021-03-16 12:25:23 +03:00
Denis.Zharkov
6c5557dae3 FIR2IR: Optimize computation of fake overrides in lazy classes 2021-03-16 09:28:52 +03:00
Denis.Zharkov
fbed88d32d FIR2IR: Do not unwrap fake override when computing overridden 2021-03-16 09:28:52 +03:00
Denis.Zharkov
74ecae7f6d IR: Optimize IrSimpleFunction::collectRealOverrides 2021-03-16 09:28:52 +03:00
Denis.Zharkov
1a36ee2110 IR: Postpone computing real fake overrides at SyntheticAccessorLowering 2021-03-16 09:28:52 +03:00
Denis.Zharkov
c09fe3ea6f FIR: Optimize unnecessary interface casts by adding relevant overload 2021-03-16 09:28:52 +03:00
Denis.Zharkov
f141c276be IR: Avoid recomputing Symbols::progressionElementTypes 2021-03-16 09:28:52 +03:00
Alexander Udalov
d9a9bd0136 Fix compilation of Interop/Runtime after fc36178f3a 2021-03-15 20:34:24 +01:00
Dmitry Petrov
d74168fb8f PSI2IR KT-44414 fix adapted reference to imported object member 2021-03-15 21:24:25 +03:00
Mikhail Glukhikh
e7129329d2 Revert "FIR: do not eagerly resolve class references in imported annotations"
This reverts commit 1a57d60f
2021-03-15 18:36:13 +03:00
Alexander Udalov
83a4b6396a Deduplicate source roots in psi2ir and CLI
Compiler plugins can add new source roots to the next compilation round
by using `AnalysisResult.RetryWithAdditionalRoots`. Some plugins added
already existing source roots to this list in some cases. For example,
this is reproducible with `square/anvil` with incremental compilation
(KT-45100, KT-44925). Psi2ir didn't deduplicate the source files before,
which resulted in several classes with the same name linked to the same
symbol. This led to a "symbol is already bound" exception, and in case
of KT-44925, to an additional NPE when we were rendering the class to
display it in the message.

The solution is to deduplicate classes before psi2ir. Note that this
commit has two changes, in CLI and in psi2ir. Any one of these is
sufficient for fixing the problem, however both are made just to make it
more future-proof against new components and/or changes in existing
subsystems (e.g. fir2ir).

In the old JVM backend, similar deduplication was happening in
`ClassFileFactory.registerSourceFiles`, which is why the problem is not
reproducible there.

 #KT-45100 Fixed
2021-03-15 16:30:46 +01:00
Alexander Udalov
fc36178f3a Annotate kotlin.reflect.jvm.reflect with ExperimentalReflectionOnLambdas
This function was always experimental, as explained in its kdoc, but it
was introduced before opt-in requirement markers were supported. Thus,
breaking changes (such as in KT-42746) were always expected, and the
`@ExperimentalReflectionOnLambdas` annotation just makes it clearer.

 #KT-45486 Fixed
2021-03-15 15:54:31 +01:00
pyos
43140db65e FIR2IR: better filter out non-declared data class properties 2021-03-15 17:32:41 +03:00
pyos
1a57d60f68 FIR: do not eagerly resolve class references in imported annotations 2021-03-15 17:32:39 +03:00
Dmitry Petrov
e630e00e99 JVM_IR KT-44744 check accessibility of enum entry 'this' 2021-03-15 17:26:49 +03:00
Svyatoslav Scherbina
14cb762133 Update the docs to reflect Kotlin/Native merge to kotlin repo
Also:
* Revamp kotlin-native/README.md a bit: make it more up-to-date,
  add useful links
* Remove "composite build" section from ReadMe.md:
  it was used for Kotlin + Kotlin/Native composite;
  this is no longer required.
2021-03-15 14:09:00 +00:00
Ilya Kirillov
d7da17d8e6 FIR: fix FirOldFrontendDiagnosticsTestGenerated.testVariableInvoke test 2021-03-15 14:31:12 +01:00
Igor Chevdar
c37f8ba708 [IR][cache] Fix for https://youtrack.jetbrains.com/issue/KT-44764
The .konanLibrary is cached for each declaration for performance purposes, but it is only ok to do it
after IR has been lowered to its final state (or at least when declarations aren't being moved around),
so the fix respects that by only taking .konanLibrary of a IrFile (it is assumed that files stay on their place
during entire backend lowering procedure).

(cherry picked from commit e021138368b48e306ba99a96f47d93ecbe039f4d)
2021-03-15 15:54:51 +03:00
Alexander Udalov
c56f719dcc Fix/suppress some warnings
(cherry picked from commit d8a43c216925b3a9e1475b786978436835a57927)
2021-03-15 15:54:50 +03:00
Igor Chevdar
c5249ac714 Disposed target data
(cherry picked from commit 250be87acf66d5c780fb593f46da3540a536e049)
2021-03-15 15:54:49 +03:00
Vladimir Ivanov
ba50a8275c Add test for [KT-3706]
Issue is already fixed by metadata-based cinterop

(cherry picked from commit fd4f5b2c07ebdc431d6243ac087f911ee30e88ca)
2021-03-15 15:54:48 +03:00
Vladimir Ivanov
64129314fb Fix sample file naming for case-sensitive FS
(cherry picked from commit 72235c31852fba4f2ab330d8178197c2584b1cda)
2021-03-15 15:54:46 +03:00
Jinseong Jeon
8dce6f2ac9 FIR CFG: don't propagate deadness on the uncaught exception path 2021-03-15 15:54:22 +03:00
Jinseong Jeon
d27ecca0e9 FIR CFA: keep UncaughtExceptionPath separated 2021-03-15 15:54:21 +03:00
Mikhail Glukhikh
06a80c0b34 FIR tree generator: merge fields from parents properly 2021-03-15 15:33:38 +03:00
Mikhail Glukhikh
7f7a964b2e FIR: annotate 'replaceSource' with '@FirImplementationDetail' 2021-03-15 15:33:38 +03:00
Mikhail Glukhikh
c641fa739b FIR: provide 'replaceSource' only for FirQualifiedAccess inheritors 2021-03-15 15:33:38 +03:00
Dmitriy Novozhilov
4d65b0ef5a [FIR2IR] Unmute passing black box test 2021-03-15 15:12:11 +03:00
Alexander Shabalin
f51c85a63f Add test support for types and objects creation
* test_support::TypeInfoHolder to create TypeInfo given payload description
* test_support::Object<Payload> to create objects with Payload and to get them from ObjHeader* after checking that their type_info are layout compatible.
* test_support::*Array<Count> to create various arrays with given length and similarly get them from ArrayHeader*.
2021-03-15 11:25:04 +00:00
Yaroslav Chernyshev
aff49c76a9 loadClassOrNull: catch 'ClassNotFoundException' and 'LinkageError' over 'Exception' 2021-03-15 13:35:37 +03:00
Yaroslav Chernyshev
116b11d8be Continue 'populateModuleDependenciesBySourceSetVisibilityGraph' on missing GradleSourceSetData' 2021-03-15 13:35:36 +03:00
Yaroslav Chernyshev
d053ee33a8 Precise platform importing changes ported from new repository 2021-03-15 13:35:35 +03:00
Yaroslav Chernyshev
960a7dca45 Re-structure KotlinMPPGradleProjectResolver.populateModuleDependencies 2021-03-15 13:35:34 +03:00
Yaroslav Chernyshev
18a06dc37e HMPP import: add dependencies present on all compilation a jvm&android shared source set participates 2021-03-15 13:35:33 +03:00
Dmitry Savvinov
96a4d19365 Minor: inline addDependsOnSourceSets in buildCompilation 2021-03-15 13:35:33 +03:00
Dmitry Savvinov
4927777ffb Minor: rename KotlinCompilation.sourceSets -> allSourceSets 2021-03-15 13:35:32 +03:00
Dmitry Savvinov
1143865e88 Minor: add test on importing platform of commonMain in single-backend project 2021-03-15 13:35:32 +03:00
Dmitry Savvinov
c3f5d57d3b Implement precise platforms importing in MPP
- skip metadata target from importing. That lead to metadata
compilations being imported is well -> some source-sets were
participating in metadata compilations as well -> logic for determining
platforms used to consider metadata compilations as well, adding COMMON
platform to set of platforms

Seems like metadata was never needed in import/IDE, and got there purely
by accident

- Use only targets, actually present in the project, as the default
platform. This is needed mostly for corner-cases/miconfigurations, like
orphan source-sets (source-sets which are created but not included into
any configuraion). Still, for those source-sets the tooling is required
to behave properly; presence of non-existing target can lead to various
issues like showing gutters for test runs, which would fail on launch
(because tests for that target actually do not exist)

^KT-37127 Fixed
2021-03-15 13:35:31 +03:00
Dmitry Savvinov
7a5b4ccb9a Refactoring: collect all logic regarding detecting sourceSet platform in one function
Note that previously addSourceSetsToCompilation had logic regarding
platforms. The reason for that is that it was the last place where
default soruce sets of compilations could be distinguished from all
participated source sets.

So, to move that logic, we have to preserve default source sets.
Therefore, this commit introduces 'KotlinCompilation.defaultSourceSets',
and 'ImportingContext.isDefaultSourceSet' method.

The rest is trivial code moving/methods introduction

The resulting code isn't really pretty and likely has non-orthogonal
predicates, this will be cleaned-up in the next commits
2021-03-15 13:35:31 +03:00
Dmitry Savvinov
ef04ae041e Minor: swap receiver and parameter for shouldCoerceToCommon
Otherwise, it reads as if KotlinSourceSet coerces ImportingContext,
which is in fact the other way around
2021-03-15 13:35:30 +03:00
Dmitry Savvinov
7ddcdca6bb Dont coerce platforms of source-sets in HMPP to set of available targets in project 2021-03-15 13:35:30 +03:00
Andrey Uskov
9c000000cf Update Gradle verion in tests from 6.1 to 6.1.1
Gradle 6.1 is not suitable for testing because of memory leak on
artefact validation (https://github.com/gradle/gradle/issues/11966)
2021-03-15 12:28:08 +03:00
Dmitriy Novozhilov
054c278c83 [FIR] Fix determining nullability of type variables and type parameters 2021-03-15 12:13:10 +03:00
Dmitriy Novozhilov
e00ff5c473 [FIR] Make FirClassifierSymbol sealed 2021-03-15 12:13:09 +03:00
Dmitriy Novozhilov
631b771251 [FIR] Report proper resolution diagnostics from arguments checks 2021-03-15 12:13:08 +03:00
Dmitriy Novozhilov
6cc3fff48d [FIR] Properly handle that type variable is contained in inv or contravar positions
#KT-45344 Fixed
2021-03-15 12:13:07 +03:00
Dmitriy Novozhilov
3d1f4b8386 [FIR] Don't add @EnhancedVisibility to types with @Nullable annotation 2021-03-15 12:13:06 +03:00
Dmitriy Novozhilov
a7c08345b4 Extract Generate Compiler Tests run configuration back to top level 2021-03-15 12:13:04 +03:00
Dmitriy Novozhilov
329d9a58bc Generate IDE run configurations for modularized and full pipeline test
To generate configuration you need to specify path to root directory
  with modularized testdata for kotlin project in `local.properties`:

```
kotlin.fir.modularized.testdata=/path/to/testdata/modularized-kotlin
```
2021-03-15 12:13:02 +03:00
Dmitriy Novozhilov
f5d00716d1 Advance kotlin-build-gradle-plugin version to 0.0.26 2021-03-15 12:13:01 +03:00
Dmitriy Novozhilov
ab62680a03 Add new configuration flag to kotlin-build-gradle-plugin
This flag is needed for auto-generation of run configurations
  for modularized tests which are used by FIR team
2021-03-15 12:12:59 +03:00
Andrey
fe6ddcc1fa [KAPT] Skip kapt tasks if no annotations processors are provided (#4190)
So we don't do any preparation, don't spin up compiler.  And user will see SKIPPED in task execution
2021-03-15 11:37:06 +03:00
Svyatoslav Scherbina
77161af92a Delete obsolete kotlin-native/GRADLE_PLUGIN.md 2021-03-15 08:30:23 +00:00
Dmitriy Dolovov
6791ae81db [Commonizer] Minor. Clean-up in AbstractCommonizerTest 2021-03-15 11:25:48 +03:00
Dmitriy Dolovov
aa196ae813 [Commonizer] Minor. Clean-up in ValueParameterCommonizerTest 2021-03-15 11:25:43 +03:00
Dmitriy Dolovov
0bd5fdb611 [Commonizer] Minor. Formatted 2021-03-15 11:25:37 +03:00
Dmitriy Dolovov
ed98d878df [Commonizer] Minor. Reorganize CirClass.supertypes 2021-03-15 11:25:32 +03:00
Mikhael Bogdanov
cdb2dd6661 Advance bootstrap to 1.5.20-dev-2613 2021-03-15 07:10:03 +01:00
Ilmir Usmanov
64abb2501f Minor. Add FIR_IDENTICAL directive 2021-03-15 06:19:22 +01:00
Ilmir Usmanov
c9f41a2440 Minor. Ignore tests on WASM 2021-03-15 06:14:44 +01:00
Ilmir Usmanov
149064803d JVM_IR: Do not unbox Result argument inside java SAM adapters
#KT-45259
2021-03-15 06:14:42 +01:00
Ilmir Usmanov
4099dfc7e0 JVM_IR: Do not unbox Result argument inside SAM adapters
#KT-45259 Fixed
2021-03-15 06:14:40 +01:00
Mikhael Bogdanov
6fab1305e9 Fix compilation after @JvmDefault deprecation
Suppress could be removed after switch to -Xjvm-default=all
2021-03-13 08:24:18 +00:00
Mikhail Bogdanov
95654bb9bc Deprecate @JvmDefault
#KT-40392 Fixed

(cherry picked from commit c11f38688e)
2021-03-13 08:24:17 +00:00
Abduqodiri Qurbonzoda
77c263fcc4 Mark kt45410.kt with TARGET_BACKEND: JVM 2021-03-13 02:30:24 +03:00
Alexander Shabalin
391458c355 Fix CompileToBitcode's llvm-link invocation
Porting https://github.com/jetbrains/kotlin-native/pull/4536 which got
lost in c85c3ac123
2021-03-12 16:53:47 +00:00
Ilmir Usmanov
d3b42709fd Revert "Value Classes: Forbid var properties with value class receivers"
This reverts commit f43899086a.
2021-03-12 17:51:24 +01:00
Ilmir Usmanov
6429ac17d8 Revert "Raise RESERVED_VAR_PROPERTY_OF_VALUE_CLASS to error"
This reverts commit bad197e075.
2021-03-12 17:51:21 +01:00
Roman Artemev
050db6d454 [KLIB] Add box test for generic annotations 2021-03-12 19:03:04 +03:00
Roman Artemev
0d8fff7186 [KLIB] Fix annotation type deserialization
Instead of hardcoded `Unit` restore it basing on annotation class and
constructor's type arguments
2021-03-12 19:03:04 +03:00
Roman Artemev
607a598f1a [IR] Add irText test for generic annotations 2021-03-12 19:02:29 +03:00
Roman Artemev
79935e29de [IR] Support type arguments in psi2ir 2021-03-12 19:02:29 +03:00
Roman Artemev
b60ebc0975 [IR] Support type arguments on annotations in IR render 2021-03-12 19:00:11 +03:00
Roman Artemev
ab8f64a3ee [FIR] Mute failing tests 2021-03-12 18:47:34 +03:00
Roman Artemev
92eac7e124 [IR] Fix irText test runner
Do not ignore compilation errors if they are existed
2021-03-12 18:36:33 +03:00
Anton Lakotka
d023f09bd4 Don't add common compiler plugin artifacts to native targets
Make native plugin configuration be non-transitive
2021-03-12 18:28:26 +03:00
Ilya Kirillov
f339748f5b FIR IDE: fix origin of synthetic functional interfaces
^KT-45312 fixed
2021-03-12 15:17:33 +01:00
Ilya Kirillov
41d1ef22b6 FIR: specify BODY_RESOLVE for synthetic functional interface 2021-03-12 15:15:32 +01:00
Alexander Likhachev
6b774b07e0 [Gradle, K/N] Fix broken iOS, watchOS, tvOS tests
They were broken in 2a8e2613a2
2021-03-12 16:36:18 +03:00
Alexander Likhachev
aedd8a104d [Gradle, K/N] Fix native test execution test on Macs 2021-03-12 15:56:03 +03:00
Mads Ager
8588412a56 [JVM IR] Support break in do-while condition.
This breaks from the loop itself which is inconsistent with
what happens for breaks in while conditions.

Also, the frontend will report that code after the loop is
unreachable, which it isn't. :-\

However, those issues are covered in
https://youtrack.jetbrains.com/issue/KT-17728, so for now
we follow the old backend to not "break" anyone. :)

Fixes KT-44412
2021-03-12 13:46:27 +01:00
Dmitry Petrov
d0d3b57366 Minor: mute test in FIR 2021-03-12 15:08:24 +03:00
Victor Petukhov
91d2f32a57 Don't lose upper non-expected type constraints to include them to intersection type during finding the result type of the fixing type variable 2021-03-12 14:36:54 +03:00
Victor Petukhov
b87c2a15b5 Don't stop constraints processing if all type variables have proper equality constraints
Those type variable may have other constraints after incorporation into which, the constraint error may appear

^KT-42042 Fixed
2021-03-12 14:36:54 +03:00
Victor Petukhov
7f7bb70596 Don't fix a type variable into the intersection type if there is an explicit expected type
^KT-43303 Fixed
^KT-42396 Fixed
^KT-42472 Fixed
2021-03-12 14:36:53 +03:00
pyos
e06bacafad JVM: fix inline cycle detection
1. use the correct descriptor in the old backend;
 2. clear the temporary variables for arguments in the IR backend.

 #KT-45292 Fixed
2021-03-12 11:49:42 +01:00
Ilya Kirillov
4e98d1b857 FIR IDE: update lazy resolve tests testdata 2021-03-12 11:44:00 +01:00
Ilya Kirillov
f8828abeba FIR: fix declaration phase updating in FirContractResolveTransformer 2021-03-12 11:44:00 +01:00
Ilya Kirillov
4dc040b91a FIR: update enum entry resolve phase in body resolve transformers 2021-03-12 11:44:00 +01:00
Ilya Kirillov
d49913944c FIR: add tests which checks that every declaration in file has body resolve phase after resolving the fiile 2021-03-12 11:44:00 +01:00
Ilya Kirillov
0dd18006e8 FIR: do not update phase from IMPLICIT_TYPES_BODY_RESOLVE to BODY_RESOLVE
This is not needed as such declarations are now marked with body resolve phase
2021-03-12 11:44:00 +01:00
Ilya Kirillov
fe207492b7 FIR: mark declarations resolved to BODY_RESOLVE with BODY_RESOLVE phase in implicit body transformer 2021-03-12 11:43:59 +01:00
Ilya Kirillov
ded234074d FIR: render value parameter/lambda/accessor resolve phase if RenderMode.renderDeclarationResolvePhase is enabled 2021-03-12 11:43:59 +01:00
Alexander Udalov
869a153327 Enable -Werror for buildSrc 2021-03-12 11:19:07 +01:00
Alexander Udalov
848b08a475 Minor, suppress 1.3 language version warnings 2021-03-12 11:18:57 +01:00
Ilya Goncharov
ead0b50107 [JS IR] In file:JsModule top level with fresh names 2021-03-12 12:57:56 +03:00
Ilya Kirillov
600e1725cb Do not run wizard project importing tests in TC
They will be run only in kotlin-ide plugin
2021-03-12 10:56:41 +01:00
Igor Yakovlev
023b7fbb8f [ULC] Fix invalid primitive type annotating
Fixed #KT-45417
2021-03-12 10:35:37 +01:00
Abduqodiri Qurbonzoda
ff5b2404af Introduce firstNotNullOf and firstNotNullOfOrNull #KT-12109 2021-03-12 09:27:14 +03:00
Abduqodiri Qurbonzoda
d4b3ae92cb [K/N] Strict version of String.toBoolean() #KT-42071 2021-03-12 09:26:58 +03:00
Abduqodiri Qurbonzoda
09ad5ca602 Strict version of String.toBoolean() #KT-42071 2021-03-12 09:26:55 +03:00
Abduqodiri Qurbonzoda
5f4a4fd8ae Introduce assertContentEquals in kotlin-test #KT-32996 2021-03-12 09:24:15 +03:00
Dmitry Petrov
44e6483090 JVM_IR Spill stack on array constructor call
KT-42932
2021-03-12 09:18:35 +03:00
Alexander Likhachev
dbfe45993a [Build] Fix test distribution plugin applying condition 2021-03-12 08:02:44 +03:00
Anton Lakotka
99ce047733 Add separate Plugin Classpaths per compilation
Make them extend the common CP for sake of backward compatibility
^KT-45020 Fixed
2021-03-11 22:34:21 +01:00
Tianyu Geng
9476175cc2 FIR: add mapping to partially resolved arg list
Initially I tried adding `mapping` field to `FirArgumentList` but it
seems to be very difficult to make it flexible enough to do what I want.

So instead, I am creating a `FirPartialResolvedArgumentList`, which
seems to be very simple.
2021-03-11 22:57:58 +03:00
Mikhail Glukhikh
5d3afbad54 Rename: BadNamedArgumentsTarget -> ForbiddenNamedArgumentsTarget 2021-03-11 22:57:57 +03:00
Tianyu Geng
be0dd84a06 FIR: check NAMED_ARGUMENTS_NOT_ALLOWED
The check has already been partially implemented in
org.jetbrains.kotlin.fir.resolve.calls.FirCallArgumentsProcessor. This
change completes the missing piece that determines if a `FirFunction`
has stable parameter names.
2021-03-11 22:57:57 +03:00
Tianyu Geng
0d4e9ca0b9 FIR: allow reporting multiple FirDiagnostics from a ConeDiagnostic 2021-03-11 22:57:57 +03:00
Mikhail Glukhikh
1f15ce2d26 FIR diagnostics: extract mapUnsafeCallError 2021-03-11 22:57:57 +03:00
Mark Punzalan
bb790195a2 FIR IDE: Enable ChangeVariableMutabilityFix for MUST_BE_INITIALIZED. 2021-03-11 16:31:40 +01:00
Ilya Chernikov
09fb2cd746 [minor] disable implicits test on IR, see added comments for details 2021-03-11 15:50:33 +01:00
Ilya Chernikov
e05c8ac57b Add script metedata flag 2021-03-11 15:50:33 +01:00
Ilya Chernikov
7c63105bb7 Mark script result expression as used to avoid coercion to unit 2021-03-11 15:50:32 +01:00
Ilya Chernikov
7d07010785 Fix handling of lambdas in top-level destructuring declarations 2021-03-11 15:50:32 +01:00
Ilya Chernikov
22f1814911 Fix CFA for destructuring declarations in scripts
in particular without the fix, the CFA skipped marking of the used
result values in lambdas and they were coerced to unit in IR
2021-03-11 15:50:31 +01:00
Ilya Chernikov
10567d9a37 [minor] fix scripting test dependencies 2021-03-11 15:50:31 +01:00
Ilya Chernikov
9c786a9cd9 [minor] uncomment 2 scripting tests:
Tests were failing before, but now fixed, most likely by switching to
default target 1.8 and some changes in scripting IR support.
#KT-44471 fixed
2021-03-11 15:50:31 +01:00
Ilya Chernikov
ef01411d20 [minor] fix script util tests 2021-03-11 15:50:30 +01:00
Ilya Chernikov
375441832e Implement REPL support in IR scripting 2021-03-11 15:50:30 +01:00
Ilya Chernikov
c066b7843c Fix provided properties generation in ir scripting 2021-03-11 15:50:07 +01:00
Ilya Chernikov
bc6c17d4b2 Enable IR in jvm scripting host tests 2021-03-11 15:50:06 +01:00
Ilya Chernikov
e9da385f7c Implement property for passing argumens to isolated script compiler 2021-03-11 15:50:06 +01:00
Ilya Chernikov
43d7536a28 Protect scripts compilation from passing -Xuse-ir via configuration
as well as other options that require changes in the compilation setup
before compiler options from the configuration could be processed
2021-03-11 15:50:06 +01:00
Ilya Chernikov
bac6a7346e Extend GeneratorExtensions with previous script, implemt it for JS REPL
also refactor JS REPL for better compatibility with the generic
REPL/scripting infrastructure
2021-03-11 15:50:01 +01:00
Ilya Chernikov
83da5f61fd [minor] Implement in-process test for main.kts cache
mainly to ease debugging
2021-03-11 15:49:46 +01:00
Ilya Chernikov
4dc228a0a3 Implement proper call to the base class ctor in ir script lowering 2021-03-11 15:49:46 +01:00
Ilya Chernikov
32d0c99289 Implement metadata handling for IR scripts 2021-03-11 15:49:45 +01:00
Ilya Chernikov
4c6b5ff0b8 Implement IR backend support in scripting tests, enable for some tests 2021-03-11 15:49:44 +01:00
Alexander Likhachev
d1ee05c7f6 Revert "[Build] Fix configuration cache issues with install task"
This reverts commit 078849d1
2021-03-11 17:22:37 +03:00
Yahor Berdnikau
543ab3fa2a Fix issues in Android test projects setup. 2021-03-11 16:36:54 +03:00
Yahor Berdnikau
590bab82e2 Remove not-needed test task validation.
Now all test 'install' dependencies are added via centralized 'dependsOnKotlinGradlePluginInstall()' method.
2021-03-11 16:36:53 +03:00
Yahor Berdnikau
3f953bcdfc Use lazy query for KGP test SourceSet output. 2021-03-11 16:36:52 +03:00
Yahor Berdnikau
7e7552bf5d Use JUnit 5 platform to run KGP tests.
Enabled vintage engine, so existing tests could run without any
modification.

^KT-45353 In Progress
2021-03-11 16:36:50 +03:00
Tianyu Geng
9bdae40ad8 FIR IDE: check generated primary constructor
Currently the IDE skips checking the delegated constructor call because
the primary constructor is generated if it's declared with the class.
2021-03-11 14:30:54 +01:00
Svyatoslav Scherbina
2b994e1b66 Native: fix links in RELEASE_NOTES.md 2021-03-11 13:25:42 +00:00
Jinseong Jeon
55561fad37 FIR CFG: correct target and label for rethrow in try expression
^KT-45385 Fixed
2021-03-11 16:19:16 +03:00
Jinseong Jeon
4f20d2dccf Reproduce KT-45385: false positive MUST_BE_INITIALIZED_* after rethrow 2021-03-11 16:19:15 +03:00
Alexander Udalov
f4c63c8ba2 Update public API dump for stdlib 2021-03-11 14:17:33 +01:00
Michael Hoisie
83383ab9e5 Make kotlin.jvm.internal.DefaultConstructorMarker public
DefaultConstructorMarker is used as a marker to ensure that a
constructor is unique for companion objects. Prior to this change,
DefaultConstructorMarker was package private.

Being package private worked when calling the
DefaultConstructorMarker-marked constsructor using `invokespecial`,
likely because the JVM may not perform strict access checks in this
situation.

However, when access checks are performed, trying to call a
DefaultConstructorMarker-marked constructor will fail. This could happen
if the constructor was called using reflection or the MethodHandle API.
These APIs may be used by tools that perform bytecode instrumentation
on Kotlin JVM bytecode, such as Robolectric. It also caused problems
when using ByteBuddy validation.

Fixes https://youtrack.jetbrains.com/issue/KT-20869
2021-03-11 14:17:33 +01:00
Alexander Likhachev
78ed758704 [Gradle, K/N] Rework environment input on test tasks
Provide method `trackEnvironment` to track environment variables. Use only tracked environment variables as task input.
#KT-44059 Fixed
2021-03-11 15:44:37 +03:00
Alexander Likhachev
c5a9f20a6f [Gradle, K/N] Don't add unsupported targets to default fat frameworks task 2021-03-11 15:37:36 +03:00
Alexander Udalov
bc5fc122c5 JVM, JVM IR: report error if not all parts of multifile class are @JvmSynthetic
#KT-41884 Fixed
2021-03-11 13:33:25 +01:00
Alexander Udalov
75850a618c Minor, move bytecodeListing tests on JvmMultifileClass 2021-03-11 13:33:25 +01:00
Steven Schäfer
057ead358c JVM: Add FILE target to the JvmSynthetic annotation (#4149) 2021-03-11 13:33:07 +01:00
Victor Petukhov
b45d5abeb1 [jspecify] Change annotations' package from org.jspecify.annotations to org.jspecify.nullness, and DefaultNonNull to NullMarked
^KT-45409 Fixed
2021-03-11 15:32:14 +03:00
Alexander Likhachev
2ae7740c46 Set explicit lang version 1.3 for kotlin-native-utils & kotlin-util-io
Without explicit version we cannot use those modules in buildscripts with Gradle 6.8+ because Gradle doesn't set flag `skipPrereleaseCheck` (previously was named `skipMetadataVersionCheck`). This way we make it compatible with all supported versions of Gradle.
2021-03-11 14:12:38 +03:00
Alexander Likhachev
875cf1acf9 [Build] Add https://nodejs.org/dist to cache redirector
https://nodejs.org/dist repository is being added by Gradle Node plugin (com.github.node-gradle.node) at configuration phase in project.afterEvaluate so we need to wrap it once more to setup redirection later than repository is added
2021-03-11 14:12:37 +03:00
Alexander Likhachev
35df00e071 [Build] Apply :idea:idea-gradle classpath modification on JPS build only
This modification is incompatible with Gradle configuration cache
Relates to #KT-44611
2021-03-11 14:12:37 +03:00
Alexander Likhachev
57f5939f5e [Build] Fix configuration cache issues (part 7)
* Read system property "disable.verification.tasks" using Gradle provider
* Fix compileTestKotlin tasks with instrumented classes
* Read Gradle property "kotlin.test.maxParallelForks" using Gradle provider
* Change :idea:performanceTests jackson version to fixed ones
Relates to #KT-44611
2021-03-11 14:12:37 +03:00
Alexander Likhachev
6bd44df861 [Build] Fix configuration cache issues (part 6)
Make DexMethodCountStats task class, tasks :examples:kotlin-jsr223-daemon-local-eval-example:test,:idea:idea-fir:test, :idea:idea-fir-performance-tests:test, :idea:idea-frontend-fir:test, :idea:idea-frontend-fir:idea-fir-low-level-api:test, :kotlin-compiler-client-embeddable:test, :kotlin-compiler-embeddable:test, :kotlin-stdlib-js-ir:compileTestKotlinJs, :plugins:android-extensions-compiler:test, :plugins:parcelize:parcelize-compiler:test, :compiler:test compatible with configuration cache
Relates to #KT-44611
2021-03-11 14:12:36 +03:00
Alexander Likhachev
1751b5182b [Build] Apply test distribution plugin conditionally only if it's needed
This buildscript logic change is motivated by configuration cache incompatibility of the plugin
Relates to #KT-44611
2021-03-11 14:12:36 +03:00
Alexander Likhachev
9be06da045 [Build] Make Gradle IT buildscript property reads via Gradle providers
Relates to #KT-44611
2021-03-11 14:12:36 +03:00
Alexander Likhachev
ca7dfe02b2 [Build] Replace deprecated configurations usage :tools:kotlinp 2021-03-11 14:12:36 +03:00
Alexander Likhachev
078849d133 [Build] Fix configuration cache issues with install task
* `install` task provided by `maven` plugin doesn't support configuration cache so replace `maven` plugin with `maven-publish` and use task that is subtype of PublishToMavenRepository. `maven-publish` partially support configuration cache, see https://github.com/gradle/gradle/issues/13468
* Apply `signing` plugin only if it really needed. The plugin doesn't support configuration cache. See https://github.com/gradle/gradle/issues/13470
Relates to #KT-44611
2021-03-11 14:12:35 +03:00
Alexander Likhachev
46b056c929 [Build] Fix configuration cache issues (part 5)
Make Project.configureFormInstrumentation and Task.useAndroidConfiguration extensions, :dependencies:android-sdk unzip tasks compatible with configuration cache

Relates to #KT-44611
2021-03-11 14:12:35 +03:00
Alexander Likhachev
da6544ae3c [Build] Make projectTest() extension compatible with configuration cache
Relates to #KT-44611
2021-03-11 14:12:35 +03:00
Alexander Likhachev
ce49664366 [Build] Bump test-retry plugin version to 1.2.0 to support conf cache
Relates to #KT-44611
2021-03-11 14:12:34 +03:00
Alexander Likhachev
74ab5c21a8 [Build] Fix configuration cache issues (part 4)
Make :kotlin-stdlib-js:prepareComparableSource, :kotlin-stdlib-js:prepareBuiltinsSources, :kotlin-stdlib-js:compileJs, :kotlin-stdlib-js:compileJs, :prepare:build.version:writeBuildNumber, :kotlin-compiler:distKotlinc compatible with configuration cache

Relates to #KT-44611
2021-03-11 14:12:34 +03:00
Alexander Likhachev
5f10c98a38 [Build] Fix configuration cache issues (part 3)
* Make IntelliJInstrumentCodeTask compatible with configuration cache
* Make CoreXmlShadingTransformer compatible with configuration cache
* Make :kotlin-reflect:relocateCoreSources compatible with configuration cache
* Copy some properties to not capture it's owning object into lambda to support configuration cache
Relates to #KT-44611
2021-03-11 14:12:34 +03:00
Alexander Likhachev
0e4e90dc13 [Build] Bump gradle-node-plugin version to 3.0.1 to support conf cache
:kotlin-test:kotlin-test-js:kotlin-test-js-it will still have old version as integration test run logic cannot be fully refactored to the new version (approximately till 3.1)
Relates to #KT-44611
2021-03-11 14:12:34 +03:00
Alexander Likhachev
89a78a02d4 [Build] Make generatePom tasks compatible with configuration cache
Relates to #KT-44611
2021-03-11 14:12:33 +03:00
Alexander Likhachev
2a49dcab47 [Build] Bump shadow plugin version to 6.1.0 to support configuration cache
Relates to #KT-44611
2021-03-11 14:12:33 +03:00
Alexander Likhachev
faf9600ff0 [Build] Fix configuration cache issues (part 2)
* Make WriteCopyrightToFile task compatible with configuration cache
* Configure shadowJar task in compatible with configuration cache way
* Configure compileJava9Java task in compatible with configuration cache way
* Make :js:js.tests buildscript compatible with configuration cache
Relates to #KT-44611
2021-03-11 14:12:33 +03:00
Alexander Likhachev
ce19063e43 [Build] Disable reporters when configuration cache is enabled
Relates to #KT-44611
2021-03-11 14:12:32 +03:00
Alexander Likhachev
27956adf3f [Build] Fix configuration cache issues (part 1)
* Make `clean` task compatible with configuration cache
* Make Java compile instrumentation compatible with configuration cache
* Make settings.gradle compatible with configuration cache
* Initial work on making IntelliJInstrumentCodeTask compatible with configuration cache
* Make writeStdlibVersion task compatible with configuration cache
* Copy some properties to not capture it's owning object into lambda to support configuration cache

Relates to #KT-44611
2021-03-11 14:12:28 +03:00
Mikhail Glukhikh
111e67dc8d Use DECLARATION_NAME strategy for FirErrors.PRIMARY_CONSTRUCTOR_REQUIRED 2021-03-11 13:25:52 +03:00
Tianyu Geng
6e8bad6ef6 FIR: Implement data class constructor checker 2021-03-11 13:25:51 +03:00
Jinseong Jeon
d2da15e039 FIR checker: report (expected|unnecessary) lateinit 2021-03-11 13:25:51 +03:00
Dmitriy Novozhilov
815e40620c [FIR-IDE] Update testdata after previous changes about java nullability enhancement 2021-03-11 13:10:05 +03:00
Dmitriy Novozhilov
dceb8b2991 [FIR] Don't render ! at the end of ConeFlexibleType 2021-03-11 13:10:05 +03:00
Dmitriy Novozhilov
932eed2c14 [FIR] Fix determining nullability of arguments during enhancement 2021-03-11 13:10:05 +03:00
Dmitriy Novozhilov
65ea4e184a [FIR] Fix enhancement of FlexibleNullability and EnhancedNullability
- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
2021-03-11 13:10:04 +03:00
Dmitriy Novozhilov
0108f8a1b4 [FIR2IR] Don't create implicit not null cast on IrGetEnumValue 2021-03-11 13:10:04 +03:00
Dmitriy Novozhilov
01e8019c4c [FIR] Properly handle friend modules in modularized and full-pipeline tests 2021-03-11 13:10:04 +03:00
Dmitriy Novozhilov
f82c7c4678 [FIR] Cleanup session creation utils 2021-03-11 13:10:04 +03:00
Dmitriy Novozhilov
f1edca8ca8 Move default gradle run configurations to separate folders 2021-03-11 13:10:03 +03:00
Dmitriy Novozhilov
8995fe36f3 Add .idea/csv-plugin.xml to .gitignore 2021-03-11 13:10:03 +03:00
Vladimir Dolzhenko
fbe18164b4 Filter KtAnnotated on-the-fly diagnostic elements
Relates to #KTIJ-1760
Relates to #KT-45254
2021-03-11 08:43:36 +00:00
Dmitriy Novozhilov
cba63f2c12 Regenerate tests 2021-03-11 00:58:26 +03:00
Dmitriy Novozhilov
74118930b4 [FE] Don't fail with exception if ESVisitor tries to visit ESLambda
#KT-45243 Fixed
2021-03-11 00:58:24 +03:00
Mikhail Glukhikh
f3135baba9 FIR: eliminate replaceSource usages in transformTypeToArrayType 2021-03-10 22:23:21 +03:00
Dmitry Petrov
0cca07fa19 Bump d8 used in box tests to 2.1.75 2021-03-10 21:04:12 +03:00
Dmitry Petrov
737fbe271f JVM_IR Do not generate generic signatures for lifted lambda methods 2021-03-10 21:04:11 +03:00
Dmitry Petrov
00a335129b JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+ 2021-03-10 21:04:08 +03:00
Alexander Udalov
bf844aa8e4 JVM IR: prevent behavior change with operator dot calls on literals
#KT-42321 Fixed
2021-03-10 18:46:30 +01:00
Alexander Udalov
c7498dd74d Remove one layer of nested exceptions in JVM backend 2021-03-10 18:44:11 +01:00
Igor Chevdar
6608ca5795 [K/N][IR] Fixed bug with parents setting
Fixes IR_VALIDATION warning as a side effect
2021-03-10 21:29:11 +05:00
Andrey Zinovyev
d941d41776 [KAPT] Fix broken incremental test 2021-03-10 17:30:10 +03:00
Alexander Udalov
a3a745e7a5 Fix ParallelBuildTest for Windows
Enclose file paths in raw strings. Otherwise in the string
"C:\Users\...", "\U" was detected as an illegal escape which led to an
error.
2021-03-10 14:25:06 +01:00
Roman Golyshev
5d0760c685 KT-44756 Ignore annotations on value parameters if metadata says so
There is a `gradle-api-impldep.jar` created by Gradle which contains
our nullability annotations, but relocated in the
`org.gradle.internal.impldep` package

In the deserialization process we use a `HAS_ANNOTATIONS` flag, and
if it is present on the declaration, we do not try to build annotations
for it, even when they are actually present and even when they are
relocated
(see usages of Flags.HAS_ANNOTATIONS in org.jetbrains.kotlin.serialization.deserialization.MemberDeserializer)

In the stubs builder we also use this HAS_ANNOTATIONS flag, but we did
not use it for the value parameters. This commit fixes that - now, if
the `org.jetbrains.annotations` packages are relocated, it should not
cause `Stub Mismatch Error` for the value parameters

Lets consider two possible cases:

1. If the value parameter has a user-defined annotation,
it will be marked as having annotations (HAS_ANNOTATIONS == true), and
both stubs and deserialized descriptors will have to
use all available annotations (even a relocated ones)

2. If, for example, the value parameter is of non-nullable type, it will
have a `@NotNull` annotation on it, but will be marked as having
no annotations at all (HAS_ANNOTATIONS == false), since `NotNull` is
considered as auxiliary by the compiler. Because of the flag, both stubs
and descriptors will ignore all present annotations (even if they were
relocated)

In the both cases, the stubs and the descriptors will completely match

^KT-44756 Fixed

See IDEA-262971 about fixing the Gradle jar and the details

N.B. This does not fixes the cases when `kotlin.Metadata` and similar
annotations are relocated (e.g. KT-25709)
2021-03-10 11:53:33 +00:00
Elena Lepilkina
f7099d34d4 [K/N] Fixed build of performance server project 2021-03-10 11:49:39 +00:00
Dmitriy Dolovov
cd2f55ea2f [Commonizer] Minor. Remove unused utility functions 2021-03-10 13:50:00 +03:00
Dmitriy Dolovov
c1848a26c3 [Commonizer] Use more compact interner based on THashSet 2021-03-10 13:49:54 +03:00
Dmitriy Dolovov
7a11c722c6 [Commonizer] Introduce CirProvided.ExportedForwardDeclarationClass
To represent classifiers that are actually exported forward declarations
2021-03-10 13:49:48 +03:00
Dmitriy Dolovov
76d93b6dca [Commonizer] Read exported forward declarations for every C-interop module 2021-03-10 13:49:41 +03:00
Ilya Gorbunov
a7fda66fa1 Suggest duration static factories instead of number extension properties
Introduce Duration companion functions to convert numbers to Duration.
Deprecate number extension properties and propose to use these
new functions instead.
2021-03-10 13:23:32 +03:00
Ilya Gorbunov
ca99fc4fed Make more lambda-taking functions in kotlin-test inline-only
So that the lambda can contain non-local control flow, such as suspend
calls. Inline-only helps preserving line numbers in the failed assertion
stack traces.

KT-44717
2021-03-10 12:15:45 +03:00
Mikhael Bogdanov
66a29c70bf Use compatibility accessors only in compatibility stubs 2021-03-10 09:09:10 +00:00
Mikhael Bogdanov
efceb89b98 Don't generate private members in compatibility mode in DefaultImpls 2021-03-10 09:09:09 +00:00
Mikhael Bogdanov
f648d86d2b Generate stubs for private function with default arguments as public in interfaces 2021-03-10 09:09:08 +00:00
Andrey Zinovyev
7edbf79b4b [KAPT] Don't fail on empty InsnList
Fix failing on empty methods inline methods (after light generation)

#KT-45032 Fixed
2021-03-10 10:58:35 +03:00
Dmitry Petrov
02b5b931d4 Revert "JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+"
This reverts commit 679756ad
2021-03-10 07:39:29 +03:00
Vasily Levchenko
ba3f27b5ce [performance] performace includes kotlinx.cli compositelly 2021-03-09 20:21:25 +00:00
Vasily Levchenko
8f97ba97f2 [kotlinx.cli] dually depends on kotlin artifacts
- in kotlin build this is project dependency
- in performace build this is artifact dependency
2021-03-09 20:21:25 +00:00
Vasily Levchenko
f159a424f5 [build][plugin] kotlin native benchmarking plugin adds dependency kotlinx.cli as project dependency 2021-03-09 20:21:24 +00:00
Vasily Levchenko
0858a92b12 [build-tools] util to substitute dependency notation as artifact or project dependency 2021-03-09 20:21:23 +00:00
Vasily Levchenko
3935c290a9 [performance] prerequisite checks added 2021-03-09 20:21:23 +00:00
Vasily Levchenko
72bb1f5b30 [kotlin-native][performance][plugin] clean up 2021-03-09 20:21:22 +00:00
Sergey Bogolepov
eb54689801 Update coverage sample documentation.
We need to invoke `llvm-profdata` tool from
the same toolchain as Clang (on macOS we use the one from Xcode).

(cherry picked from commit 91665b36af68b7fb3a56c0e7ed7ebb7d819adfb2)
2021-03-09 20:19:37 +00:00
Alexander Shabalin
e53c8ba6ca Add FinalizerQueue to ObjectFactory (#4725)
(cherry picked from commit af70866594c31c81dfcc41b2e8b33c7a0cdc38f5)
2021-03-09 20:19:36 +00:00
Sergey Bogolepov
f840b45ae1 Add hack for kotlinx-datetime:0.1.1 linkage
Provide a `std::system_category` wrapper with
the same mangling as in GCC 4.8.5

(cherry picked from commit ec5828a1f375a74a09aa49182571201e1f67b4fa)
2021-03-09 20:19:35 +00:00
LepilkinaElena
fcbb921194 [LEGACY MM] Escape making extra increments and decrements during coping to the same array (#4731)
(cherry picked from commit 8b601d8e2c6bc772386ebd88d303a032a6f54237)
2021-03-09 20:19:34 +00:00
Igor Chevdar
f9f948fea6 [IR] Fixed problems with nested inline classes
Fixes https://youtrack.jetbrains.com/issue/KT-45139 as well

(cherry picked from commit 44916e39bfa69325a9ab73cb4533bd2612fb4e56)
2021-03-09 20:19:34 +00:00
Sergey Bogolepov
f5f7e976f6 Fix #KT-45094
Rebuild linux toolchains with an older OS.

(cherry picked from commit 1d249ad7b592573dc4478f0f6cefe2766c323e12)
2021-03-09 20:19:33 +00:00
Sergey Bogolepov
357f2be14e [Toolchain] Archive versioning
Allow toolchain builder to add a suffix to toolchain name.
It is useful for rebuilding the same toolchain in different environment.

(cherry picked from commit 83148fc5bb4e8bcc5afcf119df53ec1bc854be17)
2021-03-09 20:19:32 +00:00
Florian Kistner
bd614aba0b Retain typed generics in ObjC export stubs (#4727)
* Add ObjC export test with disabled generics
* Retain typed generics in ObjC export stubs
* Introduce ObjC variance enum to decouple stubs from Kotlin variance

(cherry picked from commit 4d7c78b952a467ca3318c8c49d36b768fdc1ef9c)
2021-03-09 20:19:31 +00:00
LepilkinaElena
6641b4f029 [LEGACY MM] Fixed types in messages for tracing GC (#4729)
(cherry picked from commit 2f34b0f98e77226f02809a685a96ebb683a69e9d)
2021-03-09 20:19:30 +00:00
Dmitry Petrov
679756ad07 JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+ 2021-03-09 23:16:11 +03:00
Alexander Udalov
8294aed40c IR: add descriptor to "unbound symbols not allowed" message
This will help in diagnosing problems such as KT-45236.
2021-03-09 21:07:53 +01:00
Alexander Udalov
e3dc112c5f Add original KotlinType to rendered IrErrorType
Also improve an error message in `IrType.erasedUpperBound`, which seems
like a frequent first place where the JVM IR backend crashes in case an
error type has made it past psi2ir.

This will help in diagnosing problems such as KT-45016.
2021-03-09 21:07:53 +01:00
Alexander Udalov
cd9463ae8d Minor, add toString for GeneratedFile 2021-03-09 21:07:53 +01:00
Alexander Udalov
bdaeaca5ae Psi2ir: do not generate default accessor body for expect properties
Because generateDefaultGetterBody/generateDefaultSetterBody reference
the property's backing field, which in case of extension properties
leads to an error "Unbound symbols not allowed" because extension
property cannot have a backing field.

In some way, this check is similar to the `isExpect` check in
`generatePrimaryConstructor`.
2021-03-09 20:51:02 +01:00
Alexander Udalov
5fc9f3bc17 Minor, add box test for unreachable uninitialized property
#KT-44496
2021-03-09 20:50:39 +01:00
Alexander Udalov
247efb220c Do not require backing fields for extension properties
This has no effect on correct code because extension properties cannot
have a backing field anyway and that is checked separately. But this
function is used in psi2ir to determine whether or not to create a
backing field for a property, and in case the code where the property is
declared is unreachable like in KT-44496 and has no explicit getter or
setter, it would previously return true for extension properties, which
on JVM would result in an actual field in the class file, which made no
sense.

After this change, the compiler will actually crash with an exception in
the IR validaton step because the symbol for the field is unbound. That
is a bit better than proceeding to generate potentially invalid
bytecode, but of course a proper fix would be to report an error in the
frontend.

 #KT-44496
2021-03-09 20:50:39 +01:00
Ilya Kirillov
81baf4fae5 FIR IDE: collect diagnostics under read lock 2021-03-09 18:30:35 +01:00
Ilya Kirillov
770468c78e FIR IDE: refactor designated lazy transformers 2021-03-09 18:30:35 +01:00
Pavel Kirpichenkov
4bc019736b [MPP] Add KotlinSDK to the set of predefined test SDKs
^KT-45145 Fixed
2021-03-09 20:05:32 +03:00
Ilya Kirillov
d8a3dacdc5 FIR: return back supertypeRefs list recreation 2021-03-09 15:41:42 +01:00
Pavel Punegov
efa43052db Fix Kotlin/Native dist path setting in Klib tests 2021-03-09 14:38:59 +00:00
Vladimir Ivanov
fd02802028 [Native] Export KDoc into generated native header 2021-03-09 16:50:23 +03:00
Jinseong Jeon
6427117a35 FIR CFG: correct edge label from a node that returns Nothing
If it's not within a try/catch/finally, that should be an uncaught
exception path.

^KT-45327 Fixed
2021-03-09 14:44:42 +03:00
Jinseong Jeon
d8fb54c6bd Reproduce KT-45327: false positive MUST_INITIALIZED_OR_BE_ABSTRACT after conditional exitProcess 2021-03-09 14:44:42 +03:00
Alexander Udalov
628d75c7cd JVM: fix EnclosingMethod information for SAMs in inline lambdas
Pass parentContext to SamWrapperCodegen from the outside instead of
using the one from parentCodegen. The difference is that in case of an
inline lambda, we're creating an InlineLambdaContext whose parent is a
ClosureContext, but the codegen for that lambda has that latter
ClosureContext as its context. So the getNonInlineOuterContext call in
SamWrapperCodegen.generateInnerClassInformation wasn't able to identify
that this is a context of a lambda that needs to be skipped, and
generated it as EnclosingMethod, which caused Java reflection to fail
because once that lambda was inlined, it was removed and thus didn't
make it to runtime.

 #KT-44827 Fixed
2021-03-09 11:43:11 +01:00
Nikolay Krasko
9e5bf7e05c Increase amount of memory for Gradle Importing Tests
We have OOM in recent tests executions
2021-03-09 13:32:27 +03:00
Dmitriy Dolovov
1a3515dbab [Commonizer] Use Flag.Class.IS_VALUE instead of Flag.Class.IS_INLINE
Also: Rename CirClass.isInline to CirClass.isValue
2021-03-09 13:13:30 +03:00
Dmitriy Dolovov
0fb99f1bf2 [Commonizer] Rename: entityBuilders.kt to CirSerializers.kt 2021-03-09 13:13:24 +03:00
Dmitriy Dolovov
b41cc57ff7 [Commonizer] Rename: Cir<Entity>.build<Entity> to Cir<Entity>.serialize<Entity> 2021-03-09 13:13:18 +03:00
Dmitriy Dolovov
010ea39417 [Commonizer] Rename: MetadataBuilder -> CirTreeSeralizer 2021-03-09 13:13:13 +03:00
Dmitriy Dolovov
4f33abf5e4 [Commonizer] Minor. Rename: CirTypeProjectionImpl -> CirRegularTypeProjection 2021-03-09 13:13:06 +03:00
Dmitriy Dolovov
6b0f080ed8 [Commonizer] Rename: TypeParameterResolver -> CirTypeParameterResolver 2021-03-09 13:12:59 +03:00
Dmitriy Dolovov
d07ede7305 [Commonizer] Move all CIR deserialization logic to CirDeserializers.kt 2021-03-09 13:12:53 +03:00
Dmitriy Dolovov
1737bdd4d4 [Commonizer] Extract CirTypeResolver to a separate file 2021-03-09 13:12:47 +03:00
Dmitriy Dolovov
6697c4d197 [Commonizer] Put all CIR utils to a single file 2021-03-09 13:12:42 +03:00
Dmitriy Dolovov
20ab88c001 [Commonizer] Extract CirStandardTypes from CirTypeFactory 2021-03-09 13:12:37 +03:00
Dmitriy Dolovov
298b595826 [Commonizer] Move TA expander to 'commonizer.metadata' package 2021-03-09 13:12:32 +03:00
Dmitriy Dolovov
82589c0898 [Commonizer] Move recursion markers to 'commonizer.cir' package 2021-03-09 13:12:26 +03:00
Dmitriy Dolovov
f0669c752f [Commonizer] Extract creation of CirProperty from CirPropertyFactory 2021-03-09 13:12:21 +03:00
Dmitriy Dolovov
3778d1d631 [Commonizer] Extract creation of CirFunction from CirFunctionFactory 2021-03-09 13:12:15 +03:00
Dmitriy Dolovov
d3c60ab72e [Commonizer] Extract creation of CirClass from CirClassFactory 2021-03-09 13:12:09 +03:00
Dmitriy Dolovov
fa9285aac7 [Commonizer] Extract creation of CirTypeAlias from CirTypeAliasFactory 2021-03-09 13:12:04 +03:00
Dmitriy Dolovov
52d0250dc6 [Commonizer] Extract creation of CirClassConstructor from CirClassConstructorFactory 2021-03-09 13:11:59 +03:00
Dmitriy Dolovov
cdba0d029e [Commonizer] Extract creation of CirExtensionReceiver from CirExtensionReceiverFactory 2021-03-09 13:11:52 +03:00
Dmitriy Dolovov
885026f6db [Commonizer] Extract creation of CirTypeParameter from CirTypeParameterFactory 2021-03-09 13:11:47 +03:00
Dmitriy Dolovov
b30ebe2842 [Commonizer] Drop CirPackageFactory 2021-03-09 13:11:41 +03:00
Dmitriy Dolovov
bfe0623837 [Commonizer] Drop CirModuleFactory 2021-03-09 13:11:35 +03:00
Dmitriy Dolovov
1f17d238f8 [Commonizer] Drop CirRootFactory 2021-03-09 13:11:30 +03:00
Dmitriy Dolovov
d7ed8ff804 [Commonizer] Encapsulate interning inside of CIR entities: CirTypeAliasType 2021-03-09 13:11:24 +03:00
Dmitriy Dolovov
36294352ef [Commonizer] Encapsulate interning inside of CIR entities: CirClassType 2021-03-09 13:11:19 +03:00
Dmitriy Dolovov
c6d8cddcd9 [Commonizer] Encapsulate interning inside of CIR entities: CirTypeParameterType 2021-03-09 13:11:14 +03:00
Dmitriy Dolovov
3012839f49 [Commonizer] Encapsulate interning inside of CIR entities: CirAnnotation 2021-03-09 13:11:08 +03:00
Dmitriy Dolovov
f7d977d7c4 [Commonizer] Encapsulate interning inside of CIR entities: CirPropertySetter 2021-03-09 13:11:02 +03:00
Dmitriy Dolovov
f1739980d3 [Commonizer] Encapsulate interning inside of CIR entities: CirPropertyGetter 2021-03-09 13:10:57 +03:00
Dmitriy Dolovov
ec1e4fb26e [Commonizer] Encapsulate interning inside of CIR entities: CirFunctionModifiers 2021-03-09 13:10:51 +03:00
Dmitriy Dolovov
5e41a7c66b [Commonizer] Encapsulate interning inside of CIR entities: CirValueParameter 2021-03-09 13:10:46 +03:00
Dmitriy Dolovov
f43626d545 [Commonizer] Drop no more necessary logic for forward declarations 2021-03-09 13:10:40 +03:00
Dmitriy Dolovov
12be9c99ca [Commonizer] Replace DescriptorVisibilit[y,ies] by Visibilit[y,ies] 2021-03-09 13:10:35 +03:00
Dmitriy Dolovov
7bdbc893a0 [Commonizer] Move test-specific logic to 'tests' module 2021-03-09 13:10:30 +03:00
Dmitriy Dolovov
a0baecc6e4 [Commonizer] Rename: CirTreeMergerV2 -> CirTreeMerger 2021-03-09 13:10:24 +03:00
Dmitriy Dolovov
126b634529 [Commonizer] Drop support of descriptors, part 2 2021-03-09 13:10:18 +03:00
Dmitriy Dolovov
607568fb73 [Commonizer] Rework mocks for tests to drop descriptors 2021-03-09 13:10:13 +03:00
Dmitriy Dolovov
e96dd3b301 [Commonizer] Drop support of descriptors, part 1 2021-03-09 13:10:07 +03:00
Dmitriy Dolovov
eddeef1d51 [Commonizer] Build CIR tree directly from metadata 2021-03-09 13:10:01 +03:00
sebastian.sellmair
3d6893e518 [Commonizer] Implement safe SharedCommonizerTarget factory function
Do not try to instantiate SharedCommonizerTarget with no leaves
^KT-45350 Verification Pending
2021-03-09 10:02:00 +00:00
sebastian.sellmair
6527452143 [Commonizer] Add CommonizerIT test for ^KT-45350
Adding a test project containing commonization targets for
ios, linux and windows to test behaviour if at least one commonizer group
is fully not supported.
2021-03-09 10:02:00 +00:00
Mads Ager
7dbb0c7d20 [IR] Make IrGetObjectValue copyable to avoid duplicate IR nodes.
Fixes KT-45170
2021-03-09 09:48:16 +03:00
Ilmir Usmanov
e79c9a3618 Extend LVT record of alive variables to end of next suspension point
Otherwise, arguments of suspend call become invisible in async stack
trace
 #KT-44714
2021-03-08 23:56:40 +01:00
Ilmir Usmanov
b6bb8a576e Make start label of LVT record the point where variable becomes alive
Otherwise, there will be overlapping LVT records, which leads to
removal of the whole LVT by R8.
 #KT-44714 Fixed
2021-03-08 23:56:39 +01:00
Ilmir Usmanov
e17b7f01b6 Do not remove dead variables' LVT records
Also, extend liveness of alive variable to nearest suspension points
 #KT-44714
2021-03-08 23:56:36 +01:00
Alexander Udalov
ee11202db5 Add Flag.IS_VALUE for value classes to kotlinx-metadata-jvm
#KT-44783 Fixed
2021-03-08 21:22:40 +01:00
Alexander Udalov
6ddca4a592 Add KClass.isValue to kotlin-reflect
#KT-44782 Fixed
2021-03-08 21:22:40 +01:00
Mikhael Bogdanov
4d51d71699 Fix EXPLICIT_OVERRIDE_REQUIRED_IN_MIXED_MODE message 2021-03-08 17:52:52 +00:00
Mikhael Bogdanov
3568eba1b2 Use actual implementation instead of inherited one in -Xjvm-default diagnostics 2021-03-08 17:52:52 +00:00
Mikhael Bogdanov
71c134e54f Fix checker for -Xjvm-defaults 2021-03-08 17:52:51 +00:00
Alexander Udalov
8b8262096c Fix testKt44814 by adding an IR dump
It's supposedly needed because of the `// DUMP_IR` directive.
2021-03-08 17:32:13 +01:00
Alexander Udalov
9970851684 Restore writing bytecode version to metadata for LV < 1.5
#KT-45323 Fixed
2021-03-08 11:18:54 +01:00
Alexander Udalov
a2200b5386 Revert "Do not write bytecode version to class file"
This reverts commit c6f5ce6837.

 #KT-45323
2021-03-08 11:18:54 +01:00
Ilya Kirillov
7c11dde2cf FIR IDE: add support of FirStatement in getKtExpressionType 2021-03-07 19:48:08 +01:00
Ilya Kirillov
d311fe21f8 FIR IDE: add additional tests for expression types 2021-03-07 19:48:08 +01:00
Ilya Kirillov
8a28175302 FIR IDE: fix CCE in getKtExpressionType on loops 2021-03-07 19:48:08 +01:00
Ilya Kirillov
0130ecd21d FIR IDE: fix CCE in getKtExpressionType on assignment target 2021-03-07 19:48:08 +01:00
Andrey Uskov
b7e13d677d Fixed loading Gradle script templates located on WSL2
#KT-45042 Fixed
2021-03-07 19:40:13 +03:00
Andrey Uskov
63925ee018 Implemented collecting projectId from Gradle
#KT-45337 Fixed
2021-03-07 19:40:08 +03:00
Abduqodiri Qurbonzoda
4401589974 [K/N] Fix @SinceKotlin in Common titlecase and titlecaseChar functions 2021-03-07 07:38:05 +03:00
Abduqodiri Qurbonzoda
e7a45bba91 Fix @SinceKotlin in Common titlecase and titlecaseChar functions 2021-03-07 07:38:04 +03:00
Abduqodiri Qurbonzoda
aa5874e073 [K/N] Mark with @SinceKotlin("1.5") the Common char category API 2021-03-07 07:37:47 +03:00
Abduqodiri Qurbonzoda
10b0d147af Mark with @SinceKotlin("1.5") the Common char category API 2021-03-07 07:37:46 +03:00
Yahor Berdnikau
5db71209b2 Run Gradle advanced tests against 7.0-milestone-2 Gradle release.
^KT-44949 Fixed
2021-03-06 19:43:50 +01:00
Yahor Berdnikau
58564a7b89 Distinguish outputs of JS IR tasks.
Now JS IR link and sync tasks will output produced artifacts based on
compilation name, binary name and binary mode. This will remove
Gradle 7 error about missing task dependencies, which should not depend
on each other.

^KT-44949 In Progress
2021-03-06 19:43:50 +01:00
Yahor Berdnikau
2e1c1cd154 Fix test expects slightly different variant selection error message.
Error message was slightly changed on Gradle 7.

^KT-44949 In Progress
2021-03-06 19:43:50 +01:00
Yahor Berdnikau
c96c50a73c Update AGP tests.
Bump AGP version in some tests and ignore AGP 3.4 tests on Gradle 7.
AGP 3.4 is not compatible with Gradle 7.

^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
e17aa5efaa Change source jar duplication error to warning.
For now Gradle 7 will print warnings on publishing sources jar containing
duplicate files.

Duplicates are coming from SourceSets SourceSet added to sources jar
task depends on. Such approach should be rethought.

^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
c072c8200b Fix test was using removed publication plugin.
Replace usage of removed 'maven' plugin with 'maven-publish'.

^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
2042508df0 Fix test project uses removed configuration for dependencies.
^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
d78f579a42 Link task producing jar with sources to dukat tasks.
This required by Gradle 7 task validation.
Though in some cases sourcesJar task should not depend in some cases on Dukat tasks.

^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
2a8e2613a2 Split klib and cinterop outputs.
So Gradle 7 will not complain that some tasks using klib or cinterop
should depend on both tasks producing klib and cinterop, while they
don't need both.

^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
2ed98ee732 Fix test was using old KMM dependency notation.
^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Yahor Berdnikau
db2d6c7e0a Ensure compilation task depends on friend artifact producer task.
Without it Gradle 7.0 tasks dependency validation will fail.

Fix JS tasks are not cacheable due to friends inputs change.

^KT-44949 In Progress
2021-03-06 19:43:49 +01:00
Cedric Champeau
0340a89045 Fix File as input of an artifact transform
Using `File` as input of an artifact transform was deprecated.
With Gradle 7, this becomes an error. This commit fixes the
problem by using the proper replacement:

   Provider<FileSystemLocation>
2021-03-06 15:46:07 +03:00
scaventz
9a7ef11043 Report a readable diagnostic on empty -J argument in CLI 2021-03-06 03:14:11 -08:00
scaventz
81a495b494 Fix the NullPointerException when pathname does not name a parent. 2021-03-06 01:50:40 -08:00
Abduqodiri Qurbonzoda
1c1492da3d Optimize K/N ArrayList.toArray #KT-42720 2021-03-06 11:15:08 +03:00
Abduqodiri Qurbonzoda
421cb6971d Optimized toArray method for ArrayDeque and ListBuilder #KT-42720 2021-03-06 11:14:50 +03:00
Abduqodiri Qurbonzoda
c2f6a2cb96 [K/N] Commonize and generalize JVM-only String.contentEquals #KT-42840 2021-03-06 11:14:32 +03:00
Abduqodiri Qurbonzoda
ed57bcb3b1 Commonize and generalize JVM-only String.contentEquals #KT-42840 2021-03-06 11:14:30 +03:00
Mikhail Glukhikh
037505d9f2 FIR IDE: regenerate diagnostics 2021-03-06 09:22:35 +03:00
Mikhail Glukhikh
7eb9b1188f FIR: implement helpers for diagnostic suppression on elements children 2021-03-06 09:22:35 +03:00
Mikhail Glukhikh
15c3269e38 FIR: don't report error on inline nested classes 2021-03-06 09:22:35 +03:00
Mikhail Glukhikh
1e4d7ff690 Fix LightTreePositioningStrategies.DECLARATION_NAME 2021-03-06 09:22:35 +03:00
eugenpolytechnic
f6e564ffa6 FIR: introduce inline classes checks 2021-03-06 09:22:34 +03:00
Ilya Gorbunov
9cc8f44390 Support mod and floorDiv extensions in constant evaluator
Ignore evaluation tests for floorDiv and mod with FIR for now.
2021-03-05 23:46:57 +03:00
Ilya Gorbunov
58e6f775bb Rename test of rem operator evaluation 2021-03-05 23:46:57 +03:00
Ilya Gorbunov
3da3f0e653 Advance bootstrap to 1.5.20-dev-2378 2021-03-05 23:46:56 +03:00
Mads Ager
e5631addf3 [IR] Move annotations from original to new constructor declarations.
LocalDeclarationsLowering did not move annotations when creating
a new constructor declaration, thereby losing the annotations.

Fixes KT-45298
2021-03-05 12:24:38 -08:00
Mads Ager
965c118521 [JVM IR] Make upper bounds check recursive for ieee Equals.
Fixes KT-44402
2021-03-05 12:22:54 -08:00
Alexander Udalov
566f97ae3e JVM IR: remove dependency of 'backend.jvm' on 'psi2ir', 'ir.serialization.jvm'
Add a new module 'backend.jvm.entrypoint' which depends on psi2ir and
contains code that runs psi2ir + JVM IR backend with serialization
implementations.

Hopefully this will allow to compile these modules in parallel and
reduce the build time.
2021-03-05 20:46:33 +01:00
Alexander Udalov
5e0860ca14 IR: move PsiSourceManager, PsiErrorBuilder to ir.backend.common 2021-03-05 20:46:33 +01:00
Alexander Udalov
bec4d1903b IR: move PsiFileEntry to ir.tree, rename to PsiIrFileEntry 2021-03-05 20:46:33 +01:00
Alexander Udalov
1f8de46b3c JVM IR: do not depend on StubGeneratorExtensions in backend
Move most of the implementation from JvmGeneratorExtensions to
JvmGeneratorExtensionsImpl. The latter implements
StubGeneratorExtensions from psi2ir, and doing so helps to remove direct
dependency on this part of psi2ir from backend.
2021-03-05 20:46:33 +01:00
Alexander Udalov
22d269a0a8 Minor, rename JvmGeneratorExtensions.kt -> JvmGeneratorExtensionsImpl.kt
To keep git history for this file after the subsequent commit, where
most of the implementation is moved to JvmGeneratorExtensionsImpl.
2021-03-05 20:46:33 +01:00
Alexander Udalov
f332192de8 IR: remove SourceManager, make PsiSourceManager a singleton 2021-03-05 20:46:33 +01:00
Mikhael Bogdanov
8ff0b1e243 Reports warning on super calls in public-api inline functions 2021-03-05 18:45:07 +00:00
Alexander Udalov
027df41740 Add test which runs Kotlin compiler in parallel
This will be useful in diagnosing issues like KT-45007 in the future.

 #KT-45007
2021-03-05 17:58:42 +01:00
Alexander Udalov
e7e17cdaa9 Revert "Fix KotlinCoreEnvironment projectCount disposable"
This reverts commit 99a6bdeec7.

 #KT-45007 Fixed
2021-03-05 17:40:39 +01:00
Vladimir Dolzhenko
36ff952a0f Ignore when failed to get file text
Relates to #KTIJ-706
2021-03-05 17:12:56 +01:00
Andrei Klunnyi
a0b901b23a Revert "[FIR]: sealed hierarchy processor for IDE"
This reverts commit e6ccdff2
2021-03-05 16:37:47 +01:00
Dmitriy Novozhilov
4ed341b152 Advance bootstrap to 1.5.20-dev-1608 2021-03-05 17:23:29 +03:00
Ilya Kirillov
1d42c70056 FIR IDE: generate diagnostics 2021-03-05 15:04:07 +01:00
Igor Yakovlev
b744f41c0d [ULC] Fix annotations invalid parents
Fixed #KT-45287
2021-03-05 14:33:10 +01:00
Igor Yakovlev
179cf303da [ULC] Fix annotations with no site for ctor
Fixed #KT-45291
2021-03-05 14:33:10 +01:00
Yahor Berdnikau
297aa17b6e Fix Jvm target tries to use removed configuration.
KT-44949 In Progress
KT-44957 Fixed
2021-03-05 16:28:03 +03:00
Yahor Berdnikau
117cfc763a Fix JS target configuration triggers task creation too early.
This raised the problem that task, compilation task depends on, has not
been yet created and Gradle fails the build with exception.

KT-44949 In Progress
2021-03-05 16:28:01 +03:00
Yahor Berdnikau
d06ec61b79 Migrate to the actual workers api available from Gradle 5.6.
Old api was removed in Gradle 7 and causes build crashes.

KT-44949 In Progress
2021-03-05 16:28:00 +03:00
Tianyu Geng
8158a07063 FIR IDE: add quickfix for NESTED_CLASS_NOT_ALLOWED 2021-03-05 13:27:36 +01:00
Svyatoslav Scherbina
27904c0fb9 Native compiler source: replace inline classes by value classes
The former are deprecated.
2021-03-05 12:15:22 +00:00
Svyatoslav Scherbina
b45de517c4 Native stdlib build: fix using OptionalExpectation in Interop/Runtime
Current build for kotlin-native/Interop/Runtime sources is not truly
MPP, so explicit -Xcommon-sources flags are required for the compiler
to allow using OptionalExpectation annotations.
2021-03-05 12:15:22 +00:00
Bingran
03df752e8e Update min supported gradle version to 6.1
This PR also updates the min agp version we test with because older agp
versions are using gradle apis which doesn't exist in gradle 6.0+.

GH PR: #4155
2021-03-05 14:11:10 +03:00
Roman Artemev
9bdfbc948c [KLIB] Support assignable value parameters in deserializer
- fix KT-44945
2021-03-05 13:47:07 +03:00
Andrei Klunnyi
e6ccdff2f7 [FIR]: sealed hierarchy processor for IDE
From now on sealed declarations get resolved with the help of
FirIdeSealedHierarchyProcessor. This change entails correct IDE side
check for sealed when exhaustiveness.
2021-03-05 10:20:19 +00:00
Dmitriy Novozhilov
aa829c2321 [FIR2IR] Fix using default values of annotation arguments 2021-03-05 13:00:12 +03:00
Dmitriy Novozhilov
ca26c193ae Make all hierarchies of JavaAnnotationArgument sealed 2021-03-05 13:00:12 +03:00
Dmitriy Novozhilov
1f6ce874a1 Don't fail on unsupported default values of java annotations 2021-03-05 13:00:12 +03:00
Dmitriy Novozhilov
745aa620d0 Reformat annotationArgumentsImpl.kt 2021-03-05 13:00:11 +03:00
Dmitriy Novozhilov
bd7689d381 [FIR] Properly compute default arguments of java annotations 2021-03-05 13:00:11 +03:00
Dmitriy Novozhilov
8324f499cd [FIR] Fix serializing annotation metadata on setters value parameters 2021-03-05 13:00:11 +03:00
Vasily Levchenko
ee1bc45bd6 [performance] disable fat framework compilation 2021-03-05 09:53:27 +00:00
Vasily Levchenko
ab68bb6ddb [performance] enable "swift run" 2021-03-05 09:53:26 +00:00
Jinseong Jeon
8368812432 Minor cleanup: avoid vague util names 2021-03-05 10:06:22 +03:00
Jinseong Jeon
8b24f4b5c6 Minor cleanup: place modifier strategies close to each other 2021-03-05 10:06:22 +03:00
Jinseong Jeon
1ba943eb4a Minor cleanup: prefer actual body with return statement 2021-03-05 10:06:22 +03:00
Ilya Gorbunov
7e2c365b79 Generate docs for floorDiv and mod and improve docs for div and rem
Refactor operator documentation generation for primitives and unsigned
types so that it is easier to specialize it.

Manually sync docs of numeric types in js-ir stdlib.

 KT-26234
2021-03-05 07:32:16 +03:00
Ilya Gorbunov
50d4979531 Floor division and remainder for numeric types KT-26234
- floorDiv/mod for unsigned types
- floorDiv/mod for signed types
- mod for floating point types

- mod return type: same as divisor for integer types

- Update JS API dump
- Avoid triggering division overflow in tests due to K/N
- Workaround failing test in JS-legacy
2021-03-05 07:32:16 +03:00
Ilya Gorbunov
284e6f5bb3 Add runtime dependency on junit-jupiter-engine to kotlin-test-junit5
It is required to run tests authored with kotlin-test, so it seems
convenient to have it as a runtime dependency of kotlin-test-junit5
variant.

Depend on the version 5.6.0, which is approx. one year old.
Can be upgraded in the consumer project if necessary.

Also upgrade junit-jupiter-api dependency to 5.6.0, so that users could
use more recent JUnit functionality in JVM tests,
but continue compiling the artifact against 5.0.0 to leave a
possibility to downgrade JUnit platform dependency if needed.

KT-45107
2021-03-05 02:22:24 +03:00
scaventz
28452fc38e Kotlinc: catch FileNotFoundException caused by problematic destination. 2021-03-04 11:25:35 -08:00
Dmitriy Dolovov
149282a888 [Commonizer] Fix: Stats not logged for "native-dist-commonize" CLI task 2021-03-04 22:24:11 +03:00
Dmitriy Dolovov
1c06972ec6 [Commonizer] Minor. Formatted 2021-03-04 22:24:05 +03:00
Dmitriy Dolovov
d6961a6e60 [Commonizer] Rework MetadataDeclarationsComparator API
1. Formalize all possible variants of entities where mismatch could happen via sealed interface MetadataDeclarationsComparator.EntityKind
2. Track the path to the place of mismatch in terms of MetadataDeclarationsComparator.PathElement
2021-03-04 22:23:57 +03:00
Alexander Likhachev
70d434e992 Update tests after compiler properties rework
#KT-43605 Fixed
2021-03-04 19:36:18 +03:00
Alexander Likhachev
3537c699b5 [Gradle] Read system properties at configuration time using Gradle providers
The change is a step to fully support Gradle configuration cache.
Relates to #KT-43605
Relates to #KT-44611
2021-03-04 19:36:11 +03:00
Ivan Gavrilovic
d73f5d299a KAPT - Make StructureTransformAction cacheable
When computing classpath structure ignore absolute
paths and timestamps. This also makes the transform
cacheable and it should increase cache hit rate.

Test: existing BuildCacheRelocationIT
2021-03-04 19:00:14 +03:00
Jinseong Jeon
9badbfc30d FIR checker: simplify isExpect|isExternal checks
Those resolve information are different from modality/visibility, which
could have conflicting modifiers.
2021-03-04 17:56:30 +03:00
Jinseong Jeon
774ba58062 FIR checker: pluralize top-level/member function/property checkers 2021-03-04 17:56:30 +03:00
Jinseong Jeon
d348e58183 FIR: rename util to retrieve primary constructor 2021-03-04 17:56:30 +03:00
Jinseong Jeon
1090eca086 RAW FIR: record property accessors' own modality properly 2021-03-04 17:56:30 +03:00
Jinseong Jeon
e009b71f88 FIR checker: report uninitialized member/extension properties 2021-03-04 17:56:29 +03:00
Jinseong Jeon
e8028e7825 FIR checker: report nullable/non-class LHS of class literals 2021-03-04 17:09:52 +03:00
Dmitriy Novozhilov
a6d1d47918 [FIR] Fix clearing info about DF variable after reassignment 2021-03-04 17:09:17 +03:00
Dmitriy Novozhilov
f8adce8b96 [FIR] Cleanup data flow analysis of safe calls 2021-03-04 17:09:17 +03:00
Dmitriy Novozhilov
2cb24fbd49 Fix compiler warning in ide test utils 2021-03-04 17:09:17 +03:00
Mikhail Glukhikh
48001dbbb2 FirConstPropertyChecker: add some TODOs 2021-03-04 16:13:50 +03:00
Mikhail Glukhikh
6470b713d5 FIR: set isConst on primary constructor properties 2021-03-04 16:13:50 +03:00
Mikhail Glukhikh
d7a6fc80b0 FIR: don't report CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT on variables 2021-03-04 16:13:50 +03:00
Br0mm
dd3bc1a964 FIR: Introduce CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT diagnostic 2021-03-04 16:13:50 +03:00
Mikhail Zarechenskiy
6c2eaf2df8 Increase stub versions for major release
^KT-41056 Fixed
2021-03-04 16:03:19 +03:00
Vladimir Dolzhenko
cb92474af9 Use highlight visitor instead of custom general like highlighting pass
#KTIJ-1760 Fixed
#KT-45254 Fixed
2021-03-04 07:11:58 +00:00
KotlinIsland
5e173c9f83 Minor: remove redundant suppression (#3812)
The suppression is not needed after KT-12448 has been fixed.
2021-03-04 08:18:35 +03:00
Vyacheslav Gerasimov
bf62e52998 Build: Remove allowUntrustedServer = true from build scan config 2021-03-03 23:49:22 +03:00
Sergey Shanshin
bf6dda2d99 Lazy delegate for serializer in objects, sealed and abstract classes
Fixes Kotlin/kotlinx.serialization#585
2021-03-03 21:41:37 +03:00
Tianyu Geng
89ce629352 FIR: report VARARG_OUTSIDE_PARENTHESES 2021-03-03 20:23:59 +03:00
Vasily Levchenko
20aef57677 [performance] resolve issue with movement of kotlinx-metadata-klib and some bintray clean up 2021-03-03 14:53:19 +00:00
Mikhail Glukhikh
b7cb39fdd1 Drop/inline unused members of FirTowerDataContextsForClassParts 2021-03-03 17:15:26 +03:00
Mikhail Glukhikh
b2b502338a FIR: move lambda / reference specific contexts to general context parts 2021-03-03 17:15:26 +03:00
Mikhail Glukhikh
eca1256d7e FIR: refactor property & initializer resolve 2021-03-03 17:15:26 +03:00
Mikhail Glukhikh
130e3552ea Unite different tower contexts in FirTowerDataContextsForClassParts 2021-03-03 17:15:26 +03:00
Vladimir Dolzhenko
72322646cc Temporary disable assertion
Relates to #KT-37702
2021-03-03 14:15:50 +01:00
Svyatoslav Scherbina
9f77c68f17 Remove bintray repositories from kotlin-native build 2021-03-03 09:38:45 +00:00
Svyatoslav Scherbina
95584f90c3 Remove bintray repositories from kotlin-native/samples 2021-03-03 09:33:04 +00:00
Jinseong Jeon
5923cbd76f FIR: remove unnecessary override in PreliminaryLoopVisitor 2021-03-03 12:27:12 +03:00
Jinseong Jeon
f1fa290d49 FIR checker: report val reassignment 2021-03-03 12:27:11 +03:00
Andrey Zinovyev
b128577508 [KAPT] Some optimizations for stubs generation
* Add index to resolve compiled class by name
* Disable full property resolution
2021-03-03 12:05:49 +03:00
Ivan Gavrilovic
08446e2371 KT-45168: Avoid generating stubs for generated Kotlin sources
Filter out Kotlin sources coming from KAPT-generated dirs.
Some annotation processors e.g Moshi, generate Kotlin sources,
and when generating stubs in non-incremental runs, stub generation
must ignore those sources. This fixes #KT-45168.

Test: Kapt3IT
2021-03-03 11:35:29 +03:00
justin.wei
34274dd032 Support relocatable cache for InputCache 2021-03-03 11:25:58 +03:00
Mikhail Glukhikh
45ba035431 Drop obsolete TODO during FIR building 2021-03-03 08:55:48 +03:00
Mads Ager
8e9dfc23b6 FIR: Take targeted annotations into account for metadata
Getter/setter targeted annotations were not correctly reflected
in the kotlin metadata which made them not work with
kotlin-reflect.
2021-03-03 08:48:28 +03:00
Shagen Ogandzhanian
2a170652c5 Don't create IIFE for varags at all when it possible
^KT-40689 fixed
2021-03-02 22:13:32 +03:00
Shagen Ogandzhanian
cac57e4178 Don't create externalVarargReceiverTmp when there's no need to create it
^KT-40689 fixed
2021-03-02 22:13:31 +03:00
Shagen Ogandzhanian
6255f2bd77 Simplify JsInvocation in case we not it's Array
^KT-40689 fixed
2021-03-02 22:13:30 +03:00
Shagen Ogandzhanian
e98413740b Pass scope to the call of iifeFun only when it make sense
^KT-40689 fixed
2021-03-02 22:13:29 +03:00
Shagen Ogandzhanian
1dbe7d12a2 Simplify concatElements resolution for size=0 and size=1 cases
^KT-40689 fixed
2021-03-02 22:13:28 +03:00
Shagen Ogandzhanian
bcfc0c21b1 Don't add to the concatenation chain empty arraysForConcat at all
^KT-40689 fixed
2021-03-02 22:13:26 +03:00
Shagen Ogandzhanian
d71fa4831d Filter out empty arrays before concatentating
^KT-40689 fixed
2021-03-02 22:13:25 +03:00
Shagen Ogandzhanian
31f5bcfaef Minor cosmetic readability fixes in VarargLowering
^KT-40689 fixed
2021-03-02 22:13:24 +03:00
Shagen Ogandzhanian
c996161db0 Unroll any constructor call if argument is JsArrayLiteral
^KT-40689 fixed
2021-03-02 22:13:23 +03:00
Shagen Ogandzhanian
997d23eb43 Simplify signatures for arrays in argumentsWithVarargAsSingleArray
^KT-40689 fixed
2021-03-02 22:13:22 +03:00
Abduqodiri Qurbonzoda
85fe636d60 Commonize Char.titlecaseChar() and Char.titlecase() #KT-44369
(cherry picked from commit 7b991613bb577a58235519b76ebec8b33270f783)
2021-03-02 17:11:25 +00:00
Abduqodiri Qurbonzoda
a1be20d359 Add String case conversion tests
(cherry picked from commit 103499280c40767298eabd534d421d6e3c695c1e)
2021-03-02 17:11:24 +00:00
Abduqodiri Qurbonzoda
9592422b28 Add Char case conversion tests
(cherry picked from commit 6e28726c31d41a664e9e3d31c7370629d8b279a2)
2021-03-02 17:11:24 +00:00
Abduqodiri Qurbonzoda
63897b5aca Update Unicode version in Char and String case conversion functions #KT-45213
(cherry picked from commit 25b0dac947cb55f842b8e503351f4ebd2064628c)
2021-03-02 17:11:23 +00:00
Alexander Shabalin
27e4b21020 Extract object traversals (#4724)
(cherry picked from commit c3131ea2f51c31881ea068f28035f4d015daf609)
2021-03-02 17:11:22 +00:00
Alexander Shabalin
248e340cd9 Extract finalizer hooks (#4723)
(cherry picked from commit 31aa3521925a22f077acb723315aabb0a7274121)
2021-03-02 17:11:21 +00:00
SvyatoslavScherbina
7bfcf815ba Add missing DisposeStablePointer calls to produce_dynamic test
(cherry picked from commit 65109f68622ca6371511d7d36167197fa7f9003c)
2021-03-02 17:11:21 +00:00
Igor Chevdar
10e79bff8b [IR] Fixed bug with wrong init order of a enum's entries
This fixes https://youtrack.jetbrains.com/issue/KT-38540

(cherry picked from commit d031526a6e1a618597898dd6beadb04eed74b478)
2021-03-02 17:11:20 +00:00
Igor Chevdar
31835f1921 [IR] Reworked adapted references building + test
As a side effect, this fixes https://youtrack.jetbrains.com/issue/KT-43887

(cherry picked from commit 387c09e7aed7666f5a178b2ac342fb17ed3cdda3)
2021-03-02 17:11:19 +00:00
Dmitriy Dolovov
3c5e3d8d50 1.4.31 changelog
(cherry picked from commit a9a9a0b05df2016d84c8fad898633e60d238bf31)
2021-03-02 17:11:18 +00:00
Dmitriy Novozhilov
d45709993e [FIR] Support reading annotations of properties from interfaces in different jvm default modes 2021-03-02 19:11:28 +03:00
Dmitriy Novozhilov
714c2a8f93 [FIR] Bind return expression to function symbol instead of function itself 2021-03-02 19:11:27 +03:00
Dmitriy Novozhilov
245bc7c8e2 [FIR2IR] Fix interpreting constants from const properties from other module 2021-03-02 19:11:26 +03:00
Dmitriy Novozhilov
a7e6667648 [FIR] Properly deserialize annotations of properties in interfaces 2021-03-02 19:11:24 +03:00
Dmitriy Novozhilov
c6f56b9809 [Test] Add IrTextDumpHandler and BytecodeListingHandler to IR BlackBox tests 2021-03-02 19:11:22 +03:00
Dmitriy Novozhilov
da0fd7cc15 [FIR2IR] Approximate non-denotable types when converting ConeType to IrType 2021-03-02 19:11:21 +03:00
Dmitriy Novozhilov
c271f953d7 [FIR] Introduce ConeTypeApproximator 2021-03-02 19:11:20 +03:00
Dmitriy Novozhilov
1fac1fc5d3 [FIR] Add proper rendering of FirJavaTypeRef 2021-03-02 19:11:19 +03:00
Dmitriy Novozhilov
b31b293eef [FIR] Update testdata according to KT-45223 2021-03-02 19:11:17 +03:00
Dmitriy Novozhilov
af79265f42 [FIR] Fix creating overrides for functions with name same as renamed in JVM builtins 2021-03-02 19:11:15 +03:00
Dmitriy Novozhilov
523d37b0f5 [Test] Implement handler which dumps overrides tree of specified classes 2021-03-02 19:11:14 +03:00
Dmitriy Novozhilov
4299794de2 Move SmartPrinter to :core:compiler.common 2021-03-02 19:11:10 +03:00
Yahor Berdnikau
24ba581910 Replace, where possible in tests, jcenter() with mavenCentral().
In few places I have to leave bintray repository due to not all kotlin
dependencies where migrated to maven central.

^KT-44949 In progress
2021-03-02 17:34:23 +03:00
Yaroslav Chernyshev
7d766add4b Add lambda configurable languageSettings function in KotlinSourceSet
Function with Groovy Closure is already exists, it provides DSL parity
#KT-44834 Fixed
2021-03-02 16:32:06 +03:00
Tianyu Geng
17617ffd3f IDE FIR: fix resolving vararg parameter type
For a vararg parameter type, there corresponding FIR element has a fake
source of kind ArrayTypeFromVarargParameter. As a result,
`getOrBuildFir` returns the whole `FirValueParameter` for the parameter
type reference. Therefore, we need some special handling for this case
in order to resolve the proper `KtSymbol`.
2021-03-02 12:46:55 +01:00
Anton Bannykh
87f3ca3f36 IR: make isExternal immutable 2021-03-02 14:30:18 +03:00
Anton Bannykh
b0e0e62c0b Propagate isExternal flag in Psi2Ir and deserializer 2021-03-02 14:30:16 +03:00
Anton Bannykh
027f656790 JS IR: make PIR Carriers immutable 2021-03-02 14:30:15 +03:00
Vasily Levchenko
93fb7597e9 [build] fix issue with bundle build 2021-03-02 10:55:41 +01:00
Yaroslav Chernyshev
634c8522a1 Fix jvmTarget default divergence between KGP & IDE after change to 1.8 2021-03-02 11:51:11 +03:00
Dmitriy Dolovov
43d9c6cc90 [Commonizer] Reworked functions for making nullable CIR types 2021-03-02 11:37:25 +03:00
Ilya Kirillov
f2db93a9d2 FIR IDE: add test cases for file structure tests 2021-03-02 09:16:06 +01:00
Ilya Kirillov
ded24c708d FIR IDE: run incremental analysis in file structure tests multiple times 2021-03-02 09:16:06 +01:00
Ilya Kirillov
48761648d5 FIR IDE: correctly copy containingClassAttr when reanalysing declaration 2021-03-02 09:16:05 +01:00
Ilya Kirillov
70c98d34d2 FIR IDE: add test which check that every declaration is visited single time during diagnostic collection 2021-03-02 09:16:05 +01:00
Ilya Kirillov
0b921ed9d8 FIR IDE: fix collecting diagnostics multiple times for the same declaration
^KT-45199 fixed
2021-03-02 09:16:05 +01:00
Ilya Kirillov
4acca2fa16 FIR IDE: refactor DiagnosticsCollector.getDiagnosticsFor for easier debugging 2021-03-02 09:16:05 +01:00
Ilya Kirillov
9cca19d503 FIR IDE: do not consider OOBM in non-physical file as OOBM 2021-03-02 09:16:05 +01:00
Ilya Kirillov
e2fc20e9a1 FIR IDE: do not store psi inside HLQuickFix
Otherwise we can operate on invalidate psi

relates to ^KT-45199
2021-03-02 09:16:03 +01:00
Abduqodiri Qurbonzoda
2266cd4631 Commonize Char.titlecaseChar() and Char.titlecase() #KT-44369 2021-03-02 01:11:45 +03:00
Abduqodiri Qurbonzoda
0c9205423f Add String case conversion tests 2021-03-02 01:11:42 +03:00
Abduqodiri Qurbonzoda
49ce776bf4 Add Char case conversion tests 2021-03-02 01:11:39 +03:00
Abduqodiri Qurbonzoda
fc5e4c20c1 Implement String case conversion generators #KT-45213 2021-03-02 01:11:38 +03:00
Abduqodiri Qurbonzoda
1066de1be6 Implement Char one-to-one and one-to-many case conversion generators #KT-45213 2021-03-02 01:11:36 +03:00
Dmitriy Dolovov
7ad35b2f49 [Commonizer] Change CIR type calculation procedure
- By default, all CIR types are created as abbreviated types
  (if such information is available in descriptors).
- When necessary, CIR type can be "unabbreviated" to remove any
  abbreviations from it. This can be done via a separate function
  in CirTypeFactory: unabbreviate().
2021-03-01 23:17:16 +03:00
Alexander Udalov
3f16f84d0d Fix warnings in buildSrc 2021-03-01 19:47:24 +01:00
Alexander Udalov
17a8d24a84 Fix warnings in Util.kt
There were unreachable code warnings in printMillisec, and indeed the
variable assignment was never executed, so the function would always
print "0 msec".
2021-03-01 19:47:24 +01:00
Alexander Udalov
5d6aa01086 Fix warnings in Java code in tests-common 2021-03-01 19:47:24 +01:00
Tianyu Geng
bca393bd5c FIR IDE: Add quickfix for PRIVATE_SETTER_FOR_(OPEN|ABSTRACT)_PROPERTY 2021-03-01 19:30:31 +01:00
Mikhael Bogdanov
77559e8299 Temporary mute reflection test on Android 2021-03-01 18:05:27 +01:00
sebastian.sellmair
a7a085d640 [Commonizer] ModuleSerializer: Sanitize library names for Windows
The CInterop tool can produce klibs that contain colons in their library name.
Therefore the library name, as is, cannot be used as file name.
The sanitizer will replace any occurring ':' with '_'
2021-03-01 19:53:08 +03:00
Pavel Kirpichenkov
c68a4bdc0f [MPP] Consider expect-actual inline/value classes interchangeable
^KT-44926 Fixed
2021-03-01 19:25:31 +03:00
Pavel Kirpichenkov
c8c44da061 Add test for KT-44926 2021-03-01 19:25:29 +03:00
Mikhael Bogdanov
373d0ac660 Fix ultra light class generation for private suspend methods 2021-03-01 16:20:20 +01:00
Mikhael Bogdanov
989fea3399 Remove version requirements for -Xjvm-default=enable (1.2.40) and JvmFieldInInterface(1.2.70) 2021-03-01 16:20:20 +01:00
Mikhael Bogdanov
49aa36b70d Generate local delegated properties in interface in jvm-default all modes 2021-03-01 16:20:20 +01:00
Mikhael Bogdanov
c25a694b6b Generate private suspend functions as private (not synthetic package-private)
#KT-26592 Fixed
2021-03-01 16:20:19 +01:00
Mikhael Bogdanov
ad8eddac99 Add test for private suspend and JVM defaults 2021-03-01 16:20:19 +01:00
Mikhael Bogdanov
8764bb09f2 Generate synthetic annotation method in interface if -Xjvm-default is on 2021-03-01 16:20:19 +01:00
Mikhail Glukhikh
a101d12c78 Simplify PositioningStrategy in FIR diagnostic DSL 2021-03-01 16:57:56 +03:00
Mikhail Glukhikh
6fee46316e FIR: fix MANY_COMPANION_OBJECTS positioning 2021-03-01 16:57:55 +03:00
Tianyu Geng
724ca1d3ee FIR: introduce diagnostic NESTED_CLASS_NOT_ALLOWED 2021-03-01 16:57:54 +03:00
Jinseong Jeon
c5cabce2d5 FIR: check visibility properly for CANNOT_CHANGE_ACCESS_PRIVILEGE 2021-03-01 16:57:51 +03:00
Andrei Klunnyi
f45af5ea0e KT-44821 [Sealed Interfaces]: when-exhaustiveness failure in IDE
Compiler check for 'when' exhaustiveness requires that module
descriptors of a sealed class and its inheritors are the same (reference
identity matters). Prior to this commit and under some conditions they
were not. Details follow below.

Resolution related data structures (resolution facades) are organized
into trees (sdks, libs, and modules have their own nodes/facades,
module/class descriptors are stored inside). And the trees themselves
are put into a map associating so called PlatformAnalysisSettings and
GlobalFacades (plays a role of a root). PlatformAnalysisSettings is an
abstraction describing target platform and sdk of a module. The more
combinations exist for a project the more facades are used. Please, see
KotlinCacheService for more details.

So why a module can have multiple ModuleDescriptor-s?
Every tree mentioned above is an isolated resolution environment
containing its own instances of the outer world descriptors. Say, if a
project has modules X, Y, Z and we consider X then all three might have
their own vision of X, i.e. 3 descriptors exist at a time.

What descriptor instance does compiler get?
The path starts when the user opens a file in the editor and
highlighting pass starts (see usages of
ResolutionUtils#analyzeWithAllCompilerChecks). Module descriptor stored
in the resolution tree of the file's module gets injected into the
compiler's context. Starting from this moment compiler sees other
modules through the prism of a single resolution facade (tree).
Descriptors residing outside are alien.

This commit allows IdeSealedClassInheritorsProvider to figure out what
PlatformAnalysisSettings are associated with the resolution facade (read
ModuleDescriptor) seen by the compiler. Later on the same facade is used
to provide correct instances of sealed inheritors back to the compiler.
2021-03-01 12:12:00 +01:00
Roman Golyshev
6ebd4b954c Add new reference resolve tests
The main purpose is to show that old frontend and FIR work differently
in the case of the conflicts of local and top level classes/objects

See the tests that marked with // IGNORE_FIR

Corresponding ticket is ^KT-45192
2021-03-01 10:23:57 +00:00
anastasiia.spaseeva
fb83c491bb Update compose version to 0.3.1 2021-03-01 11:19:23 +01:00
anastasiia.spaseeva
cd23498cc4 Fix tests after libraries and wrappers versions updating 2021-03-01 11:19:23 +01:00
Ilya Goncharov
0a444bbc43 [Wizard, JS] Fix kotlin-redux version 2021-03-01 13:08:17 +03:00
Victor Turansky
bc42ab8a2c Use optimized Ktor client (-0.5MB)
[Details](https://youtrack.jetbrains.com/issue/KTOR-1084)
2021-03-01 11:33:26 +03:00
Victor Turansky
180f924989 Use appropriate kotlin wrappers version (1.4.21 -> 1.4.30) 2021-03-01 11:33:04 +03:00
Nikolay Krasko
3022fb396b Add fasutil to the list of package to relocate (KT-44758)
#KT-44758 Fixed
2021-02-26 20:21:26 +03:00
anastasiia.spaseeva
1bb31bb36f Update libraries and wrappers versions for 1.5.0 2021-02-26 17:28:37 +01:00
Vasily Levchenko
d2c9116b51 [fir][test] ignore native tree 2021-02-26 15:32:43 +01:00
Stanislav Erokhin
f77ba914c7 [MERGE] Kotlin/Native history merged into kotlin/master 2021-02-26 15:30:58 +01:00
Alexander Likhachev
9d140cacc0 [Gradle, K/N] Create compiler download temp dir inside target dir
Motivation is to make directory moving more likely atomic
Relates to KT-39016
2021-02-26 16:11:19 +03:00
Alexander Likhachev
172b5f9621 [Gradle, K/N] Unpack compiler into temp directory then move to proper place
#KT-39016 Fixed
2021-02-26 16:11:14 +03:00
Yahor Berdnikau
45d423e78c Fix test is failing to run on CI.
Remove mistakenly added 'wait for debugger' flag.
2021-02-26 15:55:57 +03:00
Vasily Levchenko
b05e742238 [commonizer-api] workaround for old k/n artifacts 2021-02-26 12:51:54 +01:00
Vasily Levchenko
e123127a4a (!fixup)[build] cache repository fix 2021-02-26 12:51:53 +01:00
Alexander Udalov
417eb60ed3 Revert "Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern."
This reverts commit 073a500370.

(cherry picked from commit eec98314c8)
2021-02-26 12:51:53 +01:00
Vasily Levchenko
f87132fff4 [performance] don't override user defined properties with fixed values 2021-02-26 12:51:53 +01:00
Vasily Levchenko
be08e29cb3 [.idea][artifacts] added kotlinx_cli_jvm 2021-02-26 12:51:53 +01:00
Vasily Levchenko
c9e0928038 [performance] enable project performance
(cherry picked from commit 947c3bd92b)
2021-02-26 12:51:53 +01:00
Vasily Levchenko
f2524dbb8d [gradle][properties] default kotlin.native.home 2021-02-26 12:51:52 +01:00
Vasily Levchenko
ed749f9b4a [.gitignore] add kotlin-native output folders 2021-02-26 12:51:52 +01:00
Vasily Levchenko
8eff15c8c2 [.idea][misc.xml] update after kotlin-native folder appear
- it isn't affected with kotlin.native.enable
2021-02-26 12:51:52 +01:00
Vasily Levchenko
fe896619d9 [editorconfig] added for k/n 2021-02-26 12:51:52 +01:00
Aleksei.Cherepanov
710a6fb7f3 [JPS] Fix import for Kotlin Native
(cherry picked from commit 049045e5fe)
2021-02-26 12:51:52 +01:00
Vasily Levchenko
f051119c4b [tests][kotlin-gradle-plugin] workaround for old k/n artifacts 2021-02-26 12:51:52 +01:00
Vasily Levchenko
5c80dbfd4b [kotlin-gradle-plugin] workaround for old k/n artifacts 2021-02-26 12:51:52 +01:00
Pavel Punegov
7ad656ea7f Fix cyclic dependency in run task configuration. 2021-02-26 12:51:51 +01:00
Nikolay Krasko
c4178daf48 Remove Bintray kotlin-dev usage from kotlin-native
(cherry picked from commit ec4ac192a8)
2021-02-26 12:51:51 +01:00
Nikolay Krasko
29e1390720 Remove Bintray ktor usage from kotlin-native
(cherry picked from commit 8a5987d821)
2021-02-26 12:51:51 +01:00
Nikolay Krasko
f1aa75ffed Remove @author tag to conform with the repository policy
(cherry picked from commit d99a9c0577)
2021-02-26 12:51:51 +01:00
Nikolay Krasko
4f3fa9f9ee Ignore kotlin-native during licences check in Kotlin
(cherry picked from commit b1c740cac7)
2021-02-26 12:51:51 +01:00
Vasily Levchenko
905c0c3dd3 [build] version of kotlin native stored in resouces 2021-02-26 12:51:51 +01:00
Vasily Levchenko
bdc87edfd0 [build] cache repository fix 2021-02-26 12:51:51 +01:00
Vasily Levchenko
f27e3b8c26 [build][conformance][test] ignore kotlin-native/runtime licence check 2021-02-26 12:51:50 +01:00
Vasily Levchenko
fe2799273d [build] drop dead repositories 2021-02-26 12:51:50 +01:00
Vasily Levchenko
dac76e606d [build][conformance][test] ignore not related to build repositories 2021-02-26 12:51:50 +01:00
Ilya Goncharov
80a0545ac2 [Gradle, JS] Fix ProcessedFilesCache.kt according to configuration cache 2021-02-26 14:32:51 +03:00
Mikhail Glukhikh
b138b166e3 FIR: use EQUALS & TO_STRING from OperatorNameConventions 2021-02-26 13:50:26 +03:00
Jinseong Jeon
e6cfd5d06f FIR: move data class synthetic members' names 2021-02-26 13:50:25 +03:00
Jinseong Jeon
856838f82c FIR: refactor delegate unwrapping
Not implemented override checker will use those to pretend to make
delegeted members (before checking similarly pretended fake overrides)
2021-02-26 13:50:24 +03:00
Alexander Udalov
dbce28053c IR: move frontend-dependent code into implementations in psi2ir 2021-02-26 11:49:28 +01:00
Alexander Udalov
2566aa9db2 IR: remove TranslationPluginContext.bindingContext
This removes another dependency of 'ir.tree' on 'frontend', and among
other things, makes it possible to implement TranslationPluginContext
for FIR in the future.
2021-02-26 11:49:28 +01:00
Alexander Udalov
e00660a789 Extract control flow analysis to separate module 2021-02-26 11:49:28 +01:00
Alexander Likhachev
ef890464d8 [Gradle] Rework KotlinTestReport to be compatible with configuration cache
Minimal supported version is effectively changed to 6.1 due to usage of Gradle build services
Relates to #KT-43605
2021-02-26 13:49:01 +03:00
Alexander Likhachev
3e09bb3d3f [Gradle] Bump gradle-download-task version to 4.1.1 to support configuration cache
Relates to #KT-44611
2021-02-26 13:49:00 +03:00
Alexander Likhachev
67632a495b [Gradle, MPP] Rework build finished listener into build service
Registering build finished listeners is not supported by configuration cache
Relates to #KT-44611
#KT-44900 Fixed
2021-02-26 13:48:59 +03:00
Dmitry Savvinov
42345b9c49 Minor: use more clear and specific naming for LazyClassContext.typeChecker (relevant for MPP with type refinement) 2021-02-26 12:37:02 +03:00
Dmitry Savvinov
168c692a27 Use overriding util with proper typechecker for overriding in LazyClassMemberScope
Note that LazyClassMemberScope actually has a separate field for
KotlinTypeRefiner, and it might be actually different from the one in
c.kotlinTypeChecker.

The one in c.kotlinTypeChecker is the refiner of *owner* module, i.e. a
module in which the class has been declared. If we have a class Foo :
Expect in common, then the refiner will be from common, and thus it
won't be able to refine supertypes to their platform-dependent values.

The one passed in constructor is actual refiner of dependant-module.
Say, if we're looking at Foo from the point of view of jvmMain, then
we'll create a (view-dependent) LCMS for that, and it will contain
refiner for jvmMain.

It is important to use proper refiner, otherwise the idea of having
"module-dependent view" breaks, and we might suddenly mismatch some
overrides with expect-classes in their signatures.

^KT-44898 Fixed
2021-02-26 12:37:01 +03:00
Dmitry Savvinov
9616eb94fd Add test on KT-44898 (MPP + type refinement + complex inheritance)
The current behaviour is undesired (ABSTRACT_MEMEBER_NOT_IMPLEMENTED
reported on class Concrete), will be fixed in the next commit
2021-02-26 12:37:01 +03:00
Dmitry Savvinov
e3d4c440b5 Minor: rename createMemberScope -> createScopesHolderForClass 2021-02-26 12:37:01 +03:00
Mikhail Glukhikh
2bf3abcb29 FIR: cache accessor symbols in JavaClassUseSiteMemberScope 2021-02-26 12:27:07 +03:00
Mikhail Glukhikh
750a39a053 JavaClassUseSiteMemberScope: optimize createOverridePropertyIfExists
Avoid calculating getter & setter twice
2021-02-26 12:27:01 +03:00
Aleksei.Cherepanov
07d11508a7 Generate JvmMultifileClass tests for Gradle 2021-02-26 11:31:17 +03:00
Denis.Zharkov
e6b61ecc22 Fix incorrectly generated tests 2021-02-26 10:46:54 +03:00
Mikhael Bogdanov
82f1b8159c Remove deprecated "-XX:-FailOverToOldVerifier" as it breaks JDK on TC 2021-02-26 07:48:20 +01:00
Tianyu Geng
2484729bd7 FIR IDE: fix redundant
Apparently there is a race condition when collecting the `fromPhase`.
This causes the same resolver to run multiple times on FIR.

^KT-45121 Fixed
2021-02-25 23:31:37 +01:00
Alexander Udalov
acc2256de9 IR: support smart cast values in RangeContainsLowering
#KT-44878 Fixed
2021-02-25 21:00:09 +01:00
Alexander Udalov
820762ca16 IR: add isUnsignedType/getUnsignedType 2021-02-25 21:00:09 +01:00
Alexander Udalov
0ebdf7c3c4 IR: add getPrimitiveType, optimize some usages of isInt/isByte/... 2021-02-25 21:00:09 +01:00
Alexander Udalov
17ee10a0d8 Minor, fix compilation warning in DurationUnit.kt 2021-02-25 21:00:09 +01:00
Victor Petukhov
94e6ec7dfd Fix test after 27846f4532 2021-02-25 22:29:45 +03:00
Yahor Berdnikau
6b56b7cca6 Fix tests are using slightly different test file names from actual. 2021-02-25 20:11:43 +01:00
Denis.Zharkov
4fffe7b9c8 FIR: Fix VerifyError caused by private delegates
^KT-45048 Fixed
2021-02-25 19:30:15 +03:00
Denis.Zharkov
ace66b7179 FIR: Prettify visibility resolution for private constructors 2021-02-25 19:30:15 +03:00
Denis.Zharkov
9d7e40ad99 Minor. Reformat FirStatusResolveTransformer.kt 2021-02-25 19:30:15 +03:00
Ilmir Usmanov
2523ea1ef4 Do not add @JvmInline annotation on JS and Native 2021-02-25 16:07:00 +01:00
Ilmir Usmanov
2df049fc03 Minor. Remove outdated test and update maven test 2021-02-25 16:06:58 +01:00
Ilmir Usmanov
8c31fcb615 Add inline class -> @JvmInline value class intention 2021-02-25 16:06:54 +01:00
Ilmir Usmanov
d67e4f0c48 Rename inline class -> @JvmInline value class in stdlib and compiler 2021-02-25 16:06:51 +01:00
Ilmir Usmanov
62123d72e2 IC: Add inline class -> @JvmInline value class warning 2021-02-25 16:06:47 +01:00
Alexander Udalov
b417786fd4 JVM IR: do not hide constructor with inline class in anonymous object
#KT-45131 Fixed
2021-02-25 14:44:16 +01:00
Alexander Udalov
b026de768d Do not ever run JVM test handlers after previous errors
If there's a frontend error in a test, or bytecode generation crashed
with an exception, it makes no sense to run JVM test handlers such as
lambda inlining checker or D8 checker.
2021-02-25 14:44:16 +01:00
Victor Petukhov
27846f4532 Add tests for obsolete issues (KT-42722, KT-39880) 2021-02-25 15:30:29 +03:00
Mark Punzalan
9492e75d38 FIR checker: Split checkProperty util function. 2021-02-25 13:06:53 +01:00
Mark Punzalan
aad86c3892 Skip directories with lowercase "testdata" in FIR total Kotlin tests.
"idea/idea-frontend-fir/idea-fir-low-level-api/testdata" is the
affected directory.
2021-02-25 13:06:53 +01:00
Mark Punzalan
1c94372b6c FIR checker/IDE: Add checker and quickfix for VAL_WITH_SETTER. 2021-02-25 13:06:53 +01:00
Dmitriy Novozhilov
99c47a0487 Fix non-exhaustive when in common stdlib 2021-02-25 14:56:08 +03:00
Dmitriy Novozhilov
4222bb9af2 [FE] Make whens on expect sealed classes and enums not exhaustive 2021-02-25 14:56:08 +03:00
Simon Ogorodnik
1cf73203c7 [FIR-Test] Disable pre-release check in modularized tests 2021-02-25 14:03:30 +03:00
Simon Ogorodnik
2ea0e69a56 [FIR-Test] Fix incorrect file count 2021-02-25 14:03:29 +03:00
Simon Ogorodnik
0086ebe6f2 [FIR-Test] Increase code cache size 2021-02-25 14:03:28 +03:00
Simon Ogorodnik
1e73f7a5b2 [FIR-Test] Force min heap size 2021-02-25 14:03:27 +03:00
Simon Ogorodnik
b6fb3c9799 [FIR] Isolate benchmark thread, add jit log format events for passes
Add special output for pass events to match with LogCompilation
2021-02-25 14:03:26 +03:00
Andrei Klunnyi
618de5fa32 KT-45074 [Sealed Interfaces]: when exhaustiveness after gradle reimport
Module descriptor names in the form of 'stableName' depend on a build
system. See JvmCodegenUtil#getModuleName(). For JPS we get
<module-name.main> or <module-name.test> whereas for Gradle we get top
level <module-name>.
This commit changes approach: ModuleDescriptor-to-Module conversion is
no longer made by name. ModuleInfo is utilized instead.

^KT-45074 fixed
2021-02-25 10:34:45 +00:00
Dmitriy Novozhilov
a9c6c115be [Test] Disable gradle test parallelization if JUnit 5 is enabled 2021-02-25 10:38:45 +03:00
Dmitriy Novozhilov
2a7a20dd99 [Test] Add ability to set maximum of working threads for parallel JUnit 5 tests 2021-02-25 10:38:45 +03:00
Ilya Gorbunov
ca6ce151a2 Unify test package names in kotlin-stdlib tests
This makes 'test.' an implicit package prefix, thus fixing the inspection
"Package directive doesn't match file location" positive in almost all
test files.
2021-02-25 09:58:14 +03:00
Alexander Udalov
a6d8bf8127 Fix compilation of idea-fir-low-level-api 2021-02-24 21:31:19 +01:00
Alexander Udalov
aeb0906f2d Build: suppress warnings for kotlin-stdlib-wasm 2021-02-24 20:48:26 +01:00
Ilya Kirillov
9ce4decb73 FIR IDE: use WhenMissingCase in NoElseInWhen diagnostic 2021-02-24 20:13:45 +01:00
Ilya Kirillov
f19a9af7b3 Unify WhenMissingCase from FIR and FE1.0 2021-02-24 20:13:43 +01:00
Ilya Kirillov
f4371c670e Move WhenMissingCase from fir module to compiler.common to use in IDE 2021-02-24 20:13:42 +01:00
Ilya Kirillov
83f8650e80 Move CallableId from fir module to compiler.common to use in IDE 2021-02-24 20:13:41 +01:00
Alexander Udalov
7e149a3a44 IR: remove unneeded dependencies on psi2ir 2021-02-24 19:07:38 +01:00
Alexander Udalov
e69cc183a4 IR: remove dependency of 'ir.tree' on 'frontend' 2021-02-24 19:07:38 +01:00
Alexander Udalov
addabae8d2 IR: move frontend-dependent code into implementations in psi2ir 2021-02-24 19:07:38 +01:00
Alexander Udalov
d991a3e40f IR: simplify initialization cycle of TypeTranslator/ConstantValueGenerator 2021-02-24 19:07:38 +01:00
Alexander Udalov
5ea3d32b98 IR: remove TranslationPluginContext.bindingContext
This removes another dependency of 'ir.tree' on 'frontend', and among
other things, makes it possible to implement TranslationPluginContext
for FIR in the future.
2021-02-24 19:07:38 +01:00
Alexander Udalov
274e0ad136 IR: remove unused dependency on BindingContext 2021-02-24 19:07:37 +01:00
Alexander Udalov
837eb739ea IR: move CompilationErrorException to frontend.common 2021-02-24 19:07:37 +01:00
Alexander Udalov
1ae46b529f IR: move ExpectDeclarationRemover to ir.backend.common 2021-02-24 19:07:37 +01:00
Victor Petukhov
26a96a1c19 Don't throw an exception while loading type use annotations on implicit bounds of a wildcard
^KT-45067 Fixed
2021-02-24 21:06:32 +03:00
Pavel Semyonov
7669d8ff26 Add README.md for the kotlin-parcelize plugin 2021-02-25 02:59:50 +09:00
Alexander Udalov
2e2caae05c Extract control flow analysis to separate module
Extract a service interface out of ControlFlowInformationProviderImpl
and register its implementation in two "leaf" modules: 'cli',
'idea-core'.

This improves parallel build, since a lot of modules depend on
'frontend' but only these two modules reference the implementation and
thus depend on the full CFA implementation now.
2021-02-24 17:17:04 +01:00
Alexander Udalov
c744515832 Minor, pass CliSealedClassInheritorsProvider explicitly in some places
Do not use default parameter value for functions with only 1 or 2 call
sites, since it doesn't add much value but provides a dangerous
possibility to forget to pass the real implementation.
2021-02-24 17:17:03 +01:00
Alexander Udalov
ca5a35b4b3 Move CompilerEnvironment from 'frontend' to 'cli'
This is needed in order to have a single convenient place where to
register frontend services implemented _outside_ of the 'frontend'
module, such as the control flow analysis, extracted to a separate
module in a subsequent commit.
2021-02-24 17:17:03 +01:00
Alexander Udalov
3efbca85ea Minor, rename file ControlFlowInformationProvider{ -> Impl}.kt 2021-02-24 17:17:03 +01:00
Alexander Udalov
5ad0033d42 Extract some cfg utilities into separate files
These utilties are used not only within CFG, but from the frontend and
idea as well. Therefore upon extraction of CFG into another module,
these two new files will remain in 'frontend'.
2021-02-24 17:17:03 +01:00
Mikhail Glukhikh
a9b9cced15 IrInterpret: remove thread creation / joining (performance fix) 2021-02-24 18:56:06 +03:00
Anton Bannykh
df62b5e311 JS IR: special origins for declaration created during lowerings
Otherwise the lazy properties lowering may try to process them
2021-02-24 18:32:56 +03:00
Tianyu Geng
aec498a4ea Add quickfixes for NON_FINAL_MEMBER_IN_FINAL_CLASS 2021-02-24 15:56:35 +01:00
Nikita Katkov
e1b3cd32f3 IDEA-253605 jvmClassPathUtil: preserve old behaviour 2021-02-24 11:48:32 +00:00
Nikita Katkov
738c6d3119 IDEA-253605 jvmClassPathUtil: correct collection of parent classloaders 2021-02-24 11:48:32 +00:00
Vladimir Dolzhenko
81efdab4e4 Do not swallow any exceptions apart FNFE
Relates to #KT-39776
2021-02-24 11:06:49 +00:00
Mikhail Glukhikh
cf830887ec FIR2IR: optimize override binding for Fir2IrLazySimpleFunction 2021-02-24 13:50:47 +03:00
Tianyu Geng
5bdea9652b FIR: fix position and reporting of PRIVATE_SETTER_*
Previously `FirPropertyAccessor.source` references the `KtProperty` if
the user code contains a setter or getter that doesn't contain a body.
For example, with the following

```
val i: Int = 1
  private set
```

The `FirPropertyAccessor` would reference the `KtProperty` as the
source.

This change makes `FirPropertyAccessor` reference `KtPropertyAccessor`
as the source if possible, regardless of whether the body is present or
not.
2021-02-24 13:50:46 +03:00
Tianyu Geng
bdeecfc188 FIR: check multiple vararg param and forbidden vararg type 2021-02-24 13:50:46 +03:00
Jinseong Jeon
0e9474342d Simplify FirMethodOfAnyImplementedInInterfaceChecker
* Override CallableId and operator tag parts only,
  not entire function representation

* Even more lazyness for inspector creation
2021-02-24 13:50:46 +03:00
Jinseong Jeon
338595703c FIR: delegate to abstract override members of Any 2021-02-24 13:50:46 +03:00
Jinseong Jeon
0defdc9e70 FIR checker: fix typos in diagnostics list 2021-02-24 13:50:45 +03:00
Jinseong Jeon
c4af92a86a FIR: don't raise an internal error for sealed members in intersection scope 2021-02-24 13:50:45 +03:00
Jinseong Jeon
4fba5891c7 FIR2IR: compute class localness before a loop 2021-02-24 13:50:45 +03:00
Vasily Levchenko
65dd798818 [build][native support] intoduced new native support. 2021-02-24 11:07:18 +01:00
Vasily Levchenko
e031da6e70 [build][dependencies] \r -> \n 2021-02-24 11:07:18 +01:00
Vasily Levchenko
7b73917217 [build][dist] global dist fixed 2021-02-24 11:07:17 +01:00
Vasily Levchenko
3298cd3455 [build][checkBuild] fix buildSrc 2021-02-24 11:07:17 +01:00
Vasily Levchenko
d34203991d [konan home provider] make more konan home detector more safe 2021-02-24 11:07:17 +01:00
Vasily Levchenko
8bcb5718d9 [build] make delete more safe 2021-02-24 11:07:17 +01:00
Vasily Levchenko
13d4003e3f [build] speedup tc-dist 2021-02-24 11:07:17 +01:00
Vasily Levchenko
fa08b1dc48 [kotlin-native] change in output of library_mismatch 2021-02-24 11:07:17 +01:00
Vasily Levchenko
8a4b5efa9e [build][native] don't ever fix dist, take it with API 2021-02-24 11:07:17 +01:00
Vasily Levchenko
ebeac62f17 [build][tests][g/c] fix dependencies on platform and dist 2021-02-24 11:07:16 +01:00
Vasily Levchenko
46f2182ba6 [build][tests] more utilities functions used 2021-02-24 11:07:16 +01:00
Vasily Levchenko
39fb47892c [build][kotlin-native] stable 2021-02-24 11:07:16 +01:00
Pavel Punegov
4610d9f171 Fix file separator in tests for Windows 2021-02-24 11:07:16 +01:00
Vasily Levchenko
0324ee508e [testData][compiler] disable tests KT4282{4,5} for native backend 2021-02-24 11:07:16 +01:00
Vasily Levchenko
69723447c4 [build][native] dependencies :kotlin-native:dependencies:update 2021-02-24 11:07:15 +01:00
Vasily Levchenko
6234bcb453 [build][test] enable external compiler tests 2021-02-24 11:07:15 +01:00
Vasily Levchenko
d6c147908e [build][bundle]upload 2021-02-24 11:07:15 +01:00
Vasily Levchenko
83fc59b0ff [klib][platform][osx] 10.11 2021-02-24 11:07:15 +01:00
Vasily Levchenko
e655778743 [build][native] conditional build 2021-02-24 11:07:14 +01:00
Vasily Levchenko
3867cf6ef5 [build] switch to kotlin-build-gradle-plugin:0.0.25 2021-02-24 11:07:14 +01:00
Vasily Levchenko
ec0f6b9ede [build][kotlin-build-gradle-plugin] bump version 0.0.25
- kotlin native versioning support
- disable metadata
- fixes of drop 0 maintanence clause
- support for kotlin.native.enabled flag to switch on/off kotlin native build
- add mode to version generatation to dump version to resourse file
2021-02-24 11:07:14 +01:00
Vasily Levchenko
326ab1cd02 [build][tests] disable interop_concurrentRuntime - very unstable 2021-02-24 11:07:14 +01:00
Vasily Levchenko
17fc4a087b [build] enable sanity tests (step 3) 2021-02-24 11:07:14 +01:00
Vasily Levchenko
a7eaa35317 [build] java os mac (Big Sur) 2021-02-24 11:07:14 +01:00
Vasily Levchenko
840c1e612c [build] joint (step 2)
- dist:
  - compiler
  - tools(cinterop,klib)
  - stdlib
  - cache
2021-02-24 11:07:13 +01:00
Vasily Levchenko
c85c3ac123 [build] joint (step 1)
(cherry picked from commit 7d0775f7e69ab900200bcf1fa78b94d68e6bd4f6)
2021-02-24 11:04:59 +01:00
Yaroslav Chernyshev
c571c5c441 Refactor and apply optimization to KaptModelBuilderService logic 2021-02-24 11:38:13 +03:00
Andrey Uskov
7ef136d142 Improve performance of import of pure kotlin project: do not force all tasks creation
#KT-34401 Fixed
2021-02-24 11:38:12 +03:00
Igor Chevdar
9d8abca195 [box-tests] Disabled a test for K/N 2021-02-24 11:00:27 +05:00
Stefan Wolf
d88ef64288 Remove references to validateTaskProperties
The task is now called `validatePlugins`.
2021-02-23 23:26:41 +03:00
Stefan Wolf
200ef832d2 Add PathSensitive annotation to all input file properties
So new validation which will be added in Gradle 7.1
won't cause warnings during the build.
2021-02-23 23:26:39 +03:00
Stefan Wolf
8b01df6772 Enable stricker Kotlin Gradle Plugin validation 2021-02-23 23:26:35 +03:00
Mads Ager
8852323a76 [PSI2IR] Do not generate property reference setter if inaccessible.
Fixes KT-45064.
2021-02-23 19:33:49 +01:00
Ilmir Usmanov
d44799fa78 JVM IR: Use INVOKESPECIAL instead of INVOKEVIRTUAL for default private
suspend functions.

 #KT-26592
2021-02-23 18:49:10 +01:00
Ilmir Usmanov
3ee62cb1b2 JVM IR: Do not generate private suspend functions as synthetic package-private
#KT-26592
2021-02-23 18:49:06 +01:00
Alexander Udalov
48fb085bf6 Deprecate kotlin.Metadata.bytecodeVersion
#KT-41758 Fixed
2021-02-23 12:45:41 +01:00
Alexander Udalov
f63ffc51ae Remove JvmBytecodeBinaryVersion from the compiler code
Move it to build-common where it's still used in incremental compilation
caches, and simplify a bit. In the future, it'll make sense to remove it
completely and to avoid writing it to caches. In this commit, I don't do
that to prevent the IC cache version to be updated, causing rebuilds for
all JPS projects.

 #KT-41758
2021-02-23 12:45:41 +01:00
Alexander Udalov
d300e05be9 Remove obsolete code in inliner for experimental coroutines 2021-02-23 12:45:41 +01:00
Alexander Udalov
448c6c2f0d kotlinx-metadata-jvm: deprecate KotlinClassHeader.bytecodeVersion
#KT-41758
2021-02-23 12:45:40 +01:00
Alexander Udalov
c6f5ce6837 Do not write bytecode version to class file
#KT-41758
2021-02-23 12:45:40 +01:00
Alexander Udalov
862a9143da Do not report errors about bytecode version
#KT-41758
2021-02-23 12:45:40 +01:00
Dmitriy Dolovov
fa2b2c8735 [Commonizer] Make CirProperty.compileTimeInitializer non-nullable
There is effectively no difference between null and CirConstantValue.NullValue recorded in compileTimeInitializer.
2021-02-22 21:06:49 +03:00
Dmitriy Dolovov
b3e68d3704 [Commonizer] Make CirProperty.[backing|delegate]FieldAnnotations non-nullable
There is effectively no difference between missing field and a field with no annotations.
2021-02-22 21:06:41 +03:00
Dmitriy Dolovov
215dd8515b Minor. Remove compilation warning 2021-02-22 21:06:34 +03:00
Toshiaki Kameyama
ee406f1622 Lift assignment out: if last statement is lambda, enclose it in parentheses if necessary
#KT-38155 Fixed
2021-02-22 17:40:06 +01:00
Alexander Udalov
e6476c39ca JVM IR: fix isMarkedNullable for nullability-flexible types
Since nullability-flexible types in IR are represented by an annotation
on an IrSimpleType, not a special instance, the common implementation of
`KotlinTypeMarker.isMarkedNullable` in `TypeSystemContext` doesn't work.

This method is used for example to generate `typeOf` in JVM IR, in
`TypeSystemCommonBackendContext.generateTypeOf`, and this issue led to a
difference in behavior of `typeOf` for nullability-flexible types.

 #KT-44726 Fixed
2021-02-22 12:52:48 +01:00
Aleksandr Liublinskii
08cf78fafd MI-141 Fix 'Empty Library' entry in module dependencies 2021-02-22 12:25:47 +01:00
Alexander Udalov
eec98314c8 Revert "Change order of WITH_RUNTIME and FILE. Wrong order brakes module pattern."
This reverts commit 073a500370.
2021-02-22 10:14:32 +01:00
19903 changed files with 638073 additions and 183055 deletions

5
.bunch
View File

@@ -1,4 +1,3 @@
202
201
as41_201
as42
203_202
as42

8
.gitignore vendored
View File

@@ -12,6 +12,7 @@
/android-studio/sdk
out/
/tmp
kotlin-ide/
workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
@@ -32,6 +33,8 @@ build/
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
.idea/runConfigurations/_FP_*.xml
.idea/runConfigurations/_MT_*.xml
.idea/libraries
.idea/modules.xml
.idea/gradle.xml
@@ -54,7 +57,8 @@ build/
.idea/artifacts/kotlin_test_js_ir_*
.idea/artifacts/kotlin_stdlib_wasm_*
.idea/jarRepositories.xml
kotlin-ultimate/
.idea/csv-plugin.xml
.idea/libraries-with-intellij-classes.xml
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-js-runner/lib/
@@ -62,3 +66,5 @@ local.properties
buildSrcTmp/
distTmp/
outTmp/
/test.output
/kotlin-native/dist

View File

@@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlinx.cli-jvm-1.5.255-SNAPSHOT">
<output-path>$PROJECT_DIR$/kotlin-native/endorsedLibraries/kotlinx.cli/build/libs</output-path>
<root id="archive" name="kotlinx.cli-jvm-1.5.255-SNAPSHOT.jar">
<element id="module-output" name="kotlin.kotlin-native.endorsedLibraries.kotlinx.cli.jvmMain" />
</root>
</artifact>
</component>

View File

@@ -63,27 +63,6 @@
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="PROTO">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
@@ -101,4 +80,4 @@
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
</codeStyleSettings>
</code_scheme>
</component>
</component>

8
.idea/dictionaries/igor.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ProjectDictionaryState">
<dictionary name="igor">
<words>
<w>descr</w>
<w>exprs</w>
</words>
</dictionary>
</component>

View File

@@ -0,0 +1,9 @@
<component name="ProjectDictionaryState">
<dictionary name="sebastiansellmair">
<words>
<w>cinterops</w>
<w>interops</w>
<w>klibrary</w>
</words>
</dictionary>
</component>

View File

@@ -2,6 +2,7 @@
<dictionary name="skuzmich">
<words>
<w>anyref</w>
<w>dataref</w>
<w>ushr</w>
<w>wasm</w>
</words>

4
.idea/misc.xml generated
View File

@@ -12,10 +12,14 @@
<item index="2" class="java.lang.String" itemvalue="org.gradle.api.tasks.options.Option" />
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="IdProvider" IDEtalkID="71A301FF1940049D6D82F12C40F1E1D5" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="JavadocGenerationManager">
<option name="OTHER_OPTIONS" value="" />
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate All Tests" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Generate All Tests" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate FIR Checker Components and FIR/IDE Diagnostics" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Generate FIR Checker Components and FIR/IDE Diagnostics" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -11,7 +11,7 @@
<option name="taskNames">
<list>
<option value=":compiler:fir:checkers:generateCheckersComponents" />
<option value=":idea:idea-frontend-fir:generateCode" />
<option value=":idea-frontend-fir:generateCode" />
</list>
</option>
<option name="vmOptions" value="" />
@@ -21,4 +21,4 @@
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
</component>

View File

@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate FIR tree" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/compiler/fir/tree" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="generateTree" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate standard library sources" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Generate standard library sources" type="GradleRunConfiguration" factoryName="Gradle" folderName="Stdlib">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/libraries/tools/kotlin-stdlib-gen" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<configuration default="false" name="IDEA" type="GradleRunConfiguration" factoryName="Gradle" singleton="true" folderName="IDEA">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA Ultimate" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="IDEA Ultimate" type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA Ultimate (No ProcessCanceledException) " type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="IDEA Ultimate (No ProcessCanceledException) " type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (Not Internal)" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="IDEA (Not Internal)" type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -16,4 +16,4 @@
<option name="vmOptions" value="" />
</ExternalSystemSettings>
</configuration>
</component>
</component>

View File

@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: Commonizer" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--tests &quot;org.jetbrains.kotlin.gradle.CommonizerHierarchicalIT&quot; --tests &quot;org.jetbrains.kotlin.gradle.CommonizerIT&quot; --tests &quot;org.jetbrains.kotlin.commonizer.**&quot;" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":native:kotlin-klib-commonizer-api:test" />
<option value=":native:kotlin-klib-commonizer:test" />
<option value=":kotlin-gradle-plugin-integration-tests:test" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: Commonizer / Light" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":native:kotlin-klib-commonizer-api:test" />
<option value=":native:kotlin-klib-commonizer:test" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: KMM" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Test: KMM" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method v="2" />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: public API binary compatibility validator, overwrite results" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Test: public API binary compatibility validator, overwrite results" type="GradleRunConfiguration" factoryName="Gradle" folderName="Stdlib">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/libraries/tools/binary-compatibility-validator" />
@@ -18,4 +18,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: stdlib-js public kotlin api test, overwrite results" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Test: stdlib-js public kotlin api test, overwrite results" type="GradleRunConfiguration" factoryName="Gradle" folderName="Stdlib">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -19,4 +19,4 @@
<GradleScriptDebugEnabled>false</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
</component>
</component>

12
.idea/vcs.xml generated
View File

@@ -8,6 +8,18 @@
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="GithubSharedProjectSettings">
<option name="branchProtectionPatterns">
<list>
<option value="master" />
<option value="1\.5\.0-M2" />
<option value="1\.5\.0" />
<option value="1\.5\.20" />
<option value="1\.5\.20-M1-release" />
<option value="1\.5\.20-RC-release" />
</list>
</option>
</component>
<component name="IssueNavigationConfiguration">
<option name="links">
<list>

File diff suppressed because it is too large Load Diff

View File

@@ -35,26 +35,30 @@ Support for multiplatform programming is one of Kotlins key benefits. It redu
## Editing Kotlin
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html) ([source code](https://github.com/JetBrains/intellij-community/tree/master/plugins/kotlin))
* [Kotlin Eclipse Plugin](https://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin Sublime Text Package](https://github.com/vkostyukov/kotlin-sublime-package)
## Build environment requirements
In order to build Kotlin distribution you need to have:
This repository is using [Gradle toolchains](https://docs.gradle.org/current/userguide/toolchains.html) feature
to select and auto-provision required JDKs from [AdoptOpenJdk](https://adoptopenjdk.net) project.
- JDK 1.6, 1.7, 1.8 and 9
- Setup environment variables as following:
Unfortunately [AdoptOpenJdk](https://adoptopenjdk.net) project does not provide required JDK 1.6 and 1.7 images,
so you could either download them manually and provide path to installation via `JDK_16` and `JDK_17` environment variables or
use following SDK managers:
- [Asdf-vm](https://asdf-vm.com/)
- [Jabba](https://github.com/shyiko/jabba)
- [SDKMAN!](https://sdkman.io/)
JAVA_HOME="path to JDK 1.8"
JDK_16="path to JDK 1.6"
JDK_17="path to JDK 1.7"
JDK_18="path to JDK 1.8"
JDK_9="path to JDK 9"
Alternatively, it is still possible to only provide required JDKs via environment variables
(see [gradle.properties](./gradle.properties#L5) for supported variable names). To ensure Gradle uses only JDKs
from environmental variables - disable Gradle toolchain auto-detection by passing `-Porg.gradle.java.installations.auto-detect=false` option
(or put it into `$GRADLE_USER_HOME/gradle.properties`).
For local development, if you're not working on bytecode generation or the standard library, it's OK to have only JDK 1.8 and JDK 9 installed, and to point `JDK_16` and `JDK_17` environment variables to your JDK 1.8 installation.
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties) to setup `JDK_*` variables.
For local development, if you're not working on bytecode generation or the standard library, it's OK to avoid installing JDK 1.6 and JDK 1.7.
Add `kotlin.build.isObsoleteJdkOverrideEnabled=true` to the `local.properties` file, so build will only use JDK 1.8+. Note, that in this
case, build will have Gradle remote build cache misses for some tasks.
Note: The JDK 6 for MacOS is not available on Oracle's site. You can install it by
@@ -93,19 +97,18 @@ command line parameters on the first run:
- `clean` - clean build results
- `dist` - assembles the compiler distribution into `dist/kotlinc/` folder
- `ideaPlugin` - assembles the Kotlin IDEA plugin distribution into `dist/artifacts/ideaPlugin/Kotlin/` folder
- `install` - build and install all public artifacts into local maven repository
- `runIde` - build IDEA plugin and run IDEA with it
- `coreLibsTest` - build and run stdlib, reflect and kotlin-test tests
- `gradlePluginTest` - build and run gradle plugin tests
- `compilerTest` - build and run all compiler tests
- `ideaPluginTest` - build and run all IDEA plugin tests
To reproduce TeamCity build use `-Pteamcity=true` flag. Local builds don't run proguard and have jar compression disabled by default.
**OPTIONAL:** Some artifacts, mainly Maven plugin ones, are built separately with Maven.
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
To build Kotlin/Native, see
[kotlin-native/README.md](kotlin-native/README.md#building-from-source).
### Building for different versions of IntelliJ IDEA and Android Studio
@@ -137,36 +140,27 @@ To be able to run tests from IntelliJ easily, check `Delegate IDE build/run acti
At this time, you can use the latest released `1.3.x` version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use `Tools` -> `Kotlin` -> `Configure Kotlin Plugin Updates`.
### Compiling and running
### Dependency verification
From this root project there are Run/Debug Configurations for running `IDEA` or the `Generate Compiler Tests` for example; so if you want to try out the latest and greatest IDEA plugin
We have a [dependencies verification](https://docs.gradle.org/current/userguide/dependency_verification.html) feature enabled in the
repository for all Gradle builds. Gradle will check hashes (md5 and sha256) of used dependencies and will fail builds with
`Dependency verification failed` errors when local artifacts are absent or have different hashes listed in the
[verification-metadata.xml](https://github.com/JetBrains/kotlin/blob/master/gradle/verification-metadata.xml) file.
* `VCS` -> `Git` -> `Pull`
* Run the `IDEA` run configuration in the project
* A child IntelliJ IDEA with the Kotlin plugin will then startup
It's expected that `verification-metadata.xml` should only be updated with the commits that modify the build. There are some tips how
to perform such updates:
### Including into composite build
- Use auto-generation for getting an initial list of new hashes (verify updates relate to you changes).
To include kotlin compiler into [composite build](https://docs.gradle.org/current/userguide/composite_builds.html) you need to define `dependencySubstitution` for `kotlin-compiler` module in `settings.gradle.kts`
`./gradlew -M sha256,md5 help`
```Kotlin
includeBuild("/path/to/kotlin") {
dependencySubstitution {
substitute(module("org.jetbrains.kotlin:kotlin-compiler"))
.with(project(":include:kotlin-compiler"))
}
}
```
*(any other task may be used instead of `help`)*
or in `settings.gradle`
```Groovy
includeBuild('/path/to/kotlin') {
dependencySubstitution {
substitute module('org.jetbrains.kotlin:kotlin-compiler') with project(':include:kotlin-compiler')
}
}
```
- Consider removing old versions from the file if you are updating dependencies.
- Leave meaningful `origin` attribute (instead of `Generated by Gradle`) if you did some manual verification of the artifact.
- Always do manual verification if several hashes are needed and a new `also-trust` tag has to be added.
- If youre adding a dependency with OS mentioning in an artifact name (`darwin`, `mac`, `osx`, `linux`, `windows`), remember to add
counterparts for other platforms.
# License
Kotlin is distributed under the terms of the Apache License (Version 2.0). See [license folder](license/README.md) for details.

View File

@@ -1,36 +1,11 @@
import kotlinx.benchmark.gradle.benchmark
val benchmarks_version = "0.2.0-dev-7"
buildscript {
val benchmarks_version = "0.2.0-dev-7"
repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
} else {
maven("https://dl.bintray.com/kotlin/kotlinx")
}
}
dependencies {
classpath("org.jetbrains.kotlinx:kotlinx.benchmark.gradle:$benchmarks_version")
}
}
apply(plugin = "kotlinx.benchmark")
val benchmarks_version = "0.3.1"
plugins {
java
kotlin("jvm")
}
repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
} else {
maven("https://dl.bintray.com/kotlin/kotlinx")
}
id("org.jetbrains.kotlinx.benchmark") version "0.3.1"
}
dependencies {
@@ -42,7 +17,7 @@ dependencies {
compile(jpsStandalone()) { includeJars("jps-model") }
compile(intellijPluginDep("java"))
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
compile("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:$benchmarks_version")
compile("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:$benchmarks_version")
}
sourceSets {
@@ -92,18 +67,16 @@ benchmark {
}
}
tasks.named("classes") {
doLast {
tasks.named("mainBenchmarkJar", Zip::class.java) {
isZip64 = true
archiveName = "benchmarks.jar"
}
listOf("mainBenchmark", "mainFirBenchmark", "mainNiBenchmark").forEach {
tasks.named(it, JavaExec::class.java) {
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
}
}
}
tasks.matching { it is Zip && it.name == "mainBenchmarkJar" }.configureEach {
this as Zip
isZip64 = true
archiveFileName.set("benchmarks.jar")
}
val benchmarkTasks = listOf("mainBenchmark", "mainFirBenchmark", "mainNiBenchmark")
tasks.matching { it is JavaExec && it.name in benchmarkTasks }.configureEach {
this as JavaExec
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
}
tasks.register<JavaExec>("runBenchmark") {

View File

@@ -12,6 +12,7 @@ import com.intellij.psi.PsiFileFactory
import com.intellij.psi.impl.PsiFileFactoryImpl
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.testFramework.LightVirtualFile
import org.jetbrains.kotlin.ObsoleteTestInfrastructure
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
@@ -24,8 +25,9 @@ import org.jetbrains.kotlin.context.withModule
import org.jetbrains.kotlin.context.withProject
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.fir.builder.PsiHandlingMode
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
import org.jetbrains.kotlin.fir.createSession
import org.jetbrains.kotlin.fir.createSessionForTests
import org.jetbrains.kotlin.fir.java.FirJavaElementFinder
import org.jetbrains.kotlin.fir.resolve.firProvider
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirProviderImpl
@@ -147,12 +149,13 @@ abstract class AbstractSimpleFileBenchmark {
bh.consume(result.shouldGenerateCode)
}
@OptIn(ObsoleteTestInfrastructure::class)
private fun analyzeGreenFileIr(bh: Blackhole) {
val scope = GlobalSearchScope.filesScope(env.project, listOf(file.virtualFile))
.uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(env.project))
val session = createSession(env, scope)
val session = createSessionForTests(env, scope)
val firProvider = session.firProvider as FirProviderImpl
val builder = RawFirBuilder(session, firProvider.kotlinScopeProvider)
val builder = RawFirBuilder(session, firProvider.kotlinScopeProvider, PsiHandlingMode.COMPILER)
val totalTransformer = FirTotalResolveProcessor(session)
val firFile = builder.buildFirFile(file).also(firProvider::recordFile)

View File

@@ -23,9 +23,6 @@ dependencies {
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(kotlinStdlib())
Platform[193].orLower {
testCompileOnly(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testRuntime(project(":kotlin-reflect"))
}

View File

@@ -40,7 +40,7 @@ abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass
): T
fun create(args: CommonCompilerArguments): T {
val languageVersion = args.languageVersion?.let((LanguageVersion)::fromVersionString) ?: LanguageVersion.LATEST_STABLE
val languageVersion = args.languageVersion?.let { LanguageVersion.fromVersionString(it) } ?: LanguageVersion.LATEST_STABLE
return create(
isEAP = languageVersion.isPreRelease(),
@@ -51,7 +51,7 @@ abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass
ownVersion = OWN_VERSION,
coroutinesVersion = COROUTINES_VERSION,
multiplatformVersion = MULTIPLATFORM_VERSION,
metadataVersionArray = args.metadataVersion?.let((BinaryVersion)::parseVersionArray)
metadataVersionArray = args.metadataVersion?.let { BinaryVersion.parseVersionArray(it) }
)
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
/**

View File

@@ -26,15 +26,17 @@ open class GeneratedFile(
val outputFile: File
) {
val sourceFiles = sourceFiles.sortedBy { it.path }
override fun toString(): String = "${this::class.java.simpleName}: $outputFile"
}
class GeneratedJvmClass (
sourceFiles: Collection<File>,
outputFile: File
class GeneratedJvmClass(
sourceFiles: Collection<File>,
outputFile: File
) : GeneratedFile(sourceFiles, outputFile) {
val outputClass = LocalFileKotlinClass.create(outputFile).sure {
"Couldn't load KotlinClass from $outputFile; it may happen because class doesn't have valid Kotlin annotations"
}
}
fun File.isModuleMappingFile() = extension == ModuleMapping.MAPPING_FILE_EXT && parentFile.name == "META-INF"
fun File.isModuleMappingFile() = extension == ModuleMapping.MAPPING_FILE_EXT && parentFile.name == "META-INF"

View File

@@ -17,6 +17,7 @@ enum class BuildAttributeKind : Serializable {
enum class BuildAttribute(val kind: BuildAttributeKind) : Serializable {
NO_BUILD_HISTORY(BuildAttributeKind.REBUILD_REASON),
NO_ABI_SNAPSHOT(BuildAttributeKind.REBUILD_REASON),
CACHE_CORRUPTION(BuildAttributeKind.REBUILD_REASON),
UNKNOWN_CHANGES_IN_GRADLE_INPUTS(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNTRACKED_FILE_IS_REMOVED(BuildAttributeKind.REBUILD_REASON),

View File

@@ -9,6 +9,7 @@ import java.io.Serializable
@Suppress("Reformat")
enum class BuildTime(val parent: BuildTime? = null) : Serializable {
GRADLE_TASK_ACTION,
GRADLE_TASK,
CLEAR_OUTPUT(GRADLE_TASK),
BACKUP_OUTPUT(GRADLE_TASK),
@@ -20,6 +21,10 @@ enum class BuildTime(val parent: BuildTime? = null) : Serializable {
NON_INCREMENTAL_COMPILATION_OUT_OF_PROCESS(RUN_COMPILER),
NON_INCREMENTAL_COMPILATION_DAEMON(RUN_COMPILER),
INCREMENTAL_COMPILATION(RUN_COMPILER),
STORE_BUILD_INFO(INCREMENTAL_COMPILATION),
JAR_SNAPSHOT(INCREMENTAL_COMPILATION),
SET_UP_ABI_SNAPSHOTS(JAR_SNAPSHOT),
IC_ANALYZE_JAR_FILES(JAR_SNAPSHOT),
IC_CALCULATE_INITIAL_DIRTY_SET(INCREMENTAL_COMPILATION),
IC_ANALYZE_CHANGES_IN_DEPENDENCIES(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_FIND_HISTORY_FILES(IC_ANALYZE_CHANGES_IN_DEPENDENCIES),

View File

@@ -29,21 +29,43 @@ import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
import org.jetbrains.kotlin.cli.common.arguments.ParseCommandLineArgumentsKt;
import org.jetbrains.kotlin.idea.ExplicitDefaultSubstitutor;
import org.jetbrains.kotlin.idea.ExplicitDefaultSubstitutorsKt;
import org.jetbrains.kotlin.utils.StringsKt;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.*;
public class ArgumentUtils {
private ArgumentUtils() {}
private ArgumentUtils() {
}
@NotNull
public static List<String> convertArgumentsToStringList(@NotNull CommonToolArguments arguments)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<String> convertedArguments = convertArgumentsToStringListInternal(arguments);
Map<KClass<? extends CommonToolArguments>, Collection<ExplicitDefaultSubstitutor>> defaultSubstitutorsMap =
ExplicitDefaultSubstitutorsKt.getDefaultSubstitutors();
KClass<? extends CommonToolArguments> argumentsKClass = JvmClassMappingKt.getKotlinClass(arguments.getClass());
Collection<ExplicitDefaultSubstitutor> defaultSubstitutors = defaultSubstitutorsMap.get(argumentsKClass);
if (defaultSubstitutors != null) {
for (ExplicitDefaultSubstitutor substitutor : defaultSubstitutors) {
if (substitutor.isSubstitutable(convertedArguments)) convertedArguments.addAll(substitutor.getNewSubstitution());
}
}
return convertedArguments;
}
@NotNull
public static List<String> convertArgumentsToStringListNoDefaults(@NotNull CommonToolArguments arguments)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
return convertArgumentsToStringListInternal(arguments);
}
private static List<String> convertArgumentsToStringListInternal(@NotNull CommonToolArguments arguments)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<String> result = new ArrayList<>();
Class<? extends CommonToolArguments> argumentsClass = arguments.getClass();
convertArgumentsToStringList(arguments, argumentsClass.newInstance(), JvmClassMappingKt.getKotlinClass(argumentsClass), result);

View File

@@ -0,0 +1,46 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea
import org.jetbrains.kotlin.cli.common.arguments.Argument
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.config.JvmTarget
import kotlin.reflect.KClass
import kotlin.reflect.KProperty1
import kotlin.reflect.full.findAnnotation
val defaultSubstitutors: Map<KClass<out CommonToolArguments>, Collection<ExplicitDefaultSubstitutor>> =
mapOf(K2JVMCompilerArguments::class to listOf(JvmTargetDefaultSubstitutor))
sealed class ExplicitDefaultSubstitutor {
abstract val substitutedProperty: KProperty1<out CommonToolArguments, String?>
abstract val oldSubstitution: List<String>
abstract val newSubstitution: List<String>
abstract fun isSubstitutable(args: List<String>): Boolean
protected val argument: Argument by lazy {
substitutedProperty.findAnnotation() ?: error("Property \"${substitutedProperty.name}\" has no Argument annotation")
}
}
object JvmTargetDefaultSubstitutor : ExplicitDefaultSubstitutor() {
override val substitutedProperty
get() = K2JVMCompilerArguments::jvmTarget
private val oldDefault: String
get() = JvmTarget.JVM_1_6.description
private val newDefault: String
get() = JvmTarget.JVM_1_8.description
private fun prepareSubstitution(default: String): List<String> = listOf(argument.value, default)
override val oldSubstitution: List<String>
get() = prepareSubstitution(oldDefault)
override val newSubstitution: List<String>
get() = prepareSubstitution(newDefault)
override fun isSubstitutable(args: List<String>): Boolean = argument.value !in args
}

View File

@@ -30,6 +30,28 @@ class ChangesCollector {
private val changedMembers = hashMapOf<FqName, MutableSet<String>>()
private val areSubclassesAffected = hashMapOf<FqName, Boolean>()
//TODO for test only: ProtoData or ProtoBuf
private val storage = hashMapOf<FqName, ProtoData>()
private val removed = ArrayList<FqName>()
//TODO change to immutable map
fun protoDataChanges(): Map<FqName, ProtoData> = storage
fun protoDataRemoved(): List<FqName> = removed
companion object {
fun <T> T.getNonPrivateNames(nameResolver: NameResolver, vararg members: T.() -> List<MessageLite>) =
members.flatMap { this.it().filterNot { it.isPrivate }.names(nameResolver) }.toSet()
fun ClassProtoData.getNonPrivateMemberNames(): Set<String> {
return proto.getNonPrivateNames(
nameResolver,
ProtoBuf.Class::getConstructorList,
ProtoBuf.Class::getFunctionList,
ProtoBuf.Class::getPropertyList
) + proto.enumEntryList.map { nameResolver.getString(it.name) }
}
}
fun changes(): List<ChangeInfo> {
val changes = arrayListOf<ChangeInfo>()
@@ -57,7 +79,7 @@ class ChangesCollector {
}
private fun <T, R> MutableMap<T, MutableSet<R>>.getSet(key: T) =
getOrPut(key) { HashSet() }
getOrPut(key) { HashSet() }
private fun collectChangedMember(scope: FqName, name: String) {
changedMembers.getSet(scope).add(name)
@@ -79,11 +101,35 @@ class ChangesCollector {
}
}
fun collectProtoChanges(oldData: ProtoData?, newData: ProtoData?, collectAllMembersForNewClass: Boolean = false) {
fun collectProtoChanges(oldData: ProtoData?, newData: ProtoData?, collectAllMembersForNewClass: Boolean = false, packageProtoKey: String? = null) {
if (oldData == null && newData == null) {
throw IllegalStateException("Old and new value are null")
}
if (newData != null) {
when (newData) {
is ClassProtoData -> {
val fqName = newData.nameResolver.getClassId(newData.proto.fqName).asSingleFqName()
storage[fqName] = newData
}
is PackagePartProtoData -> {
//TODO fqName is not unique. It's package and can be present in both java and kotlin
val fqName = newData.packageFqName
storage[packageProtoKey?.let { FqName(it) } ?: fqName] = newData
}
}
} else if (oldData != null) {
when (oldData) {
is ClassProtoData -> {
removed.add(oldData.nameResolver.getClassId(oldData.proto.fqName).asSingleFqName())
}
is PackagePartProtoData -> {
//TODO fqName is not unique. It's package and can be present in both java and kotlin
removed.add(packageProtoKey?.let { FqName(it) } ?: oldData.packageFqName)
}
}
}
if (oldData == null) {
newData!!.collectAll(isRemoved = false, isAdded = true, collectAllMembersForNewClass = collectAllMembersForNewClass)
return
@@ -125,8 +171,8 @@ class ChangesCollector {
}
}
private fun <T> T.getNonPrivateNames(nameResolver: NameResolver, vararg members: T.() -> List<MessageLite>): Set<String> =
members.flatMap { this.it().filterNot { it.isPrivate }.names(nameResolver) }.toSet()
fun <T> T.getNonPrivateNames(nameResolver: NameResolver, vararg members: T.() -> List<MessageLite>) =
members.flatMap { this.it().filterNot { it.isPrivate }.names(nameResolver) }.toSet()
//TODO remember all sealed parent classes
private fun ProtoData.collectAll(isRemoved: Boolean, isAdded: Boolean, collectAllMembersForNewClass: Boolean = false) =
@@ -137,16 +183,15 @@ class ChangesCollector {
private fun PackagePartProtoData.collectAllFromPackage(isRemoved: Boolean) {
val memberNames =
proto.getNonPrivateNames(
nameResolver,
ProtoBuf.Package::getFunctionList,
ProtoBuf.Package::getPropertyList
)
proto.getNonPrivateNames(
nameResolver,
ProtoBuf.Package::getFunctionList,
ProtoBuf.Package::getPropertyList
)
if (isRemoved) {
collectRemovedMembers(packageFqName, memberNames)
}
else {
} else {
collectChangedMembers(packageFqName, memberNames)
}
}
@@ -161,8 +206,7 @@ class ChangesCollector {
val collectMember = if (isRemoved) this@ChangesCollector::collectRemovedMember else this@ChangesCollector::collectChangedMember
collectMember(classFqName.parent(), classFqName.shortName().asString())
memberNames.forEach { collectMember(classFqName, it) }
}
else {
} else {
if (!isRemoved && collectAllMembersForNewClass) {
val memberNames = getNonPrivateMemberNames()
memberNames.forEach { this@ChangesCollector.collectChangedMember(classFqName, it) }
@@ -189,15 +233,6 @@ class ChangesCollector {
addChangedParents(fqName, changedParentsFqNames)
}
private fun ClassProtoData.getNonPrivateMemberNames(): Set<String> {
return proto.getNonPrivateNames(
nameResolver,
ProtoBuf.Class::getConstructorList,
ProtoBuf.Class::getFunctionList,
ProtoBuf.Class::getPropertyList
) + proto.enumEntryList.map { nameResolver.getString(it.name) }
}
fun collectMemberIfValueWasChanged(scope: FqName, name: String, oldValue: Any?, newValue: Any?) {
if (oldValue == null && newValue == null) {
throw IllegalStateException("Old and new value are null for $scope#$name")
@@ -205,8 +240,7 @@ class ChangesCollector {
if (oldValue != null && newValue == null) {
collectRemovedMember(scope, name)
}
else if (oldValue != newValue) {
} else if (oldValue != newValue) {
collectChangedMember(scope, name)
}
}

View File

@@ -0,0 +1,76 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.name.FqName
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import java.io.Serializable
/**
* Changes to the classpath of the `KotlinCompile` task, used to compute the source files that need to be recompiled during an incremental
* run.
*/
sealed class ClasspathChanges : Serializable {
class Available() : ClasspathChanges() {
lateinit var lookupSymbols: List<LookupSymbol>
private set
lateinit var fqNames: List<FqName>
private set
constructor(lookupSymbols: List<LookupSymbol>, fqNames: List<FqName>) : this() {
this.lookupSymbols = lookupSymbols
this.fqNames = fqNames
}
private fun writeObject(out: ObjectOutputStream) {
out.writeInt(lookupSymbols.size)
lookupSymbols.forEach {
out.writeUTF(it.name)
out.writeUTF(it.scope)
}
out.writeInt(fqNames.size)
fqNames.forEach {
out.writeUTF(it.asString())
}
}
private fun readObject(ois: ObjectInputStream) {
val lookupSymbolsSize = ois.readInt()
val lookupSymbols = ArrayList<LookupSymbol>(lookupSymbolsSize)
repeat(lookupSymbolsSize) {
val name = ois.readUTF()
val scope = ois.readUTF()
lookupSymbols.add(LookupSymbol(name, scope))
}
this.lookupSymbols = lookupSymbols
val fqNamesSize = ois.readInt()
val fqNames = ArrayList<FqName>(fqNamesSize)
repeat(fqNamesSize) {
val fqNameString = ois.readUTF()
fqNames.add(FqName(fqNameString))
}
this.fqNames = fqNames
}
companion object {
private const val serialVersionUID = 0L
}
}
sealed class NotAvailable : ClasspathChanges() {
object UnableToCompute : NotAvailable()
object ForNonIncrementalRun : NotAvailable()
object ClasspathSnapshotIsDisabled : NotAvailable()
object ReservedForTestsOnly : NotAvailable()
object ForJSCompiler : NotAvailable()
}
}

View File

@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.incremental
import com.intellij.util.io.DataExternalizer
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
import org.jetbrains.kotlin.incremental.js.IrTranslationResultValue
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
@@ -48,6 +49,7 @@ open class IncrementalJsCache(
private const val INLINE_FUNCTIONS = "inline-functions"
private const val HEADER_FILE_NAME = "header.meta"
private const val PACKAGE_META_FILE = "packages-meta"
private const val SOURCE_TO_JS_OUTPUT = "source-to-js-output"
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
@@ -60,6 +62,7 @@ open class IncrementalJsCache(
private val irTranslationResults = registerMap(IrTranslationResultMap(IR_TRANSLATION_RESULT_MAP.storageFile, pathConverter))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile, pathConverter))
private val packageMetadata = registerMap(PackageMetadataMap(PACKAGE_META_FILE.storageFile))
private val sourceToJsOutputsMap = registerMap(SourceToJsOutputMap(SOURCE_TO_JS_OUTPUT.storageFile, pathConverter))
private val dirtySources = hashSetOf<File>()
@@ -75,6 +78,7 @@ open class IncrementalJsCache(
override fun markDirty(removedAndCompiledSources: Collection<File>) {
removedAndCompiledSources.forEach { sourceFile ->
sourceToJsOutputsMap.remove(sourceFile)
// The common prefix of all FQN parents has to be the file package
sourceToClassesMap[sourceFile].map { it.parentOrNull()?.asString() ?: "" }.minByOrNull { it.length }?.let {
packageMetadata.remove(it)
@@ -95,6 +99,10 @@ open class IncrementalJsCache(
}
}
fun getOutputsBySource(sourceFile: File): Collection<File> {
return sourceToJsOutputsMap.get(sourceFile)
}
fun compareAndUpdate(incrementalResults: IncrementalResultsConsumerImpl, changesCollector: ChangesCollector) {
val translatedFiles = incrementalResults.packageParts
@@ -129,8 +137,8 @@ open class IncrementalJsCache(
}
for ((srcFile, irData) in incrementalResults.irFileData) {
val (fileData, types, signatures, strings, declarations, bodies, fqn) = irData
irTranslationResults.put(srcFile, fileData, types, signatures, strings, declarations, bodies, fqn)
val (fileData, types, signatures, strings, declarations, bodies, fqn, debugInfos) = irData
irTranslationResults.put(srcFile, fileData, types, signatures, strings, declarations, bodies, fqn, debugInfos)
}
}
@@ -175,6 +183,17 @@ open class IncrementalJsCache(
}
}
}
fun updateSourceToOutputMap(
generatedFiles: Iterable<GeneratedFile>,
) {
for (generatedFile in generatedFiles) {
for (source in generatedFile.sourceFiles) {
if (dirtySources.contains(source))
sourceToJsOutputsMap.add(source, generatedFile.outputFile)
}
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -215,17 +234,20 @@ private class TranslationResultMap(
override fun dumpValue(value: TranslationResultValue): String =
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
@Synchronized
fun put(sourceFile: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[pathConverter.toPath(sourceFile)] =
TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
}
@Synchronized
operator fun get(sourceFile: File): TranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
@Synchronized
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
@@ -247,6 +269,7 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
output.writeArray(value.declarations)
output.writeArray(value.bodies)
output.writeArray(value.fqn)
value.debugInfo?.let { output.writeArray(it) }
}
private fun DataOutput.writeArray(array: ByteArray) {
@@ -261,6 +284,17 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
return filedata
}
private fun DataInput.readArrayOrNull(): ByteArray? {
try {
val dataSize = readInt()
val filedata = ByteArray(dataSize)
readFully(filedata)
return filedata
} catch (e: Throwable) {
return null
}
}
override fun read(input: DataInput): IrTranslationResultValue {
val fileData = input.readArray()
val types = input.readArray()
@@ -269,8 +303,9 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
val declarations = input.readArray()
val bodies = input.readArray()
val fqn = input.readArray()
val debugInfos = input.readArrayOrNull()
return IrTranslationResultValue(fileData, types, signatures, strings, declarations, bodies, fqn)
return IrTranslationResultValue(fileData, types, signatures, strings, declarations, bodies, fqn, debugInfos)
}
}
@@ -295,10 +330,11 @@ private class IrTranslationResultMap(
newStrings: ByteArray,
newDeclarations: ByteArray,
newBodies: ByteArray,
fqn: ByteArray
fqn: ByteArray,
debugInfos: ByteArray?
) {
storage[pathConverter.toPath(sourceFile)] =
IrTranslationResultValue(newFiledata, newTypes, newSignatures, newStrings, newDeclarations, newBodies, fqn)
IrTranslationResultValue(newFiledata, newTypes, newSignatures, newStrings, newDeclarations, newBodies, fqn, debugInfos)
}
operator fun get(sourceFile: File): IrTranslationResultValue? =
@@ -359,6 +395,7 @@ private class InlineFunctionsMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
@Synchronized
fun process(srcFile: File, newMap: Map<String, Long>, changesCollector: ChangesCollector) {
val key = pathConverter.toPath(srcFile)
val oldMap = storage[key] ?: emptyMap()
@@ -376,6 +413,7 @@ private class InlineFunctionsMap(
}
}
@Synchronized
fun remove(sourceFile: File) {
storage.remove(pathConverter.toPath(sourceFile))
}

View File

@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMapping
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.org.objectweb.asm.*
@@ -184,7 +185,7 @@ open class IncrementalJvmCache(
sourceToClassesMap.add(source, jvmClassName)
val (proto, nameResolver) = serializedJavaClass.toProtoData()
addToClassStorage(proto, nameResolver, source)
// collector.addJavaProto(ClassProtoData(proto, nameResolver))
dirtyOutputClassesMap.notDirty(jvmClassName)
}
@@ -307,7 +308,7 @@ open class IncrementalJvmCache(
storage[key] = newData
val packageFqName = kotlinClass.className.packageFqName
changesCollector.collectProtoChanges(oldData?.toProtoData(packageFqName), newData.toProtoData(packageFqName))
changesCollector.collectProtoChanges(oldData?.toProtoData(packageFqName), newData.toProtoData(packageFqName), packageProtoKey = key)
}
operator fun contains(className: JvmClassName): Boolean =
@@ -399,7 +400,9 @@ open class IncrementalJvmCache(
}
for (const in oldMap.keys + newMap.keys) {
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(), const, oldMap[const], newMap[const])
//Constant can be declared via companion object or via const field declaration
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(companion = true), const, oldMap[const], newMap[const])
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(companion = false), const, oldMap[const], newMap[const])
}
}
@@ -599,11 +602,12 @@ sealed class ChangeInfo(val fqName: FqName) {
}
}
private fun LocalFileKotlinClass.scopeFqName() =
when (classHeader.kind) {
KotlinClassHeader.Kind.CLASS -> className.fqNameForClassNameWithoutDollars
else -> className.packageFqName
private fun LocalFileKotlinClass.scopeFqName(companion: Boolean = false) = when (classHeader.kind) {
KotlinClassHeader.Kind.CLASS -> {
className.fqNameForClassNameWithoutDollars.let { if (companion) it.child(DEFAULT_NAME_FOR_COMPANION_OBJECT) else it }
}
else -> className.packageFqName
}
fun ByteArray.md5(): Long {
val d = MessageDigest.getInstance("MD5").digest(this)!!

View File

@@ -12,7 +12,8 @@ data class IncrementalModuleEntry(
private val projectPath: String,
val name: String,
val buildDir: File,
val buildHistoryFile: File
val buildHistoryFile: File,
val abiSnapshot: File
) : Serializable {
companion object {
private const val serialVersionUID = 0L
@@ -26,7 +27,9 @@ class IncrementalModuleInfo(
val nameToModules: Map<String, Set<IncrementalModuleEntry>>,
val jarToClassListFile: Map<File, File>,
// only for js and mpp
val jarToModule: Map<File, IncrementalModuleEntry>
val jarToModule: Map<File, IncrementalModuleEntry>,
//for JVM only
val jarToAbiSnapshot: Map<File, File>
) : Serializable {
companion object {
private const val serialVersionUID = 1L

View File

@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.diagnostic.Logger
import com.intellij.util.containers.MultiMap
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.incremental.components.LookupTracker
@@ -33,6 +34,8 @@ open class LookupStorage(
targetDataDir: File,
pathConverter: FileToPathConverter
) : BasicMapsOwner(targetDataDir) {
val LOG = Logger.getInstance("#org.jetbrains.kotlin.jps.build.KotlinBuilder")
companion object {
private val DELETED_TO_SIZE_TRESHOLD = 0.5
private val MINIMUM_GARBAGE_COLLECTIBLE_SIZE = 10000
@@ -41,36 +44,44 @@ open class LookupStorage(
private val countersFile = "counters".storageFile
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile, pathConverter))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile, pathConverter))
private val lookupMap = registerMap(LookupMap("lookups".storageFile))
val lookupMap = registerMap(LookupMap("lookups".storageFile))
@Volatile
private var size: Int = 0
@Volatile
private var deletedCount: Int = 0
init {
try {
if (countersFile.exists()) {
val lines = countersFile.readLines()
size = lines[0].toInt()
deletedCount = lines[1].toInt()
}
} catch (e: Exception) {
throw IOException("Could not read $countersFile", e)
}
}
@Synchronized
fun get(lookupSymbol: LookupSymbol): Collection<String> {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val fileIds = lookupMap[key] ?: return emptySet()
val paths = mutableSetOf<String>()
val filtered = mutableSetOf<Int>()
for (fileId in fileIds) {
val path = idToFile[fileId]?.path
if (path != null) {
paths.add(path)
filtered.add(fileId)
}
return fileIds.mapNotNull {
// null means it's outdated
idToFile[it]?.path
}
if (size > MINIMUM_GARBAGE_COLLECTIBLE_SIZE && filtered.size.toDouble() / fileIds.size.toDouble() < DELETED_TO_SIZE_TRESHOLD) {
lookupMap[key] = filtered
}
return paths
}
@Synchronized
@@ -81,8 +92,8 @@ open class LookupStorage(
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val paths = lookups[lookupSymbol]
val fileIds = paths.mapTo(TreeSet()) { pathToId[it]!! }
fileIds.addAll(lookupMap[key] ?: emptySet())
lookupMap[key] = fileIds
lookupMap.append(key, fileIds)
}
}
@@ -92,7 +103,6 @@ open class LookupStorage(
val id = fileToId[file] ?: continue
idToFile.remove(id)
fileToId.remove(file)
deletedCount++
}
}
@@ -103,7 +113,6 @@ open class LookupStorage(
}
size = 0
deletedCount = 0
super.clean()
}
@@ -111,18 +120,15 @@ open class LookupStorage(
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
try {
removeGarbageIfNeeded()
if (size > 0) {
if (!countersFile.exists()) {
countersFile.parentFile.mkdirs()
countersFile.createNewFile()
}
countersFile.writeText("$size\n$deletedCount")
countersFile.writeText("$size\n")
}
}
finally {
} finally {
super.flush(memoryCachesOnly)
}
}
@@ -137,13 +143,7 @@ open class LookupStorage(
return id
}
private fun removeGarbageIfNeeded(force: Boolean = false) {
if (force || (size > MINIMUM_GARBAGE_COLLECTIBLE_SIZE && deletedCount.toDouble() / size > DELETED_TO_SIZE_TRESHOLD)) {
doRemoveGarbage()
}
}
private fun doRemoveGarbage() {
private fun removeGarbageForTests() {
for (hash in lookupMap.keys) {
lookupMap[hash] = lookupMap[hash]!!.filter { it in idToFile }.toSet()
}
@@ -153,7 +153,6 @@ open class LookupStorage(
idToFile.clean()
fileToId.clean()
size = 0
deletedCount = 0
for ((file, oldId) in oldFileToId.entries.sortedBy { it.key.path }) {
val newId = addFileIfNeeded(file)
@@ -165,15 +164,16 @@ open class LookupStorage(
if (fileIds.isEmpty()) {
lookupMap.remove(lookup)
}
else {
} else {
lookupMap[lookup] = fileIds
}
}
}
@TestOnly fun forceGC() {
removeGarbageIfNeeded(force = true)
@TestOnly
fun forceGC() {
removeGarbageForTests()
flush(false)
}

View File

@@ -182,6 +182,21 @@ open class ProtoCompareGenerated(
if (!checkEqualsClassSealedSubclassFqName(old, new)) return false
if (old.hasInlineClassUnderlyingPropertyName() != new.hasInlineClassUnderlyingPropertyName()) return false
if (old.hasInlineClassUnderlyingPropertyName()) {
if (!checkStringEquals(old.inlineClassUnderlyingPropertyName, new.inlineClassUnderlyingPropertyName)) return false
}
if (old.hasInlineClassUnderlyingType() != new.hasInlineClassUnderlyingType()) return false
if (old.hasInlineClassUnderlyingType()) {
if (!checkEquals(old.inlineClassUnderlyingType, new.inlineClassUnderlyingType)) return false
}
if (old.hasInlineClassUnderlyingTypeId() != new.hasInlineClassUnderlyingTypeId()) return false
if (old.hasInlineClassUnderlyingTypeId()) {
if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) return false
}
if (!checkEqualsClassVersionRequirement(old, new)) return false
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) return false
@@ -266,6 +281,9 @@ open class ProtoCompareGenerated(
TYPE_ALIAS_LIST,
ENUM_ENTRY_LIST,
SEALED_SUBCLASS_FQ_NAME_LIST,
INLINE_CLASS_UNDERLYING_PROPERTY_NAME,
INLINE_CLASS_UNDERLYING_TYPE,
INLINE_CLASS_UNDERLYING_TYPE_ID,
VERSION_REQUIREMENT_LIST,
VERSION_REQUIREMENT_TABLE,
JVM_EXT_CLASS_MODULE_NAME,
@@ -314,6 +332,21 @@ open class ProtoCompareGenerated(
if (!checkEqualsClassSealedSubclassFqName(old, new)) result.add(ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST)
if (old.hasInlineClassUnderlyingPropertyName() != new.hasInlineClassUnderlyingPropertyName()) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME)
if (old.hasInlineClassUnderlyingPropertyName()) {
if (!checkStringEquals(old.inlineClassUnderlyingPropertyName, new.inlineClassUnderlyingPropertyName)) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME)
}
if (old.hasInlineClassUnderlyingType() != new.hasInlineClassUnderlyingType()) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE)
if (old.hasInlineClassUnderlyingType()) {
if (!checkEquals(old.inlineClassUnderlyingType, new.inlineClassUnderlyingType)) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE)
}
if (old.hasInlineClassUnderlyingTypeId() != new.hasInlineClassUnderlyingTypeId()) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID)
if (old.hasInlineClassUnderlyingTypeId()) {
if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID)
}
if (!checkEqualsClassVersionRequirement(old, new)) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_LIST)
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_TABLE)
@@ -1071,6 +1104,11 @@ open class ProtoCompareGenerated(
if (!checkEquals(old.setter, new.setter)) return false
}
if (old.hasDelegateMethod() != new.hasDelegateMethod()) return false
if (old.hasDelegateMethod()) {
if (!checkEquals(old.delegateMethod, new.delegateMethod)) return false
}
return true
}
@@ -1728,6 +1766,18 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + fqNameIndexes(getSealedSubclassFqName(i))
}
if (hasInlineClassUnderlyingPropertyName()) {
hashCode = 31 * hashCode + stringIndexes(inlineClassUnderlyingPropertyName)
}
if (hasInlineClassUnderlyingType()) {
hashCode = 31 * hashCode + inlineClassUnderlyingType.hashCode(stringIndexes, fqNameIndexes, typeById)
}
if (hasInlineClassUnderlyingTypeId()) {
hashCode = 31 * hashCode + typeById(inlineClassUnderlyingTypeId).hashCode(stringIndexes, fqNameIndexes, typeById)
}
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
@@ -2308,6 +2358,10 @@ fun JvmProtoBuf.JvmPropertySignature.hashCode(stringIndexes: (Int) -> Int, fqNam
hashCode = 31 * hashCode + setter.hashCode(stringIndexes, fqNameIndexes, typeById)
}
if (hasDelegateMethod()) {
hashCode = 31 * hashCode + delegateMethod.hashCode(stringIndexes, fqNameIndexes, typeById)
}
return hashCode
}

View File

@@ -255,22 +255,23 @@ fun withSubtypes(
typeFqName: FqName,
caches: Iterable<IncrementalCacheCommon>
): Set<FqName> {
val types = LinkedHashSet(listOf(typeFqName))
val subtypes = hashSetOf<FqName>()
val typesToProccess = LinkedHashSet(listOf(typeFqName))
val proccessedTypes = hashSetOf<FqName>()
while (types.isNotEmpty()) {
val iterator = types.iterator()
while (typesToProccess.isNotEmpty()) {
val iterator = typesToProccess.iterator()
val unprocessedType = iterator.next()
iterator.remove()
caches.asSequence()
.flatMap { it.getSubtypesOf(unprocessedType) }
.filter { it !in subtypes }
.forEach { types.add(it) }
.filter { it !in proccessedTypes }
.forEach { typesToProccess.add(it) }
subtypes.add(unprocessedType)
proccessedTypes.add(unprocessedType)
}
return subtypes
return proccessedTypes
}

View File

@@ -290,6 +290,11 @@ class DifferenceCalculatorForClass(
isClassAffected = true
areSubclassesAffected = true
}
ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME,
ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE,
ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID -> {
isClassAffected = true
}
}
}

View File

@@ -47,10 +47,16 @@ abstract class BasicMap<K : Comparable<K>, V>(
storage.flush(memoryCachesOnly)
}
// avoid unsynchronized close
fun close() {
storage.close()
}
@TestOnly
fun closeForTest() {
close()
}
@TestOnly
fun dump(): String {
return with(StringBuilder()) {

View File

@@ -34,7 +34,6 @@ class CachingLazyStorage<K, V>(
) : LazyStorage<K, V> {
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
@@ -46,32 +45,36 @@ class CachingLazyStorage<K, V>(
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
@Synchronized
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
@Synchronized
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
@Synchronized
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
@Synchronized
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
@Synchronized
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
@Synchronized
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendData(key, { valueExternalizer.save(it, value) })
}
@@ -103,7 +106,11 @@ class CachingLazyStorage<K, V>(
@Synchronized
override fun close() {
storage?.close()
try {
storage?.close()
} finally {
storage = null
}
}
private fun createMap(): PersistentHashMap<K, V> = PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)

View File

@@ -28,6 +28,7 @@ internal open class ClassOneToManyMap(storageFile: File) : BasicStringMap<Collec
storage.append(key.asString(), listOf(value.asString()))
}
@Synchronized
operator fun get(key: FqName): Collection<FqName> =
storage[key.asString()]?.map(::FqName) ?: setOf()

View File

@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.incremental.storage
import java.io.File
internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<Int>>(storage, LookupSymbolKeyDescriptor, IntCollectionExternalizer) {
class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<Int>>(storage, LookupSymbolKeyDescriptor, IntCollectionExternalizer) {
override fun dumpKey(key: LookupSymbolKey): String = key.toString()
override fun dumpValue(value: Collection<Int>): String = value.toString()
@@ -27,6 +27,10 @@ internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<I
storage.append(LookupSymbolKey(name, scope), listOf(fileId))
}
fun append(lookup: LookupSymbolKey, fileIds: Collection<Int>) {
storage.append(lookup, fileIds)
}
operator fun get(key: LookupSymbolKey): Collection<Int>? = storage[key]
operator fun set(key: LookupSymbolKey, fileIds: Set<Int>) {

View File

@@ -31,7 +31,6 @@ class NonCachingLazyStorage<K, V>(
) : LazyStorage<K, V> {
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
@@ -43,7 +42,6 @@ class NonCachingLazyStorage<K, V>(
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
@@ -53,22 +51,28 @@ class NonCachingLazyStorage<K, V>(
}
override val keys: Collection<K>
@Synchronized
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
@Synchronized
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
@Synchronized
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
@Synchronized
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
@Synchronized
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
@Synchronized
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendData(key) { dataOutput -> valueExternalizer.save(dataOutput, value) }
}
@@ -100,7 +104,11 @@ class NonCachingLazyStorage<K, V>(
@Synchronized
override fun close() {
storage?.close()
try {
storage?.close()
} finally {
storage = null
}
}
private fun createMap(): PersistentHashMap<K, V> =

View File

@@ -0,0 +1,43 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import java.io.File
class SourceToJsOutputMap(storageFile: File, private val pathConverter: FileToPathConverter) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
@Synchronized
fun add(key: File, value: File) {
storage.append(pathConverter.toPath(key), listOf(pathConverter.toPath(value)))
}
operator fun get(sourceFile: File): Collection<File> =
storage[pathConverter.toPath(sourceFile)]?.map { pathConverter.toFile(it) } ?: setOf()
@Synchronized
operator fun set(key: File, values: Collection<File>) {
if (values.isEmpty()) {
remove(key)
return
}
storage[pathConverter.toPath(key)] = values.map { pathConverter.toPath(it) }
}
@Synchronized
fun remove(key: File) {
storage.remove(pathConverter.toPath(key))
}
@Synchronized
fun removeValues(key: File, removed: Set<File>) {
val notRemoved = this[key].filter { it !in removed }
this[key] = notRemoved
}
}

View File

@@ -21,23 +21,49 @@ import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
import org.jetbrains.kotlin.cli.common.toBooleanLenient
import java.io.DataInput
import java.io.DataInputStream
import java.io.DataOutput
import java.io.File
import java.util.*
/**
* Storage versioning:
* 0 - only name and value hashes are saved
* 1 - name and scope are saved
*/
object LookupSymbolKeyDescriptor : KeyDescriptor<LookupSymbolKey> {
override fun read(input: DataInput): LookupSymbolKey {
val first = input.readInt()
val second = input.readInt()
return LookupSymbolKey(first, second)
val version = input.readByte()
return when (version.toInt()) {
0 -> {
val name = input.readUTF()
val scope = input.readUTF()
LookupSymbolKey(name.hashCode(), scope.hashCode(), name, scope)
}
1 -> {
val first = input.readInt()
val second = input.readInt()
LookupSymbolKey(first, second, "", "")
}
else -> throw RuntimeException("Unknown version of LookupSymbolKeyDescriptor=${version}")
}
}
private val storeFullFqName = CompilerSystemProperties.COMPILE_INCREMENTAL_WITH_CLASSPATH_SHAPSHOTS.value.toBooleanLenient() ?: false
override fun save(output: DataOutput, value: LookupSymbolKey) {
output.writeInt(value.nameHash)
output.writeInt(value.scopeHash)
if (storeFullFqName) {
output.writeByte(0)
output.writeUTF(value.name)
output.writeUTF(value.scope)
} else {
output.writeByte(1)
output.writeInt(value.nameHash)
output.writeInt(value.scopeHash)
}
}
override fun getHashCode(value: LookupSymbolKey): Int = value.hashCode()

View File

@@ -16,8 +16,8 @@
package org.jetbrains.kotlin.incremental.storage
data class LookupSymbolKey(val nameHash: Int, val scopeHash: Int) : Comparable<LookupSymbolKey> {
constructor(name: String, scope: String) : this(name.hashCode(), scope.hashCode())
data class LookupSymbolKey(val nameHash: Int, val scopeHash: Int, val name:String, val scope:String) : Comparable<LookupSymbolKey> {
constructor(name: String, scope: String) : this(name.hashCode(), scope.hashCode(), name, scope)
override fun compareTo(other: LookupSymbolKey): Int {
val nameCmp = nameHash.compareTo(other.nameHash)
@@ -26,6 +26,26 @@ data class LookupSymbolKey(val nameHash: Int, val scopeHash: Int) : Comparable<L
return scopeHash.compareTo(other.scopeHash)
}
override fun hashCode(): Int {
var result = nameHash
result = 31 * result + scopeHash
return result
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as LookupSymbolKey
if (nameHash != other.nameHash) return false
if (scopeHash != other.scopeHash) return false
return true
}
}
data class ProtoMapValue(val isPackageFacade: Boolean, val bytes: ByteArray, val strings: Array<String>)

View File

@@ -23,7 +23,8 @@ data class BuildLogFinder(
private val isGradleEnabled: Boolean = false,
private val isJsEnabled: Boolean = false,
private val isScopeExpansionEnabled: Boolean = false,
private val isKlibEnabled: Boolean = false
private val isKlibEnabled: Boolean = false,
private val isFirEnabled: Boolean = false
) {
companion object {
private const val JS_LOG = "js-build.log"
@@ -32,6 +33,8 @@ data class BuildLogFinder(
private const val GRADLE_LOG = "gradle-build.log"
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
const val JS_JPS_LOG = "js-jps-build.log"
private const val FIR_LOG = "fir-build.log"
private const val GRADLE_FIR_LOG = "gradle-fir-build.log"
private const val SIMPLE_LOG = "build.log"
fun isJpsLogFile(file: File): Boolean =
@@ -45,6 +48,8 @@ data class BuildLogFinder(
isScopeExpansionEnabled && SCOPE_EXPANDING_LOG in files -> SCOPE_EXPANDING_LOG
isKlibEnabled && KLIB_LOG in files -> KLIB_LOG
isJsEnabled && JS_LOG in files -> JS_LOG
isGradleEnabled && isFirEnabled && GRADLE_FIR_LOG in files -> GRADLE_FIR_LOG
isFirEnabled && FIR_LOG in files -> FIR_LOG
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG
isDataContainerBuildLogEnabled && DATA_CONTAINER_LOG in files -> DATA_CONTAINER_LOG

View File

@@ -10,17 +10,21 @@ public final class DebugKlibMetadataProtoBuf {
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.packageFqName);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classFile);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.constructorAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.constructorKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.constructorUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionFile);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyFile);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.enumEntryOrdinal);
@@ -3163,6 +3167,17 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int CLASS_KDOC_FIELD_NUMBER = 176;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class,
java.lang.String> classKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int CLASS_UNIQ_ID_FIELD_NUMBER = 171;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
@@ -3185,6 +3200,17 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int CONSTRUCTOR_KDOC_FIELD_NUMBER = 173;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Constructor { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Constructor,
java.lang.String> constructorKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int CONSTRUCTOR_UNIQ_ID_FIELD_NUMBER = 172;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Constructor { ... }</code>
@@ -3218,6 +3244,17 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int FUNCTION_KDOC_FIELD_NUMBER = 174;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Function { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Function,
java.lang.String> functionKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int FUNCTION_UNIQ_ID_FIELD_NUMBER = 173;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Function { ... }</code>
@@ -3284,6 +3321,17 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int PROPERTY_KDOC_FIELD_NUMBER = 180;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.lang.String> propertyKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int PROPERTY_UNIQ_ID_FIELD_NUMBER = 179;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -3480,72 +3528,79 @@ public final class DebugKlibMetadataProtoBuf {
".metadata.Class\030\252\001 \003(\0132).org.jetbrains.k" +
"otlin.metadata.Annotation:?\n\nclass_file\022",
"$.org.jetbrains.kotlin.metadata.Class\030\257\001" +
" \001(\005B\004\200\265\030\001:u\n\rclass_uniq_id\022$.org.jetbra" +
"ins.kotlin.metadata.Class\030\253\001 \001(\01327.org.j" +
"etbrains.kotlin.library.metadata.Descrip" +
"torUniqId:v\n\026constructor_annotation\022*.or" +
"g.jetbrains.kotlin.metadata.Constructor\030" +
"\252\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:\201\001\n\023constructor_uniq_id\022*.org." +
"jetbrains.kotlin.metadata.Constructor\030\254\001" +
" \001(\01327.org.jetbrains.kotlin.library.meta",
"data.DescriptorUniqId:p\n\023function_annota" +
"tion\022\'.org.jetbrains.kotlin.metadata.Fun" +
"ction\030\252\001 \003(\0132).org.jetbrains.kotlin.meta" +
"data.Annotation:E\n\rfunction_file\022\'.org.j" +
"etbrains.kotlin.metadata.Function\030\254\001 \001(\005" +
"B\004\200\265\030\001:{\n\020function_uniq_id\022\'.org.jetbrai" +
"ns.kotlin.metadata.Function\030\255\001 \001(\01327.org" +
".jetbrains.kotlin.library.metadata.Descr" +
"iptorUniqId:p\n\023property_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\252\001 \003",
"(\0132).org.jetbrains.kotlin.metadata.Annot" +
"ation:w\n\032property_getter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\261\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:w\n\032property_setter_annotation\022\'.o" +
"rg.jetbrains.kotlin.metadata.Property\030\262\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:~\n\022compile_time_value\022\'.org.jetb" +
"rains.kotlin.metadata.Property\030\255\001 \001(\01328." +
"org.jetbrains.kotlin.metadata.Annotation",
".Argument.Value:E\n\rproperty_file\022\'.org.j" +
"etbrains.kotlin.metadata.Property\030\260\001 \001(\005" +
"B\004\200\265\030\001:{\n\020property_uniq_id\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\263\001 \001(\01327.org" +
".jetbrains.kotlin.library.metadata.Descr" +
"iptorUniqId:s\n\025enum_entry_annotation\022(.o" +
"rg.jetbrains.kotlin.metadata.EnumEntry\030\252" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:E\n\022enum_entry_ordinal\022(.org.jet" +
"brains.kotlin.metadata.EnumEntry\030\253\001 \001(\005:",
"~\n\022enum_entry_uniq_id\022(.org.jetbrains.ko" +
"tlin.metadata.EnumEntry\030\254\001 \001(\01327.org.jet" +
"brains.kotlin.library.metadata.Descripto" +
"rUniqId:w\n\024parameter_annotation\022-.org.je" +
"tbrains.kotlin.metadata.ValueParameter\030\252" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:h\n\017type_annotation\022#.org.jetbra" +
"ins.kotlin.metadata.Type\030\252\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:{\n\031ty" +
"pe_parameter_annotation\022,.org.jetbrains.",
"kotlin.metadata.TypeParameter\030\252\001 \003(\0132).o" +
"rg.jetbrains.kotlin.metadata.Annotation:" +
"\202\001\n\022type_param_uniq_id\022,.org.jetbrains.k" +
"otlin.metadata.TypeParameter\030\253\001 \001(\01327.or" +
"g.jetbrains.kotlin.library.metadata.Desc" +
"riptorUniqId:U\n\026package_fragment_files\022." +
".org.jetbrains.kotlin.metadata.PackageFr" +
"agment\030\252\001 \003(\005B\004\200\265\030\001:A\n\010is_empty\022..org.je" +
"tbrains.kotlin.metadata.PackageFragment\030" +
"\254\001 \001(\010:@\n\007fq_name\022..org.jetbrains.kotlin",
".metadata.PackageFragment\030\255\001 \001(\t:G\n\nclas" +
"s_name\022..org.jetbrains.kotlin.metadata.P" +
"ackageFragment\030\256\001 \003(\005B\002\020\001:~\n\022type_alias_" +
"uniq_id\022(.org.jetbrains.kotlin.metadata." +
"TypeAlias\030\203\001 \001(\01327.org.jetbrains.kotlin." +
"library.metadata.DescriptorUniqIdB\033B\031Deb" +
"ugKlibMetadataProtoBuf"
" \001(\005B\004\200\265\030\001:?\n\nclass_kdoc\022$.org.jetbrains" +
".kotlin.metadata.Class\030\260\001 \001(\tB\004\200\265\030\001:u\n\rc" +
"lass_uniq_id\022$.org.jetbrains.kotlin.meta" +
"data.Class\030\253\001 \001(\01327.org.jetbrains.kotlin" +
".library.metadata.DescriptorUniqId:v\n\026co" +
"nstructor_annotation\022*.org.jetbrains.kot" +
"lin.metadata.Constructor\030\252\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:K\n\020co" +
"nstructor_kdoc\022*.org.jetbrains.kotlin.me",
"tadata.Constructor\030\255\001 \001(\tB\004\200\265\030\001:\201\001\n\023cons" +
"tructor_uniq_id\022*.org.jetbrains.kotlin.m" +
"etadata.Constructor\030\254\001 \001(\01327.org.jetbrai" +
"ns.kotlin.library.metadata.DescriptorUni" +
"qId:p\n\023function_annotation\022\'.org.jetbrai" +
"ns.kotlin.metadata.Function\030\252\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.Annotation:E\n" +
"\rfunction_file\022\'.org.jetbrains.kotlin.me" +
"tadata.Function\030\254\001 \001(\005B\004\200\265\030\001:E\n\rfunction" +
"_kdoc\022\'.org.jetbrains.kotlin.metadata.Fu",
"nction\030\256\001 \001(\tB\004\200\265\030\001:{\n\020function_uniq_id\022" +
"\'.org.jetbrains.kotlin.metadata.Function" +
"\030\255\001 \001(\01327.org.jetbrains.kotlin.library.m" +
"etadata.DescriptorUniqId:p\n\023property_ann" +
"otation\022\'.org.jetbrains.kotlin.metadata." +
"Property\030\252\001 \003(\0132).org.jetbrains.kotlin.m" +
"etadata.Annotation:w\n\032property_getter_an" +
"notation\022\'.org.jetbrains.kotlin.metadata" +
".Property\030\261\001 \003(\0132).org.jetbrains.kotlin." +
"metadata.Annotation:w\n\032property_setter_a",
"nnotation\022\'.org.jetbrains.kotlin.metadat" +
"a.Property\030\262\001 \003(\0132).org.jetbrains.kotlin" +
".metadata.Annotation:~\n\022compile_time_val" +
"ue\022\'.org.jetbrains.kotlin.metadata.Prope" +
"rty\030\255\001 \001(\01328.org.jetbrains.kotlin.metada" +
"ta.Annotation.Argument.Value:E\n\rproperty" +
"_file\022\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\030\260\001 \001(\005B\004\200\265\030\001:E\n\rproperty_kdoc\022\'.o" +
"rg.jetbrains.kotlin.metadata.Property\030\264\001" +
" \001(\tB\004\200\265\030\001:{\n\020property_uniq_id\022\'.org.jet",
"brains.kotlin.metadata.Property\030\263\001 \001(\01327" +
".org.jetbrains.kotlin.library.metadata.D" +
"escriptorUniqId:s\n\025enum_entry_annotation" +
"\022(.org.jetbrains.kotlin.metadata.EnumEnt" +
"ry\030\252\001 \003(\0132).org.jetbrains.kotlin.metadat" +
"a.Annotation:E\n\022enum_entry_ordinal\022(.org" +
".jetbrains.kotlin.metadata.EnumEntry\030\253\001 " +
"\001(\005:~\n\022enum_entry_uniq_id\022(.org.jetbrain" +
"s.kotlin.metadata.EnumEntry\030\254\001 \001(\01327.org" +
".jetbrains.kotlin.library.metadata.Descr",
"iptorUniqId:w\n\024parameter_annotation\022-.or" +
"g.jetbrains.kotlin.metadata.ValueParamet" +
"er\030\252\001 \003(\0132).org.jetbrains.kotlin.metadat" +
"a.Annotation:h\n\017type_annotation\022#.org.je" +
"tbrains.kotlin.metadata.Type\030\252\001 \003(\0132).or" +
"g.jetbrains.kotlin.metadata.Annotation:{" +
"\n\031type_parameter_annotation\022,.org.jetbra" +
"ins.kotlin.metadata.TypeParameter\030\252\001 \003(\013" +
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:\202\001\n\022type_param_uniq_id\022,.org.jetbrai",
"ns.kotlin.metadata.TypeParameter\030\253\001 \001(\0132" +
"7.org.jetbrains.kotlin.library.metadata." +
"DescriptorUniqId:U\n\026package_fragment_fil" +
"es\022..org.jetbrains.kotlin.metadata.Packa" +
"geFragment\030\252\001 \003(\005B\004\200\265\030\001:A\n\010is_empty\022..or" +
"g.jetbrains.kotlin.metadata.PackageFragm" +
"ent\030\254\001 \001(\010:@\n\007fq_name\022..org.jetbrains.ko" +
"tlin.metadata.PackageFragment\030\255\001 \001(\t:G\n\n" +
"class_name\022..org.jetbrains.kotlin.metada" +
"ta.PackageFragment\030\256\001 \003(\005B\002\020\001:~\n\022type_al",
"ias_uniq_id\022(.org.jetbrains.kotlin.metad" +
"ata.TypeAlias\030\203\001 \001(\01327.org.jetbrains.kot" +
"lin.library.metadata.DescriptorUniqIdB\033B" +
"\031DebugKlibMetadataProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -3582,30 +3637,34 @@ public final class DebugKlibMetadataProtoBuf {
packageFqName.internalInit(descriptor.getExtensions().get(0));
classAnnotation.internalInit(descriptor.getExtensions().get(1));
classFile.internalInit(descriptor.getExtensions().get(2));
classUniqId.internalInit(descriptor.getExtensions().get(3));
constructorAnnotation.internalInit(descriptor.getExtensions().get(4));
constructorUniqId.internalInit(descriptor.getExtensions().get(5));
functionAnnotation.internalInit(descriptor.getExtensions().get(6));
functionFile.internalInit(descriptor.getExtensions().get(7));
functionUniqId.internalInit(descriptor.getExtensions().get(8));
propertyAnnotation.internalInit(descriptor.getExtensions().get(9));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(10));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(11));
compileTimeValue.internalInit(descriptor.getExtensions().get(12));
propertyFile.internalInit(descriptor.getExtensions().get(13));
propertyUniqId.internalInit(descriptor.getExtensions().get(14));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(15));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(16));
enumEntryUniqId.internalInit(descriptor.getExtensions().get(17));
parameterAnnotation.internalInit(descriptor.getExtensions().get(18));
typeAnnotation.internalInit(descriptor.getExtensions().get(19));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(20));
typeParamUniqId.internalInit(descriptor.getExtensions().get(21));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(22));
isEmpty.internalInit(descriptor.getExtensions().get(23));
fqName.internalInit(descriptor.getExtensions().get(24));
className.internalInit(descriptor.getExtensions().get(25));
typeAliasUniqId.internalInit(descriptor.getExtensions().get(26));
classKdoc.internalInit(descriptor.getExtensions().get(3));
classUniqId.internalInit(descriptor.getExtensions().get(4));
constructorAnnotation.internalInit(descriptor.getExtensions().get(5));
constructorKdoc.internalInit(descriptor.getExtensions().get(6));
constructorUniqId.internalInit(descriptor.getExtensions().get(7));
functionAnnotation.internalInit(descriptor.getExtensions().get(8));
functionFile.internalInit(descriptor.getExtensions().get(9));
functionKdoc.internalInit(descriptor.getExtensions().get(10));
functionUniqId.internalInit(descriptor.getExtensions().get(11));
propertyAnnotation.internalInit(descriptor.getExtensions().get(12));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(13));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(14));
compileTimeValue.internalInit(descriptor.getExtensions().get(15));
propertyFile.internalInit(descriptor.getExtensions().get(16));
propertyKdoc.internalInit(descriptor.getExtensions().get(17));
propertyUniqId.internalInit(descriptor.getExtensions().get(18));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(19));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(20));
enumEntryUniqId.internalInit(descriptor.getExtensions().get(21));
parameterAnnotation.internalInit(descriptor.getExtensions().get(22));
typeAnnotation.internalInit(descriptor.getExtensions().get(23));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(24));
typeParamUniqId.internalInit(descriptor.getExtensions().get(25));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(26));
isEmpty.internalInit(descriptor.getExtensions().get(27));
fqName.internalInit(descriptor.getExtensions().get(28));
className.internalInit(descriptor.getExtensions().get(29));
typeAliasUniqId.internalInit(descriptor.getExtensions().get(30));
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
@@ -3613,6 +3672,10 @@ public final class DebugKlibMetadataProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
.internalUpdateFileDescriptor(descriptor, registry);
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();

View File

@@ -10347,6 +10347,37 @@ public final class DebugProtoBuf {
*/
int getSealedSubclassFqName(int index);
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
boolean hasInlineClassUnderlyingPropertyName();
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
int getInlineClassUnderlyingPropertyName();
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
boolean hasInlineClassUnderlyingType();
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getInlineClassUnderlyingType();
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getInlineClassUnderlyingTypeOrBuilder();
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
boolean hasInlineClassUnderlyingTypeId();
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
int getInlineClassUnderlyingTypeId();
/**
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
*/
@@ -10585,9 +10616,32 @@ public final class DebugProtoBuf {
input.popLimit(limit);
break;
}
case 136: {
bitField0_ |= 0x00000008;
inlineClassUnderlyingPropertyName_ = input.readInt32();
break;
}
case 146: {
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder subBuilder = null;
if (((bitField0_ & 0x00000010) == 0x00000010)) {
subBuilder = inlineClassUnderlyingType_.toBuilder();
}
inlineClassUnderlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(inlineClassUnderlyingType_);
inlineClassUnderlyingType_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000010;
break;
}
case 152: {
bitField0_ |= 0x00000020;
inlineClassUnderlyingTypeId_ = input.readInt32();
break;
}
case 242: {
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
if (((bitField0_ & 0x00000040) == 0x00000040)) {
subBuilder = typeTable_.toBuilder();
}
typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.PARSER, extensionRegistry);
@@ -10595,13 +10649,13 @@ public final class DebugProtoBuf {
subBuilder.mergeFrom(typeTable_);
typeTable_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000008;
bitField0_ |= 0x00000040;
break;
}
case 248: {
if (!((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) {
versionRequirement_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00004000;
mutable_bitField0_ |= 0x00020000;
}
versionRequirement_.add(input.readInt32());
break;
@@ -10609,9 +10663,9 @@ public final class DebugProtoBuf {
case 250: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00004000) == 0x00004000) && input.getBytesUntilLimit() > 0) {
if (!((mutable_bitField0_ & 0x00020000) == 0x00020000) && input.getBytesUntilLimit() > 0) {
versionRequirement_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00004000;
mutable_bitField0_ |= 0x00020000;
}
while (input.getBytesUntilLimit() > 0) {
versionRequirement_.add(input.readInt32());
@@ -10621,7 +10675,7 @@ public final class DebugProtoBuf {
}
case 258: {
org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.Builder subBuilder = null;
if (((bitField0_ & 0x00000010) == 0x00000010)) {
if (((bitField0_ & 0x00000080) == 0x00000080)) {
subBuilder = versionRequirementTable_.toBuilder();
}
versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.PARSER, extensionRegistry);
@@ -10629,7 +10683,7 @@ public final class DebugProtoBuf {
subBuilder.mergeFrom(versionRequirementTable_);
versionRequirementTable_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000010;
bitField0_ |= 0x00000080;
break;
}
}
@@ -10670,7 +10724,7 @@ public final class DebugProtoBuf {
if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_);
}
if (((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) {
versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_);
}
this.unknownFields = unknownFields.build();
@@ -11225,13 +11279,64 @@ public final class DebugProtoBuf {
}
private int sealedSubclassFqNameMemoizedSerializedSize = -1;
public static final int INLINE_CLASS_UNDERLYING_PROPERTY_NAME_FIELD_NUMBER = 17;
private int inlineClassUnderlyingPropertyName_;
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
public boolean hasInlineClassUnderlyingPropertyName() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
public int getInlineClassUnderlyingPropertyName() {
return inlineClassUnderlyingPropertyName_;
}
public static final int INLINE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 18;
private org.jetbrains.kotlin.metadata.DebugProtoBuf.Type inlineClassUnderlyingType_;
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public boolean hasInlineClassUnderlyingType() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getInlineClassUnderlyingType() {
return inlineClassUnderlyingType_;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getInlineClassUnderlyingTypeOrBuilder() {
return inlineClassUnderlyingType_;
}
public static final int INLINE_CLASS_UNDERLYING_TYPE_ID_FIELD_NUMBER = 19;
private int inlineClassUnderlyingTypeId_;
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
public boolean hasInlineClassUnderlyingTypeId() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
public int getInlineClassUnderlyingTypeId() {
return inlineClassUnderlyingTypeId_;
}
public static final int TYPE_TABLE_FIELD_NUMBER = 30;
private org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable typeTable_;
/**
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
*/
public boolean hasTypeTable() {
return ((bitField0_ & 0x00000008) == 0x00000008);
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
@@ -11286,7 +11391,7 @@ public final class DebugProtoBuf {
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
*/
public boolean hasVersionRequirementTable() {
return ((bitField0_ & 0x00000010) == 0x00000010);
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
@@ -11315,6 +11420,9 @@ public final class DebugProtoBuf {
typeAlias_ = java.util.Collections.emptyList();
enumEntry_ = java.util.Collections.emptyList();
sealedSubclassFqName_ = java.util.Collections.emptyList();
inlineClassUnderlyingPropertyName_ = 0;
inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
inlineClassUnderlyingTypeId_ = 0;
typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance();
versionRequirement_ = java.util.Collections.emptyList();
versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance();
@@ -11371,6 +11479,12 @@ public final class DebugProtoBuf {
return false;
}
}
if (hasInlineClassUnderlyingType()) {
if (!getInlineClassUnderlyingType().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasTypeTable()) {
if (!getTypeTable().isInitialized()) {
memoizedIsInitialized = 0;
@@ -11443,12 +11557,21 @@ public final class DebugProtoBuf {
output.writeInt32NoTag(sealedSubclassFqName_.get(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt32(17, inlineClassUnderlyingPropertyName_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeMessage(18, inlineClassUnderlyingType_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeInt32(19, inlineClassUnderlyingTypeId_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeMessage(30, typeTable_);
}
for (int i = 0; i < versionRequirement_.size(); i++) {
output.writeInt32(31, versionRequirement_.get(i));
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeMessage(32, versionRequirementTable_);
}
extensionWriter.writeUntil(19000, output);
@@ -11544,6 +11667,18 @@ public final class DebugProtoBuf {
sealedSubclassFqNameMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32Size(17, inlineClassUnderlyingPropertyName_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(18, inlineClassUnderlyingType_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32Size(19, inlineClassUnderlyingTypeId_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(30, typeTable_);
}
@@ -11556,7 +11691,7 @@ public final class DebugProtoBuf {
size += dataSize;
size += 2 * getVersionRequirementList().size();
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(32, versionRequirementTable_);
}
@@ -11678,6 +11813,7 @@ public final class DebugProtoBuf {
getPropertyFieldBuilder();
getTypeAliasFieldBuilder();
getEnumEntryFieldBuilder();
getInlineClassUnderlyingTypeFieldBuilder();
getTypeTableFieldBuilder();
getVersionRequirementTableFieldBuilder();
}
@@ -11742,20 +11878,30 @@ public final class DebugProtoBuf {
}
sealedSubclassFqName_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00001000);
inlineClassUnderlyingPropertyName_ = 0;
bitField0_ = (bitField0_ & ~0x00002000);
if (inlineClassUnderlyingTypeBuilder_ == null) {
inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
} else {
inlineClassUnderlyingTypeBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00004000);
inlineClassUnderlyingTypeId_ = 0;
bitField0_ = (bitField0_ & ~0x00008000);
if (typeTableBuilder_ == null) {
typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance();
} else {
typeTableBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00002000);
bitField0_ = (bitField0_ & ~0x00010000);
versionRequirement_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00004000);
bitField0_ = (bitField0_ & ~0x00020000);
if (versionRequirementTableBuilder_ == null) {
versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance();
} else {
versionRequirementTableBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00008000);
bitField0_ = (bitField0_ & ~0x00040000);
return this;
}
@@ -11877,18 +12023,34 @@ public final class DebugProtoBuf {
if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
to_bitField0_ |= 0x00000008;
}
result.inlineClassUnderlyingPropertyName_ = inlineClassUnderlyingPropertyName_;
if (((from_bitField0_ & 0x00004000) == 0x00004000)) {
to_bitField0_ |= 0x00000010;
}
if (inlineClassUnderlyingTypeBuilder_ == null) {
result.inlineClassUnderlyingType_ = inlineClassUnderlyingType_;
} else {
result.inlineClassUnderlyingType_ = inlineClassUnderlyingTypeBuilder_.build();
}
if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
to_bitField0_ |= 0x00000020;
}
result.inlineClassUnderlyingTypeId_ = inlineClassUnderlyingTypeId_;
if (((from_bitField0_ & 0x00010000) == 0x00010000)) {
to_bitField0_ |= 0x00000040;
}
if (typeTableBuilder_ == null) {
result.typeTable_ = typeTable_;
} else {
result.typeTable_ = typeTableBuilder_.build();
}
if (((bitField0_ & 0x00004000) == 0x00004000)) {
if (((bitField0_ & 0x00020000) == 0x00020000)) {
versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_);
bitField0_ = (bitField0_ & ~0x00004000);
bitField0_ = (bitField0_ & ~0x00020000);
}
result.versionRequirement_ = versionRequirement_;
if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
to_bitField0_ |= 0x00000010;
if (((from_bitField0_ & 0x00040000) == 0x00040000)) {
to_bitField0_ |= 0x00000080;
}
if (versionRequirementTableBuilder_ == null) {
result.versionRequirementTable_ = versionRequirementTable_;
@@ -12132,13 +12294,22 @@ public final class DebugProtoBuf {
}
onChanged();
}
if (other.hasInlineClassUnderlyingPropertyName()) {
setInlineClassUnderlyingPropertyName(other.getInlineClassUnderlyingPropertyName());
}
if (other.hasInlineClassUnderlyingType()) {
mergeInlineClassUnderlyingType(other.getInlineClassUnderlyingType());
}
if (other.hasInlineClassUnderlyingTypeId()) {
setInlineClassUnderlyingTypeId(other.getInlineClassUnderlyingTypeId());
}
if (other.hasTypeTable()) {
mergeTypeTable(other.getTypeTable());
}
if (!other.versionRequirement_.isEmpty()) {
if (versionRequirement_.isEmpty()) {
versionRequirement_ = other.versionRequirement_;
bitField0_ = (bitField0_ & ~0x00004000);
bitField0_ = (bitField0_ & ~0x00020000);
} else {
ensureVersionRequirementIsMutable();
versionRequirement_.addAll(other.versionRequirement_);
@@ -12200,6 +12371,12 @@ public final class DebugProtoBuf {
return false;
}
}
if (hasInlineClassUnderlyingType()) {
if (!getInlineClassUnderlyingType().isInitialized()) {
return false;
}
}
if (hasTypeTable()) {
if (!getTypeTable().isInitialized()) {
@@ -14258,6 +14435,186 @@ public final class DebugProtoBuf {
return this;
}
private int inlineClassUnderlyingPropertyName_ ;
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
public boolean hasInlineClassUnderlyingPropertyName() {
return ((bitField0_ & 0x00002000) == 0x00002000);
}
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
public int getInlineClassUnderlyingPropertyName() {
return inlineClassUnderlyingPropertyName_;
}
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
public Builder setInlineClassUnderlyingPropertyName(int value) {
bitField0_ |= 0x00002000;
inlineClassUnderlyingPropertyName_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
*/
public Builder clearInlineClassUnderlyingPropertyName() {
bitField0_ = (bitField0_ & ~0x00002000);
inlineClassUnderlyingPropertyName_ = 0;
onChanged();
return this;
}
private org.jetbrains.kotlin.metadata.DebugProtoBuf.Type inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder> inlineClassUnderlyingTypeBuilder_;
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public boolean hasInlineClassUnderlyingType() {
return ((bitField0_ & 0x00004000) == 0x00004000);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getInlineClassUnderlyingType() {
if (inlineClassUnderlyingTypeBuilder_ == null) {
return inlineClassUnderlyingType_;
} else {
return inlineClassUnderlyingTypeBuilder_.getMessage();
}
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public Builder setInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) {
if (inlineClassUnderlyingTypeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
inlineClassUnderlyingType_ = value;
onChanged();
} else {
inlineClassUnderlyingTypeBuilder_.setMessage(value);
}
bitField0_ |= 0x00004000;
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public Builder setInlineClassUnderlyingType(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder builderForValue) {
if (inlineClassUnderlyingTypeBuilder_ == null) {
inlineClassUnderlyingType_ = builderForValue.build();
onChanged();
} else {
inlineClassUnderlyingTypeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00004000;
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public Builder mergeInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) {
if (inlineClassUnderlyingTypeBuilder_ == null) {
if (((bitField0_ & 0x00004000) == 0x00004000) &&
inlineClassUnderlyingType_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance()) {
inlineClassUnderlyingType_ =
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.newBuilder(inlineClassUnderlyingType_).mergeFrom(value).buildPartial();
} else {
inlineClassUnderlyingType_ = value;
}
onChanged();
} else {
inlineClassUnderlyingTypeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00004000;
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public Builder clearInlineClassUnderlyingType() {
if (inlineClassUnderlyingTypeBuilder_ == null) {
inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
onChanged();
} else {
inlineClassUnderlyingTypeBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00004000);
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder getInlineClassUnderlyingTypeBuilder() {
bitField0_ |= 0x00004000;
onChanged();
return getInlineClassUnderlyingTypeFieldBuilder().getBuilder();
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getInlineClassUnderlyingTypeOrBuilder() {
if (inlineClassUnderlyingTypeBuilder_ != null) {
return inlineClassUnderlyingTypeBuilder_.getMessageOrBuilder();
} else {
return inlineClassUnderlyingType_;
}
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
*/
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder>
getInlineClassUnderlyingTypeFieldBuilder() {
if (inlineClassUnderlyingTypeBuilder_ == null) {
inlineClassUnderlyingTypeBuilder_ = new org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder>(
getInlineClassUnderlyingType(),
getParentForChildren(),
isClean());
inlineClassUnderlyingType_ = null;
}
return inlineClassUnderlyingTypeBuilder_;
}
private int inlineClassUnderlyingTypeId_ ;
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
public boolean hasInlineClassUnderlyingTypeId() {
return ((bitField0_ & 0x00008000) == 0x00008000);
}
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
public int getInlineClassUnderlyingTypeId() {
return inlineClassUnderlyingTypeId_;
}
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
public Builder setInlineClassUnderlyingTypeId(int value) {
bitField0_ |= 0x00008000;
inlineClassUnderlyingTypeId_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
*/
public Builder clearInlineClassUnderlyingTypeId() {
bitField0_ = (bitField0_ & ~0x00008000);
inlineClassUnderlyingTypeId_ = 0;
onChanged();
return this;
}
private org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance();
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTableOrBuilder> typeTableBuilder_;
@@ -14265,7 +14622,7 @@ public final class DebugProtoBuf {
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
*/
public boolean hasTypeTable() {
return ((bitField0_ & 0x00002000) == 0x00002000);
return ((bitField0_ & 0x00010000) == 0x00010000);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
@@ -14290,7 +14647,7 @@ public final class DebugProtoBuf {
} else {
typeTableBuilder_.setMessage(value);
}
bitField0_ |= 0x00002000;
bitField0_ |= 0x00010000;
return this;
}
/**
@@ -14304,7 +14661,7 @@ public final class DebugProtoBuf {
} else {
typeTableBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00002000;
bitField0_ |= 0x00010000;
return this;
}
/**
@@ -14312,7 +14669,7 @@ public final class DebugProtoBuf {
*/
public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable value) {
if (typeTableBuilder_ == null) {
if (((bitField0_ & 0x00002000) == 0x00002000) &&
if (((bitField0_ & 0x00010000) == 0x00010000) &&
typeTable_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance()) {
typeTable_ =
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial();
@@ -14323,7 +14680,7 @@ public final class DebugProtoBuf {
} else {
typeTableBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00002000;
bitField0_ |= 0x00010000;
return this;
}
/**
@@ -14336,14 +14693,14 @@ public final class DebugProtoBuf {
} else {
typeTableBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00002000);
bitField0_ = (bitField0_ & ~0x00010000);
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder getTypeTableBuilder() {
bitField0_ |= 0x00002000;
bitField0_ |= 0x00010000;
onChanged();
return getTypeTableFieldBuilder().getBuilder();
}
@@ -14376,9 +14733,9 @@ public final class DebugProtoBuf {
private java.util.List<java.lang.Integer> versionRequirement_ = java.util.Collections.emptyList();
private void ensureVersionRequirementIsMutable() {
if (!((bitField0_ & 0x00004000) == 0x00004000)) {
if (!((bitField0_ & 0x00020000) == 0x00020000)) {
versionRequirement_ = new java.util.ArrayList<java.lang.Integer>(versionRequirement_);
bitField0_ |= 0x00004000;
bitField0_ |= 0x00020000;
}
}
/**
@@ -14463,7 +14820,7 @@ public final class DebugProtoBuf {
*/
public Builder clearVersionRequirement() {
versionRequirement_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00004000);
bitField0_ = (bitField0_ & ~0x00020000);
onChanged();
return this;
}
@@ -14475,7 +14832,7 @@ public final class DebugProtoBuf {
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
*/
public boolean hasVersionRequirementTable() {
return ((bitField0_ & 0x00008000) == 0x00008000);
return ((bitField0_ & 0x00040000) == 0x00040000);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
@@ -14500,7 +14857,7 @@ public final class DebugProtoBuf {
} else {
versionRequirementTableBuilder_.setMessage(value);
}
bitField0_ |= 0x00008000;
bitField0_ |= 0x00040000;
return this;
}
/**
@@ -14514,7 +14871,7 @@ public final class DebugProtoBuf {
} else {
versionRequirementTableBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00008000;
bitField0_ |= 0x00040000;
return this;
}
/**
@@ -14522,7 +14879,7 @@ public final class DebugProtoBuf {
*/
public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable value) {
if (versionRequirementTableBuilder_ == null) {
if (((bitField0_ & 0x00008000) == 0x00008000) &&
if (((bitField0_ & 0x00040000) == 0x00040000) &&
versionRequirementTable_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance()) {
versionRequirementTable_ =
org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial();
@@ -14533,7 +14890,7 @@ public final class DebugProtoBuf {
} else {
versionRequirementTableBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00008000;
bitField0_ |= 0x00040000;
return this;
}
/**
@@ -14546,14 +14903,14 @@ public final class DebugProtoBuf {
} else {
versionRequirementTableBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00008000);
bitField0_ = (bitField0_ & ~0x00040000);
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.Builder getVersionRequirementTableBuilder() {
bitField0_ |= 0x00008000;
bitField0_ |= 0x00040000;
onChanged();
return getVersionRequirementTableFieldBuilder().getBuilder();
}
@@ -34382,7 +34739,7 @@ public final class DebugProtoBuf {
"Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\036\n\016upper" +
"_bound_id\030\006 \003(\005B\006\020\001\240\265\030\001\"$\n\010Variance\022\006\n\002I" +
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\250\007\n\005Class\022\020" +
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\327\010\n\005Class\022\020" +
"\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022",
"#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016" +
"type_parameter\030\005 \003(\0132,.org.jetbrains.kot" +
@@ -34398,122 +34755,127 @@ public final class DebugProtoBuf {
"brains.kotlin.metadata.TypeAlias\022<\n\nenum" +
"_entry\030\r \003(\0132(.org.jetbrains.kotlin.meta" +
"data.EnumEntry\022\'\n\027sealed_subclass_fq_nam" +
"e\030\020 \003(\005B\006\020\001\220\265\030\001\022<\n\ntype_table\030\036 \001(\0132(.or" +
"g.jetbrains.kotlin.metadata.TypeTable\022\033\n" +
"\023version_requirement\030\037 \003(\005\022Y\n\031version_re" +
"quirement_table\030 \001(\01326.org.jetbrains.ko" +
"tlin.metadata.VersionRequirementTable\"x\n" +
"\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_",
"CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CL" +
"ASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*" +
"\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'." +
"org.jetbrains.kotlin.metadata.Function\0229" +
"\n\010property\030\004 \003(\0132\'.org.jetbrains.kotlin." +
"metadata.Property\022<\n\ntype_alias\030\005 \003(\0132(." +
"org.jetbrains.kotlin.metadata.TypeAlias\022" +
"<\n\ntype_table\030\036 \001(\0132(.org.jetbrains.kotl" +
"in.metadata.TypeTable\022Y\n\031version_require" +
"ment_table\030 \001(\01326.org.jetbrains.kotlin.",
"metadata.VersionRequirementTable*\005\010d\020\310\001\"" +
"`\n\tTypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrai" +
"ns.kotlin.metadata.Type\022\032\n\016first_nullabl" +
"e\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Constructor\022\020\n\005fla" +
"gs\030\001 \001(\005:\0016\022F\n\017value_parameter\030\002 \003(\0132-.o" +
"rg.jetbrains.kotlin.metadata.ValueParame" +
"ter\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224\001" +
"\"\246\004\n\010Function\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_f" +
"lags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013ret" +
"urn_type\030\003 \001(\0132#.org.jetbrains.kotlin.me",
"tadata.Type\022\034\n\016return_type_id\030\007 \001(\005B\004\240\265\030" +
"\001\022D\n\016type_parameter\030\004 \003(\0132,.org.jetbrain" +
"s.kotlin.metadata.TypeParameter\022:\n\rrecei" +
"ver_type\030\005 \001(\0132#.org.jetbrains.kotlin.me" +
"tadata.Type\022\036\n\020receiver_type_id\030\010 \001(\005B\004\240" +
"\265\030\001\022F\n\017value_parameter\030\006 \003(\0132-.org.jetbr" +
"ains.kotlin.metadata.ValueParameter\022<\n\nt" +
"ype_table\030\036 \001(\0132(.org.jetbrains.kotlin.m" +
"etadata.TypeTable\022\033\n\023version_requirement" +
"\030\037 \003(\005\0229\n\010contract\030 \001(\0132\'.org.jetbrains",
".kotlin.metadata.Contract*\006\010d\020\270\224\001\"\345\003\n\010Pr" +
"operty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030" +
"\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013retur" +
"n_type\030\003 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022\034\n\016return_type_id\030\t \001(\005B\004\240\265\030\001\022" +
"D\n\016type_parameter\030\004 \003(\0132,.org.jetbrains." +
"kotlin.metadata.TypeParameter\022:\n\rreceive" +
"r_type\030\005 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022\036\n\020receiver_type_id\030\n \001(\005B\004\240\265\030" +
"\001\022M\n\026setter_value_parameter\030\006 \001(\0132-.org.",
"jetbrains.kotlin.metadata.ValueParameter" +
"\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_flags\030\010" +
" \001(\005\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224" +
"\001\"\357\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(\005:\0010\022\022" +
"\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\025\n\007type_id" +
"\030\005 \001(\005B\004\240\265\030\001\022@\n\023vararg_element_type\030\004 \001(" +
"\0132#.org.jetbrains.kotlin.metadata.Type\022$" +
"\n\026vararg_element_type_id\030\006 \001(\005B\004\240\265\030\001*\005\010d" +
"\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004n",
"ame\030\002 \002(\005B\004\210\265\030\001\022D\n\016type_parameter\030\003 \003(\0132" +
",.org.jetbrains.kotlin.metadata.TypePara" +
"meter\022<\n\017underlying_type\030\004 \001(\0132#.org.jet" +
"brains.kotlin.metadata.Type\022 \n\022underlyin" +
"g_type_id\030\005 \001(\005B\004\240\265\030\001\022:\n\rexpanded_type\030\006" +
" \001(\0132#.org.jetbrains.kotlin.metadata.Typ" +
"e\022\036\n\020expanded_type_id\030\007 \001(\005B\004\240\265\030\001\022=\n\nann" +
"otation\030\010 \003(\0132).org.jetbrains.kotlin.met" +
"adata.Annotation\022\033\n\023version_requirement\030" +
"\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumEntry\022\022\n\004name\030\001 \001(\005B",
"\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022VersionRequirement\022\017\n\007v" +
"ersion\030\001 \001(\005\022\024\n\014version_full\030\002 \001(\005\022M\n\005le" +
"vel\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
"a.VersionRequirement.Level:\005ERROR\022\022\n\nerr" +
"or_code\030\004 \001(\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001\022e\n\014" +
"version_kind\030\006 \001(\0162=.org.jetbrains.kotli" +
"n.metadata.VersionRequirement.VersionKin" +
"d:\020LANGUAGE_VERSION\"+\n\005Level\022\013\n\007WARNING\020" +
"\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDEN\020\002\"J\n\013VersionKind\022" +
"\024\n\020LANGUAGE_VERSION\020\000\022\024\n\020COMPILER_VERSIO",
"N\020\001\022\017\n\013API_VERSION\020\002\"a\n\027VersionRequireme" +
"ntTable\022F\n\013requirement\030\001 \003(\01321.org.jetbr" +
"ains.kotlin.metadata.VersionRequirement\"" +
"\217\002\n\017PackageFragment\022;\n\007strings\030\001 \001(\0132*.o" +
"rg.jetbrains.kotlin.metadata.StringTable" +
"\022J\n\017qualified_names\030\002 \001(\01321.org.jetbrain" +
"s.kotlin.metadata.QualifiedNameTable\0227\n\007" +
"package\030\003 \001(\0132&.org.jetbrains.kotlin.met" +
"adata.Package\0223\n\005class\030\004 \003(\0132$.org.jetbr" +
"ains.kotlin.metadata.Class*\005\010d\020\310\001\"A\n\010Con",
"tract\0225\n\006effect\030\001 \003(\0132%.org.jetbrains.ko" +
"tlin.metadata.Effect\"\306\003\n\006Effect\022E\n\013effec" +
"t_type\030\001 \001(\01620.org.jetbrains.kotlin.meta" +
"data.Effect.EffectType\022N\n\033effect_constru" +
"ctor_argument\030\002 \003(\0132).org.jetbrains.kotl" +
"in.metadata.Expression\022S\n conclusion_of_" +
"conditional_effect\030\003 \001(\0132).org.jetbrains" +
".kotlin.metadata.Expression\022B\n\004kind\030\004 \001(" +
"\01624.org.jetbrains.kotlin.metadata.Effect" +
".InvocationKind\"C\n\nEffectType\022\024\n\020RETURNS",
"_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n\020RETURNS_NOT_NU" +
"LL\020\002\"G\n\016InvocationKind\022\020\n\014AT_MOST_ONCE\020\000" +
"\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_LEAST_ONCE\020\002\"\245\003" +
"\n\nExpression\022\020\n\005flags\030\001 \001(\005:\0010\022!\n\031value_" +
"parameter_reference\030\002 \001(\005\022O\n\016constant_va" +
"lue\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
"a.Expression.ConstantValue\022=\n\020is_instanc" +
"e_type\030\004 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022!\n\023is_instance_type_id\030\005 \001(\005B\004" +
"\240\265\030\001\022?\n\014and_argument\030\006 \003(\0132).org.jetbrai",
"ns.kotlin.metadata.Expression\022>\n\013or_argu" +
"ment\030\007 \003(\0132).org.jetbrains.kotlin.metada" +
"ta.Expression\".\n\rConstantValue\022\010\n\004TRUE\020\000" +
"\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010Modality\022\t\n\005FIN" +
"AL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003" +
"*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020" +
"\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_" +
"TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013DE" +
"CLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGA" +
"TION\020\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBuf"
"e\030\020 \003(\005B\006\020\001\220\265\030\001\0223\n%inline_class_underlyi" +
"ng_property_name\030\021 \001(\005B\004\210\265\030\001\022I\n\034inline_c" +
"lass_underlying_type\030\022 \001(\0132#.org.jetbrai" +
"ns.kotlin.metadata.Type\022-\n\037inline_class_" +
"underlying_type_id\030\023 \001(\005B\004\240\265\030\001\022<\n\ntype_t" +
"able\030\036 \001(\0132(.org.jetbrains.kotlin.metada",
"ta.TypeTable\022\033\n\023version_requirement\030\037 \003(" +
"\005\022Y\n\031version_requirement_table\030 \001(\01326.o" +
"rg.jetbrains.kotlin.metadata.VersionRequ" +
"irementTable\"x\n\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTER" +
"FACE\020\001\022\016\n\nENUM_CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024" +
"\n\020ANNOTATION_CLASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMP" +
"ANION_OBJECT\020\006*\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010fu" +
"nction\030\003 \003(\0132\'.org.jetbrains.kotlin.meta" +
"data.Function\0229\n\010property\030\004 \003(\0132\'.org.je" +
"tbrains.kotlin.metadata.Property\022<\n\ntype",
"_alias\030\005 \003(\0132(.org.jetbrains.kotlin.meta" +
"data.TypeAlias\022<\n\ntype_table\030\036 \001(\0132(.org" +
".jetbrains.kotlin.metadata.TypeTable\022Y\n\031" +
"version_requirement_table\030 \001(\01326.org.je" +
"tbrains.kotlin.metadata.VersionRequireme" +
"ntTable*\005\010d\020\310\001\"`\n\tTypeTable\0221\n\004type\030\001 \003(" +
"\0132#.org.jetbrains.kotlin.metadata.Type\022\032" +
"\n\016first_nullable\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Con" +
"structor\022\020\n\005flags\030\001 \001(\005:\0016\022F\n\017value_para" +
"meter\030\002 \003(\0132-.org.jetbrains.kotlin.metad",
"ata.ValueParameter\022\033\n\023version_requiremen" +
"t\030\037 \003(\005*\006\010d\020\270\224\001\"\246\004\n\010Function\022\020\n\005flags\030\t " +
"\001(\005:\0016\022\024\n\told_flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002" +
"(\005B\004\210\265\030\001\0228\n\013return_type\030\003 \001(\0132#.org.jetb" +
"rains.kotlin.metadata.Type\022\034\n\016return_typ" +
"e_id\030\007 \001(\005B\004\240\265\030\001\022D\n\016type_parameter\030\004 \003(\013" +
"2,.org.jetbrains.kotlin.metadata.TypePar" +
"ameter\022:\n\rreceiver_type\030\005 \001(\0132#.org.jetb" +
"rains.kotlin.metadata.Type\022\036\n\020receiver_t" +
"ype_id\030\010 \001(\005B\004\240\265\030\001\022F\n\017value_parameter\030\006 ",
"\003(\0132-.org.jetbrains.kotlin.metadata.Valu" +
"eParameter\022<\n\ntype_table\030\036 \001(\0132(.org.jet" +
"brains.kotlin.metadata.TypeTable\022\033\n\023vers" +
"ion_requirement\030\037 \003(\005\0229\n\010contract\030 \001(\0132" +
"\'.org.jetbrains.kotlin.metadata.Contract" +
"*\006\010d\020\270\224\001\"\345\003\n\010Property\022\022\n\005flags\030\013 \001(\005:\00351" +
"8\022\027\n\told_flags\030\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005" +
"B\004\210\265\030\001\0228\n\013return_type\030\003 \001(\0132#.org.jetbra" +
"ins.kotlin.metadata.Type\022\034\n\016return_type_" +
"id\030\t \001(\005B\004\240\265\030\001\022D\n\016type_parameter\030\004 \003(\0132,",
".org.jetbrains.kotlin.metadata.TypeParam" +
"eter\022:\n\rreceiver_type\030\005 \001(\0132#.org.jetbra" +
"ins.kotlin.metadata.Type\022\036\n\020receiver_typ" +
"e_id\030\n \001(\005B\004\240\265\030\001\022M\n\026setter_value_paramet" +
"er\030\006 \001(\0132-.org.jetbrains.kotlin.metadata" +
".ValueParameter\022\024\n\014getter_flags\030\007 \001(\005\022\024\n" +
"\014setter_flags\030\010 \001(\005\022\033\n\023version_requireme" +
"nt\030\037 \003(\005*\006\010d\020\270\224\001\"\357\001\n\016ValueParameter\022\020\n\005f" +
"lags\030\001 \001(\005:\0010\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004typ" +
"e\030\003 \001(\0132#.org.jetbrains.kotlin.metadata.",
"Type\022\025\n\007type_id\030\005 \001(\005B\004\240\265\030\001\022@\n\023vararg_el" +
"ement_type\030\004 \001(\0132#.org.jetbrains.kotlin." +
"metadata.Type\022$\n\026vararg_element_type_id\030" +
"\006 \001(\005B\004\240\265\030\001*\005\010d\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005flag" +
"s\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022D\n\016type_p" +
"arameter\030\003 \003(\0132,.org.jetbrains.kotlin.me" +
"tadata.TypeParameter\022<\n\017underlying_type\030" +
"\004 \001(\0132#.org.jetbrains.kotlin.metadata.Ty" +
"pe\022 \n\022underlying_type_id\030\005 \001(\005B\004\240\265\030\001\022:\n\r" +
"expanded_type\030\006 \001(\0132#.org.jetbrains.kotl",
"in.metadata.Type\022\036\n\020expanded_type_id\030\007 \001" +
"(\005B\004\240\265\030\001\022=\n\nannotation\030\010 \003(\0132).org.jetbr" +
"ains.kotlin.metadata.Annotation\022\033\n\023versi" +
"on_requirement\030\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumEntry" +
"\022\022\n\004name\030\001 \001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022VersionR" +
"equirement\022\017\n\007version\030\001 \001(\005\022\024\n\014version_f" +
"ull\030\002 \001(\005\022M\n\005level\030\003 \001(\01627.org.jetbrains" +
".kotlin.metadata.VersionRequirement.Leve" +
"l:\005ERROR\022\022\n\nerror_code\030\004 \001(\005\022\025\n\007message\030" +
"\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind\030\006 \001(\0162=.org.",
"jetbrains.kotlin.metadata.VersionRequire" +
"ment.VersionKind:\020LANGUAGE_VERSION\"+\n\005Le" +
"vel\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDEN\020\002\"" +
"J\n\013VersionKind\022\024\n\020LANGUAGE_VERSION\020\000\022\024\n\020" +
"COMPILER_VERSION\020\001\022\017\n\013API_VERSION\020\002\"a\n\027V" +
"ersionRequirementTable\022F\n\013requirement\030\001 " +
"\003(\01321.org.jetbrains.kotlin.metadata.Vers" +
"ionRequirement\"\217\002\n\017PackageFragment\022;\n\007st" +
"rings\030\001 \001(\0132*.org.jetbrains.kotlin.metad" +
"ata.StringTable\022J\n\017qualified_names\030\002 \001(\013",
"21.org.jetbrains.kotlin.metadata.Qualifi" +
"edNameTable\0227\n\007package\030\003 \001(\0132&.org.jetbr" +
"ains.kotlin.metadata.Package\0223\n\005class\030\004 " +
"\003(\0132$.org.jetbrains.kotlin.metadata.Clas" +
"s*\005\010d\020\310\001\"A\n\010Contract\0225\n\006effect\030\001 \003(\0132%.o" +
"rg.jetbrains.kotlin.metadata.Effect\"\306\003\n\006" +
"Effect\022E\n\013effect_type\030\001 \001(\01620.org.jetbra" +
"ins.kotlin.metadata.Effect.EffectType\022N\n" +
"\033effect_constructor_argument\030\002 \003(\0132).org" +
".jetbrains.kotlin.metadata.Expression\022S\n",
" conclusion_of_conditional_effect\030\003 \001(\0132" +
").org.jetbrains.kotlin.metadata.Expressi" +
"on\022B\n\004kind\030\004 \001(\01624.org.jetbrains.kotlin." +
"metadata.Effect.InvocationKind\"C\n\nEffect" +
"Type\022\024\n\020RETURNS_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n" +
"\020RETURNS_NOT_NULL\020\002\"G\n\016InvocationKind\022\020\n" +
"\014AT_MOST_ONCE\020\000\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_" +
"LEAST_ONCE\020\002\"\245\003\n\nExpression\022\020\n\005flags\030\001 \001" +
"(\005:\0010\022!\n\031value_parameter_reference\030\002 \001(\005" +
"\022O\n\016constant_value\030\003 \001(\01627.org.jetbrains",
".kotlin.metadata.Expression.ConstantValu" +
"e\022=\n\020is_instance_type\030\004 \001(\0132#.org.jetbra" +
"ins.kotlin.metadata.Type\022!\n\023is_instance_" +
"type_id\030\005 \001(\005B\004\240\265\030\001\022?\n\014and_argument\030\006 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Expres" +
"sion\022>\n\013or_argument\030\007 \003(\0132).org.jetbrain" +
"s.kotlin.metadata.Expression\".\n\rConstant" +
"Value\022\010\n\004TRUE\020\000\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010" +
"Modality\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRAC" +
"T\020\002\022\n\n\006SEALED\020\003*b\n\nVisibility\022\014\n\010INTERNA",
"L\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLI" +
"C\020\003\022\023\n\017PRIVATE_TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nM" +
"emberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_OVERR" +
"IDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHESIZED\020\003B\017" +
"B\rDebugProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -34587,7 +34949,7 @@ public final class DebugProtoBuf {
internal_static_org_jetbrains_kotlin_metadata_Class_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_metadata_Class_descriptor,
new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "TypeTable", "VersionRequirement", "VersionRequirementTable", });
new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "InlineClassUnderlyingPropertyName", "InlineClassUnderlyingType", "InlineClassUnderlyingTypeId", "TypeTable", "VersionRequirement", "VersionRequirementTable", });
internal_static_org_jetbrains_kotlin_metadata_Package_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_org_jetbrains_kotlin_metadata_Package_fieldAccessorTable = new
@@ -34696,6 +35058,8 @@ public final class DebugProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);

View File

@@ -3443,6 +3443,34 @@ public final class DebugJvmProtoBuf {
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4;</code>
*/
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder getSetterOrBuilder();
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
boolean hasDelegateMethod();
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature getDelegateMethod();
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder getDelegateMethodOrBuilder();
}
/**
* Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature}
@@ -3548,6 +3576,19 @@ public final class DebugJvmProtoBuf {
bitField0_ |= 0x00000008;
break;
}
case 42: {
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.Builder subBuilder = null;
if (((bitField0_ & 0x00000010) == 0x00000010)) {
subBuilder = delegateMethod_.toBuilder();
}
delegateMethod_ = input.readMessage(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(delegateMethod_);
delegateMethod_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000010;
break;
}
}
}
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
@@ -3684,11 +3725,48 @@ public final class DebugJvmProtoBuf {
return setter_;
}
public static final int DELEGATE_METHOD_FIELD_NUMBER = 5;
private org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature delegateMethod_;
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public boolean hasDelegateMethod() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature getDelegateMethod() {
return delegateMethod_;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder getDelegateMethodOrBuilder() {
return delegateMethod_;
}
private void initFields() {
field_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmFieldSignature.getDefaultInstance();
syntheticMethod_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
getter_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
setter_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
delegateMethod_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -3715,6 +3793,9 @@ public final class DebugJvmProtoBuf {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(4, setter_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeMessage(5, delegateMethod_);
}
getUnknownFields().writeTo(output);
}
@@ -3740,6 +3821,10 @@ public final class DebugJvmProtoBuf {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(4, setter_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(5, delegateMethod_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -3853,6 +3938,7 @@ public final class DebugJvmProtoBuf {
getSyntheticMethodFieldBuilder();
getGetterFieldBuilder();
getSetterFieldBuilder();
getDelegateMethodFieldBuilder();
}
}
private static Builder create() {
@@ -3885,6 +3971,12 @@ public final class DebugJvmProtoBuf {
setterBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
if (delegateMethodBuilder_ == null) {
delegateMethod_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
} else {
delegateMethodBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
@@ -3945,6 +4037,14 @@ public final class DebugJvmProtoBuf {
} else {
result.setter_ = setterBuilder_.build();
}
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
if (delegateMethodBuilder_ == null) {
result.delegateMethod_ = delegateMethod_;
} else {
result.delegateMethod_ = delegateMethodBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -3973,6 +4073,9 @@ public final class DebugJvmProtoBuf {
if (other.hasSetter()) {
mergeSetter(other.getSetter());
}
if (other.hasDelegateMethod()) {
mergeDelegateMethod(other.getDelegateMethod());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -4500,6 +4603,167 @@ public final class DebugJvmProtoBuf {
return setterBuilder_;
}
private org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature delegateMethod_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature, org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.Builder, org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder> delegateMethodBuilder_;
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public boolean hasDelegateMethod() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature getDelegateMethod() {
if (delegateMethodBuilder_ == null) {
return delegateMethod_;
} else {
return delegateMethodBuilder_.getMessage();
}
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public Builder setDelegateMethod(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature value) {
if (delegateMethodBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
delegateMethod_ = value;
onChanged();
} else {
delegateMethodBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public Builder setDelegateMethod(
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.Builder builderForValue) {
if (delegateMethodBuilder_ == null) {
delegateMethod_ = builderForValue.build();
onChanged();
} else {
delegateMethodBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public Builder mergeDelegateMethod(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature value) {
if (delegateMethodBuilder_ == null) {
if (((bitField0_ & 0x00000010) == 0x00000010) &&
delegateMethod_ != org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance()) {
delegateMethod_ =
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.newBuilder(delegateMethod_).mergeFrom(value).buildPartial();
} else {
delegateMethod_ = value;
}
onChanged();
} else {
delegateMethodBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public Builder clearDelegateMethod() {
if (delegateMethodBuilder_ == null) {
delegateMethod_ = org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.getDefaultInstance();
onChanged();
} else {
delegateMethodBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.Builder getDelegateMethodBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getDelegateMethodFieldBuilder().getBuilder();
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
public org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder getDelegateMethodOrBuilder() {
if (delegateMethodBuilder_ != null) {
return delegateMethodBuilder_.getMessageOrBuilder();
} else {
return delegateMethod_;
}
}
/**
* <code>optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature delegate_method = 5;</code>
*
* <pre>
* The delegate field of delegated properties may be optimized out; `getDelegate` should
* then call this method instead
* </pre>
*/
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature, org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.Builder, org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder>
getDelegateMethodFieldBuilder() {
if (delegateMethodBuilder_ == null) {
delegateMethodBuilder_ = new org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature, org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignature.Builder, org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.JvmMethodSignatureOrBuilder>(
getDelegateMethod(),
getParentForChildren(),
isClean());
delegateMethod_ = null;
}
return delegateMethodBuilder_;
}
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature)
}
@@ -4740,7 +5004,7 @@ public final class DebugJvmProtoBuf {
"\020DESC_TO_CLASS_ID\020\002\"<\n\022JvmMethodSignatur" +
"e\022\022\n\004name\030\001 \001(\005B\004\230\265\030\001\022\022\n\004desc\030\002 \001(\005B\004\230\265\030" +
"\001\";\n\021JvmFieldSignature\022\022\n\004name\030\001 \001(\005B\004\230\265" +
"\030\001\022\022\n\004desc\030\002 \001(\005B\004\230\265\030\001\"\272\002\n\024JvmPropertySi" +
"\030\001\022\022\n\004desc\030\002 \001(\005B\004\230\265\030\001\"\212\003\n\024JvmPropertySi" +
"gnature\022C\n\005field\030\001 \001(\01324.org.jetbrains.k" +
"otlin.metadata.jvm.JvmFieldSignature\022O\n\020",
"synthetic_method\030\002 \001(\01325.org.jetbrains.k" +
@@ -4748,11 +5012,13 @@ public final class DebugJvmProtoBuf {
"\006getter\030\003 \001(\01325.org.jetbrains.kotlin.met" +
"adata.jvm.JvmMethodSignature\022E\n\006setter\030\004" +
" \001(\01325.org.jetbrains.kotlin.metadata.jvm" +
".JvmMethodSignature\022N\n\017delegate_method\030\005" +
" \001(\01325.org.jetbrains.kotlin.metadata.jvm" +
".JvmMethodSignature:\200\001\n\025constructor_sign" +
"ature\022*.org.jetbrains.kotlin.metadata.Co" +
"nstructor\030d \001(\01325.org.jetbrains.kotlin.m" +
"nstructor\030d \001(\01325.org.jetbrains.kotlin.m",
"etadata.jvm.JvmMethodSignature:x\n\020method" +
"_signature\022\'.org.jetbrains.kotlin.metada",
"_signature\022\'.org.jetbrains.kotlin.metada" +
"ta.Function\030d \001(\01325.org.jetbrains.kotlin" +
".metadata.jvm.JvmMethodSignature:O\n\030lamb" +
"da_class_origin_name\022\'.org.jetbrains.kot" +
@@ -4760,9 +5026,9 @@ public final class DebugJvmProtoBuf {
"perty_signature\022\'.org.jetbrains.kotlin.m" +
"etadata.Property\030d \001(\01327.org.jetbrains.k" +
"otlin.metadata.jvm.JvmPropertySignature:" +
"9\n\005flags\022\'.org.jetbrains.kotlin.metadata" +
"9\n\005flags\022\'.org.jetbrains.kotlin.metadata",
".Property\030e \001(\005:\0010:g\n\017type_annotation\022#." +
"org.jetbrains.kotlin.metadata.Type\030d \003(\013",
"org.jetbrains.kotlin.metadata.Type\030d \003(\013" +
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:3\n\006is_raw\022#.org.jetbrains.kotlin.met" +
"adata.Type\030e \001(\010:z\n\031type_parameter_annot" +
@@ -4770,9 +5036,9 @@ public final class DebugJvmProtoBuf {
"peParameter\030d \003(\0132).org.jetbrains.kotlin" +
".metadata.Annotation:E\n\021class_module_nam" +
"e\022$.org.jetbrains.kotlin.metadata.Class\030" +
"e \001(\005B\004\230\265\030\001:k\n\024class_local_variable\022$.or" +
"e \001(\005B\004\230\265\030\001:k\n\024class_local_variable\022$.or",
"g.jetbrains.kotlin.metadata.Class\030f \003(\0132" +
"\'.org.jetbrains.kotlin.metadata.Property",
"\'.org.jetbrains.kotlin.metadata.Property" +
":P\n\034anonymous_object_origin_name\022$.org.j" +
"etbrains.kotlin.metadata.Class\030g \001(\005B\004\230\265" +
"\030\001:@\n\017jvm_class_flags\022$.org.jetbrains.ko" +
@@ -4780,7 +5046,7 @@ public final class DebugJvmProtoBuf {
"module_name\022&.org.jetbrains.kotlin.metad" +
"ata.Package\030e \001(\005B\004\230\265\030\001:o\n\026package_local" +
"_variable\022&.org.jetbrains.kotlin.metadat" +
"a.Package\030f \003(\0132\'.org.jetbrains.kotlin.m" +
"a.Package\030f \003(\0132\'.org.jetbrains.kotlin.m",
"etadata.PropertyB\022B\020DebugJvmProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
@@ -4826,7 +5092,7 @@ public final class DebugJvmProtoBuf {
internal_static_org_jetbrains_kotlin_metadata_jvm_JvmPropertySignature_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_metadata_jvm_JvmPropertySignature_descriptor,
new java.lang.String[] { "Field", "SyntheticMethod", "Getter", "Setter", });
new java.lang.String[] { "Field", "SyntheticMethod", "Getter", "Setter", "DelegateMethod", });
constructorSignature.internalInit(descriptor.getExtensions().get(0));
methodSignature.internalInit(descriptor.getExtensions().get(1));
lambdaClassOriginName.internalInit(descriptor.getExtensions().get(2));

View File

@@ -1,7 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.crypto.checksum.Checksum
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import proguard.gradle.ProGuardTask
buildscript {
@@ -14,8 +13,11 @@ buildscript {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
maven("https://cache-redirector.jetbrains.com/repo.maven.apache.org/maven2")
} else {
maven("https://plugins.gradle.org/m2")
mavenCentral()
}
}
@@ -27,18 +29,13 @@ buildscript {
dependencies {
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.31")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath(kotlin("serialization", bootstrapKotlinVersion))
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
classpath("org.jfrog.buildinfo:build-info-extractor-gradle:4.17.2")
}
}
if (kotlinBuildProperties.buildScanServer != null) {
apply(from = "gradle/buildScanUserData.gradle")
}
plugins {
base
idea
@@ -58,13 +55,6 @@ pill {
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
val configuredJdks: List<JdkId> =
getConfiguredJdks().also {
it.forEach { jdkId ->
logger.info("Using ${jdkId.majorVersion} home: ${jdkId.homeDir}")
}
}
val defaultSnapshotVersion: String by extra
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
val kotlinVersion by extra(
@@ -90,10 +80,8 @@ val distKotlinHomeDir by extra("$distDir/kotlinc")
val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
extra["ktorExcludesForDaemon"] = listOf(
"org.jetbrains.kotlin" to "kotlin-reflect",
@@ -111,40 +99,11 @@ extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
val jdkNotFoundConst = "JDK NOT FOUND"
if (isTeamcityBuild) {
extra["JDK_16"] = jdkPath("1.6")
extra["JDK_17"] = jdkPath("1.7")
} else {
extra["JDK_16"] = jdkPath("1.6", "1.8")
extra["JDK_17"] = jdkPath("1.7", "1.8")
}
extra["JDK_18"] = jdkPath("1.8")
extra["JDK_9"] = jdkPath("9")
extra["JDK_10"] = jdkPath("10")
extra["JDK_11"] = jdkPath("11")
extra["JDK_15"] = jdkPath("15")
// allow opening the project without setting up all env variables (see KT-26413)
if (!kotlinBuildProperties.isInIdeaSync) {
checkJDK()
}
fun checkJDK() {
val missingEnvVars = JdkMajorVersion.values()
.filter { it.isMandatory() && extra[it.name] == jdkNotFoundConst }
.mapTo(ArrayList()) { it.name }
if (missingEnvVars.isNotEmpty()) {
throw GradleException("Required environment variables are missing: ${missingEnvVars.joinToString()}")
}
val kotlinNativeVersionObject = project.kotlinNativeVersionValue()
subprojects {
extra["kotlinNativeVersion"] = kotlinNativeVersionObject
}
rootProject.apply {
@@ -155,6 +114,7 @@ rootProject.apply {
from(rootProject.file("gradle/checkArtifacts.gradle.kts"))
from(rootProject.file("gradle/checkCacheability.gradle.kts"))
from(rootProject.file("gradle/retryPublishing.gradle.kts"))
from(rootProject.file("gradle/modularizedTestConfigurations.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(project)
@@ -168,8 +128,9 @@ extra["versions.junit"] = "4.12"
extra["versions.javaslang"] = "2.0.6"
extra["versions.ant"] = "1.10.7"
extra["versions.android"] = "2.3.1"
extra["versions.kotlinx-coroutines-core"] = "1.3.8"
extra["versions.kotlinx-coroutines-jdk8"] = "1.3.8"
extra["versions.kotlinx-coroutines-core"] = "1.5.0"
extra["versions.kotlinx-coroutines-core-jvm"] = "1.5.0"
extra["versions.kotlinx-coroutines-jdk8"] = "1.5.0"
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.robolectric"] = "4.0"
@@ -178,7 +139,7 @@ extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
extra["versions.completion-ranking-kotlin"] = "0.1.3"
extra["versions.r8"] = "2.0.88"
extra["versions.r8"] = "2.2.64"
val immutablesVersion = "0.3.1"
extra["versions.kotlinx-collections-immutable"] = immutablesVersion
extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
@@ -187,13 +148,11 @@ extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.5-dev-17775"
extra["versions.kotlin-native"] = "1.6.0-dev-248"
}
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
val useJvmIrBackend by extra(project.kotlinBuildProperties.useIR)
val useJvmFir by extra(project.kotlinBuildProperties.useFir)
val intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
@@ -203,6 +162,7 @@ extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf(
when {
Platform[203].orHigher() -> "asm-all-9.0"
Platform[202].orHigher() -> "asm-all-8.0.1"
else -> "asm-all-7.0.1"
},
@@ -210,7 +170,6 @@ extra["IntellijCoreDependencies"] =
"jdom",
"jna",
"log4j",
if (Platform[201].orHigher()) null else "picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
@@ -230,6 +189,7 @@ extra["compilerModules"] = arrayOf(
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:frontend:cfg",
":compiler:cli-common",
":compiler:ir.tree",
":compiler:ir.tree.impl",
@@ -237,6 +197,7 @@ extra["compilerModules"] = arrayOf(
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.jvm:backend.jvm.entrypoint",
":compiler:backend.js",
":compiler:backend.wasm",
":compiler:ir.serialization.common",
@@ -256,6 +217,7 @@ extra["compilerModules"] = arrayOf(
":compiler:incremental-compilation-impl",
":compiler:compiler.version",
":js:js.ast",
":js:js.sourcemap",
":js:js.serializer",
":js:js.parser",
":js:js.config",
@@ -291,6 +253,7 @@ extra["compilerModules"] = arrayOf(
":compiler:fir:java",
":compiler:fir:jvm",
":compiler:fir:checkers",
":compiler:fir:checkers:checkers.jvm",
":compiler:fir:entrypoint",
":compiler:fir:analysis-tests",
":compiler:fir:analysis-tests:legacy-fir-tests",
@@ -310,7 +273,6 @@ extra["compilerModulesForJps"] = listOf(
":core:compiler.common.jvm",
":core:descriptors",
":core:descriptors.jvm",
":idea:idea-jps-common",
":kotlin-preloader",
":compiler:util",
":compiler:config",
@@ -320,13 +282,54 @@ extra["compilerModulesForJps"] = listOf(
":compiler:compiler.version"
)
extra["compilerArtifactsForIde"] = listOf(
":prepare:ide-plugin-dependencies:android-extensions-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:allopen-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:incremental-compilation-impl-tests-for-ide",
":prepare:ide-plugin-dependencies:js-ir-runtime-for-ide",
":prepare:ide-plugin-dependencies:kotlin-build-common-tests-for-ide",
":prepare:ide-plugin-dependencies:kotlin-compiler-for-ide",
":prepare:ide-plugin-dependencies:kotlin-compiler-cli-for-ide",
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide",
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:compiler-components-for-jps",
":prepare:ide-plugin-dependencies:parcelize-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:lombok-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:kotlin-compiler-tests-for-ide",
":prepare:ide-plugin-dependencies:kotlin-compiler-testdata-for-ide",
":prepare:ide-plugin-dependencies:kotlin-stdlib-minimal-for-test-for-ide",
":prepare:ide-plugin-dependencies:low-level-api-fir-for-ide",
":prepare:ide-plugin-dependencies:high-level-api-for-ide",
":prepare:ide-plugin-dependencies:high-level-api-fir-for-ide",
":prepare:ide-plugin-dependencies:high-level-api-fir-tests-for-ide",
":kotlin-script-runtime",
":kotlin-script-util",
":kotlin-scripting-common",
":kotlin-scripting-jvm",
":kotlin-scripting-compiler",
":kotlin-scripting-compiler-impl",
":kotlin-android-extensions-runtime",
":kotlin-stdlib-common",
":kotlin-stdlib",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-reflect",
":kotlin-main-kts"
)
// TODO: fix remaining warnings and remove this property.
extra["tasksWithWarnings"] = listOf(
":kotlin-stdlib:compileTestKotlin",
":kotlin-stdlib-jdk7:compileTestKotlin",
":kotlin-stdlib-jdk8:compileTestKotlin",
":plugins:uast-kotlin-base:compileKotlin",
":plugins:uast-kotlin-base:compileTestKotlin",
":plugins:uast-kotlin:compileKotlin",
":plugins:uast-kotlin:compileTestKotlin"
":plugins:uast-kotlin:compileTestKotlin",
":plugins:uast-kotlin-fir:compileKotlin",
":plugins:uast-kotlin-fir:compileTestKotlin"
)
val tasksWithWarnings: List<String> by extra
@@ -348,6 +351,17 @@ val coreLibProjects = listOfNotNull(
":kotlin-reflect"
)
val projectsWithDisabledFirBootstrap = coreLibProjects + listOf(
":kotlin-gradle-plugin",
":kotlinx-metadata",
":kotlinx-metadata-jvm",
// For some reason stdlib isn't imported correctly for this module
// Probably it's related to kotlin-test module usage
":kotlin-gradle-statistics",
// Requires serialization plugin
":wasm:wasm.ir"
)
val gradlePluginProjects = listOf(
":kotlin-gradle-plugin",
":kotlin-gradle-plugin-api",
@@ -355,7 +369,8 @@ val gradlePluginProjects = listOf(
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-sam-with-receiver",
":kotlin-parcelize-compiler"
":kotlin-parcelize-compiler",
":kotlin-lombok"
)
apply {
@@ -364,7 +379,7 @@ apply {
}
apply {
if (extra["isSonatypeRelease"] as? Boolean == true) {
if (extra["isDeployStagingRepoGenerationRequired"] as? Boolean == true) {
logger.info("Applying configuration for sonatype release")
from("libraries/prepareSonatypeStaging.gradle")
}
@@ -378,11 +393,32 @@ fun Task.listConfigurationContents(configName: String) {
}
}
val defaultJvmTarget = "1.8"
val defaultJavaHome = jdkPath(if (Platform[203].orHigher()) "11" else defaultJvmTarget)
val ignoreTestFailures by extra(project.kotlinBuildProperties.ignoreTestFailures)
allprojects {
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
internalBootstrapRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
maven(protobufRepo)
maven(intellijRepo)
mavenCentral()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
maven("https://dl.google.com/dl/android/maven2")
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
jcenter()
}
if (path.startsWith(":kotlin-ide.")) {
return@allprojects
}
configurations.maybeCreate("embedded").apply {
isCanBeConsumed = false
@@ -402,32 +438,17 @@ allprojects {
}
}
jvmTarget = defaultJvmTarget
javaHome = defaultJavaHome
// There are problems with common build dir:
// - some tests (in particular js and binary-compatibility-validator depend on the fixed (default) location
// - idea seems unable to exclude common buildDir from indexing
// therefore it is disabled by default
// buildDir = File(commonBuildDir, project.name)
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
jcenter()
maven(protobufRepo)
maven(intellijRepo)
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies")
maven("https://dl.google.com/dl/android/maven2")
bootstrapKotlinRepo?.let(::maven)
internalBootstrapRepo?.let(::maven)
project.configureJvmDefaultToolchain()
plugins.withId("java-base") {
project.configureShadowJarSubstitutionInCompileClasspath()
}
configureJvmProject(javaHome!!, jvmTarget!!)
val commonCompilerArgs = listOfNotNull(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xread-deserialized-contracts",
@@ -453,11 +474,7 @@ allprojects {
kotlinOptions {
freeCompilerArgs = commonCompilerArgs + jvmCompilerArgs
if (useJvmIrBackend) {
useIR = true
}
if (useJvmFir) {
if (useJvmFir && this@allprojects.path !in projectsWithDisabledFirBootstrap) {
freeCompilerArgs += "-Xuse-fir"
freeCompilerArgs += "-Xabi-stability=stable"
}
@@ -500,12 +517,16 @@ allprojects {
outputs.doNotCacheIf("https://youtrack.jetbrains.com/issue/KTI-112") { true }
}
normalization {
runtimeClasspath {
ignore("META-INF/MANIFEST.MF")
ignore("META-INF/compiler.version")
ignore("META-INF/plugin.xml")
ignore("kotlin/KotlinVersionCurrentValue.class")
if (isConfigurationCacheDisabled) {
// Custom input normolization isn't supported by configuration cache at the moment
// See https://github.com/gradle/gradle/issues/13706
normalization {
runtimeClasspath {
ignore("META-INF/MANIFEST.MF")
ignore("META-INF/compiler.version")
ignore("META-INF/plugin.xml")
ignore("kotlin/KotlinVersionCurrentValue.class")
}
}
}
@@ -520,12 +541,9 @@ allprojects {
register("checkBuild")
}
afterEvaluate {
if (javaHome != defaultJavaHome || jvmTarget != defaultJvmTarget) {
logger.info("configuring project $name to compile to the target jvm version $jvmTarget using jdk: $javaHome")
configureJvmProject(javaHome!!, jvmTarget!!)
} // else we will actually fail during the first task execution. We could not fail before configuration is done due to impact on import in IDE
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
afterEvaluate {
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
fun FileCollection.printClassPath(role: String) =
@@ -554,27 +572,10 @@ allprojects {
?.exclude("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
}
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
apply(from = "$rootDir/gradle/testRetry.gradle.kts")
}
}
gradle.buildFinished {
val taskGraph = gradle?.taskGraph
if (taskGraph != null) {
taskGraph.allTasks
.filterIsInstance<SourceTask>()
.filter { it.didWork }
.forEach {
it.source.visit {
if (file.isDirectory && file.listFiles()?.isEmpty() == true) {
logger.warn("Empty source directories may cause build cache misses: " + file.absolutePath)
}
}
}
}
}
gradle.taskGraph.whenReady {
fun Boolean.toOnOff(): String = if (this) "on" else "off"
val profile = if (isTeamcityBuild) "CI" else "Local"
@@ -615,17 +616,12 @@ val ideaPlugin by task<Task> {
}
tasks {
named("clean") {
doLast {
delete("$buildDir/repo")
delete(distDir)
}
named<Delete>("clean") {
delete += setOf("$buildDir/repo", distDir)
}
register("cleanupArtifacts") {
doLast {
delete(artifactsDir)
}
register<Delete>("cleanupArtifacts") {
delete = setOf(artifactsDir)
}
listOf("clean", "assemble", "install").forEach { taskName ->
@@ -724,10 +720,12 @@ tasks {
register("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-compiler-embeddable:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-compiler:testWithIr")
dependsOn(":kotlin-scripting-common:test")
dependsOn(":kotlin-scripting-jvm:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
dependsOn(":kotlin-scripting-jvm-host-test:testWithIr")
dependsOn(":kotlin-scripting-dependencies:test")
dependsOn(":kotlin-scripting-dependencies-maven:test")
dependsOn(":kotlin-scripting-jsr223-test:test")
@@ -735,8 +733,15 @@ tasks {
// dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
dependsOn(":kotlin-scripting-ide-services-test:test")
dependsOn(":kotlin-scripting-ide-services-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:testWithIr")
if (kotlinBuildProperties.getOrNull("attachedIntellijVersion") == null &&
!kotlinBuildProperties.getBoolean("disableKotlinPluginModules", false)
) {
dependsOn(":kotlin-scripting-ide-services-test:test")
dependsOn(":kotlin-scripting-ide-services-test:embeddableTest")
}
dependsOn(":kotlin-scripting-js-test:test")
}
@@ -760,6 +765,9 @@ tasks {
dependsOn("jvmCompilerIntegrationTest")
dependsOn(":plugins:parcelize:parcelize-compiler:test")
dependsOn(":kotlin-util-io:test")
dependsOn(":kotlin-util-klib:test")
}
register("toolsTest") {
@@ -777,6 +785,7 @@ tasks {
register("distTest") {
dependsOn("compilerTest")
dependsOn("frontendApiTests")
dependsOn("toolsTest")
dependsOn("gradlePluginTest")
dependsOn("examplesTest")
@@ -800,7 +809,6 @@ tasks {
dependsOn("dist")
dependsOn(
":idea:idea-maven:test",
":j2k:test",
":nj2k:test",
":idea:jvm-debugger:jvm-debugger-core:test",
":idea:jvm-debugger:jvm-debugger-evaluation:test",
@@ -839,12 +847,22 @@ tasks {
dependsOn("dist")
dependsOn(
":idea:idea-fir:test",
":idea:idea-frontend-api:test",
":idea:idea-frontend-fir:test",
":idea:idea-frontend-fir:idea-fir-low-level-api:test"
":idea:idea-frontend-fir:fir-low-level-api-ide-impl:test",
":plugins:uast-kotlin-fir:test",
":idea:idea-fir-fe10-binding:test"
)
}
register("frontendApiTests") {
dependsOn("dist")
dependsOn(
":idea-frontend-api:test",
":idea-frontend-fir:test",
":idea-frontend-fir:idea-fir-low-level-api:test"
)
}
register("android-ide-tests") {
dependsOn("dist")
@@ -886,18 +904,11 @@ tasks {
if (Ide.IJ()) {
dependsOn(
":libraries:tools:new-project-wizard:test",
":libraries:tools:new-project-wizard:new-project-wizard-cli:test",
":idea:idea-new-project-wizard:test" // Temporary here. Remove after enabling builds for ideaIntegrationsTests
":libraries:tools:new-project-wizard:new-project-wizard-cli:test"
)
}
}
register("ideaIntegrationsTests") {
if (Ide.IJ()) {
dependsOn(":idea:idea-new-project-wizard:test")
}
}
register("kaptIdeTest") {
dependsOn(":kotlin-annotation-processing:test")
dependsOn(":kotlin-annotation-processing-base:test")
@@ -911,22 +922,6 @@ tasks {
)
}
register("kmmTest", AggregateTest::class) {
dependsOn(
":idea:idea-gradle:test",
":idea:test",
":compiler:test",
":compiler:container:test",
":js:js.tests:test"
)
dependsOn(":kotlin-gradle-plugin-integration-tests:test")
if (Ide.AS40.orHigher())
dependsOn(":kotlin-ultimate:ide:android-studio-native:test")
testPatternFile = file("tests/mpp/kmm-patterns.csv")
}
register("test") {
doLast {
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
@@ -953,32 +948,13 @@ tasks {
register("publishIdeArtifacts") {
idePluginDependency {
dependsOn(
":prepare:ide-plugin-dependencies:android-extensions-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:allopen-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:incremental-compilation-impl-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-build-common-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-compiler-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:compiler-components-for-jps:publish",
":prepare:ide-plugin-dependencies:parcelize-compiler-plugin-for-ide:publish",
":kotlin-script-runtime:publish",
":kotlin-script-util:publish",
":kotlin-scripting-common:publish",
":kotlin-scripting-jvm:publish",
":kotlin-scripting-compiler:publish",
":kotlin-scripting-compiler-impl:publish",
":kotlin-android-extensions-runtime:publish",
":kotlin-stdlib-common:publish",
":kotlin-stdlib:publish",
":kotlin-stdlib-jdk7:publish",
":kotlin-stdlib-jdk8:publish",
":kotlin-reflect:publish",
":kotlin-main-kts:publish"
)
dependsOn((rootProject.extra["compilerArtifactsForIde"] as List<String>).map { "$it:publish" })
}
}
register("installIdeArtifacts") {
idePluginDependency {
dependsOn((rootProject.extra["compilerArtifactsForIde"] as List<String>).map { "$it:install" })
}
}
}
@@ -1030,8 +1006,7 @@ val zipTestData by task<Zip> {
val zipPlugin by task<Zip> {
val src = when (project.findProperty("pluginArtifactDir") as String?) {
"Kotlin" -> ideaPluginDir
"KotlinUltimate" -> ideaUltimatePluginDir
null -> if (project.hasProperty("ultimate")) ideaUltimatePluginDir else ideaPluginDir
null -> ideaPluginDir
else -> error("Unsupported plugin artifact dir")
}
val destPath = project.findProperty("pluginZipPath") as String?
@@ -1088,66 +1063,6 @@ configure<IdeaModel> {
}
}
fun jdkPathOrNull(version: String): String? {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath
}
fun jdkPath(version: String, vararg replacementVersions: String): String {
return jdkPathOrNull(version) ?: run {
replacementVersions.asSequence().map { jdkPathOrNull(it) }.find { it != null }
} ?: jdkNotFoundConst
}
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
val currentJavaHome = File(System.getProperty("java.home")!!).canonicalPath
val shouldFork = !currentJavaHome.startsWith(File(javaHome).canonicalPath)
tasks.withType<JavaCompile> {
if (name != "compileJava9Java") {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.isFork = shouldFork
options.forkOptions.javaHome = file(javaHome)
options.compilerArgs.add("-proc:none")
options.encoding = "UTF-8"
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jdkHome = javaHome
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.freeCompilerArgs += "-Xjvm-default=compatibility"
}
tasks.withType<Test> {
executable = File(javaHome, "bin/java").canonicalPath
}
plugins.withId("java-base") {
configureShadowJarSubstitutionInCompileClasspath()
}
}
fun Project.configureShadowJarSubstitutionInCompileClasspath() {
val substitutionMap = mapOf(":kotlin-reflect" to ":kotlin-reflect-api")
fun configureSubstitution(substitution: DependencySubstitution) {
val requestedProject = (substitution.requested as? ProjectComponentSelector)?.projectPath ?: return
val replacementProject = substitutionMap[requestedProject] ?: return
substitution.useTarget(project(replacementProject), "Non-default shadow jars should not be used in compile classpath")
}
sourceSets.all {
for (configName in listOf(compileOnlyConfigurationName, compileClasspathConfigurationName)) {
configurations.getByName(configName).resolutionStrategy.dependencySubstitution {
all(::configureSubstitution)
}
}
}
}
tasks.register("findShadowJarsInClasspath") {
doLast {
fun Collection<File>.printSorted(indent: String = " ") {
@@ -1203,7 +1118,8 @@ val Jar.outputFile: File
val Project.sourceSetsOrNull: SourceSetContainer?
get() = convention.findPlugin(JavaPluginConvention::class.java)?.sourceSets
val disableVerificationTasks = System.getProperty("disable.verification.tasks") == "true"
val disableVerificationTasks = providers.systemProperty("disable.verification.tasks")
.forUseAtConfigurationTime().orNull?.toBoolean() ?: false
if (disableVerificationTasks) {
gradle.taskGraph.whenReady {
allTasks.forEach {
@@ -1214,3 +1130,19 @@ if (disableVerificationTasks) {
}
}
}
plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class) {
extensions.configure(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension::class.java) {
nodeVersion = "16.2.0"
}
}
afterEvaluate {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().downloadBaseUrl =
"https://cache-redirector.jetbrains.com/github.com/yarnpkg/yarn/releases/download"
}
}
}

View File

@@ -11,10 +11,8 @@ buildscript {
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
} else {
jcenter()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
}
@@ -24,14 +22,12 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.31")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${project.bootstrapKotlinVersion}")
}
}
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
logger.info("buildSrcKotlinVersion: " + extra["bootstrapKotlinVersion"])
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
@@ -39,6 +35,7 @@ logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
apply {
plugin("kotlin")
plugin("kotlin-sam-with-receiver")
plugin("groovy")
from("../gradle/checkCacheability.gradle.kts")
}
@@ -72,7 +69,6 @@ rootProject.apply {
}
val isTeamcityBuild = kotlinBuildProperties.isTeamcityBuild
val intellijUltimateEnabled by extra(kotlinBuildProperties.intellijUltimateEnabled)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
extra["intellijReleaseType"] = when {
@@ -81,11 +77,12 @@ extra["intellijReleaseType"] = when {
else -> "releases"
}
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build"
repositories {
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
mavenCentral()
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
gradlePluginPortal()
@@ -94,11 +91,60 @@ repositories {
}
}
val generateCompilerVersion by tasks.registering(VersionGenerator::class) {
kotlinNativeVersionInResources=true
defaultVersionFileLocation()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
dependsOn(generateCompilerVersion)
}
tasks.clean {
doFirst {
val versionSourceDirectory = project.konanVersionGeneratedSrc()
if (versionSourceDirectory.exists()) {
versionSourceDirectory.delete()
}
}
}
sourceSets["main"].withConvention(org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet::class) {
kotlin.srcDir("src/main/kotlin")
if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
kotlin.srcDir("../kotlin-native/shared/src/library/kotlin")
kotlin.srcDir("../kotlin-native/shared/src/main/kotlin")
kotlin.srcDir("../kotlin-native/build-tools/src/main/kotlin")
kotlin.srcDir("../kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin")
kotlin.srcDir("../compiler/util-klib/src")
kotlin.srcDir("../native/utils/src")
}
kotlin.srcDir(project.kotlinNativeVersionSrc())
/**
* TODO: mentioned bellow and Co it'd be better to move to :kotlin-native:performance:buildSrc,
* because all this relates to benchmarking.
*/
kotlin.exclude("**/benchmark/*.kt")
kotlin.exclude("**/kotlin/MPPTools.kt")
kotlin.exclude("**/kotlin/RegressionsReporter.kt")
kotlin.exclude("**/kotlin/RunJvmTask.kt")
kotlin.exclude("**/kotlin/RunKotlinNativeTask.kt")
kotlin.exclude("**/kotlin/BuildRegister.kt")
kotlin.exclude("**/kotlin/benchmarkUtils.kt")
}
tasks.validatePlugins.configure {
enabled = false
}
java {
disableAutoTargetJvm()
}
dependencies {
implementation(kotlin("stdlib", embeddedKotlinVersion))
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
implementation("com.gradle.publish:plugin-publish-plugin:0.12.0")
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.31")
implementation("com.gradle.publish:plugin-publish-plugin:0.14.0")
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
@@ -109,10 +155,31 @@ dependencies {
implementation("net.sf.proguard:proguard-gradle:6.2.2")
implementation("org.jetbrains.intellij.deps:asm-all:8.0.1")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.0.1")
implementation("org.gradle:test-retry-gradle-plugin:1.1.9")
implementation("com.gradle.enterprise:test-distribution-gradle-plugin:1.2.1")
implementation("org.gradle:test-retry-gradle-plugin:1.2.0")
implementation("com.gradle.enterprise:test-distribution-gradle-plugin:2.1")
compileOnly(gradleApi())
val kotlinVersion = project.bootstrapKotlinVersion
val ktorVersion = "1.2.1"
val slackApiVersion = "1.2.0"
val metadataVersion = "0.0.1-dev-10"
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("com.ullink.slack:simpleslackapi:$slackApiVersion")
implementation("io.ktor:ktor-client-auth:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
implementation("org.jetbrains.kotlin:kotlin-native-utils:${project.bootstrapKotlinVersion}")
}
}
samWithReceiver {
@@ -128,12 +195,26 @@ java {
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.freeCompilerArgs += listOf(
"-Xopt-in=kotlin.RequiresOptIn", "-Xskip-runtime-version-check", "-Xsuppress-version-warnings"
"-Xopt-in=kotlin.RequiresOptIn",
"-Xskip-runtime-version-check",
"-Xsuppress-version-warnings",
"-Xopt-in=kotlin.ExperimentalStdlibApi"
)
}
tasks["build"].dependsOn(":prepare-deps:build")
sourceSets["main"].withConvention(org.gradle.api.tasks.GroovySourceSet::class) {
if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
groovy.srcDir("../kotlin-native/build-tools/src/main/groovy")
}
}
tasks.named("compileGroovy", GroovyCompile::class.java) {
classpath += project.files(tasks.named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java))
dependsOn(tasks.named("compileKotlin"))
}
allprojects {
tasks.register("checkBuild")
@@ -142,3 +223,40 @@ allprojects {
apply(from = "$rootDir/../gradle/cacheRedirector.gradle.kts")
}
}
gradlePlugin {
plugins {
create("compileToBitcode") {
id = "compile-to-bitcode"
implementationClass = "org.jetbrains.kotlin.bitcode.CompileToBitcodePlugin"
}
create("runtimeTesting") {
id = "runtime-testing"
implementationClass = "org.jetbrains.kotlin.testing.native.RuntimeTestingPlugin"
}
create("konan") {
id = "konan"
implementationClass = "org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin"
}
// We bundle a shaded version of kotlinx-serialization plugin
create("kotlinx-serialization-native") {
id = "kotlinx-serialization-native"
implementationClass = "shadow.org.jetbrains.kotlinx.serialization.gradle.SerializationGradleSubplugin"
}
create("org.jetbrains.kotlin.konan") {
id = "org.jetbrains.kotlin.konan"
implementationClass = "org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin"
}
create("native") {
id = "native"
implementationClass = "org.jetbrains.gradle.plugins.tools.NativePlugin"
}
create("native-interop-plugin") {
id = "native-interop-plugin"
implementationClass = "org.jetbrains.kotlin.NativeInteropPlugin"
}
}
}

View File

@@ -15,30 +15,28 @@ plugins {
base
}
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val intellijVersionForIde = rootProject.intellijSdkVersionForIde()
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled && androidStudioRelease == null
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
fun checkIntellijVersion(intellijVersion: String) {
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
}
checkIntellijVersion(intellijVersion)
intellijVersionForIde?.let { checkIntellijVersion(it) }
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("intellijVersionForIde: $intellijVersionForIde")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val androidStudioOs by lazy {
when {
@@ -65,36 +63,22 @@ repositories {
artifact()
}
}
ivy {
url = URI("https://dl.bintray.com/kotlin/as/")
patternLayout {
artifact("[artifact]-[revision]-$androidStudioOs.[ext]")
}
credentials {
username = System.getenv("AS_BINTRAY_USER_NAME") ?: findProperty("bintray.user") as String?
password = System.getenv("AS_BINTRAY_API_KEY") ?: findProperty("bintray.apikey") as String?
}
metadataSources {
artifact()
}
}
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val intellijForIde by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val sourcesForIde by configurations.creating
val jpsStandalone by configurations.creating
val jpsStandaloneForIde by configurations.creating
val intellijCore by configurations.creating
val intellijCoreForIde by configurations.creating
val nodeJSPlugin by configurations.creating
/**
@@ -110,7 +94,6 @@ val dependenciesDir = (findProperty("kotlin.build.dependencies.dir") as String?)
val customDepsRepoDir = dependenciesDir.resolve("repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
dependencies {
@@ -122,12 +105,8 @@ dependencies {
androidStudio("google:android-studio-ide:$androidStudioBuild@$extension")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
intellijVersionForIde?.let { intellijForIde("com.jetbrains.intellij.idea:ideaIC:$it") }
}
if (asmVersion != null) {
@@ -135,102 +114,104 @@ dependencies {
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
intellijVersionForIde?.let { sourcesForIde("com.jetbrains.intellij.idea:ideaIC:$it:sources@jar") }
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijVersionForIde?.let { jpsStandaloneForIde("com.jetbrains.intellij.idea:jps-standalone:$it") }
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
intellijVersionForIde?.let { intellijCoreForIde("com.jetbrains.intellij.idea:intellij-core:$it") }
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
fun prepareDeps(
intellij: Configuration,
intellijCore: Configuration,
sources: Configuration,
jpsStandalone: Configuration,
intellijVersion: String
) {
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.registering(Copy::class) {
dependsOn(makeIntellijCore)
val makeIntellijAnnotations = tasks.register("makeIntellijAnnotations${intellij.name.capitalize()}", Copy::class) {
dependsOn(makeIntellijCore)
val intellijCoreRepo = CleanableStore[repoDir.resolve("intellij-core").absolutePath][intellijVersion].use()
from(intellijCoreRepo.resolve("artifacts/annotations.jar"))
val intellijCoreRepo = CleanableStore[repoDir.resolve("intellij-core").absolutePath][intellijVersion].use()
from(intellijCoreRepo.resolve("artifacts/annotations.jar"))
val annotationsStore = CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath]
val targetDir = annotationsStore[intellijVersion].use()
into(targetDir)
val annotationsStore = CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath]
val targetDir = annotationsStore[intellijVersion].use()
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doFirst {
annotationsStore.cleanStore()
doFirst {
annotationsStore.cleanStore()
}
doLast {
writeIvyXml(
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
)
}
}
doLast {
writeIvyXml(
val mergeSources = tasks.create("mergeSources${intellij.name.capitalize()}", Jar::class.java) {
dependsOn(sources)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
isZip64 = true
if (!kotlinBuildProperties.isTeamcityBuild) {
from(provider { sources.map(::zipTree) })
}
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
archiveVersion.set(intellijVersion)
}
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
task.configure {
dependsOn(mergeSources)
}
task
}
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
tasks.named("build") {
dependsOn(
makeIntellijCore,
makeIde,
buildJpsStandalone,
makeIntellijAnnotations
)
}
}
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
isZip64 = true
if (!kotlinBuildProperties.isTeamcityBuild) {
from(provider { sources.map(::zipTree) })
}
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
archiveVersion.set(intellijVersion)
}
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
dependsOn(mergeSources)
}
task
}
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
tasks.named("build") {
dependsOn(
makeIntellijCore,
makeIde,
buildJpsStandalone,
makeIntellijAnnotations
)
}
if (installIntellijUltimate) {
val buildNodeJsPlugin =
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
prepareDeps(intellij, intellijCore, sources, jpsStandalone, intellijVersion)
if (intellijVersionForIde != null) {
prepareDeps(intellijForIde, intellijCoreForIde, sourcesForIde, jpsStandaloneForIde, intellijVersionForIde)
}
tasks.named<Delete>("clean") {
@@ -417,6 +398,11 @@ fun skipToplevelDirectory(path: String) = path.substringAfter('/')
fun skipContentsDirectory(path: String) = path.substringAfter("Contents/")
fun Project.intellijSdkVersionForIde(): String? {
val majorVersion = kotlinBuildProperties.getOrNull("attachedIntellijVersion") as? String ?: return null
return rootProject.findProperty("versions.intellijSdk.forIde.$majorVersion") as? String
}
class XMLWriter(private val outputStreamWriter: OutputStreamWriter) : Closeable {
private val xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStreamWriter)

View File

@@ -18,55 +18,11 @@ buildscript {
} else {
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies" }
}
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.30")
}
}
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)
def projectVersions = file("../gradle/versions.properties").text
include "prepare-deps"
def target_AppCode_Clion = buildProperties.includeCidrPlugins && !projectVersions.contains("versions.androidStudioRelease")
def target_AndroidStudio = buildProperties.includeCidrPlugins && projectVersions.contains("versions.androidStudioRelease")
def target_IdeaUltimate = buildProperties.includeUltimate
if (target_AppCode_Clion) {
logger.info("Including modules for AC and CL in buildSrc/settings.gradle")
include ":prepare-deps:kotlin-native-platform-deps"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:kotlin-native-platform-deps").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else if (target_AndroidStudio) {
logger.info("Including modules for AS (mobile plugin) in buildSrc/settings.gradle")
include ":prepare-deps:appcode-binaries"
include ":prepare-deps:lldb-framework"
include ":prepare-deps:lldb-frontend"
project(":prepare-deps:appcode-binaries").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/appcode-binaries")
project(":prepare-deps:lldb-framework").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-framework")
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
} else if (target_IdeaUltimate) {
logger.info("Including modules for IU in buildSrc/settings.gradle")
include ":prepare-deps:lldb-frontend"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else {
logger.info("Not including extra modules in buildSrc/settings.gradle")
}
include "prepare-deps"

View File

@@ -0,0 +1,17 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.konan
import java.io.*
val VERSION_PATH = "/META-INF/kotlin-native.compiler.version"
val CompilerVersion.Companion.CURRENT: CompilerVersion
get() {
return InputStreamReader(this::class.java.getResourceAsStream(VERSION_PATH)).use {
it.readLines().single().parseCompilerVersion()
}
}
val currentCompilerVersion = CompilerVersion.CURRENT

View File

@@ -20,3 +20,6 @@ val KotlinBuildProperties.jarCompression: Boolean get() = getBoolean("kotlin.bui
val KotlinBuildProperties.ignoreTestFailures: Boolean get() = getBoolean("ignoreTestFailures", isTeamcityBuild)
val KotlinBuildProperties.disableWerror: Boolean get() = getBoolean("kotlin.build.disable.werror", false)
val KotlinBuildProperties.isObsoleteJdkOverrideEnabled: Boolean
get() = getBoolean("kotlin.build.isObsoleteJdkOverrideEnabled", false)

View File

@@ -4,32 +4,36 @@
*/
import groovy.lang.Closure
import org.gradle.api.JavaVersion
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.*
import org.gradle.internal.jvm.Jvm
import org.gradle.internal.jvm.inspection.JvmVersionDetector
import org.gradle.jvm.toolchain.JavaLauncher
import org.gradle.kotlin.dsl.property
import proguard.ClassSpecification
import java.io.File
import javax.inject.Inject
@CacheableTask
open class CacheableProguardTask @Inject constructor(
private val jvmVersionDetector: JvmVersionDetector
) : proguard.gradle.ProGuardTask() {
open class CacheableProguardTask : proguard.gradle.ProGuardTask() {
@Internal
var jdkHome: File? = null
@get:Internal
val javaLauncher: Property<JavaLauncher> = project.objects.property()
@get:Internal
val jdkHomePath: Provider<File> = javaLauncher.map { it.metadata.installationPath.asFile }
@get:Optional
@get:Input
internal val jdkMajorVersion: String?
get() = jdkHome?.let { jvmVersionDetector.getJavaVersion(Jvm.forHome(jdkHome)) }?.majorVersion
internal val jdkMajorVersion: Provider<JavaVersion> = javaLauncher.map {
JavaVersion.toVersion(it.metadata.languageVersion.toString())
}
@CompileClasspath
override fun getLibraryJarFileCollection(): FileCollection = super.getLibraryJarFileCollection().filter { libraryFile ->
jdkHome?.let { !libraryFile.absoluteFile.startsWith(it.absoluteFile) } ?: true
}
override fun getLibraryJarFileCollection(): FileCollection = super.getLibraryJarFileCollection()
.filter { libraryFile ->
jdkHomePath.orNull?.let { !libraryFile.absoluteFile.startsWith(it.absoluteFile) } ?: true
}
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)

View File

@@ -81,3 +81,12 @@ fun Task.singleOutputFile(): File = when (this) {
is ProGuardTask -> project.file(outJarFiles.single()!!)
else -> outputs.files.singleFile
}
val Project.isConfigurationCacheDisabled
get() = (gradle.startParameter as? org.gradle.api.internal.StartParameterInternal)?.isConfigurationCache != true
val Project.isIdeaActive
get() = providers.systemProperty("idea.active").forUseAtConfigurationTime().isPresent
val Project.intellijCommunityDir: File
get() = rootDir.resolve("kotlin-ide/intellij/community").takeIf { it.isDirectory } ?: rootDir.resolve("kotlin-ide/intellij")

View File

@@ -0,0 +1,144 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import org.gradle.api.file.FileTreeElement
import shadow.org.apache.tools.zip.ZipEntry
import shadow.org.apache.tools.zip.ZipOutputStream
import shadow.org.codehaus.plexus.util.IOUtil
import shadow.org.codehaus.plexus.util.ReaderFactory
import shadow.org.codehaus.plexus.util.WriterFactory
import shadow.org.codehaus.plexus.util.xml.Xpp3Dom
import shadow.org.codehaus.plexus.util.xml.Xpp3DomBuilder
import shadow.org.codehaus.plexus.util.xml.Xpp3DomWriter
import java.io.*
import java.lang.Exception
import java.util.LinkedHashMap
/**
* A resource processor that aggregates plexus `components.xml` files.
*
* Fixed version of [com.github.jengelman.gradle.plugins.shadow.transformers.ComponentsXmlResourceTransformer],
* may be dropped after [the fix in ShadowJAR](https://github.com/johnrengelman/shadow/pull/678/files) will be accepted
*/
class ComponentsXmlResourceTransformerPatched : Transformer {
private val components: MutableMap<String, Xpp3Dom> =
LinkedHashMap<String, Xpp3Dom>()
override fun canTransformResource(element: FileTreeElement): Boolean {
val path = element.relativePath.pathString
return COMPONENTS_XML_PATH == path
}
override fun transform(context: TransformerContext) {
val newDom: Xpp3Dom = try {
val bis: BufferedInputStream = object : BufferedInputStream(context.getIs()) {
override fun close() {
// leave ZIP open
}
}
val reader: Reader = ReaderFactory.newXmlReader(bis)
Xpp3DomBuilder.build(reader)
} catch (e: Exception) {
throw (IOException("Error parsing components.xml in " + context.getIs()).initCause(e) as IOException)
}
// Only try to merge in components if there are some elements in the component-set
if (newDom.getChild("components") == null) {
return
}
val children: Array<Xpp3Dom>? = newDom.getChild("components")?.getChildren("component")
children?.forEach { component ->
var role: String? = getValue(component, "role")
role = getRelocatedClass(role, context)
setValue(component, "role", role)
val roleHint = getValue(component, "role-hint")
var impl: String? = getValue(component, "implementation")
impl = getRelocatedClass(impl, context)
setValue(component, "implementation", impl)
val key = "$role:$roleHint"
if (components.containsKey(key)) {
// configuration carry over
val dom: Xpp3Dom? = components[key]
if (dom?.getChild("configuration") != null) {
component.addChild(dom.getChild("configuration"))
}
}
val requirements: Xpp3Dom? = component.getChild("requirements")
if (requirements != null && requirements.childCount > 0) {
for (r in requirements.childCount - 1 downTo 0) {
val requirement: Xpp3Dom = requirements.getChild(r)
var requiredRole: String? = getValue(requirement, "role")
requiredRole = getRelocatedClass(requiredRole, context)
setValue(requirement, "role", requiredRole)
}
}
components[key] = component
}
}
override fun modifyOutputStream(os: ZipOutputStream, preserveFileTimestamps: Boolean) {
val data = transformedResource
val entry = ZipEntry(COMPONENTS_XML_PATH)
entry.time = TransformerContext.getEntryTimestamp(preserveFileTimestamps, entry.time)
os.putNextEntry(entry)
IOUtil.copy(data, os)
components.clear()
}
override fun hasTransformedResource(): Boolean {
return components.isNotEmpty()
}
private val transformedResource: ByteArray
get() {
val baos = ByteArrayOutputStream(1024 * 4)
val writer: Writer = WriterFactory.newXmlWriter(baos)
try {
val dom = Xpp3Dom("component-set")
val componentDom = Xpp3Dom("components")
dom.addChild(componentDom)
for (component in components.values) {
componentDom.addChild(component)
}
Xpp3DomWriter.write(writer, dom)
} finally {
IOUtil.close(writer)
}
return baos.toByteArray()
}
companion object {
private const val COMPONENTS_XML_PATH = "META-INF/plexus/components.xml"
private fun getRelocatedClass(className: String?, context: TransformerContext): String? {
val relocators = context.relocators
val stats = context.stats
if (className != null && className.isNotEmpty() && relocators != null) {
for (relocator in relocators) {
if (relocator.canRelocateClass(className)) {
val relocateClassContext = RelocateClassContext(className, stats)
return relocator.relocateClass(relocateClassContext)
}
}
}
return className
}
private fun getValue(dom: Xpp3Dom, element: String): String {
val child: Xpp3Dom? = dom.getChild(element)
return if (child?.value != null) child.value else ""
}
private fun setValue(dom: Xpp3Dom, element: String, value: String?) {
val child: Xpp3Dom? = dom.getChild(element)
if (value == null || value.isEmpty()) {
return
}
child?.value = value
}
}
}

View File

@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P183, P191, P192, P193, P201, P202, P203;
P202, P203;
val version: Int = name.drop(1).toInt()
@@ -43,17 +43,9 @@ enum class Platform : CompatibilityPredicate {
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ191(Platform.P191),
IJ192(Platform.P192),
IJ193(Platform.P193),
IJ201(Platform.P201),
IJ202(Platform.P202),
IJ203(Platform.P203),
AS35(Platform.P183),
AS36(Platform.P192),
AS40(Platform.P193),
AS41(Platform.P201),
AS42(Platform.P202);
val kind = Kind.values().first { it.shortName == name.take(2) }

View File

@@ -0,0 +1,51 @@
import org.gradle.api.Action
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.withGroovyBuilder
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
class InstrumentJava(@Transient val javaInstrumentator: Configuration, @Transient val sourceSet: SourceSet) : Action<Task> {
private val instrumentatorClasspath: String by lazy {
javaInstrumentator.asPath
}
private val srcDirs: FileCollection by lazy {
sourceSet.allJava.sourceDirectories
}
override fun execute(task: Task) {
require(task is JavaCompile) { "$task is not of type JavaCompile!" }
task.doLast {
task.ant.withGroovyBuilder {
"taskdef"(
"name" to "instrumentIdeaExtensions",
"classpath" to instrumentatorClasspath,
"loaderref" to "java2.loader",
"classname" to "com.intellij.ant.InstrumentIdeaExtensions"
)
}
val javaSourceDirectories = srcDirs.filter { it.exists() }
task.ant.withGroovyBuilder {
javaSourceDirectories.forEach { directory ->
"instrumentIdeaExtensions"(
"srcdir" to directory,
"destdir" to task.destinationDir,
"classpath" to task.classpath.asPath,
"includeantruntime" to false,
"instrumentNotNull" to true
)
}
}
}
}
}

View File

@@ -0,0 +1,183 @@
@file:JvmName("JvmToolchain")
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.jvm.toolchain.*
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
enum class JdkMajorVersion(
val majorVersion: Int,
val targetName: String = majorVersion.toString(),
val overrideMajorVersion: Int? = null,
private val mandatory: Boolean = true
) {
JDK_1_6(6, targetName = "1.6", overrideMajorVersion = 8),
JDK_1_7(7, targetName = "1.7", overrideMajorVersion = 8),
JDK_1_8(8, targetName = "1.8"),
JDK_9(9, overrideMajorVersion = 11),
JDK_10(10, mandatory = false, overrideMajorVersion = 11),
JDK_11(11, mandatory = false),
JDK_15(15, mandatory = false),
JDK_16(16, mandatory = false);
fun isMandatory(): Boolean = mandatory
companion object {
fun fromMajorVersion(majorVersion: Int) = values().first { it.majorVersion == majorVersion }
}
}
fun Project.configureJvmDefaultToolchain() {
configureJvmToolchain(JdkMajorVersion.JDK_1_8)
}
fun Project.shouldOverrideObsoleteJdk(
jdkVersion: JdkMajorVersion
): Boolean = kotlinBuildProperties.isObsoleteJdkOverrideEnabled &&
jdkVersion.overrideMajorVersion != null
fun Project.configureJvmToolchain(
jdkVersion: JdkMajorVersion
) {
// Ensure java only modules also set default toolchain
configureJavaOnlyToolchain(jdkVersion)
plugins.withId("org.jetbrains.kotlin.jvm") {
val kotlinExtension = extensions.getByType<KotlinTopLevelExtension>()
if (shouldOverrideObsoleteJdk(jdkVersion)) {
kotlinExtension.jvmToolchain {
(this as JavaToolchainSpec).languageVersion
.set(JavaLanguageVersion.of(jdkVersion.overrideMajorVersion!!))
}
updateJvmTarget(jdkVersion.targetName)
} else {
kotlinExtension.jvmToolchain {
(this as JavaToolchainSpec).languageVersion
.set(JavaLanguageVersion.of(jdkVersion.majorVersion))
}
}
tasks
.matching { it.name != "compileJava9Java" && it is JavaCompile }
.configureEach {
with(this as JavaCompile) {
options.compilerArgs.add("-proc:none")
options.encoding = "UTF-8"
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-Xjvm-default=compatibility"
}
}
}
fun Project.configureJavaOnlyToolchain(
jdkVersion: JdkMajorVersion
) {
plugins.withId("java-base") {
val javaExtension = extensions.getByType<JavaPluginExtension>()
if (shouldOverrideObsoleteJdk(jdkVersion)) {
javaExtension.toolchain {
languageVersion.set(
JavaLanguageVersion.of(jdkVersion.overrideMajorVersion!!)
)
}
tasks.withType<JavaCompile>().configureEach {
targetCompatibility = jdkVersion.targetName
sourceCompatibility = jdkVersion.targetName
}
} else {
javaExtension.toolchain {
languageVersion.set(
JavaLanguageVersion.of(jdkVersion.majorVersion)
)
}
}
}
}
fun KotlinCompile.configureTaskToolchain(
jdkVersion: JdkMajorVersion
) {
if (project.shouldOverrideObsoleteJdk(jdkVersion)) {
kotlinJavaToolchain.toolchain.use(
project.getToolchainLauncherFor(
JdkMajorVersion.fromMajorVersion(
jdkVersion.overrideMajorVersion!!
)
)
)
kotlinOptions {
jvmTarget = jdkVersion.targetName
}
} else {
kotlinJavaToolchain.toolchain.use(
project.getToolchainLauncherFor(jdkVersion)
)
}
}
fun JavaCompile.configureTaskToolchain(
jdkVersion: JdkMajorVersion
) {
if (project.shouldOverrideObsoleteJdk(jdkVersion)) {
javaCompiler.set(
project.getToolchainCompilerFor(
JdkMajorVersion.fromMajorVersion(
jdkVersion.overrideMajorVersion!!
)
)
)
targetCompatibility = jdkVersion.targetName
sourceCompatibility = jdkVersion.targetName
} else {
javaCompiler.set(project.getToolchainCompilerFor(jdkVersion))
}
}
fun Project.updateJvmTarget(
jvmTarget: String
) {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = jvmTarget
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = jvmTarget
targetCompatibility = jvmTarget
}
}
private fun Project.getToolchainCompilerFor(
jdkVersion: JdkMajorVersion
): Provider<JavaCompiler> {
val service = project.extensions.getByType<JavaToolchainService>()
return service.compilerFor {
this.languageVersion.set(JavaLanguageVersion.of(jdkVersion.majorVersion))
}
}
fun Project.getToolchainLauncherFor(
jdkVersion: JdkMajorVersion
): Provider<JavaLauncher> {
val service = project.extensions.getByType<JavaToolchainService>()
val jdkVersionWithOverride = project.getJdkVersionWithOverride(jdkVersion)
return service.launcherFor {
this.languageVersion.set(JavaLanguageVersion.of(jdkVersionWithOverride.majorVersion))
}
}
fun Project.getJdkVersionWithOverride(jdkVersion: JdkMajorVersion): JdkMajorVersion {
return if (project.shouldOverrideObsoleteJdk(jdkVersion)) {
JdkMajorVersion.fromMajorVersion(jdkVersion.overrideMajorVersion!!)
} else {
jdkVersion
}
}

View File

@@ -0,0 +1,75 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:JvmName("LibrariesCommon")
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.withType
import org.gradle.process.CommandLineArgumentProvider
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@JvmOverloads
fun Project.configureJava9Compilation(
moduleName: String,
moduleOutputs: Collection<FileCollection> = setOf(sourceSets["main"].output)
) {
configurations["java9CompileClasspath"].extendsFrom(configurations["compileClasspath"])
tasks.named("compileJava9Java", JavaCompile::class.java) {
dependsOn(moduleOutputs)
targetCompatibility = JavaVersion.VERSION_1_9.toString()
sourceCompatibility = JavaVersion.VERSION_1_9.toString()
configureTaskToolchain(JdkMajorVersion.JDK_9)
// module-info.java should be in java9 source set by convention
val java9SourceSet = sourceSets["java9"].java
destinationDir = file("${java9SourceSet.outputDir}/META-INF/versions/9")
options.sourcepath = files(java9SourceSet.srcDirs)
val compileClasspath = configurations["java9CompileClasspath"]
val moduleFiles = objects.fileCollection().from(moduleOutputs)
val modulePath = compileClasspath.filter { it !in moduleFiles.files }
classpath = objects.fileCollection().from()
options.compilerArgumentProviders.add(
Java9AdditionalArgumentsProvider(
moduleName,
moduleFiles,
modulePath
)
)
}
}
private class Java9AdditionalArgumentsProvider(
private val moduleName: String,
private val moduleFiles: FileCollection,
private val modulePath: FileCollection
) : CommandLineArgumentProvider {
override fun asArguments(): Iterable<String> = listOf(
"--module-path", modulePath.asPath,
"--patch-module", "$moduleName=${moduleFiles.asPath}",
"-Xlint:-requires-transitive-automatic" // suppress automatic module transitive dependencies in kotlin.test
)
}
fun Project.disableDeprecatedJvmTargetWarning() {
if (!kotlinBuildProperties.useFir && !kotlinBuildProperties.disableWerror) {
val tasksWithWarnings: List<String> by rootProject.extra
tasks.withType<KotlinCompile>().configureEach {
if (!tasksWithWarnings.contains(path)) {
kotlinOptions {
allWarningsAsErrors = true
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
}
}
}

View File

@@ -1,6 +1,6 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.GradleException
import com.gradle.publish.PublishTask
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ConfigurablePublishArtifact
@@ -22,13 +22,12 @@ import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.tasks.GenerateModuleMetadata
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.*
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer
import plugins.KotlinBuildPublishingPlugin
import plugins.mainPublicationName
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -63,8 +62,6 @@ fun Project.removeArtifacts(configuration: Configuration, task: Task) {
fun Project.noDefaultJar() {
tasks.named("jar").configure {
enabled = false
actions = emptyList()
configurations.forEach { cfg ->
removeArtifacts(cfg, this)
}
@@ -113,6 +110,8 @@ fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {})
addVariantsFromConfiguration(runtimeJar) { }
}
(components.findByName("java") as AdhocComponentWithVariants?)?.addVariantsFromConfiguration(runtimeJar) { }
return task
}
@@ -226,24 +225,20 @@ fun Project.publish(moduleMetadata: Boolean = false, configure: MavenPublication
val publication = extensions.findByType<PublishingExtension>()
?.publications
?.findByName(KotlinBuildPublishingPlugin.PUBLICATION_NAME) as MavenPublication
?.findByName(mainPublicationName) as MavenPublication
publication.configure()
}
fun Project.publishWithLegacyMavenPlugin(body: Upload.() -> Unit = {}): Upload {
apply<plugins.PublishedKotlinModule>()
if (artifactsRemovedDiagnosticFlag) {
error("`publish()` should be called before removing artifacts typically done in `noDefaultJar()` or `runtimeJar()` call")
}
fun Project.publishGradlePlugin() {
mainPublicationName = "pluginMaven"
publish()
afterEvaluate {
if (configurations.findByName("classes-dirs") != null)
throw GradleException("classesDirsArtifact() is incompatible with publish(), see sources comments for details")
}
return (tasks.getByName("uploadArchives") as Upload).apply {
body()
tasks.withType<PublishTask> {
// Makes plugin publication task reuse poms and metadata from publication named "pluginMaven"
useAutomatedPublishing()
useGradleModuleMetadataIfAvailable()
}
}
}
@@ -254,6 +249,41 @@ fun Project.idePluginDependency(block: () -> Unit) {
}
}
fun Project.publishJarsForIde(projects: List<String>, libraryDependencies: List<String> = emptyList()) {
idePluginDependency {
publishProjectJars(projects, libraryDependencies)
}
configurations.all {
// Don't allow `ideaIC` from compiler to leak into Kotlin plugin modules. Compiler and
// plugin may depend on different versions of IDEA and it will lead to version conflict
exclude(module = ideModuleName())
}
dependencies {
projects.forEach {
jpsLikeJarDependency(project(it), JpsDepScope.COMPILE, { isTransitive = false }, exported = true)
}
libraryDependencies.forEach {
jpsLikeJarDependency(it, JpsDepScope.COMPILE, exported = true)
}
}
}
fun Project.publishTestJarsForIde(projectNames: List<String>) {
idePluginDependency {
publishTestJar(projectNames)
}
configurations.all {
// Don't allow `ideaIC` from compiler to leak into Kotlin plugin modules. Compiler and
// plugin may depend on different versions of IDEA and it will lead to version conflict
exclude(module = ideModuleName())
}
dependencies {
for (projectName in projectNames) {
jpsLikeJarDependency(projectTests(projectName), JpsDepScope.COMPILE, exported = true)
}
}
}
fun Project.publishProjectJars(projects: List<String>, libraryDependencies: List<String> = emptyList()) {
apply<JavaPlugin>()
@@ -292,13 +322,15 @@ fun Project.publishProjectJars(projects: List<String>, libraryDependencies: List
javadocJar()
}
fun Project.publishTestJar(projectName: String) {
fun Project.publishTestJar(projects: List<String>) {
apply<JavaPlugin>()
val fatJarContents by configurations.creating
dependencies {
fatJarContents(project(projectName, configuration = "tests-jar")) { isTransitive = false }
for (projectName in projects) {
fatJarContents(project(projectName, configuration = "tests-jar")) { isTransitive = false }
}
}
publish()
@@ -315,7 +347,7 @@ fun Project.publishTestJar(projectName: String) {
sourcesJar {
from {
project(projectName).testSourceSet.allSource
projects.map { project(it).testSourceSet.allSource }
}
}

View File

@@ -8,48 +8,37 @@ package tasks
import groovy.util.Node
import groovy.util.XmlParser
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import java.io.File
import java.util.*
open class WriteCopyrightToFile : DefaultTask() {
abstract class WriteCopyrightToFile : DefaultTask() {
@InputFile
var path = project.file("${project.rootDir}/.idea/copyright/apache.xml")
val path = project.file("${project.rootDir}/.idea/copyright/apache.xml")
@OutputFile
var outputFile: File? = null
@get:OutputFile
abstract val outputFile: RegularFileProperty
@Input
var commented: Boolean = true
@get:Input
val commented: Property<Boolean> = project.objects.property(Boolean::class.java).convention(true)
@TaskAction
fun write() {
if (commented) {
outputFile!!.writeText(project.readCopyrightCommented())
} else {
outputFile!!.writeText(project.readCopyright())
}
val file = outputFile.asFile.get()
file.writeText(if (commented.get()) readCopyrightCommented() else readCopyright())
}
fun Project.readCopyright(): String {
val file = rootDir.resolve(".idea/copyright/apache.xml")
assert(file.exists()) {
"File $file with copyright not found"
private fun readCopyright(): String {
assert(path.exists()) {
"File $path with copyright not found"
}
val xmlParser = XmlParser()
val node = xmlParser.parse(file)
val node = xmlParser.parse(path)
assert(node.attribute("name") == "CopyrightManager") {
"Format changed occasionally?"
}
@@ -59,7 +48,7 @@ open class WriteCopyrightToFile : DefaultTask() {
return noticeNode.attribute("value").toString().replace("&#36;today.year", GregorianCalendar()[Calendar.YEAR].toString())
}
fun Project.readCopyrightCommented(): String {
private fun readCopyrightCommented(): String {
return "/*\n" + readCopyright().prependIndent(" * ") + "\n */"
}
}

View File

@@ -9,13 +9,15 @@
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.internal.jvm.Jvm
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
import org.gradle.kotlin.dsl.closureOf
import org.gradle.kotlin.dsl.exclude
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import java.io.File
@@ -34,7 +36,7 @@ val Project.internalBootstrapRepo: String? get() =
when {
bootstrapKotlinRepo?.startsWith("https://buildserver.labs.intellij.net") == true ->
bootstrapKotlinRepo!!.replace("artifacts/content/maven", "artifacts/content/internal/repo")
else -> "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:$bootstrapKotlinVersion," +
else -> "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Aggregate),number:$bootstrapKotlinVersion," +
"branch:default:any/artifacts/content/internal/repo/"
}
@@ -89,12 +91,6 @@ fun Project.preloadedDeps(
return files(*matchingFiles.map { it.canonicalPath }.toTypedArray())
}
fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir: String? = null): ConfigurableFileCollection {
val ultimateDepsDir = fileFrom(rootDir, "ultimate", "dependencies")
return if (ultimateDepsDir.isDirectory) preloadedDeps(*artifactBaseNames, baseDir = ultimateDepsDir, subdir = subdir)
else files()
}
fun Project.kotlinDep(artifactBaseName: String, version: String, classifier: String? = null): String =
listOfNotNull("org.jetbrains.kotlin:kotlin-$artifactBaseName:$version", classifier).joinToString(":")
@@ -115,10 +111,100 @@ fun DependencyHandler.projectTests(name: String): ProjectDependency = project(na
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
enum class JpsDepScope {
COMPILE, TEST, RUNTIME, PROVIDED
}
fun DependencyHandler.add(configurationName: String, dependencyNotation: Any, configure: (ModuleDependency.() -> Unit)?) {
// Avoid `dependencyNotation` to `ModuleDependency` class cast exception if possible
if (configure != null) {
add(configurationName, dependencyNotation, closureOf(configure))
} else {
add(configurationName, dependencyNotation)
}
}
fun Project.disableDependencyVerification() {
configurations.all {
resolutionStrategy {
disableDependencyVerification()
}
}
}
fun DependencyHandler.jpsLikeJarDependency(
dependencyNotation: Any,
scope: JpsDepScope,
dependencyConfiguration: (ModuleDependency.() -> Unit)? = null,
exported: Boolean = false
) {
when (scope) {
JpsDepScope.COMPILE -> {
if (exported) {
add("api", dependencyNotation, dependencyConfiguration)
add("testCompile", dependencyNotation, dependencyConfiguration)
} else {
add("implementation", dependencyNotation, dependencyConfiguration)
}
}
JpsDepScope.TEST -> {
if (exported) {
add("testCompile", dependencyNotation, dependencyConfiguration)
} else {
add("testImplementation", dependencyNotation, dependencyConfiguration)
}
}
JpsDepScope.RUNTIME -> {
add("testRuntimeOnly", dependencyNotation, dependencyConfiguration)
}
JpsDepScope.PROVIDED -> {
if (exported) {
add("compileOnlyApi", dependencyNotation, dependencyConfiguration)
add("testCompile", dependencyNotation, dependencyConfiguration)
} else {
add("compileOnly", dependencyNotation, dependencyConfiguration)
add("testImplementation", dependencyNotation, dependencyConfiguration)
}
}
}
}
fun DependencyHandler.jpsLikeModuleDependency(moduleName: String, scope: JpsDepScope, exported: Boolean = false) {
jpsLikeJarDependency(project(moduleName), scope, exported = exported)
when (scope) {
JpsDepScope.COMPILE -> {
if (exported) {
add("testCompile", projectTests(moduleName))
} else {
add("testImplementation", projectTests(moduleName))
}
}
JpsDepScope.TEST -> {
if (exported) {
add("testCompile", projectTests(moduleName))
} else {
add("testImplementation", projectTests(moduleName))
}
}
JpsDepScope.RUNTIME -> {
add("runtimeOnly", projectTests(moduleName))
}
JpsDepScope.PROVIDED -> {
if (exported) {
add("testCompile", projectTests(moduleName))
} else {
add("testImplementation", projectTests(moduleName))
}
}
}
}
fun Project.testApiJUnit5(
vintageEngine: Boolean = false,
runner: Boolean = false,
suiteApi: Boolean = false
suiteApi: Boolean = false,
jupiterParams: Boolean = false
) {
with(dependencies) {
val platformVersion = commonVer("org.junit", "junit-bom")
@@ -127,6 +213,11 @@ fun Project.testApiJUnit5(
if (vintageEngine) {
testApi("org.junit.vintage:junit-vintage-engine:$platformVersion")
}
if (jupiterParams) {
testApi("org.junit.jupiter:junit-jupiter-params:$platformVersion")
}
val componentsVersion = commonVer("org.junit.platform", "")
val components = mutableListOf(
@@ -198,14 +289,16 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
fun Project.toolsJarApi(): Any =
if (kotlinBuildProperties.isInJpsBuildIdeaSync)
files(toolsJarFile() ?: error("tools.jar is not found!"))
toolsJar()
else
dependencies.project(":dependencies:tools-jar-api")
fun Project.toolsJar(): FileCollection = files(toolsJarFile() ?: error("tools.jar is not found!"))
fun Project.toolsJarFile(jdkHome: File = File(this.property("JDK_18") as String)): File? =
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
fun Project.toolsJar(): FileCollection = files(
getToolchainLauncherFor(JdkMajorVersion.JDK_1_8)
.map {
Jvm.forHome(it.metadata.installationPath.asFile).toolsJar ?: throw GradleException("tools.jar not found!")
}
)
val compilerManifestClassPath
get() = "annotations-13.0.jar kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"

View File

@@ -2,6 +2,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.artifacts.DependencySubstitution
import org.gradle.api.artifacts.component.ProjectComponentSelector
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.tasks.TaskProvider
import org.gradle.jvm.tasks.Jar
@@ -25,6 +27,7 @@ val packagesToRelocate =
"org.fusesource",
"net.jpountz",
"one.util.streamex",
"it.unimi.dsi.fastutil",
"kotlinx.collections.immutable"
)
@@ -79,6 +82,24 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
}
}
fun Project.configureShadowJarSubstitutionInCompileClasspath() {
val substitutionMap = mapOf(":kotlin-reflect" to ":kotlin-reflect-api")
fun configureSubstitution(substitution: DependencySubstitution) {
val requestedProject = (substitution.requested as? ProjectComponentSelector)?.projectPath ?: return
val replacementProject = substitutionMap[requestedProject] ?: return
substitution.useTarget(project(replacementProject), "Non-default shadow jars should not be used in compile classpath")
}
sourceSets.all {
for (configName in listOf(compileOnlyConfigurationName, compileClasspathConfigurationName)) {
configurations.getByName(configName).resolutionStrategy.dependencySubstitution {
all(::configureSubstitution)
}
}
}
}
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<out ShadowJar> =
compilerShadowJar(taskName) {
configureEmbeddableCompilerRelocation()
@@ -92,7 +113,6 @@ fun Project.compilerDummyForDependenciesRewriting(
exclude(packagesToExcludeFromDummy)
body()
}
const val COMPILER_DUMMY_JAR_CONFIGURATION_NAME = "compilerDummyJar"
fun Project.compilerDummyJar(task: TaskProvider<out Jar>, body: Jar.() -> Unit = {}) {
@@ -127,7 +147,6 @@ fun Project.rewriteDepsToShadedJar(
archiveClassifier.set("original")
}
val compilerDummyJarFile by lazy { configurations.getAt("compilerDummyJar").singleFile }
shadowJarTask.configure {
dependsOn(originalJarTask)
@@ -135,7 +154,8 @@ fun Project.rewriteDepsToShadedJar(
// When Gradle traverses the inputs, reject the shaded compiler JAR,
// which leads to the content of that JAR being excluded as well:
exclude { it.file == compilerDummyJarFile }
val compilerDummyJarFile = project.provider { configurations.getByName("compilerDummyJar").singleFile }
exclude { it.file == compilerDummyJarFile.get() }
archiveClassifier.set("original")
body()

View File

@@ -0,0 +1,52 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
}
publishGradlePlugin()
standardPublicJars()
extensions.extraProperties["kotlin.stdlib.default.dependency"] = "false"
dependencies {
compileOnly(kotlinStdlib())
compileOnly(gradleApi())
}
// These dependencies will be provided by Gradle and we should prevent version conflict
fun Configuration.excludeGradleCommonDependencies() {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-script-runtime")
}
configurations {
"implementation" {
excludeGradleCommonDependencies()
}
"api" {
excludeGradleCommonDependencies()
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.languageVersion = "1.3"
kotlinOptions.apiVersion = "1.3"
kotlinOptions.freeCompilerArgs += listOf(
"-Xskip-prerelease-check",
"-Xskip-runtime-version-check",
"-Xsuppress-version-warnings",
"-Xuse-ir" // Needed as long as languageVersion is less than 1.5.
)
}
tasks.named<Jar>("jar") {
callGroovy("manifestAttributes", manifest, project)
}

View File

@@ -24,16 +24,16 @@ fun ProjectSettings.compiler(block: IdeaCompilerConfiguration.() -> Unit) =
fun ProjectSettings.delegateActions(block: ActionDelegationConfig.() -> Unit) =
(this@delegateActions as ExtensionAware).extensions.configure(block)
fun ProjectSettings.runConfigurations(block: DefaultRunConfigurationContainer.() -> Unit) =
fun ProjectSettings.runConfigurations(block: RunConfigurationContainer.() -> Unit) =
(this@runConfigurations as ExtensionAware).extensions.configure("runConfigurations", block)
inline fun <reified T: RunConfiguration> DefaultRunConfigurationContainer.defaults(noinline block: T.() -> Unit) =
inline fun <reified T: RunConfiguration> RunConfigurationContainer.defaults(noinline block: T.() -> Unit) =
defaults(T::class.java, block)
fun DefaultRunConfigurationContainer.junit(name: String, block: JUnit.() -> Unit) =
fun RunConfigurationContainer.junit(name: String, block: JUnit.() -> Unit) =
create(name, JUnit::class.java, block)
fun DefaultRunConfigurationContainer.application(name: String, block: Application.() -> Unit) =
fun RunConfigurationContainer.application(name: String, block: Application.() -> Unit) =
create(name, Application::class.java, block)
fun ProjectSettings.ideArtifacts(block: NamedDomainObjectContainer<org.jetbrains.gradle.ext.TopLevelArtifact>.() -> Unit) =

View File

@@ -21,15 +21,18 @@ import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileSystemOperations
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.internal.ConventionTask
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
import javax.inject.Inject
fun Project.configureFormInstrumentation() {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.all {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.configureEach {
// When we change the output classes directory, Gradle will automatically configure
// the test compile tasks to use the instrumented classes. Normally this is fine,
// however, it causes problems for Kotlin projects:
@@ -42,31 +45,36 @@ fun Project.configureFormInstrumentation() {
// This fails when we change the classes dir. The easiest fix is to prepend the
// classes from the "friendly directory" to the compile classpath.
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
val originalClassesDirs = files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy"))
if (!tasks.names.contains("compileTestKotlin")) return@configureEach
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ originalClassesDirs)
tasks.named<AbstractCompile>("compileTestKotlin") {
val objects = project.objects
val classesDirs = project.mainSourceSet.output.classesDirs
val classesDirsCopy = project.provider { (mainSourceSet as ExtensionAware).extra.get("classesDirsCopy") }
doFirst {
val originalClassesDirs = objects.fileCollection().from(classesDirsCopy)
// Since Kotlin 1.3.60, the friend paths available to the test compile task are calculated as the main source set's
// output.classesDirs. Since the classesDirs are excluded from the classpath (replaced by the originalClassesDirs),
// in order to be able to access the internals of 'main', tests need to receive the original classes dirs as a
// -Xfriend-paths compiler argument as well.
fun addFreeCompilerArgs(kotlinCompileTask: AbstractCompile, vararg args: String) {
val getKotlinOptions = kotlinCompileTask::class.java.getMethod("getKotlinOptions")
val kotlinOptions = getKotlinOptions(kotlinCompileTask)
classpath = (classpath
- classesDirs
+ originalClassesDirs)
val getFreeCompilerArgs = kotlinOptions::class.java.getMethod("getFreeCompilerArgs")
val freeCompilerArgs = getFreeCompilerArgs(kotlinOptions) as List<*>
// Since Kotlin 1.3.60, the friend paths available to the test compile task are calculated as the main source set's
// output.classesDirs. Since the classesDirs are excluded from the classpath (replaced by the originalClassesDirs),
// in order to be able to access the internals of 'main', tests need to receive the original classes dirs as a
// -Xfriend-paths compiler argument as well.
fun addFreeCompilerArgs(kotlinCompileTask: AbstractCompile, vararg args: String) {
val getKotlinOptions = kotlinCompileTask::class.java.getMethod("getKotlinOptions")
val kotlinOptions = getKotlinOptions(kotlinCompileTask)
val setFreeCompilerArgs = kotlinOptions::class.java.getMethod("setFreeCompilerArgs", List::class.java)
setFreeCompilerArgs(kotlinOptions, freeCompilerArgs + args)
val getFreeCompilerArgs = kotlinOptions::class.java.getMethod("getFreeCompilerArgs")
val freeCompilerArgs = getFreeCompilerArgs(kotlinOptions) as List<*>
val setFreeCompilerArgs = kotlinOptions::class.java.getMethod("setFreeCompilerArgs", List::class.java)
setFreeCompilerArgs(kotlinOptions, freeCompilerArgs + args)
}
addFreeCompilerArgs(this as AbstractCompile, "-Xfriend-paths=" + originalClassesDirs.joinToString(",") { it.absolutePath })
}
addFreeCompilerArgs(testCompile, "-Xfriend-paths=" + originalClassesDirs.joinToString(",") { it.absolutePath })
}
}
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
@@ -76,7 +84,7 @@ fun Project.configureFormInstrumentation() {
}
afterEvaluate {
sourceSets.all { sourceSetParam ->
sourceSets.forEach { sourceSetParam ->
// This copy will ignore filters, but they are unlikely to be used.
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
@@ -88,66 +96,82 @@ fun Project.configureFormInstrumentation() {
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask =
project.tasks.register(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java) {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
outputs.dir(instrumentedClassesDir)
dependsOn(sourceSetParam.classesTaskName)
compileClasspath.from(sourceSetParam.compileClasspath)
sourceDirs.from(project.files({ sourceSetParam.allSource.srcDirs.filter { !sourceSetParam.resources.contains(it) && it.exists() } }))
instrumentationClasspathConfiguration = instrumentationClasspathCfg
originalClassesDirs.from(classesDirsCopy)
output.set(instrumentedClassesDir)
}
// Ensure that our task is invoked when the source set is built
sourceSetParam.compiledBy(instrumentTask)
@Suppress("UNUSED_EXPRESSION")
true
}
}
}
@CacheableTask
open class IntelliJInstrumentCodeTask : ConventionTask() {
abstract class IntelliJInstrumentCodeTask : ConventionTask() {
companion object {
private const val FILTER_ANNOTATION_REGEXP_CLASS = "com.intellij.ant.ClassFilterAnnotationRegexp"
private const val LOADER_REF = "java2.loader"
}
@Classpath
var instrumentationClasspath: Configuration? = null
@Transient
@Internal
lateinit var instrumentationClasspathConfiguration: Configuration
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
var originalClassesDirs: FileCollection? = null
@get:Classpath
val instrumentationClasspath: String by lazy {
instrumentationClasspathConfiguration.asPath
}
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:SkipWhenEmpty
abstract val originalClassesDirs: ConfigurableFileCollection
@get:Input
var instrumentNotNull: Boolean = false
@Internal
var sourceSet: SourceSet? = null
@get:InputFiles
@get:Classpath
abstract val compileClasspath: ConfigurableFileCollection
// Instrumentation needs to have access to sources of forms for inclusion
private val depSourceDirectorySets by lazy {
project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
}
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
abstract val sourceDirs: ConfigurableFileCollection
@get:OutputDirectory
lateinit var output: File
abstract val output: RegularFileProperty
@get:Inject
abstract val fs: FileSystemOperations
@TaskAction
fun instrumentClasses() {
logger.info(
"input files are: ${originalClassesDirs?.joinToString(
"; ",
transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)"}" })}"
"input files are: ${
originalClassesDirs.joinToString(
"; ",
transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)"}" })
}"
)
output.deleteRecursively()
output.asFile.get().deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
val classpath = instrumentationClasspath
ant.withGroovyBuilder {
"taskdef"(
"name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions"
)
@@ -155,14 +179,14 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
logger.info("Compiling forms and instrumenting code with nullability preconditions")
if (instrumentNotNull) {
prepareNotNullInstrumenting(classpath.asPath)
prepareNotNullInstrumenting(classpath)
}
instrumentCode(sourceDirs, instrumentNotNull)
}
private fun copyOriginalClasses() {
project.copy {
fs.copy {
from(originalClassesDirs)
into(output)
}
@@ -181,12 +205,10 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
val headlessOldValue = System.setProperty("java.awt.headless", "true")
val output = output.get().asFile
// Instrumentation needs to have access to sources of forms for inclusion
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
val instrumentationClasspath =
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
depSourceDirectorySets.fold(compileClasspath as FileCollection) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}

View File

@@ -1,193 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import net.rubygrapefruit.platform.Native
import net.rubygrapefruit.platform.WindowsRegistry
import org.gradle.api.GradleException
import org.gradle.api.Project
import java.nio.file.Paths
import java.io.File
import net.rubygrapefruit.platform.WindowsRegistry.Key.HKEY_LOCAL_MACHINE
import org.gradle.internal.os.OperatingSystem
enum class JdkMajorVersion(private val mandatory: Boolean = true) {
JDK_16, JDK_17, JDK_18, JDK_9, JDK_10(false), JDK_11(false), /*15.0*/JDK_15(false);
fun isMandatory(): Boolean = mandatory
}
val jdkAlternativeVarNames = mapOf(JdkMajorVersion.JDK_9 to listOf("JDK_19"), JdkMajorVersion.JDK_15 to listOf("JDK_15_0"))
data class JdkId(val explicit: Boolean, val majorVersion: JdkMajorVersion, var version: String, var homeDir: File)
fun Project.getConfiguredJdks(): List<JdkId> {
val res = arrayListOf<JdkId>()
for (jdkMajorVersion in JdkMajorVersion.values()) {
val explicitJdkEnvVal = findProperty(jdkMajorVersion.name)?.toString()
?: System.getenv(jdkMajorVersion.name)
?: jdkAlternativeVarNames[jdkMajorVersion]?.mapNotNull { System.getenv(it) }?.firstOrNull()
?: continue
val explicitJdk = Paths.get(explicitJdkEnvVal).toRealPath().toFile()
if (!explicitJdk.isDirectory) {
throw GradleException("Invalid environment value $jdkMajorVersion: $explicitJdkEnvVal, expecting JDK home path")
}
res.add(JdkId(true, jdkMajorVersion, "X", explicitJdk))
}
if (res.size < JdkMajorVersion.values().size) {
res.discoverJdks(this)
}
return res
}
// see JEP 223
private val javaMajorVersionRegex = Regex("""(?:1\.)?(\d+).*""")
private val javaVersionRegex = Regex("""(?:1\.)?(\d+)(\.\d+)?([+-_]\w+){0,3}""")
fun MutableCollection<JdkId>.addIfBetter(project: Project, version: String, id: String, homeDir: File): Boolean {
val matchString = javaMajorVersionRegex.matchEntire(version)?.groupValues?.get(1)
val majorJdkVersion = when (matchString) {
"6" -> JdkMajorVersion.JDK_16
"7" -> JdkMajorVersion.JDK_17
"8" -> JdkMajorVersion.JDK_18
"9" -> JdkMajorVersion.JDK_9
else -> {
project.logger.info("Cannot recognize version string '$version' (found version '$matchString')")
return false
}
}
val prev = find { it.majorVersion == majorJdkVersion }
if (prev == null) {
add(JdkId(false, majorJdkVersion, version, homeDir))
return true
}
if (prev.explicit) return false
val versionsComparisonRes = compareVersions(prev.version, version)
if (versionsComparisonRes < 0 || (versionsComparisonRes == 0 && id.contains("64"))) { // prefer 64-bit
prev.version = version
prev.homeDir = homeDir
return true
}
return false
}
private fun compareVersions(left: String, right: String): Int {
if (left == right) return 0
fun MatchResult.extractNumVer(): List<Int> =
groups.drop(2).map {
it?.value?.filter { it in '0'..'9' }?.toIntOrNull() ?: 0
}
val lmi = (javaVersionRegex.matchEntire(left)?.extractNumVer() ?: emptyList()).iterator()
val rmi = (javaVersionRegex.matchEntire(right)?.extractNumVer() ?: emptyList()).iterator()
while (lmi.hasNext() && rmi.hasNext()) {
val l = lmi.next()
val r = rmi.next()
when {
l < r -> return -1
l > r -> return 1
}
}
return when {
rmi.hasNext() -> -1
lmi.hasNext() -> 1
else -> 0
}
}
fun MutableCollection<JdkId>.discoverJdks(project: Project) {
val os = OperatingSystem.current()
when {
os.isWindows -> discoverJdksOnWindows(project)
os.isMacOsX -> discoverJdksOnMacOS(project)
else -> discoverJdksOnUnix(project)
}
}
private val macOsJavaHomeOutRegexes =
listOf(
Regex("""\s+(\S+),\s+(\S+):\s+".*?"\s+(.+)"""),
Regex("""\s+(\S+)\s+\((.*?)\):\s+(.+)"""),
Regex("""\s+(\S+)\s+\((.*?)\)\s+"[^"]*"\s+-\s+"[^"]*"\s(.+)""")
)
fun MutableCollection<JdkId>.discoverJdksOnMacOS(project: Project) {
val procBuilder = ProcessBuilder("/usr/libexec/java_home", "-V").redirectErrorStream(true)
val process = procBuilder.start()
val retCode = process.waitFor()
if (retCode != 0) throw GradleException("Unable to run 'java_home', return code $retCode")
process.inputStream.bufferedReader().forEachLine { line ->
for (rex in macOsJavaHomeOutRegexes) {
val matchResult = rex.matchEntire(line)
if (matchResult != null) {
addIfBetter(project, matchResult.groupValues[1], matchResult.groupValues[0], File(matchResult.groupValues[3]))
break
}
}
}
}
private val unixConventionalJdkLocations = listOf(
"/usr/lib/jvm", // *deb, Arch
"/opt", // *rpm, Gentoo, HP/UX
"/usr/lib", // Slackware 32
"/usr/lib64", // Slackware 64
"/usr/local", // OpenBSD, FreeBSD
"/usr/pkg/java", // NetBSD
"/usr/jdk/instances") // Solaris
private val unixConventionalJdkDirRex = Regex("jdk|jre|java|zulu")
fun MutableCollection<JdkId>.discoverJdksOnUnix(project: Project) {
for (loc in unixConventionalJdkLocations) {
val installedJdks = File(loc).listFiles { dir ->
dir.isDirectory &&
unixConventionalJdkDirRex.containsMatchIn(dir.name) &&
fileFrom(dir, "bin", "java").isFile
} ?: continue
for (dir in installedJdks) {
val versionMatch = javaVersionRegex.find(dir.name)
if (versionMatch == null) {
project.logger.info("Unable to extract version from possible JDK dir: $dir")
}
else {
addIfBetter(project, versionMatch.value, dir.name, dir)
}
}
}
}
private val windowsConventionalJdkRegistryPaths = listOf(
"SOFTWARE\\JavaSoft\\Java Development Kit",
"SOFTWARE\\Wow6432Node\\JavaSoft\\Java Development Kit",
"SOFTWARE\\JavaSoft\\JDK",
"SOFTWARE\\Wow6432Node\\JavaSoft\\JDK")
fun MutableCollection<JdkId>.discoverJdksOnWindows(project: Project) {
val registry = Native.get(WindowsRegistry::class.java)
for (regPath in windowsConventionalJdkRegistryPaths) {
val jdkKeys = try {
registry.getSubkeys(HKEY_LOCAL_MACHINE, regPath)
} catch (e: RuntimeException) {
// ignore missing nodes
continue
}
for (jdkKey in jdkKeys) {
try {
val javaHome = registry.getStringValue(HKEY_LOCAL_MACHINE, regPath + "\\" + jdkKey, "JavaHome")
val versionMatch = javaVersionRegex.find(jdkKey)
if (versionMatch == null) {
project.logger.info("Unable to extract version from possible JDK location: $javaHome ($jdkKey)")
}
else {
javaHome.takeIf { it.isNotEmpty() }
?.let { File(it) }
?.takeIf { it.isDirectory && fileFrom(it, "bin", "java.exe").isFile }
?.let {
addIfBetter(project, versionMatch.value, jdkKey, it)
}
}
}
catch (e: RuntimeException) {
// Ignore
}
}
}
}

View File

@@ -35,16 +35,26 @@ private fun Project.kotlinBuildLocalDependenciesDir(): File =
private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenciesDir().resolve("repo")
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> "android-studio-ide"
Ide.Kind.IntelliJ -> "ideaIC"
}
private fun Project.ideModuleVersion(forIde: Boolean) = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> rootProject.findProperty("versions.androidStudioBuild")
Ide.Kind.IntelliJ -> {
if (kotlinBuildProperties.intellijUltimateEnabled) "ideaIU" else "ideaIC"
if (forIde) {
intellijSdkVersionForIde()
?: error("Please specify 'attachedIntellijVersion' in your local.properties")
} else {
rootProject.findProperty("versions.intellijSdk")
}
}
}
private fun Project.ideModuleVersion() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> rootProject.findProperty("versions.androidStudioBuild")
Ide.Kind.IntelliJ -> rootProject.findProperty("versions.intellijSdk")
fun Project.intellijSdkVersionForIde(): String? {
val majorVersion = kotlinBuildProperties.getOrNull("attachedIntellijVersion") as? String ?: return null
return rootProject.findProperty("versions.intellijSdk.forIde.$majorVersion") as? String
}
fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactRepository = ivy {
@@ -58,6 +68,7 @@ fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactReposit
artifact("[organisation]/[module]/[revision]/artifacts/lib/[artifact](-[classifier]).[ext]")
artifact("[organisation]/[module]/[revision]/artifacts/[artifact](-[classifier]).[ext]")
artifact("[organisation]/intellij-core/[revision]/artifacts/[artifact](-[classifier]).[ext]")
artifact("[organisation]/${project.ideModuleName()}/[revision]/artifacts/plugins/[module]/lib/[artifact](-[classifier]).[ext]") // bundled plugins
artifact("[organisation]/sources/[artifact]-[revision](-[classifier]).[ext]")
artifact("[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]")
@@ -68,7 +79,9 @@ fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactReposit
}
}
fun Project.intellijDep(module: String? = null) = "kotlin.build:${module ?: ideModuleName()}:${ideModuleVersion()}"
@JvmOverloads
fun Project.intellijDep(module: String? = null, forIde: Boolean = false) =
"kotlin.build:${module ?: ideModuleName()}:${ideModuleVersion(forIde)}"
fun Project.intellijCoreDep() = "kotlin.build:intellij-core:${rootProject.extra["versions.intellijSdk"]}"
@@ -93,11 +106,7 @@ fun Project.kotlinxCollectionsImmutable() = "org.jetbrains.kotlinx:kotlinx-colle
*/
fun Project.intellijRuntimeAnnotations() = "kotlin.build:intellij-runtime-annotations:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijUltimateDep() = intellijDep("ideaIU")
fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijPluginDep(plugin: String, forIde: Boolean = false) = intellijDep(plugin, forIde)
fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
names.forEach {
@@ -125,7 +134,7 @@ object IntellijRootUtils {
fun getIntellijRootDir(project: Project): File = with(project.rootProject) {
return File(
getRepositoryRootDir(this),
"${ideModuleName()}/${ideModuleVersion()}/artifacts"
"${ideModuleName()}/${ideModuleVersion(forIde = false)}/artifacts"
)
}
}
@@ -137,19 +146,8 @@ fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFi
rootProject = project.rootProject
)
fun Project.isIntellijCommunityAvailable() =
!(rootProject.extra["intellijUltimateEnabled"] as Boolean) || rootProject.extra["intellijSeparateSdks"] as Boolean
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.extra["intellijUltimateEnabled"] as Boolean)
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.intellijUltimateRootDir() =
if (isIntellijUltimateSdkAvailable())
File(kotlinBuildLocalRepoDir(), "kotlin.build/ideaIU/${rootProject.extra["versions.intellijSdk"]}/artifacts")
else
throw GradleException("intellij ultimate SDK is not available")
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.extra.has("versions.androidStudioRelease")) {
block()
@@ -183,9 +181,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (Platform[201].orHigher() && !isIntellijUltimateSdkAvailable()) {
jvmArgs("-Didea.platform.prefix=Idea")
}
jvmArgs("-Didea.platform.prefix=Idea")
if (rootProject.findProperty("versions.androidStudioRelease") != null) {
jvmArgs("-Didea.platform.prefix=AndroidStudio")

View File

@@ -0,0 +1,228 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.gradle.plugins.tools
import org.gradle.api.DefaultTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.plugins.BasePlugin
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.withType
import org.gradle.language.base.plugins.LifecycleBasePlugin
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsMac
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsMingw
import java.io.File
import kotlin.collections.List
import kotlin.collections.MutableMap
import kotlin.collections.addAll
import kotlin.collections.drop
import kotlin.collections.first
import kotlin.collections.flatMap
import kotlin.collections.forEach
import kotlin.collections.listOf
import kotlin.collections.map
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf
import kotlin.collections.plusAssign
import kotlin.collections.set
import kotlin.collections.toTypedArray
open class NativePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.apply<BasePlugin>()
project.extensions.create("native", NativeToolsExtension::class.java, project)
}
}
abstract class ToolExecutionTask : DefaultTask() {
@get:OutputFile
abstract var output: File
@get:InputFiles
abstract var input: List<File>
@get:Input
abstract var cmd: String
@get:Input
abstract var args: List<String>
@TaskAction
fun action() {
project.exec {
executable(cmd)
args(*this@ToolExecutionTask.args.toTypedArray())
}
}
}
class ToolPatternImpl(val extension: NativeToolsExtension, val output:String, vararg val input: String):ToolPattern {
val tool = mutableListOf<String>()
val args = mutableListOf<String>()
override fun ruleOut(): String = output
override fun ruleInFirst(): String = input.first()
override fun ruleInAll(): Array<String> = arrayOf(*input)
override fun flags(vararg args: String) {
this.args.addAll(args)
}
override fun tool(vararg arg: String) {
tool.addAll(arg)
}
override fun env(name: String) = emptyArray<String>()
fun configure(task: ToolExecutionTask, configureDepencies:Boolean) {
extension.cleanupfiles += output
task.input = input.map {
extension.project.file(it)
}
task.dependsOn(":kotlin-native:dependencies:update")
if (configureDepencies)
task.input.forEach { task.dependsOn(it.name) }
val file = extension.project.file(output)
file.parentFile.mkdirs()
task.output = file
task.cmd = tool.first()
task.args = listOf(*tool.drop(1).toTypedArray(), *args.toTypedArray())
}
}
open class SourceSet(
val sourceSets: SourceSets,
val name: String,
val initialDirectory: File = sourceSets.project.projectDir,
val initialSourceSet: SourceSet? = null,
val rule: Pair<String, String>? = null
) {
var collection = sourceSets.project.objects.fileCollection() as FileCollection
fun file(path: String) {
collection = collection.plus(sourceSets.project.files("${initialDirectory.absolutePath}/$path"))
}
fun dir(path: String) {
sourceSets.project.fileTree("${initialDirectory.absolutePath}/$path").files.forEach {
collection = collection.plus(sourceSets.project.files(it))
}
}
fun transform(suffixes: Pair<String, String>): SourceSet {
return SourceSet(
sourceSets,
name,
sourceSets.project.file("${sourceSets.project.buildDir}/$name/${suffixes.first}_${suffixes.second}/"),
this,
suffixes
)
}
fun implicitTasks(): Array<TaskProvider<*>> {
rule ?: return emptyArray()
initialSourceSet?.implicitTasks()
return initialSourceSet!!.collection
.filter { !it.isDirectory() }
.filter { it.name.endsWith(rule.first) }
.map { it.relativeTo(initialSourceSet.initialDirectory) }
.map { it.path }
.map { it to (it.substring(0, it.lastIndexOf(rule.first)) + rule.second) }
.map {
file(it.second)
sourceSets.project.file("${initialSourceSet.initialDirectory.path}/${it.first}") to sourceSets.project.file("${initialDirectory.path}/${it.second}")
}.map {
sourceSets.project.tasks.register<ToolExecutionTask>(it.second.name, ToolExecutionTask::class.java) {
val toolConfiguration = ToolPatternImpl(sourceSets.extension, it.second.path, it.first.path)
sourceSets.extension.toolPatterns[rule]!!.invoke(toolConfiguration)
toolConfiguration.configure(this, initialSourceSet.rule != null)
}
}.toTypedArray()
}
}
class SourceSets(val project: Project, val extension: NativeToolsExtension, val sources: MutableMap<String, SourceSet>) :
MutableMap<String, SourceSet> by sources {
operator fun String.invoke(initialDirectory: File = project.projectDir, configuration: SourceSet.() -> Unit) {
sources[this] = SourceSet(this@SourceSets, this, initialDirectory).also {
configuration(it)
}
}
}
interface Environment {
operator fun String.invoke(vararg values: String)
}
interface ToolPattern {
fun ruleOut(): String
fun ruleInFirst(): String
fun ruleInAll(): Array<String>
fun flags(vararg args: String): Unit
fun tool(vararg arg: String): Unit
fun env(name: String): Array<String>
}
typealias ToolPatternConfiguration = ToolPattern.() -> Unit
typealias EnvironmentConfiguration = Environment.() -> Unit
class ToolConfigurationPatterns(
val extension: NativeToolsExtension,
val patterns: MutableMap<Pair<String, String>, ToolPatternConfiguration>
) : MutableMap<Pair<String, String>, ToolPatternConfiguration> by patterns {
operator fun Pair<String, String>.invoke(configuration: ToolPatternConfiguration) {
patterns[this] = configuration
}
}
open class NativeToolsExtension(val project: Project) {
val sourceSets = SourceSets(project, this, mutableMapOf<String, SourceSet>())
val toolPatterns = ToolConfigurationPatterns(this, mutableMapOf<Pair<String, String>, ToolPatternConfiguration>())
val cleanupfiles = mutableListOf<String>()
fun sourceSet(configuration: SourceSets.() -> Unit) {
sourceSets.configuration()
}
var environmentConfiguration: EnvironmentConfiguration? = null
fun environment(configuration: EnvironmentConfiguration) {
environmentConfiguration = configuration
}
fun suffixes(configuration: ToolConfigurationPatterns.() -> Unit) = toolPatterns.configuration()
fun target(name: String, vararg objSet: SourceSet, configuration: ToolPatternConfiguration) {
project.tasks.withType<Delete>().named(LifecycleBasePlugin.CLEAN_TASK_NAME).configure {
doLast {
delete(*this@NativeToolsExtension.cleanupfiles.toTypedArray())
}
}
sourceSets.project.tasks.create<ToolExecutionTask>(name, ToolExecutionTask::class.java) {
objSet.forEach {
dependsOn(it.implicitTasks())
}
val deps = objSet.flatMap { it.collection.files }.map { it.path }
val toolConfiguration = ToolPatternImpl(sourceSets.extension, "${project.buildDir.path}/$name", *deps.toTypedArray())
toolConfiguration.configuration()
toolConfiguration.configure(this, false )
}
}
}
fun solib(name: String) = when {
hostIsMingw -> "$name.dll"
hostIsMac -> "lib$name.dylib"
else -> "lib$name.so"
}
fun lib(name:String) = when {
hostIsMingw -> "$name.lib"
else -> "lib$name.a"
}

View File

@@ -10,31 +10,16 @@ import java.io.File
import org.gradle.api.Project
open class PillExtension {
/*
* Here's how you can specify a custom variant:
* `./gradlew pill -Dpill.variant=<NAME>`
*/
enum class Variant {
// Default variant (./gradlew pill)
BASE() {
override val includes = setOf(BASE)
},
// Full variant (./gradlew pill -Dpill.variant=full)
FULL() {
override val includes = setOf(BASE, FULL)
},
// Do not import the project to JPS model, but set some options for it
NONE() {
override val includes = emptySet<Variant>()
},
// 'BASE' if the "jps-compatible" plugin is applied, 'NONE' otherwise
DEFAULT() {
override val includes = emptySet<Variant>()
};
abstract val includes: Set<Variant>
BASE, // Includes compiler and IDE (default)
FULL, // Includes compiler, IDE and Gradle plugin
}
open var variant: Variant = Variant.DEFAULT
open var variant: Variant? = null
open var excludedDirs: List<File> = emptyList()
@@ -45,7 +30,7 @@ open class PillExtension {
@Suppress("unused")
fun serialize() = mapOf<String, Any?>(
"variant" to variant.name,
"variant" to variant?.name,
"excludedDirs" to excludedDirs
)
}

View File

@@ -14,6 +14,7 @@ import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.*
import plugins.KotlinBuildPublishingPlugin
import plugins.configureRepository
import plugins.mainPublicationName
import java.util.*
internal const val PLUGIN_MARKER_SUFFIX = ".gradle.plugin"
@@ -26,7 +27,7 @@ fun Project.publishPluginMarkers(withEmptyJars: Boolean = true) {
val pluginDevelopment = extensions.getByType<PluginBundleExtension>()
val publishingExtension = extensions.getByType<PublishingExtension>()
val mainPublication = publishingExtension.publications[KotlinBuildPublishingPlugin.PUBLICATION_NAME] as MavenPublication
val mainPublication = publishingExtension.publications[mainPublicationName] as MavenPublication
pluginDevelopment.plugins.forEach { declaration ->
val markerPublication = createMavenMarkerPublication(declaration, mainPublication, publishingExtension.publications)
@@ -64,6 +65,9 @@ private fun createMavenMarkerPublication(
): MavenPublication {
return publications.create<MavenPublication>(declaration.name.toString() + "PluginMarkerMaven") {
val pluginId: String = declaration.id
val cGroupId = coordinates.groupId
val cArtifactId = coordinates.artifactId
val cVersion = coordinates.version
artifactId = pluginId + PLUGIN_MARKER_SUFFIX
groupId = pluginId
pom.withXml {
@@ -72,11 +76,11 @@ private fun createMavenMarkerPublication(
val dependencies = root.appendChild(document.createElement("dependencies"))
val dependency = dependencies.appendChild(document.createElement("dependency"))
val groupId = dependency.appendChild(document.createElement("groupId"))
groupId.textContent = coordinates.groupId
groupId.textContent = cGroupId
val artifactId = dependency.appendChild(document.createElement("artifactId"))
artifactId.textContent = coordinates.artifactId
artifactId.textContent = cArtifactId
val version = dependency.appendChild(document.createElement("version"))
version.textContent = coordinates.version
version.textContent = cVersion
}
pom.name.set(declaration.displayName)

View File

@@ -6,12 +6,15 @@
import com.jakewharton.dex.*
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.*
import org.gradle.jvm.tasks.Jar
import java.io.File
@CacheableTask
open class DexMethodCount : DefaultTask() {
abstract class DexMethodCount : DefaultTask() {
data class Counts(
val total: Int,
@@ -24,16 +27,18 @@ open class DexMethodCount : DefaultTask() {
@Classpath
lateinit var jarFile: File
@Optional
@Input
var ownPackages: List<String>? = null
@get:Optional
@get:Input
abstract val ownPackages: ListProperty<String>
@Internal
var artifactName: String? = null
private val projectName = project.name
@get:Input
val artifactOrArchiveName: String
get() = artifactName ?: project.name
get() = artifactName ?: projectName
fun from(jar: Jar) {
jarFile = jar.archiveFile.get().asFile
@@ -41,12 +46,13 @@ open class DexMethodCount : DefaultTask() {
dependsOn(jar)
}
@Internal // plain output properties are not supported, mark as internal to suppress warning from validateTaskProperties
@Internal // plain output properties are not supported, mark as internal to suppress warning from validatePlugins
lateinit var counts: Counts
@get:OutputFile
val detailOutputFile: File
get() = project.buildDir.resolve("$artifactOrArchiveName-method-count.txt")
val detailOutputFile: File by lazy {
project.buildDir.resolve("$artifactOrArchiveName-method-count.txt")
}
@TaskAction
fun invoke() {
@@ -59,9 +65,9 @@ open class DexMethodCount : DefaultTask() {
val byPackage = this.groupingBy { it.`package` }.eachCount()
val byClass = this.groupingBy { it.declaringType }.eachCount()
val ownPackages = ownPackages?.map { "$it." }
val byOwnPackages = if (ownPackages != null) {
this.partition { method -> ownPackages.any { method.declaringType.startsWith(it) } }.let {
val ownPackages = ownPackages.map { list -> list.map { "$it." } }
val byOwnPackages = if (ownPackages.isPresent) {
this.partition { method -> ownPackages.get().any { method.declaringType.startsWith(it) } }.let {
it.first.size to it.second.size
}
} else (null to null)
@@ -78,7 +84,7 @@ open class DexMethodCount : DefaultTask() {
private fun outputDetails(counts: Counts) {
detailOutputFile.printWriter().use { writer ->
writer.println("${counts.total.padRight()}\tTotal methods")
ownPackages?.let { packages ->
ownPackages.orNull?.let { packages ->
writer.println("${counts.totalOwnPackages?.padRight()}\tTotal methods from packages ${packages.joinToString { "$it.*" }}")
writer.println("${counts.totalOtherPackages?.padRight()}\tTotal methods from other packages")
}
@@ -96,23 +102,24 @@ open class DexMethodCount : DefaultTask() {
}
}
open class DexMethodCountStats : DefaultTask() {
@Internal
lateinit var from: TaskProvider<DexMethodCount>
abstract class DexMethodCountStats : DefaultTask() {
@get:InputFile
internal val inputFile
get() = from.get().detailOutputFile
internal abstract val inputFile: RegularFileProperty
@get:Input
internal abstract val artifactOrArchiveName: Property<String>
@get:Input
@get:Optional
internal abstract val ownPackages: ListProperty<String>
@TaskAction
private fun printStats() {
val artifactOrArchiveName = from.get().artifactOrArchiveName
inputFile.reader().useLines { lines ->
val artifactOrArchiveName = artifactOrArchiveName.get()
inputFile.get().asFile.reader().useLines { lines ->
fun String.getStatValue() = substringBefore("\t").trim()
val ownPackages = from.get().ownPackages
val statsLineCount = if (ownPackages == null) 1 else 3
val statsLineCount = if (!ownPackages.isPresent) 1 else 3
val stats = lines.take(statsLineCount).map { it.getStatValue() }.toList()
val total = stats[0]
@@ -122,7 +129,7 @@ open class DexMethodCountStats : DefaultTask() {
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}' value='$total']")
}
ownPackages?.let { packages ->
ownPackages.map { packages ->
val totalOwnPackages = stats[1]
val totalOtherPackages = stats[2]
@@ -141,7 +148,9 @@ open class DexMethodCountStats : DefaultTask() {
fun Project.printStats(dexMethodCount: TaskProvider<DexMethodCount>) {
val dexMethodCountStats = tasks.register("dexMethodCountStats", DexMethodCountStats::class.java) {
dependsOn(dexMethodCount)
from = dexMethodCount
inputFile.set(dexMethodCount.flatMap { objects.fileProperty().apply { set(it.detailOutputFile) } })
artifactOrArchiveName.set(dexMethodCount.map { it.artifactOrArchiveName })
ownPackages.set(dexMethodCount.flatMap { it.ownPackages })
}
dexMethodCount.configure {

View File

@@ -5,6 +5,7 @@
package plugins
import PublishToMavenLocalSerializable
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.attributes.Usage
@@ -13,10 +14,10 @@ import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.publish.maven.tasks.PublishToMavenLocal
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
import java.util.*
@@ -27,7 +28,6 @@ class KotlinBuildPublishingPlugin @Inject constructor(
) : Plugin<Project> {
override fun apply(target: Project): Unit = with(target) {
apply<MavenPublishPlugin>()
apply<SigningPlugin>()
val publishedRuntime = configurations.maybeCreate(RUNTIME_CONFIGURATION).apply {
isCanBeConsumed = false
@@ -68,7 +68,7 @@ class KotlinBuildPublishingPlugin @Inject constructor(
configure<PublishingExtension> {
publications {
create<MavenPublication>(PUBLICATION_NAME) {
create<MavenPublication>(project.mainPublicationName) {
from(kotlinLibraryComponent)
configureKotlinPomAttributes(project)
@@ -79,16 +79,26 @@ class KotlinBuildPublishingPlugin @Inject constructor(
}
companion object {
const val PUBLICATION_NAME = "Main"
const val DEFAULT_MAIN_PUBLICATION_NAME = "Main"
const val MAIN_PUBLICATION_NAME_PROPERTY = "MainPublicationName"
const val REPOSITORY_NAME = "Maven"
const val ADHOC_COMPONENT_NAME = "kotlinLibrary"
const val COMPILE_CONFIGURATION = "publishedCompile"
const val RUNTIME_CONFIGURATION = "publishedRuntime"
}
}
var Project.mainPublicationName: String
get() {
return if (project.extra.has(KotlinBuildPublishingPlugin.MAIN_PUBLICATION_NAME_PROPERTY))
project.extra.get(KotlinBuildPublishingPlugin.MAIN_PUBLICATION_NAME_PROPERTY) as String
else KotlinBuildPublishingPlugin.DEFAULT_MAIN_PUBLICATION_NAME
}
set(value) {
project.extra.set(KotlinBuildPublishingPlugin.MAIN_PUBLICATION_NAME_PROPERTY, value)
}
@OptIn(ExperimentalStdlibApi::class)
private fun humanReadableName(name: String) =
name.split("-").joinToString(separator = " ") { it.capitalize(Locale.ROOT) }
@@ -132,31 +142,49 @@ fun Project.configureDefaultPublishing() {
}
}
configureSigning()
val signingRequired = project.providers.gradleProperty("signingRequired").forUseAtConfigurationTime().orNull?.toBoolean()
?: project.providers.gradleProperty("isSonatypeRelease").forUseAtConfigurationTime().orNull?.toBoolean() ?: false
if (signingRequired) {
apply<SigningPlugin>()
configureSigning()
}
tasks.register("install") {
dependsOn(tasks.named("publishToMavenLocal"))
}
// workaround for Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
tasks.withType(PublishToMavenLocal::class.java) {
val originalTask = this
val serializablePublishTask =
tasks.register(originalTask.name + "Serializable", PublishToMavenLocalSerializable::class.java) {
publication = originalTask.publication
}
originalTask.onlyIf { false }
originalTask.dependsOn(serializablePublishTask)
}
tasks.withType<PublishToMavenRepository>()
.matching { it.name.endsWith("PublicationTo${KotlinBuildPublishingPlugin.REPOSITORY_NAME}Repository") }
.all { configureRepository() }
}
private fun Project.configureSigning() {
val signingRequired = provider {
project.findProperty("signingRequired")?.toString()?.toBoolean()
?: project.property("isSonatypeRelease") as Boolean
}
configure<SigningExtension> {
setRequired(signingRequired)
sign(extensions.getByType<PublishingExtension>().publications) // all publications
useGpgCmd()
}
tasks.withType<Sign>().configureEach {
setOnlyIf { signingRequired.get() }
val signKeyId = project.findProperty("signKeyId") as? String
if (!signKeyId.isNullOrBlank()) {
val signKeyPrivate = project.findProperty("signKeyPrivate") as? String
?: error("Parameter `signKeyPrivate` not found")
val signKeyPassphrase = project.findProperty("signKeyPassphrase") as? String
?: error("Parameter `signKeyPassphrase` not found")
useInMemoryPgpKeys(signKeyId, signKeyPrivate, signKeyPassphrase)
} else {
useGpgCmd()
}
}
}
@@ -181,4 +209,4 @@ private fun PublishToMavenRepository.configureRepository() {
}
}
}
}
}

View File

@@ -1,173 +0,0 @@
@file:Suppress("DEPRECATION")
package plugins
import org.codehaus.groovy.runtime.InvokerHelper
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer
import org.gradle.api.artifacts.maven.MavenDeployment
import org.gradle.api.artifacts.maven.MavenResolver
import org.gradle.api.plugins.MavenPluginConvention
import org.gradle.api.plugins.MavenRepositoryHandlerConvention
import org.gradle.api.publication.maven.internal.deployer.MavenRemoteRepository
import org.gradle.api.tasks.Upload
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import kotlin.properties.Delegates
/**
* Configures a Kotlin module for publication.
*/
open class PublishedKotlinModule : Plugin<Project> {
private fun String.toBooleanOrNull() = listOf(true, false).firstOrNull { it.toString().equals(this, ignoreCase = true) }
override fun apply(project: Project) {
project.run {
plugins.apply("maven")
configurations.maybeCreate("publishedRuntime").apply {
the<MavenPluginConvention>()
.conf2ScopeMappings
.addMapping(0, this, Conf2ScopeMappingContainer.RUNTIME)
}
configurations.maybeCreate("publishedCompile").apply {
the<MavenPluginConvention>()
.conf2ScopeMappings
.addMapping(0, this, Conf2ScopeMappingContainer.COMPILE)
}
if (!project.hasProperty("prebuiltJar")) {
plugins.apply("signing")
val signingRequired = project.findProperty("signingRequired")?.toString()?.toBooleanOrNull()
?: project.property("isSonatypeRelease") as Boolean
configure<SigningExtension> {
isRequired = signingRequired
sign(configurations["archives"])
useGpgCmd()
}
tasks.named<Sign>("signArchives").configure {
enabled = signingRequired
}
}
fun MavenResolver.configurePom() {
pom.project {
withGroovyBuilder {
"licenses" {
"license" {
"name"("The Apache Software License, Version 2.0")
"url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
"distribution"("repo")
}
}
"name"("${project.group}:${project.name}")
"packaging"("jar")
// optionally artifactId can be defined here
"description"(project.description)
"url"("https://kotlinlang.org/")
"licenses" {
"license" {
"name"("The Apache License, Version 2.0")
"url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
"scm" {
"url"("https://github.com/JetBrains/kotlin")
"connection"("scm:git:https://github.com/JetBrains/kotlin.git")
"developerConnection"("scm:git:https://github.com/JetBrains/kotlin.git")
}
"developers" {
"developer" {
"name"("Kotlin Team")
setProperty("organization", "JetBrains")
"organizationUrl"("https://www.jetbrains.com")
}
}
}
}
pom.whenConfigured {
dependencies.removeIf {
InvokerHelper.getMetaClass(it).getProperty(it, "scope") == "test"
}
dependencies
.find {
InvokerHelper.getMetaClass(it).getProperty(it, "groupId") == "org.jetbrains.kotlin"
&& InvokerHelper.getMetaClass(it).getProperty(it, "artifactId") == "kotlin-stdlib"
}
?.also {
InvokerHelper.getMetaClass(it).setProperty(it, "exclusions", emptyList<Any>())
logger.warn("WARNING! Removed exclusions from kotlin-stdlib dependency of ${this.artifactId} artifact's maven metadata, check kotlin-stdlib dependency of ${project.path} project")
}
}
}
tasks.named<Upload>("uploadArchives").configure {
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
dependsOn(preparePublication)
val username: String? by preparePublication.extra
val password: String? by preparePublication.extra
val repoUrl: String by preparePublication.extra
var repository by Delegates.notNull<MavenRemoteRepository>()
repositories {
withConvention(MavenRepositoryHandlerConvention::class) {
mavenDeployer {
withGroovyBuilder {
"beforeDeployment" {
val signing = project.the<SigningExtension>()
if (signing.isRequired)
signing.signPom(delegate as MavenDeployment)
}
"repository"("url" to repoUrl)!!.also { repository = it as MavenRemoteRepository }.withGroovyBuilder {
if (username != null && password != null) {
"authentication"("userName" to username, "password" to password)
}
}
}
configurePom()
}
}
}
doFirst {
repository.url = repoUrl
}
}
val install = if (tasks.names.contains("install")) tasks.getByName("install") as Upload
else tasks.create("install", Upload::class.java)
install.apply {
configuration = project.configurations.getByName(Dependency.ARCHIVES_CONFIGURATION)
description = "Installs the 'archives' artifacts into the local Maven repository."
repositories {
withConvention(MavenRepositoryHandlerConvention::class) {
mavenInstaller {
configurePom()
}
}
}
}
tasks.register("publish") {
dependsOn(tasks.named("uploadArchives"))
}
}
}
}

View File

@@ -7,13 +7,25 @@
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.FileSystemOperations
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.publish.internal.PublishOperation
import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal
import org.gradle.api.publish.maven.internal.publisher.MavenNormalizedPublication
import org.gradle.api.publish.maven.internal.publisher.MavenPublisher
import org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher
import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.testing.Test
import org.gradle.internal.serialization.Cached
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.support.serviceOf
import java.io.File
import java.lang.Character.isLowerCase
import java.lang.Character.isUpperCase
@@ -25,6 +37,7 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
":kotlin-noarg",
":kotlin-sam-with-receiver",
":kotlin-android-extensions",
":kotlin-android-extensions-runtime",
":kotlin-parcelize-compiler",
":kotlin-build-common",
":kotlin-compiler-embeddable",
@@ -34,15 +47,18 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
":kotlin-compiler-runner",
":kotlin-daemon-embeddable",
":kotlin-daemon-client",
":kotlin-project-model",
":kotlin-gradle-plugin-api",
":kotlin-gradle-plugin",
":kotlin-gradle-plugin-model",
":kotlin-tooling-metadata",
":kotlin-reflect",
":kotlin-annotation-processing-gradle",
":kotlin-test",
":kotlin-gradle-subplugin-example",
":kotlin-stdlib-common",
":kotlin-stdlib",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-stdlib-js",
":examples:annotation-processor-example",
@@ -51,9 +67,11 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
":kotlin-scripting-jvm",
":kotlin-scripting-compiler-embeddable",
":kotlin-scripting-compiler-impl-embeddable",
":kotlin-serialization",
":kotlin-test-js-runner",
":native:kotlin-klib-commonizer-embeddable",
":native:kotlin-klib-commonizer-api"
":native:kotlin-klib-commonizer-api",
":native:kotlin-native-utils"
)
fun Task.dependsOnKotlinGradlePluginInstall() {
@@ -70,135 +88,149 @@ fun Task.dependsOnKotlinGradlePluginPublish() {
}
}
/**
* @param parallel is redundant if @param jUnit5Enabled is true, because
* JUnit5 supports parallel test execution by itself, without gradle help
*/
fun Project.projectTest(
taskName: String = "test",
parallel: Boolean = false,
shortenTempRootName: Boolean = false,
jUnit5Enabled: Boolean = false,
body: Test.() -> Unit = {}
): TaskProvider<Test> = getOrCreateTask(taskName) {
doFirst {
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: mutableSetOf()
val patterns = filter.includePatterns + commandLineIncludePatterns
if (patterns.isEmpty() || patterns.any { '*' in it }) return@doFirst
patterns.forEach { pattern ->
var isClassPattern = false
val maybeMethodName = pattern.substringAfterLast('.')
val maybeClassFqName = if (maybeMethodName.isFirstChar(::isLowerCase)) {
pattern.substringBeforeLast('.')
} else {
isClassPattern = true
pattern
}
if (!maybeClassFqName.substringAfterLast('.').isFirstChar(::isUpperCase)) {
return@forEach
}
val classFileNameWithoutExtension = maybeClassFqName.replace('.', '/')
val classFileName = "$classFileNameWithoutExtension.class"
if (isClassPattern) {
val innerClassPattern = "$pattern$*"
if (pattern in commandLineIncludePatterns) {
commandLineIncludePatterns.add(innerClassPattern)
(filter as? DefaultTestFilter)?.setCommandLineIncludePatterns(commandLineIncludePatterns)
} else {
filter.includePatterns.add(innerClassPattern)
}
}
val parentNames = if (jUnit5Enabled) {
/*
* If we run test from inner test class with junit 5 we need
* to include all containing classes of our class
*/
val nestedNames = classFileNameWithoutExtension.split("$")
mutableListOf(nestedNames.first()).also {
for (s in nestedNames.subList(1, nestedNames.size)) {
it += "${it.last()}\$$s"
}
}
} else emptyList()
include { treeElement ->
val path = treeElement.path
if (treeElement.isDirectory) {
classFileNameWithoutExtension.startsWith(path)
} else {
if (jUnit5Enabled) {
path == classFileName || (path.endsWith(".class") && parentNames.any { path.startsWith(it) })
} else {
path == classFileName || (path.endsWith(".class") && path.startsWith("$classFileNameWithoutExtension$"))
}
}
}
}
): TaskProvider<Test> {
val shouldInstrument = project.providers.gradleProperty("kotlin.test.instrumentation.disable")
.forUseAtConfigurationTime().orNull?.toBoolean() != true
if (shouldInstrument) {
evaluationDependsOn(":test-instrumenter")
}
if (project.findProperty("kotlin.test.instrumentation.disable")?.toString()?.toBoolean() != true) {
return getOrCreateTask<Test>(taskName) {
doFirst {
val agent = tasks.findByPath(":test-instrumenter:jar")!!.outputs.files.singleFile
val args = project.findProperty("kotlin.test.instrumentation.args")?.let { "=$it" }.orEmpty()
jvmArgs("-javaagent:$agent$args")
}
dependsOn(":test-instrumenter:jar")
}
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: mutableSetOf()
val patterns = filter.includePatterns + commandLineIncludePatterns
if (patterns.isEmpty() || patterns.any { '*' in it }) return@doFirst
patterns.forEach { pattern ->
var isClassPattern = false
val maybeMethodName = pattern.substringAfterLast('.')
val maybeClassFqName = if (maybeMethodName.isFirstChar(::isLowerCase)) {
pattern.substringBeforeLast('.')
} else {
isClassPattern = true
pattern
}
jvmArgs(
"-ea",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+UseCodeCacheFlushing",
"-XX:ReservedCodeCacheSize=256m",
"-Djna.nosys=true"
)
if (!maybeClassFqName.substringAfterLast('.').isFirstChar(::isUpperCase)) {
return@forEach
}
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
systemProperty("java.awt.headless", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
environment("PROJECT_BUILD_DIR", buildDir)
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
systemProperty("org.jetbrains.kotlin.skip.muted.tests", if (rootProject.hasProperty("skipMutedTests")) "true" else "false")
val classFileNameWithoutExtension = maybeClassFqName.replace('.', '/')
val classFileName = "$classFileNameWithoutExtension.class"
if (Platform[202].orHigher()) {
systemProperty("idea.ignore.disabled.plugins", "true")
}
if (isClassPattern) {
val innerClassPattern = "$pattern$*"
if (pattern in commandLineIncludePatterns) {
commandLineIncludePatterns.add(innerClassPattern)
(filter as? DefaultTestFilter)?.setCommandLineIncludePatterns(commandLineIncludePatterns)
} else {
filter.includePatterns.add(innerClassPattern)
}
}
var subProjectTempRoot: Path? = null
doFirst {
val teamcity = rootProject.findProperty("teamcity") as? Map<*, *>
val systemTempRoot =
// TC by default doesn't switch `teamcity.build.tempDir` to 'java.io.tmpdir' so it could cause to wasted disk space
// Should be fixed soon on Teamcity side
(teamcity?.get("teamcity.build.tempDir") as? String)
?: System.getProperty("java.io.tmpdir")
systemTempRoot.let {
val prefix = (project.name + "Project_" + taskName + "_").takeUnless { shortenTempRootName }
subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), prefix)
systemProperty("java.io.tmpdir", subProjectTempRoot.toString())
}
}
val parentNames = if (jUnit5Enabled) {
/*
* If we run test from inner test class with junit 5 we need
* to include all containing classes of our class
*/
val nestedNames = classFileNameWithoutExtension.split("$")
mutableListOf(nestedNames.first()).also {
for (s in nestedNames.subList(1, nestedNames.size)) {
it += "${it.last()}\$$s"
}
}
} else emptyList()
doLast {
subProjectTempRoot?.let {
try {
delete(it)
} catch (e: Exception) {
project.logger.warn("Can't delete test temp root folder $it", e.printStackTrace())
include { treeElement ->
val path = treeElement.path
if (treeElement.isDirectory) {
classFileNameWithoutExtension.startsWith(path)
} else {
if (jUnit5Enabled) {
path == classFileName || (path.endsWith(".class") && parentNames.any { path.startsWith(it) })
} else {
path == classFileName || (path.endsWith(".class") && path.startsWith("$classFileNameWithoutExtension$"))
}
}
}
}
}
}
if (parallel) {
maxParallelForks =
project.findProperty("kotlin.test.maxParallelForks")?.toString()?.toInt()
?: (Runtime.getRuntime().availableProcessors() / if (kotlinBuildProperties.isTeamcityBuild) 2 else 4).coerceAtLeast(1)
}
body()
if (shouldInstrument) {
val instrumentationArgsProperty = project.providers.gradleProperty("kotlin.test.instrumentation.args")
val testInstrumenterOutputs = project.tasks.findByPath(":test-instrumenter:jar")!!.outputs.files
doFirst {
val agent = testInstrumenterOutputs.singleFile
val args = instrumentationArgsProperty.orNull?.let { "=$it" }.orEmpty()
jvmArgs("-javaagent:$agent$args")
}
dependsOn(":test-instrumenter:jar")
}
jvmArgs(
"-ea",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+UseCodeCacheFlushing",
"-XX:ReservedCodeCacheSize=256m",
"-Djna.nosys=true"
)
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", project.intellijRootDir().canonicalPath)
systemProperty("java.awt.headless", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", project.testSourceSet.output.classesDirs.asPath)
environment("PROJECT_BUILD_DIR", project.buildDir)
systemProperty("jps.kotlin.home", project.rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (project.rootProject.hasProperty("newInferenceTests")) "true" else "false")
systemProperty("org.jetbrains.kotlin.skip.muted.tests", if (project.rootProject.hasProperty("skipMutedTests")) "true" else "false")
systemProperty("idea.ignore.disabled.plugins", "true")
var subProjectTempRoot: Path? = null
val projectName = project.name
val teamcity = project.rootProject.findProperty("teamcity") as? Map<*, *>
doFirst {
val systemTempRoot =
// TC by default doesn't switch `teamcity.build.tempDir` to 'java.io.tmpdir' so it could cause to wasted disk space
// Should be fixed soon on Teamcity side
(teamcity?.get("teamcity.build.tempDir") as? String)
?: System.getProperty("java.io.tmpdir")
systemTempRoot.let {
val prefix = (projectName + "Project_" + taskName + "_").takeUnless { shortenTempRootName }
subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), prefix)
systemProperty("java.io.tmpdir", subProjectTempRoot.toString())
}
}
val fs = project.serviceOf<FileSystemOperations>()
doLast {
subProjectTempRoot?.let {
try {
fs.delete {
delete(it)
}
} catch (e: Exception) {
logger.warn("Can't delete test temp root folder $it", e.printStackTrace())
}
}
}
if (parallel && !jUnit5Enabled) {
maxParallelForks =
project.providers.gradleProperty("kotlin.test.maxParallelForks").forUseAtConfigurationTime().orNull?.toInt()
?: (Runtime.getRuntime().availableProcessors() / if (project.kotlinBuildProperties.isTeamcityBuild) 2 else 4).coerceAtLeast(1)
}
}.apply { configure(body) }
}
private inline fun String.isFirstChar(f: (Char) -> Boolean) = isNotEmpty() && f(first())
@@ -225,18 +257,25 @@ private fun Task.useAndroidConfiguration(systemPropertyName: String, configName:
val configuration = with(project) {
configurations.getOrCreate(configName)
.also {
dependencies.add(
configName,
dependencies.project(":dependencies:android-sdk", configuration = configName)
)
if (it.allDependencies.matching { dep ->
dep is ProjectDependency &&
dep.targetConfiguration == configName &&
dep.dependencyProject.path == ":dependencies:android-sdk"
}.count() == 0) {
dependencies.add(
configName,
dependencies.project(":dependencies:android-sdk", configuration = configName)
)
}
}
}
dependsOn(configuration)
if (this is Test) {
val androidFilePath = configuration.singleFile.canonicalPath
doFirst {
systemProperty(systemPropertyName, configuration.singleFile.canonicalPath)
systemProperty(systemPropertyName, androidFilePath)
}
}
}
@@ -248,3 +287,30 @@ fun Task.useAndroidSdk() {
fun Task.useAndroidJar() {
TaskUtils.useAndroidJar(this)
}
// Workaround to make PublishToMavenLocal compatible with Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
abstract class PublishToMavenLocalSerializable : AbstractPublishToMaven() {
private val normalizedPublication = Cached.of { this.computeNormalizedPublication() }
private fun computeNormalizedPublication(): MavenNormalizedPublication {
val publicationInternal: MavenPublicationInternal = publicationInternal
?: throw InvalidUserDataException("The 'publication' property is required")
duplicatePublicationTracker.checkCanPublishToMavenLocal(publicationInternal)
return publicationInternal.asNormalisedPublication()
}
@TaskAction
open fun publish() {
val normalizedPublication = normalizedPublication.get()
object : PublishOperation(normalizedPublication.name, "mavenLocal") {
override fun publish() {
val localPublisher = mavenPublishers.getLocalPublisher(
temporaryDirFactory
)
val validatingPublisher: MavenPublisher = ValidatingMavenPublisher(localPublisher)
validatingPublisher.publish(normalizedPublication, null)
}
}.run()
}
}

View File

@@ -10,8 +10,8 @@ import org.gradle.internal.os.OperatingSystem
fun Test.configureTestDistribution(configure: TestDistributionExtension.() -> Unit = {}) {
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
val testDistributionEnabled = project.findProperty("kotlin.build.test.distribution.enabled")?.toString()?.toBoolean()
?: isTeamcityBuild
val testDistributionEnabled =
project.findProperty("kotlin.build.test.distribution.enabled")?.toString()?.toBoolean() ?: false
useJUnitPlatform()
extensions.configure(TestDistributionExtension::class.java) {

View File

@@ -24,24 +24,18 @@ dependencies {
testApi(projectTests(":compiler:tests-compiler-utils"))
testApi(projectTests(":compiler:tests-common-new"))
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
Platform[193].orLower {
testCompile(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testCompile(intellijDep()) { includeJars("util", "idea", "idea_rt", rootProject = rootProject) }
Platform[202].orHigher {
testCompile(intellijDep()) { includeJars("groovy", rootProject = rootProject) }
}
Platform[201].orLower {
testCompile(intellijDep()) { includeJars("groovy-all", rootProject = rootProject) }
}
testCompile(intellijDep()) { includeJars("groovy", rootProject = rootProject) }
testCompile(intellijPluginDep("java")) { includeJars("jps-builders") }
testCompile(jpsStandalone()) { includeJars("jps-model") }
testCompile(jpsBuildTest())
testRuntimeOnly(compile(intellijCoreDep()) { includeJars("intellij-core") })
testRuntimeOnly(compile(intellijDep()) { includeJars("jna", rootProject = rootProject) })
testCompile("org.junit.platform:junit-platform-launcher:${commonVer("org.junit.platform", "")}")
}

View File

@@ -262,7 +262,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
private fun getFlavorUnitTestFolder(flavourName: String): String {
return pathManager.srcFolderInAndroidTmpFolder +
"/androidTest${flavourName.capitalize()}/java/" +
"/androidTest${flavourName.replaceFirstChar(Char::uppercaseChar)}/java/" +
testClassPackage.replace(".", "/") + "/"
}
@@ -354,8 +354,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
extractor.provideConfigurationKeys()
extractor.configure(keyConfiguration, module.directives)
}
val kind = configuratorForFlags.extractConfigurationKind(module.directives)
val jdkKind = configuratorForFlags.extractJdkKind(module.directives)
val kind = JvmEnvironmentConfigurator.extractConfigurationKind(module.directives)
val jdkKind = JvmEnvironmentConfigurator.extractJdkKind(module.directives)
keyConfiguration.languageVersionSettings = module.languageVersionSettings
@@ -379,7 +379,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
configure(backend)
testInfo = KotlinTestInfo(
"org.jetbrains.kotlin.android.tests.AndroidRunner",
"test${testDataFile.nameWithoutExtension.capitalize()}",
"test${testDataFile.nameWithoutExtension.replaceFirstChar(Char::uppercaseChar)}",
emptySet()
)
}.build(testDataFile.path)

View File

@@ -27,7 +27,7 @@ class UnitTestFileWriter(
}
fun generate() {
FileWriter(File(flavourFolder, flavourName.capitalize() + ".java").also { it.parentFile.mkdirs() }).use { suite ->
FileWriter(File(flavourFolder, flavourName.replaceFirstChar(Char::uppercaseChar) + ".java").also { it.parentFile.mkdirs() }).use { suite ->
val p = Printer(suite)
p.println(
"""package ${CodegenTestsOnAndroidGenerator.testClassPackage};
@@ -35,7 +35,7 @@ class UnitTestFileWriter(
|import ${CodegenTestsOnAndroidGenerator.baseTestClassPackage}.${CodegenTestsOnAndroidGenerator.baseTestClassName};
|
|/* This class is generated by ${CodegenTestsOnAndroidGenerator.generatorName}. DO NOT MODIFY MANUALLY */
|public class ${flavourName.capitalize()} extends ${CodegenTestsOnAndroidGenerator.baseTestClassName} {
|public class ${flavourName.replaceFirstChar(Char::uppercaseChar)} extends ${CodegenTestsOnAndroidGenerator.baseTestClassName} {
|
""".trimMargin()
)

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.backend.common
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
import org.jetbrains.kotlin.resolve.sam.getAbstractMembers
import org.jetbrains.kotlin.types.KotlinType
class SamType constructor(val type: KotlinType) {
val classDescriptor: ClassDescriptor
get() = type.constructor.declarationDescriptor as? ClassDescriptor ?: error("Sam/Fun interface not a class descriptor: $type")
val kotlinFunctionType: KotlinType
get() = classDescriptor.defaultFunctionTypeForSamInterface!!
val originalAbstractMethod: SimpleFunctionDescriptor
get() = getAbstractMembers(classDescriptor)[0] as SimpleFunctionDescriptor
override fun equals(other: Any?): Boolean {
return other is SamType && type == other.type
}
override fun hashCode(): Int {
return type.hashCode()
}
override fun toString(): String {
return "SamType($type)"
}
}

View File

@@ -0,0 +1,76 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.backend.common
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.checker.intersectWrappedTypes
import org.jetbrains.kotlin.types.typeUtil.replaceArgumentsWithNothing
class SamTypeApproximator(builtIns: KotlinBuiltIns, languageVersionSettings: LanguageVersionSettings) {
private val typeApproximator = TypeApproximator(builtIns, languageVersionSettings)
fun getSamTypeForValueParameter(valueParameter: ValueParameterDescriptor): KotlinType? {
val singleArgumentType: KotlinType
val originalSingleArgumentType: KotlinType?
val varargElementType = valueParameter.varargElementType
if (varargElementType != null) {
singleArgumentType = varargElementType
originalSingleArgumentType = valueParameter.original.varargElementType
assert(originalSingleArgumentType != null) {
"Value parameter and original value parameter have inconsistent varargs: " +
valueParameter + "; " + valueParameter.original
}
} else {
singleArgumentType = valueParameter.type
originalSingleArgumentType = valueParameter.original.type
}
if (singleArgumentType.isError || originalSingleArgumentType!!.isError) {
return null
}
// This can be true in case when the value parameter is in the method of a generic type with out-projection.
// We approximate Inv<Captured#1> to Nothing, while Inv itself can be a SAM interface safe to call here
// (see testData genericSamProjectedOut.kt for details)
// In such a case we can't have a proper supertype since wildcards are not allowed there,
// so we use Nothing arguments instead that leads to a raw type used for a SAM wrapper.
// See org.jetbrains.kotlin.codegen.state.KotlinTypeMapper#writeGenericType to understand how
// raw types and Nothing arguments relate.
val originalTypeToUse =
if (KotlinBuiltIns.isNothing(singleArgumentType))
originalSingleArgumentType.replaceArgumentsWithNothing()
else
singleArgumentType
val approximatedOriginalTypeToUse =
typeApproximator.approximateToSubType(
originalTypeToUse,
TypeApproximatorConfiguration.UpperBoundAwareIntersectionTypeApproximator
) ?: originalTypeToUse
approximatedOriginalTypeToUse as KotlinType
return approximatedOriginalTypeToUse.removeExternalProjections()
}
private fun KotlinType.removeExternalProjections(): KotlinType {
val newArguments = arguments.map { TypeProjectionImpl(Variance.INVARIANT, it.type) }
return replace(newArguments)
}
}
open class SamTypeFactory {
open fun isSamType(type: KotlinType): Boolean {
val descriptor = type.constructor.declarationDescriptor
return descriptor is ClassDescriptor && descriptor.isFun
}
fun create(originalType: KotlinType): SamType? {
return if (isSamType(originalType)) SamType(originalType) else null
}
}

View File

@@ -18,7 +18,7 @@ fun mangleNameIfNeeded(name: String): String {
if (c.isValidCharacter()) {
append(c)
} else {
val hexString = Integer.toHexString(c.toInt())
val hexString = Integer.toHexString(c.code)
assert(hexString.length <= 4)
append("_u").append(hexString)
}

View File

@@ -1,13 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.codegen
import org.jetbrains.org.objectweb.asm.Opcodes
// This object should help compiling against different ASM versions from different bunch versions
object VersionIndependentOpcodes {
const val ACC_RECORD = 0
}

View File

@@ -18,7 +18,10 @@ interface TypeMappingContext<Writer : JvmDescriptorTypeWriter<Type>> {
val typeContext: TypeSystemCommonBackendContextForTypeMapping
fun getClassInternalName(typeConstructor: TypeConstructorMarker): String
fun Writer.writeGenericType(type: SimpleTypeMarker, asmType: Type, mode: TypeMappingMode)
fun getScriptInternalName(typeConstructor: TypeConstructorMarker): String
// NB: The counterpart, [KotlinTypeMapper#writeGenericType], doesn't have restriction on [type]
fun Writer.writeGenericType(type: KotlinTypeMarker, asmType: Type, mode: TypeMappingMode)
}
object AbstractTypeMapper {
@@ -43,6 +46,7 @@ object AbstractTypeMapper {
sw: Writer? = null
): Type = context.typeContext.mapType(context, type, mode, sw)
// NB: The counterpart, [descriptorBasedTypeSignatureMapping#mapType] doesn't have restriction on [type].
@OptIn(ExperimentalStdlibApi::class)
private fun <Writer : JvmDescriptorTypeWriter<Type>> TypeSystemCommonBackendContextForTypeMapping.mapType(
context: TypeMappingContext<Writer>,
@@ -50,10 +54,7 @@ object AbstractTypeMapper {
mode: TypeMappingMode = TypeMappingMode.DEFAULT,
sw: Writer? = null
): Type {
if (type !is SimpleTypeMarker) {
error("Unexpected type: $type (original Kotlin type=$type of ${type.let { it::class }})")
}
if (type.isSuspendFunction()) {
if (type is SimpleTypeMarker && type.isSuspendFunction()) {
val argumentsCount = type.argumentsCount()
val argumentsList = type.asArgumentList()
@@ -78,7 +79,7 @@ object AbstractTypeMapper {
val typeConstructor = type.typeConstructor()
when {
type.isArrayOrNullableArray() -> {
type is SimpleTypeMarker && type.isArrayOrNullableArray() -> {
val typeArgument = type.asArgumentList()[0]
val (variance, memberType) = when {
typeArgument.isStarProjection() -> Variance.OUT_VARIANCE to nullableAnyType()
@@ -98,7 +99,7 @@ object AbstractTypeMapper {
return AsmUtil.getArrayType(arrayElementType)
}
typeConstructor.isClassTypeConstructor() -> {
type is SimpleTypeMarker && typeConstructor.isClassTypeConstructor() -> {
if (typeConstructor.isInlineClass() && !mode.needInlineClassWrapping) {
val expandedType = computeExpandedTypeForInlineClass(type)
require(expandedType is SimpleTypeMarker?)
@@ -116,6 +117,10 @@ object AbstractTypeMapper {
return asmType
}
typeConstructor.isScript() -> {
return Type.getObjectType(context.getScriptInternalName(typeConstructor))
}
typeConstructor.isTypeParameter() -> {
val typeParameter = typeConstructor as TypeParameterMarker
return mapType(context, typeParameter.representativeUpperBound(), mode, null).also { asmType ->

View File

@@ -1,158 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.codegen.inline.FileMapping;
import org.jetbrains.kotlin.codegen.inline.SMAPBuilder;
import org.jetbrains.kotlin.codegen.inline.SourceMapper;
import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings;
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
import org.jetbrains.org.objectweb.asm.*;
import java.util.List;
import static org.jetbrains.kotlin.codegen.inline.InlineCodegenUtilsKt.GENERATE_SMAP;
public abstract class AbstractClassBuilder implements ClassBuilder {
protected static final MethodVisitor EMPTY_METHOD_VISITOR = new MethodVisitor(Opcodes.API_VERSION) {};
protected static final FieldVisitor EMPTY_FIELD_VISITOR = new FieldVisitor(Opcodes.API_VERSION) {};
private String thisName;
private final JvmSerializationBindings serializationBindings = new JvmSerializationBindings();
private String sourceName;
private String debugInfo;
public static class Concrete extends AbstractClassBuilder {
private final ClassVisitor v;
public Concrete(@NotNull ClassVisitor v) {
this.v = v;
}
@Override
@NotNull
public ClassVisitor getVisitor() {
return v;
}
}
@Override
@NotNull
public FieldVisitor newField(
@NotNull JvmDeclarationOrigin origin,
int access,
@NotNull String name,
@NotNull String desc,
@Nullable String signature,
@Nullable Object value
) {
FieldVisitor visitor = getVisitor().visitField(access, name, desc, signature, value);
if (visitor == null) {
return EMPTY_FIELD_VISITOR;
}
return visitor;
}
@Override
@NotNull
public MethodVisitor newMethod(
@NotNull JvmDeclarationOrigin origin,
int access,
@NotNull String name,
@NotNull String desc,
@Nullable String signature,
@Nullable String[] exceptions
) {
MethodVisitor visitor = getVisitor().visitMethod(access, name, desc, signature, exceptions);
if (visitor == null) {
return EMPTY_METHOD_VISITOR;
}
return visitor;
}
@Override
@NotNull
public JvmSerializationBindings getSerializationBindings() {
return serializationBindings;
}
@Override
@NotNull
public AnnotationVisitor newAnnotation(@NotNull String desc, boolean visible) {
return getVisitor().visitAnnotation(desc, visible);
}
@Override
public void done() {
getVisitor().visitSource(sourceName, debugInfo);
getVisitor().visitEnd();
}
@Override
public void defineClass(
@Nullable PsiElement origin,
int version,
int access,
@NotNull String name,
@Nullable String signature,
@NotNull String superName,
@NotNull String[] interfaces
) {
thisName = name;
getVisitor().visit(version, access, name, signature, superName, interfaces);
}
@Override
public void visitSource(@NotNull String name, @Nullable String debug) {
assert sourceName == null || sourceName.equals(name) : "inconsistent file name: " + sourceName + " vs " + name;
sourceName = name;
debugInfo = debug;
}
@Override
public void visitSMAP(@NotNull SourceMapper smap, boolean backwardsCompatibleSyntax) {
if (!GENERATE_SMAP) return;
List<FileMapping> fileMappings = smap.getResultMappings();
if (fileMappings.isEmpty()) return;
visitSource(fileMappings.get(0).getName(), SMAPBuilder.INSTANCE.build(fileMappings, backwardsCompatibleSyntax));
}
@Override
public void visitOuterClass(@NotNull String owner, @Nullable String name, @Nullable String desc) {
getVisitor().visitOuterClass(owner, name, desc);
}
@Override
public void visitInnerClass(@NotNull String name, @Nullable String outerName, @Nullable String innerName, int access) {
getVisitor().visitInnerClass(name, outerName, innerName, access);
}
@Override
@NotNull
public String getThisName() {
assert thisName != null : "This name isn't set";
return thisName;
}
}

View File

@@ -50,7 +50,7 @@ class AccessorForFunctionDescriptor(
if (calleeDescriptor.getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION) != null) {
userDataMap = LinkedHashMap<CallableDescriptor.UserDataKey<*>, Any>()
userDataMap[INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION] =
calleeDescriptor.getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION)
calleeDescriptor.getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION)
}
}

View File

@@ -34,10 +34,10 @@ import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.AnnotationChecker;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
import org.jetbrains.kotlin.resolve.checkers.ExpectedActualDeclarationChecker;
import org.jetbrains.kotlin.resolve.constants.*;
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
import org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt;
import org.jetbrains.kotlin.resolve.multiplatform.OptionalAnnotationUtil;
import org.jetbrains.kotlin.types.FlexibleType;
import org.jetbrains.kotlin.types.FlexibleTypesKt;
import org.jetbrains.kotlin.types.KotlinType;
@@ -376,7 +376,7 @@ public abstract class AnnotationCodegen {
// We do not generate annotations whose classes are optional (annotated with `@OptionalExpectation`) because if an annotation entry
// is resolved to the expected declaration, this means that annotation has no actual class, and thus should not be generated.
// (Otherwise we would've resolved the entry to the actual annotation class.)
if (ExpectedActualDeclarationChecker.isOptionalAnnotationClass(classDescriptor)) {
if (OptionalAnnotationUtil.isOptionalAnnotationClass(classDescriptor)) {
return null;
}

View File

@@ -20,14 +20,12 @@ import org.jetbrains.kotlin.codegen.inline.NameGenerator
import org.jetbrains.kotlin.codegen.inline.ReifiedTypeInliner.Companion.putReifiedOperationMarker
import org.jetbrains.kotlin.codegen.inline.ReifiedTypeInliner.OperationKind
import org.jetbrains.kotlin.codegen.inline.ReifiedTypeParametersUsages
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.types.TypeSystemCommonBackendContext
import org.jetbrains.kotlin.types.model.KotlinTypeMarker
import org.jetbrains.kotlin.types.model.TypeParameterMarker
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
interface BaseExpressionCodegen {
val frameMap: FrameMapBase<*>
val visitor: InstructionAdapter
@@ -40,25 +38,14 @@ interface BaseExpressionCodegen {
fun propagateChildReifiedTypeParametersUsages(reifiedTypeParametersUsages: ReifiedTypeParametersUsages)
fun pushClosureOnStack(
classDescriptor: ClassDescriptor,
putThis: Boolean,
callGenerator: CallGenerator,
functionReferenceReceiver: StackValue?
)
fun markLineNumberAfterInlineIfNeeded(registerLineNumberAfterwards: Boolean)
fun consumeReifiedOperationMarker(typeParameter: TypeParameterMarker)
@JvmDefault
fun putReifiedOperationMarkerIfTypeIsReifiedParameter(type: KotlinTypeMarker, operationKind: OperationKind) {
with(typeSystem) {
val (typeParameter, second) = extractReificationArgument(type) ?: return
if (typeParameter.isReified()) {
consumeReifiedOperationMarker(typeParameter)
putReifiedOperationMarker(operationKind, second, visitor)
}
}
}
}
fun BaseExpressionCodegen.putReifiedOperationMarkerIfTypeIsReifiedParameter(type: KotlinTypeMarker, operationKind: OperationKind): Boolean {
val (typeParameter, second) = typeSystem.extractReificationArgument(type) ?: return false
consumeReifiedOperationMarker(typeParameter)
putReifiedOperationMarker(operationKind, second, visitor)
return true
}

View File

@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument
import org.jetbrains.kotlin.resolve.calls.model.ExpressionValueArgument
import org.jetbrains.kotlin.resolve.calls.model.VarargValueArgument
import org.jetbrains.kotlin.resolve.inline.InlineUtil
import org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE
import org.jetbrains.kotlin.types.upperIfFlexible
import org.jetbrains.org.objectweb.asm.Type
@@ -51,7 +52,7 @@ class CallBasedArgumentGenerator(
callGenerator.putValueIfNeeded(
getJvmKotlinType(i),
StackValue.createDefaultValue(valueParameterTypes[i]),
ValueKind.DEFAULT_PARAMETER,
if (InlineUtil.isInlineParameter(valueParameters[i])) ValueKind.DEFAULT_INLINE_PARAMETER else ValueKind.DEFAULT_PARAMETER,
i
)
}

View File

@@ -15,10 +15,9 @@ enum class ValueKind {
GENERAL,
GENERAL_VARARG,
DEFAULT_PARAMETER,
DEFAULT_INLINE_PARAMETER,
DEFAULT_MASK,
METHOD_HANDLE_IN_DEFAULT,
CAPTURED,
DEFAULT_LAMBDA_CAPTURED_PARAMETER,
NON_INLINEABLE_ARGUMENT_FOR_INLINE_PARAMETER_CALLED_IN_SUSPEND,
NON_INLINEABLE_ARGUMENT_FOR_INLINE_SUSPEND_PARAMETER
}
@@ -40,13 +39,9 @@ interface CallGenerator {
}
}
override fun processAndPutHiddenParameters(justProcess: Boolean) {
override fun processHiddenParameters() {}
}
override fun putHiddenParamsIntoLocals() {
}
override fun putHiddenParamsIntoLocals() {}
override fun genValueAndPut(
valueParameterDescriptor: ValueParameterDescriptor?,
@@ -141,9 +136,8 @@ interface CallGenerator {
paramIndex: Int
)
fun processAndPutHiddenParameters(justProcess: Boolean)
fun processHiddenParameters()
/*should be called if justProcess = true in processAndPutHiddenParameters*/
fun putHiddenParamsIntoLocals()
fun reorderArgumentsIfNeeded(actualArgsWithDeclIndex: List<ArgumentAndDeclIndex>, valueParameterTypes: List<Type>)

Some files were not shown because too many files have changed in this diff Show More