Compare commits

..

5402 Commits

Author SHA1 Message Date
Simon Ogorodnik
667dc57a9f WIP: FIR concurrency 2019-07-30 20:08:31 +03:00
Simon Ogorodnik
d31d29bb61 [FIR] concurrency: non-fir changes 2019-07-30 20:08:12 +03:00
Simon Ogorodnik
80e0da1751 WIP: Concurrency 2019-07-25 04:45:29 +03:00
Simon Ogorodnik
ccceacd8cc WIP: Multithreaded compiler 2019-07-17 19:56:54 +03:00
Simon Ogorodnik
379f564a98 Fixup: t 2019-07-17 16:23:11 +03:00
Simon Ogorodnik
2a4dbb3a2a Remove FirTotalKotlinResolveInIdeTest as no more useful 2019-07-17 16:22:57 +03:00
Simon Ogorodnik
b81716a918 Candidate pool WIP 2019-07-16 21:35:50 +03:00
Simon Ogorodnik
f53001a6e1 WIP: Make call resolver resettable 2019-07-16 21:03:55 +03:00
Simon Ogorodnik
7372bb2e5f WIP: Do not recreate body resolve transformer for each file 2019-07-16 20:57:05 +03:00
Mikhail Glukhikh
abadfc50bd FIR resolve: attempt to skip non-valid groups 2019-07-16 13:45:38 +03:00
Mikhail Glukhikh
b99de17e40 ++ Make ... not resolved 2019-07-16 13:29:57 +03:00
Mikhail Glukhikh
f1374612ed FIR resolve: fix vararg parameter types 2019-07-15 18:44:30 +03:00
Mikhail Glukhikh
11df6091fa Make FirNamedReferenceWithCandidate not resolved, fix receiver completion
Counting it as resolved provokes a lot of difficult to discover errors
2019-07-15 18:21:45 +03:00
Mikhail Glukhikh
d11a4f96f2 FIR resolve: add early protection against cyclic property resolve 2019-07-15 17:47:38 +03:00
Mikhail Glukhikh
0b5a5c6d62 Extract part of utility FIR transformers into TransformUtils 2019-07-15 17:34:07 +03:00
Mikhail Glukhikh
45d3e6eb97 Minor (FIR resolve): replace session with fileSession 2019-07-15 17:32:37 +03:00
Mikhail Glukhikh
b16d53c855 Minor (FIR resolve): remove duplicated check 2019-07-15 17:32:37 +03:00
Mikhail Glukhikh
605cd838d5 FIR: set constructor parameter scope correctly for designated transformer 2019-07-15 17:32:36 +03:00
Mikhail Glukhikh
c2caccc175 FIR: preliminary implementation of delegate resolve #KT-32217 Fixed 2019-07-15 17:32:36 +03:00
Mikhail Glukhikh
6e63310b68 Measure unresolved function call & qualified access # in FIR bench 2019-07-15 17:32:36 +03:00
Simon Ogorodnik
67f2259e1a Use no-op substitutor instead of substitutor with empty map 2019-07-15 17:32:36 +03:00
Mikhail Glukhikh
f76356a4fe ++ FIR2IR test data 2019-07-15 17:32:35 +03:00
Simon Ogorodnik
de08dfbc7f FIR resolve: perform inference completion for property access 2019-07-15 17:32:35 +03:00
Mikhail Glukhikh
d5228afa94 ? FIR: questionable invoke refactoring -- breaks FIR2IR test(s) ? 2019-07-15 17:32:14 +03:00
Mikhail Glukhikh
75d315f5c9 Add test (works only partially) for "type from delegate" 2019-07-15 17:07:33 +03:00
Mikhail Glukhikh
43c6049f02 FIR2IR: set origin correctly for synthetic property accesses 2019-07-11 12:46:48 +03:00
Mikhail Glukhikh
c6a09dba4e FIR: consider Java default constructors as primary ones 2019-07-11 12:40:29 +03:00
Mikhail Glukhikh
2ceffa241b FIR: make Java default constructor visibility same with class visibility 2019-07-11 12:38:53 +03:00
Mikhail Glukhikh
14bbbb5bf5 FIR: add test for synthetic property access 2019-07-11 12:37:45 +03:00
Mikhail Glukhikh
c35d7eab70 Refactor FIR symbols to make them and their FIR element types more clear
This commit also fixes work with Java synthetic properties
2019-07-11 12:37:32 +03:00
Sergey Igushkin
701b9ce166 (minor) Minor corrections in K/A/30GradleIT#testOmittedStdlibVersion 2019-07-11 02:04:58 +03:00
technoir
15feeddc46 Allow omitting version of standard artifacts when kotlin-android plugin is used 2019-07-11 01:44:52 +03:00
Sergey Igushkin
0aa80d1912 Fix org.jetbrains.kotlin.native.disabledTargets registered as extension
Do not register an extension, use an extra property instead. This way,
it is less visible for a build author.

Hotfix for commit c292380aff
Issue #KT-29693
2019-07-10 21:12:23 +03:00
Sergey Igushkin
26a8c16166 Fix Gradle task input annotations for Gradle 5.5 checks
* Interface and abstract properties are now checked, too.
  For them, copy the @Input/@Internal annotations from the
  implementations (luckily, they were all consistent).

* Annotating a private property without a public accessor is not not
  allowed. Remove one such annotation.
2019-07-10 21:06:57 +03:00
Nikolay Krasko
e804b58f5f Fix getting logger factory in 182 2019-07-10 20:38:13 +03:00
Sergey Igushkin
4516902aaf Fix metadata transformation for non-published dependencies, KT-32225
Fix dependencies that are added in non-published source sets, which were
omitted from the requested dependencies since their configurations were
not added to the extendsFrom set of the merged configurations.

Also, don't resolve both merged configurations (compile and runtime) in
GranularMetadataTransformation, as the IDE can anyway import only the
compile-scoped dependencies from api & implementation.

Issue #KT-32225 Fixed
2019-07-10 19:37:03 +03:00
Sergey Igushkin
dbc8007c63 Fix visibility for MPP dependencies from non-root source sets, KT-32204
Fix incorrect source sets visibility when a dependency is added to a
non-root source set and its visible source sets are mistakenly treated
as already visible by the dependsOn parents and are thus not extracted
from the metadata package.

To simplify the logic, reuse the GranularMetadataTransformation
instances from the dependsOn parent source sets: they can provide the
requested dependencies sets for the parents and their transformation
results, so that excluding the dependency source sets which are seen
the parents gets simpler.

The issue is then fixed by naturally excluding only the source sets
which are mentioned in the parents' transformation results.

Issue #KT-32204 Fixed
2019-07-10 19:36:57 +03:00
Nikolay Krasko
0da55e8284 Unregister custom logger after use in AbstractGradleMultiplatformWizardTest 2019-07-10 17:52:29 +03:00
Max Medvedev
5d35bebacd Keyword completion: use proper prefix matcher for keyword completion
fixes #KT-32519
2019-07-10 15:54:44 +03:00
Mikhail Glukhikh
ee37a0aa9f Inline callable: keep all usages inside annotation entries
#KT-24596 Fixed
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh
eb00af6b96 CFG: mark annotation arguments as "used as expressions" #KT-24596 Fixed
NB: only classes / function / properties annotations are considered here,
not including local declarations and other annotations
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh
b24b8bfb28 BindingContextUtils: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
b97f187cf6 ControlFlowInformationProvider: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
5e94f537ef Refactoring: use isUsedAsExpression instead of USED_AS_EXPRESSION slice 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
5afa5de1d7 ReplaceWith: don't keep class literal & callable reference in inlining
#KT-30197 Fixed
2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
615aa265f5 Inline: do more precise check before adding this@Labeled #KT-30762 Fixed 2019-07-10 15:10:51 +03:00
Dmitry Gridin
6605e0dfc0 Update test 'moveMultipleFIlesWithImplicitPrefix' 2019-07-10 14:09:37 +03:00
Dmitry Gridin
d2b8535548 Move/copy refactoring: add base support of implicit package prefix
#KT-29720 Fixed
2019-07-10 14:09:37 +03:00
Dmitry Gridin
7c547d8c5a Minor: clean up copy refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin
1a9abaeb2a Clean up move refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin
beba1d82fc ReplaceJavaStaticMethodWithKotlinAnalogInspection: add CommentSaver for case with transform to extension 2019-07-10 14:09:37 +03:00
Dmitry Gridin
56d2961cd9 ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more tests 2019-07-10 14:09:37 +03:00
Dmitry Gridin
82bf21f195 ReplaceJavaStaticMethodWithKotlinAnalogInspection: rename isApplicable(call, context) to isApplicableInContext 2019-07-10 14:09:37 +03:00
Dmitry Gridin
71c0b3caa0 ReplaceJavaStaticMethodWithKotlinAnalogInspection: clean up comments 2019-07-10 14:09:36 +03:00
Dmitry Gridin
8314dbffd5 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null arguments 2019-07-10 14:09:36 +03:00
Dmitry Gridin
8b8858b223 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null receiver 2019-07-10 14:09:36 +03:00
Dmitry Gridin
d47a7234bb ReplaceJavaStaticMethodWithKotlinAnalogInspection: apply inspection on idea module 2019-07-10 14:09:36 +03:00
Dmitry Gridin
026949a758 ReplaceJavaStaticMethodWithKotlinAnalogInspection: remove non-implemented cases 2019-07-10 14:09:36 +03:00
Dmitry Gridin
632158cd52 ReplaceJavaStaticMethodWithKotlinAnalogInspection: simplify Transform for default action 2019-07-10 14:09:36 +03:00
Dmitry Gridin
3aa2401f19 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transform interface
#KT-32454 Fixed
2019-07-10 14:09:36 +03:00
Dmitry Gridin
835532c206 ReplaceJavaStaticMethodWithKotlinAnalogInspection: move to move to inspections.jdk2k subpackage 2019-07-10 14:09:36 +03:00
Dmitry Gridin
b2a60795da ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more cases for Arrays
#KT-32512 Fixed
#KT-30124 Fixed
2019-07-10 14:09:35 +03:00
Dmitry Gridin
24caca1882 ReplaceJavaStaticMethodWithKotlinAnalogInspection: fix false positive for 'Arrays.copyOf'
#KT-32477
2019-07-10 14:09:35 +03:00
Sergey Rostov
4a8dbeda1b Gradle, webpack: add conventional archive properties
#KT-31890 Fixed
#KT-32209 Fixed
2019-07-10 13:26:56 +03:00
Sergey Rostov
b6ca323a5e Gradle, karma, webpack: add required dependencies 2019-07-10 13:26:55 +03:00
Sergey Rostov
8b622955fe Gradle, js, minor: fix typos, formatting and imports 2019-07-10 13:26:55 +03:00
Sergey Rostov
b68582656e Gradle, DtsResolver: use canonical path to avoid files duplication 2019-07-10 13:26:55 +03:00
Sergey Rostov
80068c0a40 Gradle, js: fix task annotations 2019-07-10 13:26:55 +03:00
Sergey Rostov
3c606c27a1 Gradle, js: support generating kotlin external declarations from .d.ts
#KT-31703 Fixed
2019-07-10 13:26:55 +03:00
Sergey Rostov
2fb4d23f1e Gradle, js, KotlinProjectNpmResolution: index by compilation 2019-07-10 13:26:54 +03:00
Sergey Rostov
7332290ece Gradle, js, NpmDependency: getDependenciesRecursively 2019-07-10 13:26:54 +03:00
Sergey Rostov
50e07330f4 Gradle, js, resolver, requireInstalled: close resolving if kotlinNpmResolve is up-to-date 2019-07-10 13:26:54 +03:00
Sergey Rostov
1860097c08 Gradle, js, npm resolver: support custom package json entries, index files and extensions 2019-07-10 13:26:54 +03:00
Sergey Rostov
88fa396d26 Gradle, js, resolver: don't skip reading lock file while skipping package manager execution 2019-07-10 13:26:54 +03:00
Sergey Rostov
d1789b07ad Gradle, js, yarn: store resolved version and integrity hash to NpmDependency 2019-07-10 13:26:54 +03:00
Sergey Rostov
d051748e2b Gradle, js, npm: support scopes 2019-07-10 13:26:54 +03:00
Sergey Rostov
5e6c76a6e7 Gradle, execWithProgress: report description as first progress 2019-07-10 13:26:53 +03:00
Sergey Rostov
638554ba1c Gradle, JS, resolver: don't add files that are not existed, add kjsm files 2019-07-10 13:26:53 +03:00
Sergey Rostov
bcf894aba3 Gradle, JS, resolver: return null if npm dependency being resolved before kotlinNpmInstall 2019-07-10 13:26:53 +03:00
Sergey Rostov
8b0dffe182 Gradle, JS, compilation resolver: close dependent compilation resolver when it's packageJson task is up-to-date 2019-07-10 13:26:53 +03:00
Sergey Rostov
3658ad785f Gradle, JS, NpmResolutionManager: cleanup and document states 2019-07-10 13:26:53 +03:00
Sergey Rostov
327d75dc5d Gradle, JS: Extract NpmResolutionManager 2019-07-10 13:26:53 +03:00
Sergey Rostov
982f08ce7a Gradle, JS: replace NodeJs plugin and extension with NpmResolver plugin 2019-07-10 13:26:52 +03:00
Sergey Rostov
2f90742809 Gradle, JS: rework nodejs extensions and plugins
Get rid of Project.nodeJs
2019-07-10 13:26:52 +03:00
Sergey Rostov
24f08a614e Gradle, GradleNodeModulesCache: use new ProcessedFilesCache API 2019-07-10 13:26:52 +03:00
Sergey Rostov
fd2d99e205 Gradle, ProcessedFilesCache: use file as target type (not string)
recompute removed target directories
2019-07-10 13:26:52 +03:00
Sergey Rostov
9679403831 Gradle, ProcessedFilesCache: optimize serialization
JSON kept for debugability
2019-07-10 13:26:52 +03:00
Sergey Rostov
dff48b251d Gradle, JS: rework extension registering and resolver phasing
This allows to resolve projects lazily.

#KT-32393 Fixed
#KT-31565
#KT-32015
#KT-31917
2019-07-10 13:26:52 +03:00
Sergey Rostov
f4dcc18baf Gradle, JS: rework NpmResolver
Now resolving works per compilation, so transitive dependency between
 compilations in same project can be resolved (KT-31917).

Resolving gradle configurations now occurs in separate
per-project `KotlinPackageJsonTask`s. Global install called in
`KotlinNpmInstallTask`. Tasks inputs configured, so tasks now
reported as UP-TO-DATE if nothing was changed.

#KT-31565 Fixed
#KT-32015 Fixed
#KT-31917 Fixed
2019-07-10 13:26:51 +03:00
Ilya Kirillov
196e3f968e New J2K: fix generating nj2k tests bunch files 2019-07-10 13:21:53 +03:00
Ilya Kirillov
cabc26184b New J2K: convert single Java static import statements 2019-07-10 13:19:23 +03:00
Ilya Kirillov
b18350e9c8 New J2K: fix ExceptionInInitializerError in JKJavaPrimitiveTypeImpl 2019-07-10 13:19:23 +03:00
Ilya Kirillov
f0dd21790a New J2K: add plain text copy-paste conversion test for new J2K 2019-07-10 13:18:36 +03:00
Ilya Kirillov
041677ab1b New J2K: force use old j2k for all not file/copy-paste conversions 2019-07-10 13:16:54 +03:00
Ilya Kirillov
8f69cca2b3 New J2K: enable new J2K by default 2019-07-10 13:16:53 +03:00
Ilya Kirillov
ba3927b580 New J2K: add default null value to property with type parameter type when it is implicit in Java
#KT-32436 fixed
2019-07-10 13:16:53 +03:00
Ilya Kirillov
9d6338afb2 New J2K: do not fail conversion if some of post-processings throws exception 2019-07-10 13:16:53 +03:00
Ilya Kirillov
a9865e5d7b New J2K: check for element validity before applying fix in diagnostic-based post processings 2019-07-10 13:16:53 +03:00
Ilya Kirillov
236f62be2a New J2K, minor: refactor code builder 2019-07-10 13:16:52 +03:00
Ilya Kirillov
934425e86a New J2K: rearrange and optimize some post-processings 2019-07-10 13:16:52 +03:00
Ilya Kirillov
370f113b78 New J2K: run add/remove modifiers post-processings only single time && do not call resolve in them for some corner cases 2019-07-10 13:16:52 +03:00
Ilya Kirillov
3e04bfb156 New J2K: do not print modifiers which are going to be removed in postprocessing 2019-07-10 13:16:52 +03:00
Natalia Selezneva
0b7b16162d 182: scripts, pass File finding script definition instead of File.name 2019-07-10 12:05:17 +03:00
Roman Artemev
6ab46204cb [JS IR BE] Properly handle primary constructors
- force primary constructor to be created by codegen
 - make sure initializer is invoked once in primary constructor
 - make one of coroutine constructor primary
 - remove hack from codegen
2019-07-10 10:39:11 +03:00
Roman Artemev
a112345418 [JS IR BE] Fix builtin constructor lowering
- Do not touch delegation construction call
2019-07-10 10:39:11 +03:00
Roman Artemev
131158df65 [JS IR BE] Refact MultipleCatchLowering
- catch dynamic type instead of common super type over all catch blocks
2019-07-10 10:39:11 +03:00
Roman Artemev
1605dc3251 [JS IR BE] Remove unused classifier symbol from IrTypeOperatorCall builder 2019-07-10 10:39:10 +03:00
Nicolay Mitropolsky
69c4db82d4 Uast: IdeaKotlinUastResolveProviderService analyze as BodyResolveMode.PARTIAL_WITH_CFA
it is required for `isUsedAsResultOfLambda` in `KotlinULambdaExpression`
2019-07-10 10:33:10 +03:00
Dmitry Gridin
fda5692fc6 RemoveCurlyBracesFromTemplateInspection: add heuristic to change severity
Change severity to INFORMATION if a variable hasn't whitespace around & add an option to return the old behavior
 #KT-31717 Fixed
2019-07-10 10:28:45 +03:00
Natalia Selezneva
e4d0c2cb0e Scripts: switch ScriptReportSink to new scripting API
Use ScriptDiagnostic instead of ScripReport
2019-07-10 10:10:21 +03:00
Natalia Selezneva
bd0f947222 Refactor script reports: introduce getter, check that report are changed inside attach method 2019-07-10 10:10:21 +03:00
Natalia Selezneva
68b45ce1dc FromFileAttributeScriptDependenciesLoader should be applicable when there are scriptCompilationConfiguration file attribute 2019-07-10 10:10:20 +03:00
Natalia Selezneva
923e89db69 Provide toString method for ScriptCompilationConfigurationWrapper
This is needed for debug and logging proposes
2019-07-10 10:10:20 +03:00
Natalia Selezneva
7215e03a47 Scripts: rewrite search without usage of legacy script definition 2019-07-10 10:10:20 +03:00
Natalia Selezneva
4853190752 Scratch: should always have default script definition 2019-07-10 10:10:20 +03:00
Natalia Selezneva
b0c9339dee Scripts: search for script definition using PsiFile instead of file name 2019-07-10 10:10:07 +03:00
Natalia Selezneva
fbe965be9d Scripts: pass File finding script definition instead of File.name 2019-07-10 10:08:19 +03:00
Vladimir Dolzhenko
ac4df86fa6 Fix performance test compilation 2019-07-10 09:44:11 +03:00
Andrey Uskov
9da630a1ac Fix compilation of KotlinMPPGradleProjectResolver in bunch 192 2019-07-10 02:07:37 +03:00
Vladimir Dolzhenko
3c41db654a Fix performance test compilation for 192 2019-07-09 20:49:21 +03:00
Ilya Gorbunov
7d14fb756d Make Duration storageUnit inline val to avoid state initialization
Avoid state initialization in JS and Native
2019-07-09 20:39:28 +03:00
Alexander Udalov
f7fc5d2ffa Fix codegen for JvmOverloads with more than 32 parameters
Use DefaultCallArgs to handle mask list construction correctly

 #KT-31070 Fixed
2019-07-09 19:31:59 +02:00
Andrey Uskov
40633768bc Implement dependency deduplication in order to reduce memory
consumption during import process
2019-07-09 20:14:07 +03:00
Andrey Uskov
09c2b2800c Migrate collections to arrays for memory optimisation
during import process
2019-07-09 20:13:44 +03:00
Andrey Uskov
f6f072693a Fully disable editing target platforms for HMPP modules. Show
java target platform version in Facets
2019-07-09 20:13:17 +03:00
Andrey Uskov
c98ad923bd Import list of pure kotlin source roots from gradle
in facet settings for inspections
#KT-32300 Fixed
2019-07-09 20:12:55 +03:00
Andrey Uskov
2665fff373 Import package prefix from MPP projects 2019-07-09 20:12:13 +03:00
Andrey Uskov
2b6f566d58 Import package prefix from gradle
#KT-19693 Fixed
2019-07-09 20:11:48 +03:00
Vladimir Dolzhenko
dbec626a49 Fix performance test compilation for 182 2019-07-09 19:43:18 +03:00
Vyacheslav Gerasimov
ffb65b2655 Build: Fix kotlinBuildProperties, should always proguard on teamcity 2019-07-09 19:19:58 +03:00
Vyacheslav Gerasimov
8605ad6630 Build: Upgrade gradle to 5.5 2019-07-09 19:19:27 +03:00
Alexander Udalov
a6be6f4986 Use Class.forName instead of ClassLoader.loadClass in reflection
This fixes an issue in constructing annotation instances with array
class elements. For some reason, behavior of `ClassLoader.loadClass`
differs from `Class.forName` in handling arrays, namely:

* `loadClass("[Ltest.Foo;")` returns null
* `Class.forName("[Ltest.Foo;")` returns class for array of test.Foo

Overall, there doesn't seem to be any way to load an array class with
`CLassLoader.loadClass`.

We pass initialize=false to forName because this is the behavior of
ClassLoader.loadClass: it doesn't perform class initialization (e.g.
<clinit> is not executed).

 #KT-31318 Fixed
2019-07-09 18:14:45 +02:00
Vladimir Dolzhenko
72d74ff888 Add build gradle kts performance tests 2019-07-09 17:27:33 +03:00
Sergey Igushkin
c292380aff Improve Kotlin/Native disabled targets warning, KT-29693
* Group all disabled targets from all subprojects in a single warning
* Make the warning optional, suggest disabling it with a Gradle property

Issue #KT-29693 Fixed
2019-07-09 16:01:18 +03:00
Alexander Udalov
dabb7bb496 Fix new inference CLI tests on Windows 2019-07-09 11:52:54 +02:00
Mikhael Bogdanov
b82c32a807 Use default target for android tests 2019-07-09 09:46:34 +02:00
Roman Artemev
d4fb76c1da [JS IR BE] Fix overriding property of Throwable 2019-07-09 10:40:01 +03:00
Roman Artemev
d9c6d38715 [JS IR BE] Fix private members lowering
- visit over file instead of class
2019-07-09 10:40:01 +03:00
Ilya Gorbunov
7573fcde53 Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
2019-07-09 03:39:25 +03:00
Ilya Gorbunov
686bcb830e Bit query and bit rotation functions for UInt, ULong, UShort, UByte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov
39bdf34b9f Use common implementation of fastLog2 based on countLeadingZeroBits 2019-07-08 19:09:32 +03:00
Ilya Gorbunov
f8724654a1 Bit query and bit rotation functions for Int, Long, Short, Byte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov
32fc131d62 Rename jvm actuals from Numbers to NumbersJVM
Rename multifile facade to from MathKt to NumbersKt to avoid confusion
with kotlin.math.MathKt
2019-07-08 19:09:32 +03:00
Steven Schäfer
da8fb3a195 JVM_IR: Respect -Xno-param-assertions 2019-07-08 17:48:33 +02:00
Steven Schäfer
dd20b74030 Split GenerateNotNullAssertionsTests into standard box and bytecode tests 2019-07-08 17:48:33 +02:00
Simon Ogorodnik
dfd0042a5b Do not create single element list if only one candidate 2019-07-08 16:59:50 +03:00
Mikhail Glukhikh
f434248cb7 FIR property getter: take return type from property even if it's error 2019-07-08 16:59:45 +03:00
Mikhail Glukhikh
d96c66adac FIR: partially implement invoke resolution 2019-07-08 16:59:37 +03:00
Toshiaki Kameyama
2ca0056cd0 ReplaceGuardClause inspection: check contracts availability 2019-07-08 16:36:19 +03:00
Toshiaki Kameyama
8cbcb66197 ReplaceGuardClause inspection: don't report when argument is not String 2019-07-08 16:36:18 +03:00
Toshiaki Kameyama
90b0ea73dc Add inspection for check/require/checkNotNull/requireNotNull
#KT-30640 Fixed
#KT-22412 Fixed
2019-07-08 16:36:18 +03:00
Toshiaki Kameyama
64780293d3 "Redundant visibility modifier" inspection: don't report for property getter
#KT-32347 Fixed
2019-07-08 16:14:35 +03:00
Ilya Chernikov
a96a938f87 Fix creating of the script definition from legacy template
adding classpath needed to load template and related class to the
appropriate host configuration
fixes tests
2019-07-08 13:20:06 +02:00
Dmitry Gridin
d3810bfcae Add operator modifier by inspection on idea module 2019-07-08 13:03:22 +03:00
Dmitry Gridin
795dcfa8ff Minor: clean up some quickfixes & refactorings 2019-07-08 13:03:22 +03:00
Yan Zhulanow
9ba7907b81 Fix compatibility issues with third-party plugins
This commit fixes compatibility with these plugins:
1. com.wuhao.code.check:1.4.5
2. net.lagerwey.cucumber-kotlin:1.1.1
3. cat.helm.clean:0.1.1-SNAPSHOT
4. no.tornado.tornadofx.idea:1.7.17.2
5. com.gmail.blueboxware.libgdxplugin:1.20
2019-07-08 16:25:20 +09:00
Yan Zhulanow
36e1149e51 Light classes: Fix getTextOffset() and getTextRange() for property accessors
Before this commit, getTextOffset() and getTextRange() coming from the super class, returned numbers for the property, not for its accessor. This commit fixes the inconsistency.
2019-07-08 16:25:20 +09:00
Yan Zhulanow
7078302e6c Light classes: Fix getTextOffset() for identifiers
Before this commit, getTextOffset() and getTextRange() implementations were inconsistent.
2019-07-08 16:25:19 +09:00
Yan Zhulanow
0f4085066f Debugger: Do not assume we are inside the class body when in '}' (KT-15259) 2019-07-08 16:25:19 +09:00
Yan Zhulanow
a8efb349ed Debugger, minor: Remove debugger labels in dispatch receivers
In anonymous classes/lambdas the debug name becomes something like 'this@<anonymous>' that doesn't make much sense to the user.
It's more correct to show just 'this'.
2019-07-08 16:25:19 +09:00
Yan Zhulanow
8f20f0b963 Debugger: Do not calculate default source file if an alternative one is available 2019-07-08 16:25:19 +09:00
Yan Zhulanow
d45bbaabcd Debugger: Fix missing NOPs in optimized Unit.INSTANCE calls (KT-31702) 2019-07-08 16:25:19 +09:00
Ivan Gavrilovic
f60bf5cb97 KT-31127: register only generated Java sources to AGP
When adding generated Java sources to AGP using Variant API,
add only Java sources. This was already done in
a6ae4494167c9d4cca23995457c59fb2daedad39 for Java projects, and this
commit fixes the same issue for Android projects.

Test: Kapt3Android33IT.testKotlinProcessorUsingFiler
2019-07-08 16:25:18 +09:00
Jiaxiang Chen
2c102ecd57 Replicate old backend's naming logic for captured receiver parameter and extension receiver parameters.
Context for determine if a value parameter is captured from outer
context is not directly available after lowering, hence introduce a new
IrDeclarationOrigin for captured receiver parameter to avoid duplicate
calculation.
2019-07-08 16:25:18 +09:00
Yan Zhulanow
9760c156a4 Debugger: Fix breakpoints on if/loops with constant conditions (KT-14421) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6fc801afd2 Debugger: Make calls to LocalVariableProxyImpl.type lazy
Avoid unnecessary calls to getType() in variables and fields.
2019-07-08 16:25:18 +09:00
Yan Zhulanow
91565076e2 Debugger: Fix property accessor evaluation in scripts (KT-23526) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6686ed2e38 Evaluator: Do not report parsing error on empty block/expression (KT-11938) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6d7d524b9b Debugger: Fix 'expect fun' evaluation from common code (KT-26742) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
873f4a1b08 Debugger: Accept empty code fragment contexts (KT-19556) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
188ed82081 Debugger: Handle closure receivers came from outer callables properly (KT-31709) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
577f32740e Debugger: Fix isDumb contract in evaluator (KT-31510) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
c2f0286183 Debugger: Prefer the closest captured values 2019-07-08 16:25:17 +09:00
Yan Zhulanow
4fe6431b0f Debugger: Disable value rendering in watches by default (KT-19084) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
0f3d85716c Debugger: Fix test, synthetic this variable is now hidden in Kotlin variables mode 2019-07-08 16:25:16 +09:00
Yan Zhulanow
1eab78124a Debugger: Fix private member priority test 2019-07-08 16:25:16 +09:00
Yan Zhulanow
54f78a2920 Debugger: Remove debugger-related hacks in resolution
Candidate ordering should be the same in ordinary Kotlin code and in evaluated expressions.
With the invention of 'foo_field' syntax, there is no need to do these nasty things any more.
2019-07-08 16:25:16 +09:00
Yan Zhulanow
b4f515a436 Debugger: Support Kotlin variables for inlined lambdas inside inline functions (KT-31418) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
afa0bec6f6 Debugger: Change the inline depth calculation heuristics, fix debugging for inlined lambdas (KT-30919) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
9c9d2b5ad4 Minor: Rename constant to match its meaning 2019-07-08 16:25:16 +09:00
Yan Zhulanow
5777592024 Debugger: Support captured values (KT-30740) 2019-07-08 16:25:15 +09:00
Yan Zhulanow
f16459df32 Pill: Support 'runtimeOnly' dependency configuration 2019-07-08 16:25:15 +09:00
Mikhail Zarechenskiy
6eefea6715 Add tests for obsolete issues
#KT-32395 Obsolete (fixed in 42a5c488)
 #KT-32388 Obsolete (fixed in f3e4c9cd)
 #KT-32271 Obsolete (fixed in 60a0cf1)
2019-07-06 10:06:04 +03:00
Svyatoslav Kuzmich
675f01ee80 [JS IR BE] Set Throwable subtype name in extendThrowable function 2019-07-05 19:31:23 +03:00
Leonid Startsev
4379780ff8 Fixed extra argument in function call after rebase 2019-07-05 18:48:51 +03:00
Leonid Startsev
80ddac64e0 Add serializers for primitive arrays to default types list 2019-07-05 18:14:34 +03:00
Ilya Chernikov
cfceeb1e8c Implement direct bindings to script properties mapping in the JSR-223 implementation
fix infrastructure and codegen parts
2019-07-05 17:02:10 +02:00
Ilya Chernikov
4940f64265 Refactor scripting infrastructure - convert usages to the new entities 2019-07-05 17:02:10 +02:00
Ilya Chernikov
80ada5113e Fix flaky test 2019-07-05 17:02:10 +02:00
Alexander Udalov
37002748c8 Do not wrap and display cause's message in compiler exceptions
In case the wrapped exception message contains some long text (bytecode,
IR, etc.), it could be displayed several times in the same stack trace,
which significantly worsened the experience of parsing such stack traces
2019-07-05 15:55:01 +02:00
Dmitry Gridin
430aed6559 Minor: clean up code 2019-07-05 19:28:02 +07:00
Toshiaki Kameyama
1f89c0f730 "Convert to sealed class" intention: don't suggest when no "class" keyword
#KT-32365 Fixed
2019-07-05 19:28:02 +07:00
Toshiaki Kameyama
9786564d75 "Remove argument name" intention: remove array literal brackets for annotation vararg argument
#KT-32318 Fixed
2019-07-05 19:18:40 +07:00
Juan Chen
d33d1913cb Not throw exception when cidr has been registered already
This is to avoid failures from some Android Studio tests depending on cidr.
2019-07-05 12:57:48 +03:00
Toshiaki Kameyama
9f6e88d571 Formatter: format around safe cast operator as? (KT-32324)
#KT-32324 Fixed
2019-07-05 12:57:48 +03:00
Toshiaki Kameyama
44e9090931 Formatter: format between type reference and 'by' keyword (KT-32277)
#KT-32277 Fixed
2019-07-05 12:57:47 +03:00
Nikolay Krasko
0b8f35c04d Revert "Register mock injection language manager in compiler"
This reverts commit 674badc6

Since idea 192.5587.17 idea has own InjectedLanguageManager registration
and fails because of duplicate.

org.junit.ComparisonFailure: exception: org.picocontainer.defaults.DuplicateComponentKeyRegistrationException: Key com.intellij.lang.injection.InjectedLanguageManager duplicated
	at com.intellij.util.pico.DefaultPicoContainer.registerComponent(DefaultPicoContainer.java:123)
	at com.intellij.util.pico.DefaultPicoContainer.registerComponentInstance(DefaultPicoContainer.java:331)
	at com.intellij.mock.MockComponentManager.registerService(MockComponentManager.java:89)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerJavaPsiFacade(KotlinCoreEnvironment.kt:162)
	at com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:55)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:27)
	...
2019-07-05 09:08:15 +03:00
Dmitry Gridin
f9b53da0fa Attempt to fix some inspection tests 2019-07-05 13:02:52 +07:00
Roman Artemev
8a569cc698 [JS IR BE] Do not create $default stub for external function and any its fake override 2019-07-04 22:59:12 +03:00
Roman Artemev
28a108a205 [JS IR BE] Visit callable reference members in private member lowering 2019-07-04 22:59:12 +03:00
Roman Artemev
b4c68025a7 [JS IR BE] Improve error reporting 2019-07-04 22:59:12 +03:00
Vyacheslav Karpukhin
940c9e5604 192: build against IDEA 192.5587.17 2019-07-04 20:23:58 +02:00
Svyatoslav Kuzmich
a2625c7bc8 [JS IR BE] Don't render null messages in Throwable
Set message property to 'undefined' to make Error.prototype.toString
skip it
2019-07-04 18:33:23 +03:00
Svyatoslav Kuzmich
94aebd0101 [JS IR BE] Proper support for String and Any constructors
Remove workarounds from codegen
2019-07-04 17:03:47 +03:00
Roman Artemev
d7cb3e05ef [JS IR BE] Replace 32bit default String.hashcode with 64bit cityhash for UniqID
Split uniqID space into two part 63 bit each.
2019-07-04 12:49:30 +03:00
Dmitry Gridin
46eb929bd1 ControlFlowWithEmptyBodyInspection: shouldn't report on while with comments
#KT-32419 Fixed
2019-07-04 16:33:24 +07:00
Nikolay Krasko
6e750b0857 Enable API watcher in Kotlin
When Api Watcher plugin is installed this will activates pre-commit
checks in the project.
2019-07-04 11:54:22 +03:00
Nikolay Krasko
ef90353831 Another test-runtime java plugin dependency 2019-07-04 11:54:22 +03:00
Nicolay Mitropolsky
5d081efe60 Uast: tests for no implicit returns in lambdas (KT-32370) 2019-07-04 10:53:48 +03:00
Nicolay Mitropolsky
a180d78eaf Uast: implicit returns for local function bodies (KT-32370) 2019-07-04 10:53:48 +03:00
Nicolay Mitropolsky
f85ebe7f43 Uast: implicit returns for lambda expressions (KT-32370) 2019-07-04 10:53:48 +03:00
Svyatoslav Kuzmich
631a09e541 [JS IR BE] ThrowableLowering: Use dynamic operators instead of jsSetJSField intrinsic 2019-07-03 20:37:49 +03:00
Svyatoslav Kuzmich
871180cdc0 [JS IR BE] Fix setting names of Throwable subclasses without primary constructor 2019-07-03 20:37:49 +03:00
Svyatoslav Kuzmich
918d470e1b [JS IR BE] Simplify throwable lowering.
- Make kotlin.Throwable class extenral
- Add runtime function 'extendThrowable' to use instead of delegating
  constructors to Throwable
2019-07-03 20:37:48 +03:00
Svyatoslav Kuzmich
6d1f893a5a [JS IR BE] Move object instance creation lowerings to IR 2019-07-03 20:37:48 +03:00
Svyatoslav Kuzmich
5dcb0ee016 [JS IR BE] Reduce JsScope usage in codegen 2019-07-03 20:37:48 +03:00
Jeffrey van Gogh
a9c8fd903b reduce calls to Object.hashCode originating from LabelNormailizationMethodTransformer
Building on the work in #2403, shaves 1% of compilation time on kotlinx.serialization
by using SmartIdentityTable instead of hashMap in LabelNormailizationMethodTransformer.

Metrics on the prior hashMap use in this code:

| What      | Count |
| --------- | ----- |
| instances | 21530 |
| min       | 0     |
| max       | 174   |
| mean      | 4     |
| stddev    | 8.24  |
| median    | 4     |
| 90p       | 8     |
| 95p       | 15    |
2019-07-03 19:25:57 +02:00
Alexander Udalov
361c468c33 IR: move type utilities from IrTypeUtils.kt to irTypePredicates.kt
Multiple IrType extensions were incorrectly calling isNameInPackage
which actually checked if the name of the type's classifier _starts_
with the given string, not equals it. Move them to irTypePredicates,
which seems a more natural place for these extensions anyway. Move
isKClassArray to JVM backend utilities, since this is JVM-specific
behavior at the moment. Fix minor warnings/inspections
2019-07-03 19:10:03 +02:00
Alexey Tsvetkov
7c6f48df39 Revert "Set sourceCompatibility and targetCompatibility for JavaCompile tasks"
This reverts commit 290aded9
2019-07-03 12:47:36 +03:00
Alexey Tsvetkov
2a3bb2968e Revert "Call configureJvmProject once per project in afterEvaluate"
This reverts commit 33de71f7
2019-07-03 12:47:23 +03:00
Alexey Tsvetkov
ab6174defd Revert "Check JDK env vars once during configuration when not syncing"
This reverts commit 48b86bba
2019-07-03 12:47:10 +03:00
Alexey Tsvetkov
aa7aff84fc Revert "Do not fork java compile tasks when current JDK can be used"
This reverts commit f2021b58
2019-07-03 12:46:50 +03:00
Alexey Tsvetkov
9340bffd02 Revert "Add ext.jvmTarget and ext.javaHome to core:descriptors.runtime"
This reverts commit 35dea296fa.
2019-07-03 12:40:02 +03:00
Andrey Uskov
1a290621b0 Minor. Update multiplatform kotlin plugin version in HMPP tests 2019-07-03 11:49:04 +03:00
Andrey Uskov
e079615cdf Add possibility to edit target platform for non-HMPP projects in order to keep ability to edit target platform for IDEA-based projects 2019-07-02 22:46:48 +03:00
Andrey Uskov
efb0e692ae Minor. Reformat KotlinFacetEditorGeneralTab 2019-07-02 22:46:47 +03:00
Andrey Uskov
9fc60be9d8 Fix serialization of facet settings in order to read properly
settings of native platforms
2019-07-02 22:46:47 +03:00
Andrey Uskov
404ce1a8c1 Facet serialization changed in order to keep compatibility with previous
versions of Kotlin plugin
2019-07-02 22:46:46 +03:00
Andrey Uskov
87e75bd4cc HMPP: fix importing target platforms for case when JVM targets are involved 2019-07-02 22:46:45 +03:00
Andrey Uskov
8445e3a2a4 HMPP: add importing tests 2019-07-02 22:46:45 +03:00
Andrey Uskov
8280c647af HMPP: Migration of source root types for middle HMPP source sets fixed 2019-07-02 22:41:49 +03:00
Andrey Uskov
90187c959e Add test for 'isHMPP' flag 2019-07-02 22:41:02 +03:00
Andrey Uskov
e791b9d3f7 HMPP: import flag indicating that the project uses HMPP feature 2019-07-02 22:40:19 +03:00
Alexey Tsvetkov
35dea296fa Add ext.jvmTarget and ext.javaHome to core:descriptors.runtime
After the following changes:
* 290aded94f
* 33de71f792

default values of jvmTarget and javaHome started to overwrite properties
set through compileJava in core:descriptors.runtime
2019-07-02 17:37:59 +03:00
Vyacheslav Gerasimov
d3f9d0866a Build: Improve cache redirector usage in buildSrc settings.gradle 2019-07-02 17:30:06 +03:00
Nikolay Krasko
8b05d4df46 More NoClassDefFoundError fixes in tests after 192 update 2019-07-02 16:45:42 +03:00
Ilya Matveev
ba64600ee5 Gradle: Make K/N properties uniform with other Kotlin properties
Names of project properties used by K/N (e.g.
org.jetbrains.kotlin.native.home) are not uniform
with other kotlin properties (e.g. kotlin.coroutines).

This patch renames these properties by dropping the
'org.jetbrains' prefix and adds corresponding
deprecation warnings.

Issue #KT-32302 Fixed
2019-07-02 19:46:50 +07:00
Ilya Matveev
fd1fc7d28a Gradle: Support K/N restricted distribution
Restricted distribution is a K/N distribution built for MacOS only
alongside with a regular distribution and containing no platform
libraries for MacOS. This commit allows switching between
distribution types using a special project property.

Issue #KT-32301 Fixed
2019-07-02 19:46:49 +07:00
Ilya Matveev
35d7fff035 Gradle: Fix input annotation for the Webpack task 2019-07-02 19:46:48 +07:00
Alexey Tsvetkov
f2021b580e Do not fork java compile tasks when current JDK can be used
I see the following improvements:
* `clean dist --parallel` is ~10% faster (from 3:40 to 3:20)
* incremental `dist --parallel` is ~50% faster
(adding public method to org.jetbrains.kotlin.utils.SmartList)
2019-07-02 15:18:19 +03:00
Alexey Tsvetkov
48b86bba69 Check JDK env vars once during configuration when not syncing
Previous code (callback in `beforeTask`) was added to allow
opening project without setting up all env. variables.
This change simplifies the code and avoids a callback,
while keeping the ability to open the project without
setting up all variables by checking `kotlinBuildProperties.isInIdeaSync`
2019-07-02 15:18:19 +03:00
Alexey Tsvetkov
33de71f792 Call configureJvmProject once per project in afterEvaluate
Calling it twice does not seem to make sense now
2019-07-02 15:18:19 +03:00
Alexey Tsvetkov
290aded94f Set sourceCompatibility and targetCompatibility for JavaCompile tasks
Currently running build with JAVA_HOME pointing to
any JDK != 1.8 results in errors like

    #KT-30382 Fixed
2019-07-02 15:18:19 +03:00
Anton Bannykh
f8035096ea JS: lock tape version to avoid kotlin.test + tape integration test failure 2019-07-02 15:14:07 +03:00
Mikhail Zarechenskiy
60ac2056bd Update diagnostic message in test data
Follow-up of 42a5c488: function `unCapture` is used to render
 diagnostic messages, therefore we have this change now
2019-07-02 14:02:07 +03:00
Nikolay Krasko
a67c3ef855 Update 183 branch to 183.6156.11 2019-07-02 14:00:26 +03:00
Nikolay Krasko
2d85d18a74 Minor: add more exceptions to project dictionary 2019-07-02 14:00:25 +03:00
Nikolay Krasko
28a45909a0 Fix compatibility with 192 branch (KT-32364) 2019-07-02 14:00:24 +03:00
Nikolay Krasko
ba2ca5ae3c Fallback to simple oocb when per-language trackers are disabled (KT-32364) 2019-07-02 14:00:11 +03:00
Nikolay Krasko
f605d4e73b Revise per module out-of-code-block (KT-32364) 2019-07-02 13:59:35 +03:00
Nikolay Krasko
73eea6f4b6 Minor: rename file before refactoring 2019-07-02 13:59:21 +03:00
Nikolay Krasko
4f678c8289 Create project service with Kotlin trackers (KT-32364) 2019-07-02 13:59:19 +03:00
Nikolay Krasko
263d8eea16 Use Kotlin oocb instead of platform oocb tracker (KT-32364) 2019-07-02 13:59:06 +03:00
Nikolay Krasko
557ea54a9f Introduce Kotlin specific out-of-code-block tracker (KT-32364) 2019-07-02 13:59:04 +03:00
Nikolay Krasko
12bb1a5bd1 Make invalidateOnOOCB explicit in ResolverForProjectImpl and remove usage in tests 2019-07-02 13:45:35 +03:00
Nikolay Krasko
b32b362810 Extract KotlinModuleModificationTracker to separate file 2019-07-02 13:45:35 +03:00
Nikolay Krasko
26c7eddb03 Move trackers to caches.trackers package 2019-07-02 13:45:35 +03:00
Nikolay Krasko
2ddcd9f0af Minor: cleanup and reformat KotlinCodeBlockModificationListener.kt 2019-07-02 13:45:35 +03:00
Vladimir Dolzhenko
2029d16062 Add add-imports performance tests
Add missed auto generated perf tests
2019-07-02 09:58:04 +03:00
Dmitry Gridin
57a732c247 Minor: fixes after review 2019-07-02 11:54:38 +07:00
Dmitry Gridin
9316f45a5c Optimize Imports: improve tooltip information
#KT-21374 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin
074829bcea Import: IDE should import class from root package
#KT-21422 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin
148eed2a12 ShortenReferences: fix false negative for object call chain
#KT-32320 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin
33914a3a94 ImportMemberIntention: make more flexible based on caret position
#KT-31924 Fixed
2019-07-02 11:54:38 +07:00
Dmitriy Dolovov
6f2f60869c Minor: Don't create unnecessary PluginId instances
(to avoid PluginId cache pollution)
2019-07-02 10:49:43 +07:00
Anton Bannykh
208c8f9339 JS: fix bootstrap 2019-07-01 20:22:05 +03:00
Svyatoslav Kuzmich
69962cbf8c [JS IR BE] Add JsExport annotations 2019-07-01 18:55:41 +03:00
Svyatoslav Kuzmich
685597d20a [JS IR BE] Codegen class model refactorings
Reduce JsScope usage
2019-07-01 18:55:41 +03:00
Steven Schäfer
e7a5e5b4a0 JVM_IR: Handle annotation KClass fields in external declarations 2019-07-01 16:16:23 +02:00
Steven Schäfer
1ab0b76af3 Minor: use more descriptive argument name 2019-07-01 15:49:12 +02:00
Steven Schäfer
078ccbf077 JVM_IR: Implement name mangling exceptions for Result class. 2019-07-01 15:49:12 +02:00
Steven Schäfer
d458e4a7b2 JVM_IR: Enable inlining for external declarations with inline class parameters. 2019-07-01 15:49:12 +02:00
Natalia Selezneva
da86ef8454 Fix tests for long command line: create folder instead of file
Compiler doesn't allow files as classpath roots
2019-07-01 16:41:56 +03:00
Natalia Selezneva
30222582f4 Scratch tests: print test output at onFinish to avoid multiple calls of invokeLater
Multiple calls of invokeLater significantly affects test speed
2019-07-01 16:41:56 +03:00
Natalia Selezneva
85f07927c9 Minor: check output with errors in scratch tests 2019-07-01 16:41:55 +03:00
Natalia Selezneva
784cc17d21 Do not use deprecated UIUtil.invokeLaterIfNeeded. Use TransactionGuard instead 2019-07-01 16:41:55 +03:00
Natalia Selezneva
63246f57d2 Scripts: drop sdk caches on project root change event
Otherwise old invalid roots may be saved
2019-07-01 16:41:55 +03:00
Natalia Selezneva
d981135c4b Scratch: finish execution if no new lines was executed
^KT-32062
2019-07-01 16:41:55 +03:00
Leonid Startsev
7ef9fb5511 Export deserialization constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/443
2019-07-01 14:56:10 +03:00
Mark Punzalan
969478481e Move extension receiver to value parameters for static functions created
during InlineClassLowering phase.

This was the only place where both dispatch and extension receivers were
NOT moved to value parameters, which meant that the receivers were not
following the conventional ordering.

Merged createStaticBodilessMethod with createStaticFunctionWithReceivers
and the latter was moved to backend/common/ir/IrUtils.kt.
2019-07-01 13:24:08 +02:00
Mark Punzalan
1abdf0561a Generate synthetic functions for local functions with default values, by
re-ordering the lowering phases.

The changes in InterfaceLowering are necessary so that IrElements that
target the removed functions are re-targeted to the new functions in
DefaultImpls. This affects local functions in interface functions since
now LocalDeclarationsLowering comes before InterfaceLowering.
2019-07-01 13:24:08 +02:00
Vyacheslav Gerasimov
d2f1852c5e Build: Upgrade gradle to 5.4.1 2019-07-01 14:14:55 +03:00
Alexey Tsvetkov
ffa191d91d Fix filling Main-Class attribute in manifest file of output jar
Before 5b7cee6221 JVM CLI compiler
was calling `KotlinToJVMBytecodeCompiler.compileBunchOfSources`.
`compileBunchOfSources` detected possible main classes,
and filled the Main-Class attribute in output jar
if if there was only one candidate.

After the change JVM CLI began calling
`KotlinToJVMBytecodeCompiler.compileModules`, which was not searching for a main class.

This change adds searching for main classes to `compileModules`.
We search for a main class only when one module is compiled,
and an output is written a jar file (so the change only affects JVM CLI compilation).

    #KT-32272 Fixed
2019-07-01 13:57:04 +03:00
Mikhail Zarechenskiy
515e666733 [NI] Fix exception on incomplete try/catch block
There was an inconsistency on creating PSI call and corresponding
 descriptor. See variable `catchBlocks` from visitor, it's created
 only if PSI elements are not null, but for descriptor parameters
 there wasn't such check

 #KT-32134 Fixed
 #EA-139748 Fixed
2019-07-01 12:59:37 +03:00
Mikhail Zarechenskiy
42a5c488c1 [NI] Fix OnlyInputTypes annotation support for top-level captured types
#KT-32157 Fixed
 #KT-32116 Fixed
 #KT-32235 Fixed
 #KT-32218 Fixed
2019-07-01 12:59:35 +03:00
Mikhail Zarechenskiy
c2cf4aa2b5 [NI] Move ability to convert standalone SAM-argument under the feature
If new inference is enabled only for IDE analysis, then this feature
 will be disabled to reduce difference between new and old inference,
 but if new inference is enabled in the compiler, then this feature
 will be enabled too to preserve behavior of new inference for
 compilation

 #KT-32175 Fixed
 #KT-32143 Fixed
 #KT-32123 Fixed
 #KT-32230 Fixed
2019-07-01 12:53:33 +03:00
Mikhael Bogdanov
4d82b02f83 Properly set parent inside copied bodies 2019-07-01 07:56:32 +02:00
Toshiaki Kameyama
3a77b63c85 Completion: don't propose the same name for arguments of lambda (KT-9792)
#KT-9792 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
c442d69db6 Extend selection: select just KDoc if cursor is just before the KDoc (KT-16476)
#KT-16476 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
8afa938723 Extend selection: select escaped identifier name without backticks (KT-31499)
#KT-31499 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
9b04af9968 Complete statment for function call: fix wrong right parenthesis place (KT-31595)
#KT-31595 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
bd661fcf82 Method sepatators: separate single-expression functions (KT-30782)
#KT-30782 Fixed
2019-06-29 20:36:55 +03:00
Toshiaki Kameyama
ade51588f9 Insert paired brackets: insert space after right brace of nested lambda (KT-28098)
#KT-28098 Fixed
2019-06-29 20:36:54 +03:00
Toshiaki Kameyama
49d6bbbd6b Quick doc: fix missing line break for enum constant (KT-30985)
#KT-30985 Fixed
2019-06-29 20:36:54 +03:00
Georgy Bronnikov
f332aff4ce Mute back tests that still fail 2019-06-28 19:44:04 +03:00
Georgy Bronnikov
3a9b94235f JVM_IR: generate facade classes for imported toplevel declarations 2019-06-28 17:34:49 +03:00
Sergey Rostov
bb0f467f63 Gradle, JS: don't project.getTasksByName inside task realization callback
Or project evaluation would be called

#KT-32072 Fixed
2019-06-28 15:28:21 +03:00
Anton Bannykh
fadeac083f JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed) 2019-06-28 13:49:22 +03:00
Anton Yalyshev
d972d50296 small fix of FUS J2K merge conflict 2019-06-28 12:32:17 +03:00
Ilya Kirillov
01c866632d New J2K: add FUS statistics for J2K conversions 2019-06-28 12:32:17 +03:00
Anton Yalyshev
cf885789ff created FUS Group for J2K 2019-06-28 12:32:16 +03:00
Vladimir Dolzhenko
ccfe155f58 Add highlight and completion performance tests 2019-06-28 10:37:29 +02:00
Vyacheslav Gerasimov
4531d2a7b4 Build: restore service files relocation for kotlin-reflect 2019-06-27 19:51:58 +03:00
Igor Chevdar
e8ac22e238 Fixed some IR tests on enums 2019-06-27 19:04:01 +03:00
Igor Chevdar
1e8f7c2b7d Removed IrCallWithShallowCopy 2019-06-27 19:04:01 +03:00
Igor Chevdar
5a01ad799e [Serializer] Bumped ABI version 2019-06-27 19:04:00 +03:00
Igor Chevdar
dff0ac8866 [Serializer] UniqId clashes handling 2019-06-27 19:04:00 +03:00
Igor Chevdar
b62e9487d1 Fixes in IrValidator 2019-06-27 19:04:00 +03:00
Igor Chevdar
595a549188 [IR] Fixes related to IR validation 2019-06-27 19:04:00 +03:00
Igor Chevdar
175dfb41b6 [IrSerializer] Supported all annotations + refactoring 2019-06-27 19:04:00 +03:00
Vyacheslav Gerasimov
bdcf674c79 Build: Remove dependency on missing task :kotlin-main-kts:dist 2019-06-27 18:33:51 +03:00
Sergey Rostov
59411e1a28 Build: flags for comparing gradle and jps 2019-06-27 17:56:52 +03:00
Sergey Rostov
f35680e823 Build: cleanup stdlib/jps-build/build.gradle.kts 2019-06-27 17:56:52 +03:00
Sergey Rostov
6647d8fd93 Build: remove mergeServiceFiles from reflectShadowJar 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
2d6a3cb2c8 Build: Introduce flag for disabling jar post processing
proguard, relocation, etc.
2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
6e20e03cbc Build: Reuse archive from project build logic for building jars 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
ec157a43ba Build: Add jar-resources directory to kotlin-main-kts 2019-06-27 17:56:52 +03:00
Vyacheslav Gerasimov
22bbbeb1ec Build: Fix manifest for kotlin-compiler in jps build
Trigger manifest generation from jar task during jps import
2019-06-27 17:56:51 +03:00
Vyacheslav Gerasimov
fc68bb46dc Build: Move compiler.xml extensions to cli-common 2019-06-27 17:56:51 +03:00
Vyacheslav Gerasimov
e49cd527bc Build: Remove version from libraries copied to lib of ide plugin 2019-06-27 17:56:51 +03:00
Vyacheslav Gerasimov
373a250b28 Build: Exclude common stdlib only from dist/lib contents configurations 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
e7ba9e5e4e Build: Fix kotlin-daemon-client-new compile classpath for jps build 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
0e7de4df41 Build: Fix embedded configuration import in jps build
Should affect only test configurations
2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
ca37cb0028 Build: Remove jps hacks from kotlin-main-kts-test 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
7864c40bb1 Build: Force child projects evaluation while importing jps 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
947783833f Minor: Cleanup jps.gradle.kts 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
286b9f5233 Build: Add jps artifact for kotlinc 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
c76138c55c Build: Drop obsolete jps artifact generation 2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
db8a4a52da Build: Add JPS artifact for kotlin-compiler.jar
JPS build assumes fat jar is built from embedded configuration,
but we can't use it in gradle build in :prepare:compiler project
since slightly more complex processing is required like stripping
metadata & services from some jars
2019-06-27 17:56:50 +03:00
Vyacheslav Gerasimov
64f2298703 Build: Extract jarContentsFromConfiguration dsl helper 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
31c3955940 Build: Add workaround dist root artifact referencing auto-generated dist
We can't set output-path and build-on-make from idea-ext plugin
2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
72be81ba46 Build: Add JPS artifact for dist 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
86ad25ba55 Build: Add jps artifact for kotlin-reflect 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
3138757d66 Build: Add jps artifact for kotlin-compiler-client-embeddable 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
7149fc75f5 Build: Add jps artifact for kotlin-main-kts 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
1f795882c4 Build: Extract kotlin-plugin.jar to separate jps artifact 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
5c72fed918 Build: Add jps artifact for kotlin-imports-compiler-dumper 2019-06-27 17:56:49 +03:00
Vyacheslav Gerasimov
9b7a5e87d1 Build: Include project main source set output in jar 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
d24c56e08d Build: Add jps artifact for kotlin-daemon-client.jar 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
12b4cf3f0e Build: Add jps artifact for kotlin-jps-plugin.jar 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
55b1ee9a17 Build: Fix premature configuration resolution in kotlin-test-js-it 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
62126d0e43 Build: Fix idea plugin dependencies for JPS build
we interpret embedded configuration as runtime in JPS and need to exclude embedded jars while copying libs
2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
12ba0efd19 Build: Use embedded configuration in kotlin-compiler-client-embeddable 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov
6cf5514f6e Build: Fix jps import for jvm-abi-gen plugin 2019-06-27 17:56:47 +03:00
Vyacheslav Gerasimov
4f090f2744 Build: Use default jar task in kotlin-daemon-client 2019-06-27 17:56:47 +03:00
Vyacheslav Gerasimov
a10a261894 Build: Workaround wrong import of transitive libraries in Idea 2019-06-27 17:56:47 +03:00
Vyacheslav Gerasimov
bbfa2646fd Minor: Cleanup :prepare:compiler build script 2019-06-27 17:56:47 +03:00
Alexander Udalov
3800d57691 Fix behavior of multiple methods in IrTypeSystemContext
Make sure implementations are the same as in ClassicTypeSystemContext
and ConeTypeSystemContext
2019-06-27 16:43:07 +02:00
Alexander Udalov
445c4ebe65 Do not inherit IrTypeSystemContext from TypeSystemInferenceExtensionContext
This inheritance was not used. Moreover, multiple methods were
implemented incorrectly and/or inconsistently with the base
implementation at ClassicTypeSystemContext
2019-06-27 16:43:07 +02:00
Alexander Udalov
cf6ff8c6b3 Simplify implementation of TypeSystemCommonSuperTypesContext.typeDepth 2019-06-27 16:43:07 +02:00
Alexander Udalov
331f0291ce Minor, remove TypeSystemContext.isNotNullNothing
Use equivalent isNothing instead
2019-06-27 16:43:07 +02:00
Alexander Udalov
c452934f5b Pull isNullableType and related extensions up into TypeSystemContext 2019-06-27 16:43:07 +02:00
Alexander Udalov
9131ff3626 Move IrType.isNullable to 'ir.tree' 2019-06-27 16:43:06 +02:00
Alexander Udalov
29a144cee7 Minor, move IrClass.primaryConstructor to 'ir.tree' 2019-06-27 16:43:06 +02:00
Ilmir Usmanov
0a37cb561b Minor. Regenerate IrBlackBoxInlineCodegenTestGenerated 2019-06-27 17:02:22 +03:00
Nikolay Krasko
78aaf62734 Disable internal plugin bunch check if separate plugin is installed 2019-06-27 16:03:39 +03:00
Igor Yakovlev
a1462407f9 Avoid to change singleton test project descriptor
#KT-32276
2019-06-27 16:01:50 +03:00
Leonid Startsev
a3218da1c3 Add IDE diagnostic on @Serializable classes for non-applied serialization plugin 2019-06-27 15:55:38 +03:00
Toshiaki Kameyama
fb94cb141f Add "Add constructor parameter" quick fix for NO_VALUE_FOR_PARAMETER
#KT-27353 Fixed
2019-06-27 19:19:25 +07:00
Alexander Gorshenev
aa73420312 Provide the default hashing function 2019-06-27 13:56:25 +03:00
Igor Yakovlev
8b40005b0c UL classes flaky tests partially fix
#KT-32276 - Reduce affected tests count from 117 cases to 2 cases
2019-06-27 12:46:02 +03:00
Ilya Chernikov
5fe85e4767 Attempt to fix flaky testSimpleRepl 2019-06-27 10:42:16 +02:00
Mikhael Bogdanov
9b6fef005f Simplify LocalDeclarationsLowering, support declaration pop up via separate lower
1. Scheme of capturing local variables not touched
 2. Lowered local functions are transposed to the nearest class (including local) or file
 3. Local classes are also transpose to the nearest class (including local) or file
2019-06-27 08:07:01 +02:00
Mikhael Bogdanov
bb48e756ca Minor. Simplify and clean IrElementVisitorVoidWithContext/IrElementTransformerVoidWithContext 2019-06-27 08:06:59 +02:00
Ilya Gorbunov
d58c8c68d5 Fix replacement for deprecated Math.pow #KT-32083 2019-06-27 05:22:25 +03:00
AJ Alt
ed96197d6b Always use LF line endings in generated stdlib code
The code generation uses a mixture of literal `\n` characters and `appendln`. The latter insert `\r\n` on Windows by default, causing generated files to contain a mixture of line endings.

This commit sets the `line.separator` system property for the generator to `\n` so that `appendln` will never insert `\r` characters. As an additional measure, `.gitattributes` files were added to checkout generated stdlib files always with LF line endings.
2019-06-27 03:02:10 +03:00
Ilmir Usmanov
7a096b305f Do not mangle functions with inline classes when the only inline class
in arguments is kotlin.Result.
Fix returnTarget for suspend function views.
2019-06-26 22:28:08 +03:00
Vladimir Dolzhenko
4ac324a939 Fix performanceTests compilation errors on 182 2019-06-26 20:13:21 +02:00
Ilya Kirillov
3926be900d New J2K: remove accidentally added println call in conversions 2019-06-26 18:36:05 +03:00
Ilya Kirillov
0dfaae2bb4 New J2K: add some tests from obsolete issues 2019-06-26 18:36:05 +03:00
Ilya Kirillov
98be5d8ed0 New J2K: add copy-paste tests for new j2k 2019-06-26 18:36:05 +03:00
Ilya Kirillov
dc469cbdbf New J2K: remove incorrect modifiers in post processing 2019-06-26 18:36:05 +03:00
Ilya Kirillov
3beef2b22e New J2K: do not apply diagnostic based inspections if target element is not in the converting range 2019-06-26 18:36:05 +03:00
Ilya Kirillov
1b681a7dd6 New J2K: correctly handle empty range marker in post processings 2019-06-26 18:36:05 +03:00
Igor Yakovlev
d7f28d9e19 Fix flaky tests for incorrect language version recognition
(UltraLightFacadeClassTestGenerated.testCoroutines and UltraLightClassLoadingTestGenerated.testCoroutines tests)
2019-06-26 16:32:24 +03:00
Igor Yakovlev
4c1d0678eb Remove class delegate requests from annotations and modifier lists
(#EA-144876 and #EA-144882 Fixed)
2019-06-26 16:32:24 +03:00
Igor Yakovlev
3146b12471 Fix UL inline class delegate loading for tooComplex case (#KT-31950 Fixed) 2019-06-26 16:32:24 +03:00
Sergey Igushkin
685f56e179 Fix slow AndroidSubPlugin#getCommonResDirectories, KT-29538
Replace a functionally-built file collection that filters files against
multiple original file collections upon each evaluation with a
lazy file sets intersection that is evaluated only once.

Issue #KT-29538 Fixed
2019-06-26 16:18:08 +03:00
Dmitry Petrov
991c87b9c2 Minor: remove empty JvmCoercionToUnitPatcher.kt 2019-06-26 16:16:04 +03:00
Nikolay Krasko
b7c12014ee Modify dependencies for 192 branch: more dependencies to full java plugin 2019-06-26 14:11:23 +03:00
Ilya Chernikov
6ea1d92841 Implement main-kts test with command-line compiler 2019-06-26 13:01:40 +02:00
Ilya Chernikov
432d500c40 Fix custom script definition cashing and script validity check:
- reorder initialization logic, so that script definitions are
  requested only after plugins loading
- clear definitions cache after adding explicit definitions or sources

#KT-32206 fixed
#KT-32169 fixed

Note: any of these modification fix the problem alone, but the second
may prevent other similar problems, while the first fixes actual logic
of the script validity checks as well.
2019-06-26 13:01:39 +02:00
Ilya Chernikov
1b8cd9b731 Implement command-line REPL smoke test 2019-06-26 13:01:39 +02:00
Ilya Chernikov
3c1c9ca523 Fix jline proguarding in the compiler: fixes cli REPL
#KT-32085 fixed
2019-06-26 13:01:39 +02:00
Natalia Selezneva
b3e08c0b61 Minor: remove debug code 2019-06-26 13:47:34 +03:00
Natalia Selezneva
b503b29c51 Report exception from script definition loading to third party plugin if it's present 2019-06-26 13:47:34 +03:00
Natalia Selezneva
2fce671d0d Scripts, AsyncScripDependenciesLoader: notifyRootsChanged should return false in case when no dependencies are loaded 2019-06-26 13:47:33 +03:00
Natalia Selezneva
be82979a49 Add dot before file extension at Scripting Settings Tab 2019-06-26 13:47:33 +03:00
Natalia Selezneva
cccc17b139 Fix compatibility for 'com.centurylink.mdw.studio' plugin 2019-06-26 13:47:33 +03:00
Natalia Selezneva
08e599ea5b Scripts: show notification only when compilation configuration is changed 2019-06-26 13:47:32 +03:00
Natalia Selezneva
fa2b9b11d6 Check classpath jars before applying script compilation result from file attributes
^KT-32061 Fixed
2019-06-26 13:47:32 +03:00
Anton Bannykh
d6c10d24e1 JS IR: move inliner to common part; inline suspendCoroutineUninterceptedOrReturnJS 2019-06-26 13:13:39 +03:00
Toshiaki Kameyama
e3c9134904 Add "Convert to notNull delegate" quick fix for INAPPLICABLE_LATEINIT_MODIFIER
#KT-12515 Fixed
2019-06-26 17:07:32 +07:00
Dmitry Petrov
b3b7e26985 Make InsertImplicitCasts work with Descriptors and KotlinTypes again
This is a temporary change to make sure IrType infrastructure work is in
master.

It causes some of irText tests to work incorrectly (as in master).
2019-06-26 10:07:13 +03:00
Dmitry Petrov
8da5f6b955 IR: fixes after rebase 2019-06-26 09:39:17 +03:00
Dmitry Petrov
339291b01f psi2ir: update testData 2019-06-26 09:39:16 +03:00
Dmitry Petrov
7a44b0f951 IR: IrTypeOperatorCall.classifierSymbol can be computed from typeOperand 2019-06-26 09:39:16 +03:00
Dmitry Petrov
18c3778250 Minor: cleanup IrLazyProperty 2019-06-26 09:39:16 +03:00
Dmitry Petrov
1b5d077452 Minor: explicitly throw exception if declaration parent is not set 2019-06-26 09:39:16 +03:00
Dmitry Petrov
8e7ae3a996 Minor: IrTypeCheckerContext.removeExactAnnotation 2019-06-26 09:39:16 +03:00
Roman Artemev
6a82ffdc5e [JS IR BE] Make tests work 2019-06-26 09:39:16 +03:00
Dmitry Petrov
760806a1ac IR: IMPLICIT_DYNAMIC_CAST
Generate IMPLICIT_DYNAMIC_CAST for implicit casts from `dynamic` to `T`
2019-06-26 09:39:16 +03:00
Dmitry Petrov
422c13bd03 IR: add docs for IrTypeOperator's 2019-06-26 09:39:16 +03:00
Dmitry Petrov
1d9cb39915 psi2ir: fix nullability assertion generation for platform types
Incorporate PR from Steven Schäfer into IrType-based implicit cast
insertion (commit 17b925636e8717e7648c5d7b792c6ab4d18f776d).

NB this still uses originalKotlinType to determine if the type was
nullability flexible. It is somewhat error-prone and something we want
to get rid of. However, it boils down to some design questions related
to implicit null checks in Kotlin - e.g., it might be Ok to just treat
nullability flexible type `T!` as `T?` in IR, generate null checks for
all usages of type `T?` where a non-null type is expected, and later
eliminate the null checks that are redundant according to the (quite
conservative) criterion in the redundant null check elimination.
2019-06-26 09:39:16 +03:00
Dmitry Petrov
ab38430ded psi2ir: irText/.../types: NI vs OI 2019-06-26 09:39:15 +03:00
Dmitry Petrov
38ad56fb78 psi2ir: Update testData for intersection type tests
Actually, IrType-based InsertImplicitCasts provides proper casts here.
2019-06-26 09:39:15 +03:00
Dmitry Petrov
3fa671943c psi2ir: coerce SAM conversion arguments to corresponding function types
Given an expression with SAM conversion, e.g.:
```
  fun test(a: Any?) {
    if (a is () -> Unit) {
      Runnable(a).run()
    }
  }
```
Here `Runnable(a)` expects `a` to be a value of functional type
`() -> Unit` (and corresponding type check makes smart cast possible).

Relation between `Runnable` and `() -> Unit` is somewhat non-trivial,
is implemented in terms of KotlinTypes and DeclarationDescriptors,
and so should be encapsulated in psi2ir if possible.
Thus, psi2ir generates IR such as
```
TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION ...
  TYPE_OP type=kotlin.Function0<kotlin.Unit> origin=IMPLICIT_CAST ...
    [| a |]
```
and InsertImplicitCasts knows that IMPLICIT_CAST actually might be
unnecessary (which also allows to use InsertImplicitCasts in some other
context that might require IMPLICIT_CAST rewriting, such as inlining).
2019-06-26 09:39:15 +03:00
Roman Artemev
332b191546 Fix ir type substitutor 2019-06-26 09:39:15 +03:00
Roman Artemev
7ac3f56a43 Fix InsertImplicitCasts to test isSubtypeOf 2019-06-26 09:39:15 +03:00
Roman Artemev
0c74eef500 Implement IrType context 2019-06-26 09:39:15 +03:00
Roman Artemev
3fc1419d01 [IR] Implement TypeChecker context and full isSubtypeOf/commonSuperType for IrType 2019-06-26 09:39:15 +03:00
Roman Artemev
b7d098af56 [IR] Implement captureFromArguments for IrType 2019-06-26 09:39:15 +03:00
Roman Artemev
d4e561baf6 [IR] Support IrType in type checker 2019-06-26 09:39:15 +03:00
Mikhail Zarechenskiy
c77f18fbe6 [NI] Support callable references on qualified types with generics
#KT-32154 Fixed
2019-06-26 00:23:12 +03:00
nikita.movshin
b8ccd98a17 Add changelog for 1.3.40 2019-06-25 19:33:10 +03:00
Pavel Punegov
e9aec54f59 Ignore test in native because it doesn't support 40 parameters 2019-06-25 19:12:41 +03:00
Ilmir Usmanov
0ada383281 Move addFunctionOverride to AddContinuationLowering 2019-06-25 16:30:02 +03:00
Ilmir Usmanov
c613e04962 Do not try to create view of suspend function descriptor on IR BE
Keep container source in wrapped descriptor
2019-06-25 16:30:02 +03:00
Ilmir Usmanov
53878b6961 Do not generate synthetic accessors of local functions as suspend 2019-06-25 16:30:02 +03:00
Ilmir Usmanov
48e64e8a07 Use WrappedSimpleFunctionDescriptor instead of real one for
suspend function views
2019-06-25 16:30:02 +03:00
Ilmir Usmanov
ca421e0aa5 Do not generate empty bodies for suspend functions 2019-06-25 16:30:01 +03:00
Ilmir Usmanov
95a65ba94d Restore order of lowerings 2019-06-25 16:30:01 +03:00
Ilmir Usmanov
60cbf0696d Do not generate tests with experimental coroutines on JVM_IR backend
Enable working tests.
2019-06-25 16:30:01 +03:00
Ilmir Usmanov
0628783308 Move coroutines-related stuff to AddContinuationLowering 2019-06-25 16:30:00 +03:00
Ilmir Usmanov
8306c28117 Generate continuation class for suspend lambdas
generate state-machine for coroutines.
2019-06-25 16:30:00 +03:00
Ilmir Usmanov
f369324520 Generate continuation class for named functions
TODO: Generate label and result for suspend lambdas
2019-06-25 16:30:00 +03:00
Ilmir Usmanov
379390c472 Introduce add continuation pass, which transforms each suspend function
and call to have additional continuation parameter.
2019-06-25 16:30:00 +03:00
Mikhail Zarechenskiy
b3a05b1e0d [IDE-NI-MIGRATE] Update test-data after switching to NI 2019-06-25 15:55:47 +03:00
Alexander Gorshenev
76088cdf00 Bind WrappedVariableDescriptorWithAccessors in IR deserializer 2019-06-25 15:18:04 +03:00
Mikhail Zarechenskiy
48f25385ac [NI] Don't use old common supertype calculator in NI 2019-06-25 14:09:45 +03:00
Mikhail Zarechenskiy
60a0cf1fcc [NI] Fix exception: don't try to compute type depth on null type
#KT-32184 Fixed
2019-06-25 14:09:42 +03:00
Mikhail Zarechenskiy
a26cf86af7 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-25 14:09:38 +03:00
Mikhail Zarechenskiy
bc0773b219 [NI] Capture receiver of invoke-based call
#KT-32133 Fixed
2019-06-25 14:09:34 +03:00
pyos
54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Nikolay Krasko
674badc692 Register mock injection language manager in compiler
In 192 it's important to have service registered since
f204718c88

Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'value' of com/intellij/openapi/util/UserDataHolderBase.putUserDataIfAbsent must not be null
	at com.intellij.openapi.util.UserDataHolderBase.$$$reportNull$$$0(UserDataHolderBase.java)
	at com.intellij.openapi.util.UserDataHolderBase.putUserDataIfAbsent(UserDataHolderBase.java)
	at com.intellij.openapi.util.NotNullLazyKey.getValue(NotNullLazyKey.java:41)
	at com.intellij.lang.injection.InjectedLanguageManager.getInstance(InjectedLanguageManager.java:41)
	at com.intellij.psi.impl.PsiCachedValue.isVeryPhysical(PsiCachedValue.java:74)
	at com.intellij.psi.impl.PsiCachedValue.anyChangeImpliesPsiCounterChange(PsiCachedValue.java:57)

Reproduced with Fir2IrTextTestGenerated
2019-06-25 11:49:00 +03:00
Nikolay Krasko
ebcf306ecc Update proguard rules for 192 idea 2019-06-25 11:48:59 +03:00
Nikolay Krasko
5119979571 Fix compile warnings with 192.5118.30 in backward compatible way 2019-06-25 11:48:59 +03:00
Nikolay Krasko
beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Nikolay Krasko
997d896557 Inline ORDER_ENTRY_TYPE_ATTR to fix compilation in 192 branch 2019-06-25 11:48:58 +03:00
Nikolay Krasko
96f0f444ad Remove dependency to IconLoader from compiler 2019-06-25 11:48:58 +03:00
Nikolay Krasko
aa079376e7 Fix signing artifacts (KT-32192)
Broken in f1e3e26e6cd6e38b473ffe1a23b19b68ebb2d11f.

----
> Task :kotlin-reflect:signArchives FAILED
Build time for tasks:
Compiling kotlin: 1.44s (12.33% of total time)
Processing jars: 4.28s (36.75% of total time)
Uncategorized: 5.39s (46.26% of total time)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotlin-reflect:signArchives'.
> Duplicate key Signature kotlin-reflect:jar.asc:asc:
---

 #KT-32192 Fixed
2019-06-25 11:46:17 +03:00
Dmitry Gridin
2ef2c358c4 RedundantLetInspection: fix descriptions 2019-06-25 15:10:17 +07:00
Dmitry Gridin
7e0db3d612 ComplexRedundantLetInspection: fix highlight for multiple line receiver
#KT-31278 Fixed
2019-06-25 14:37:04 +07:00
Dmitry Gridin
b97aaf0f71 Split ReplaceSingleLineLetInspection to SimpleRedundantLet & ComplexRedundantLet
Relates to #KT-32010
2019-06-25 14:37:04 +07:00
Dmitry Gridin
8e0bbe7d4a Convert ReplaceSingleLineLetIntention to inspection & decrease severity to INFORMATION
#KT-32010 Fixed
2019-06-25 14:37:04 +07:00
Dmitry Gridin
ea76ea6fb8 Minor: cleanup ReplaceSingleLineLetIntention 2019-06-25 14:37:04 +07:00
Amaury
bb0ee8ca0a Fix typo in jdksFinder.kt 2019-06-25 09:33:43 +02:00
Anton Yalyshev
c8ad7b95cd small refactoring: hashSets are replaced by sets 2019-06-25 09:14:04 +03:00
Anton Yalyshev
de02fcb626 it doesn't need to override second invoke(..) for FUS, as they both are called during refactoring 2019-06-25 09:14:04 +03:00
Anton Yalyshev
1acb89d760 added PullUp and PushDown cases to set of possible values for Refactorings collector 2019-06-25 09:14:04 +03:00
Anton Yalyshev
2adcb6d616 fixed a set of possible values for New File Templates collector 2019-06-25 09:14:03 +03:00
Anton Yalyshev
edf467febf added lists of possible values for Evaluator collector 2019-06-25 09:14:03 +03:00
Anton Yalyshev
1a4a6bb0ff added lists of possible values for Refactoring, NewFileTemplate and NPWizards collectors 2019-06-25 09:14:03 +03:00
Anton Yalyshev
eb5ab1cc52 added lists of possible values for buildSystemTarget collectors 2019-06-25 09:14:03 +03:00
Alexander Udalov
edce35a643 Minor, remove obsolete coroutines-related code from mapBuiltInType 2019-06-24 19:15:17 +02:00
Alexander Udalov
10d1adca03 Minor, fix typo in kdoc in JavaToKotlinClassMap 2019-06-24 19:15:17 +02:00
Roman Artemev
97203973ac [JS IR BE] Fix coroutine context 2019-06-24 20:14:19 +03:00
Roman Artemev
544443f113 [JS IR BE] Initialize module dependencies in the correct order 2019-06-24 20:14:19 +03:00
Simon Ogorodnik
9d4fbf8cbd FIR: reuse scopeSession in call resolver & implicit typed ref resolution 2019-06-24 18:51:15 +03:00
Simon Ogorodnik
bc7c822b74 FIR resolve: stop visiting receiver hierarchy during call completion 2019-06-24 18:51:14 +03:00
Mikhail Glukhikh
046c82ab60 FIR: remove unused utility function 2019-06-24 18:51:13 +03:00
Simon Ogorodnik
0e60af95bf Optimization: make every FIR node extend FirPureAbstractElement 2019-06-24 18:51:12 +03:00
Mikhail Glukhikh
d41c50d6cf FIR: support type inference for assignments, fix related lambda inference 2019-06-24 18:51:03 +03:00
Mikhail Glukhikh
48cea4b800 FIR: take expected type into account during inference
NB: this commit provokes some inference problems,
which are fixed by next commit about type inference for assignments
2019-06-24 18:42:52 +03:00
Mikhail Glukhikh
1e1f4d4472 ConeTypeContext: handle "recursive type alias" situation 2019-06-24 18:42:51 +03:00
Mikhail Glukhikh
152abbfb4c ConeTypeContext: handle star projection more correctly
See substitutionSupertypePolicy & testInnerTP in FIR smoke diagnostics
2019-06-24 18:42:29 +03:00
pyos
6a21285aed JVM_IR: do not generate two nullary constructors
when the primary constructor with @JvmOverloads has default values for
all arguments.
2019-06-24 14:58:45 +02:00
ghedeon
40957ad46a KT-17916: Import popup does not indicate deprecated classes 2019-06-24 16:49:33 +07:00
Dmitry Gridin
8c84f885ac Cleanup: apply RemoveRedundantQualifierNameInspection to idea 2019-06-24 15:56:33 +07:00
Dmitry Gridin
f1e2ba728f RemoveRedundantQualifierNameInspection: fix case with non-static java functions 2019-06-24 15:56:30 +07:00
Dmitry Gridin
0b16c51baf RemoveRedundantQualifierNameInspection: fix false positive
#KT-32112 Fixed
2019-06-24 15:17:10 +07:00
Dmitry Gridin
a170de2c56 RemoveRedundantQualifierNameInspection: support class literal expression
#KT-32046 Fixed
2019-06-24 15:17:09 +07:00
Dmitry Gridin
b930c061a8 RemoveRedundantQualifierNameInspection: context should evaluated once for KtUserType 2019-06-24 15:17:09 +07:00
Mikhail Glukhikh
ac730a693a FIR: don't count implicit built-in type as a kind of implicit type
Before this commit, implicit Unit type for function with body and
without type, implicit Boolean type for conditions etc. were 'implicit'
types and resolved types together.
Sometimes this could lead to hard-to-find issues in FIR resolve, because
'implicit' types are usually handled there as 'necessary to resolve'
which is wrong for such effectively-resolved types.
2019-06-24 10:13:26 +03:00
Toshiaki Kameyama
2efbc6e914 Explicit this inspection: fix false positive with subclass and extension
#KT-27550 Fixed
2019-06-24 09:34:08 +03:00
Jeffrey van Gogh
1dbe487077 Reduce compiler runtime overhead of MaxStackFrameSizeAndLocalsCalculator
Profiling the compilation of kotlinx.serialization, MaxStackFrameSizeAndLocalsCalculator
causes ~7% of the runtime to be spent in java.lang.Object.hashCode

This is through two uses:
- visitMaxs(..) has a pushed hashSet that causes ~2%
- labelWrappersMap used to attach additional data to asm Labels, causes ~ 5%

visitMaxs can use the existing SmartSet (not to be confused with SmartHashSet)

Analysis of the visitMaxs HashSet creation & sizes:

| What               | Amount |
| calls to visitMaxs | 4416   |
| max pushed	     | 158    |
| median pushed	     | 4      |
| average pushed     | 5.20   |
| stddev pushed	     | 7.66   |
| 90 percentile      | 10     |

Analysis of labelWrappersMap creation & sizes:

| What               | Amount |
| ------------------ | ------ |
| hashtables created | 4006   |
| max entries        | 175    |
| median entries     | 5      |
| average entries    | 6.10   |
| stdev entries      | 8.28   |
| 90 percentile      | 11     |

testing with a non hash based map using an array for keys and an array for values
showed that the cost of MaxStackFrameSizeAndLocalsCalculator became neglible to
the overall running time.

SmartIdentityTable is a Map like structure that uses reference identity for keys.
It uses 2 arrays to store keys & values until the number of entries stored is larger than 10.
At that point it switches to using an IdentityHashMap.

This structure can be used instead of HashMap when reference identity can be used and
the number of entries inserted is small (<= 10) on average, drastically reducing the overhead
of calls to Object.hashCode

Between the two changes, compilation of kotlinx.serialization through kotlinc
commandline decreased from 14 seconds to 11 seconds on my machine
2019-06-21 18:51:22 +02:00
Svyatoslav Kuzmich
0b19a4a32b [JS IR BE] Initial version of member namer 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
3e10de9cd1 [JS IR BE] Fixup property accessors 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
84d48b8c7b [IR BE] Don't override private declarations 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
7796d084e1 [JS IR BE] Generate fileds for all properties 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
14ec30dd5a [JS IR BE] Lower property accessors in PrimitiveCompanionLowering 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
19b0bb8d0f [JS IR BE] Minor codegen refactoring 2019-06-21 17:02:01 +03:00
Dmitry Petrov
79d4b46d2b KT-32044 Fix unsigned integer coercion in loop intrinsics 2019-06-21 16:30:23 +03:00
Dmitry Petrov
0b580b2741 Refactor: SimpleBoundedValue, AbstractBoundedValue -> BoundedValue class 2019-06-21 16:30:22 +03:00
victor.petukhov
bfeb9537ee Exclude functional types for the warning reporting about implicitly inferred a type parameter to Nothing 2019-06-21 15:52:01 +03:00
Dmitry Gridin
66795db042 PackageDirectoryMismatchInspection: fix visibility in editor
#KT-31816 Fixed
2019-06-21 18:40:31 +07:00
Dmitry Gridin
59325900df KotlinInvalidBundleOrPropertyInspection: fix false positive for a bundle with several properties files
#KT-31359 Fixed
2019-06-21 18:40:31 +07:00
Dmitry Gridin
d9808b70b6 LeakingThisInspection: fix false positives for enum class
#KT-25905 Fixed
2019-06-21 18:40:31 +07:00
Vladimir Dolzhenko
efd004c997 Add j2k, nj2k performance tests 2019-06-21 13:04:08 +02:00
Mikhail Zarechenskiy
fe0282809e [NI] Skip fake call for descriptor from object in builder-inference
This call have interesting rules for resolution, see
 `KtQualifiedExpression.elementChain` function and it's usages:
 resolution results for such call can be omitted and be replaced with
 some other information, while diagnostics will be reported from
 builder-inference.

 To mitigate this problem, we'll just skip this call from builder-inference
 as such calls can't have type parameters anyway

 #KT-32094 Fixed
2019-06-21 11:56:09 +03:00
Mikhail Zarechenskiy
bebdf6fcef [NI] Added test for KT-32094 2019-06-21 11:52:44 +03:00
Mikhail Zarechenskiy
f3e4c9cdb3 [NI] Don't avoid Nothing-like constraints if Nothing was in initial type
#KT-32081 Fixed
 #KT-32951 Fixed
2019-06-21 11:52:39 +03:00
Mikhail Glukhikh
4b2175c8f8 FIR: do not resolve constructors / initializers in implicit type mode 2019-06-20 23:43:04 +03:00
Georgy Bronnikov
48b0cac92e Update tests 2019-06-20 22:37:56 +03:00
pyos
8cca74c932 JVM_IR: support vararg & defaults in function references 2019-06-20 22:37:56 +03:00
pyos
b45e8c7021 JVM_IR: make CallableReferenceLowering a bit shorter 2019-06-20 22:37:56 +03:00
Denis Zharkov
6d63214d1b Optimize AbstractTypeChecker::collectAllSupertypesWithGivenTypeConstructor
Add fast path for a case when subType is a class and super is not
Classes may only have classes supertypes
2019-06-20 15:42:42 +03:00
Denis Zharkov
7a31a14002 Clarify parameter names in AbstractTypeChecker 2019-06-20 15:42:42 +03:00
Denis Zharkov
1a2ccb50c6 Minor. Drop unused functions 2019-06-20 15:42:42 +03:00
Denis Zharkov
bf0781d790 FIR: Implement fast path for classes subtyping 2019-06-20 15:42:42 +03:00
Mikhail Glukhikh
cafe92639b [FIR] Output total time & set passes in old FE performance test 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
c8003518a5 FIR: set super type reference properly 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
65d14ff097 FIR: do not try to calculate annotation call type
Annotation type is used instead
2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
ca401cb01d FIR2IR: support backing field symbols from FIR, fix test data 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
54078c4e9c FIR resolve: support inferring property type from getter 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
16ead49967 FIR: implement backing field references via 'field' synthetic variable 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
11620d848b FIR resolve: set property accessor return type to initializer type 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
7e2828c276 FIR: provide error type for property/variable without initializer 2019-06-20 15:26:39 +03:00
Ilya Matveev
65b7da9d0a Gradle: Add a shortcut DSL method for linuxArm64 target
Issue #KT-32034 Fixed
2019-06-20 18:05:25 +07:00
Roman Artemev
88e92be091 [IR] Fix name clash between properties with the same fqn
Promote ABI version
2019-06-20 12:08:55 +03:00
Simon Ogorodnik
2995e9fcac FIR deserializer optimization: avoid calling findKotlinClass twice
This commit influences enum entries deserialization.
In particular, now we don't deserialize enum entry members,
but deserialize its supertype correctly (see test data changes).
2019-06-19 23:04:41 +03:00
Mikhail Glukhikh
b3c21d6e14 Optimize FirClassSymbol.hashCode() 2019-06-19 22:54:14 +03:00
Mikhail Glukhikh
f4fefa042d Optimization: directly call transformChildren on FirExpression
This is done instead of calling super transformer function,
which does the same after several redirections to other functions.
2019-06-19 22:53:24 +03:00
Mikhail Glukhikh
688c2cf74f Optimization: make FIR expression an abstract class
NB: this commit does significant fir:tree refactoring.
It provides some boost due to faster abstract class dispatching in JVM.
2019-06-19 22:52:44 +03:00
Mikhail Glukhikh
dab6fe29b1 Optimization: make property 'FirExpression.resultType' inline 2019-06-19 22:52:20 +03:00
Mikhail Glukhikh
f6f879302f Optimization: make FirFunctionCall an abstract class 2019-06-19 22:52:13 +03:00
Mikhail Glukhikh
d85ad650d5 Optimization: make FirWrappedArgumentExpression an abstract class 2019-06-19 22:52:04 +03:00
Mikhail Glukhikh
b71de954ff Forbid manipulations with FirWrappedArgumentExpression type reference
The type of this expression is bound to the type of wrapped expression,
so it's better not to change it directly.
2019-06-19 22:51:26 +03:00
Mikhail Glukhikh
b7da2f2ad8 FIR resolve: check early receivers on kotlin.* only
To provide more stable behaviour, the check introduced in the previous
commit is now applied only to extensions from kotlin.* package.
2019-06-19 22:48:52 +03:00
Mikhail Glukhikh
374b59dee3 FIR resolve: add early explicit receiver type check
Before this commit, explicit extension receiver type check was performed
during found candidates analysis (together with arguments type check etc.)
Now we do it just after candidate is found, and filter the candidate
out if explicit receiver type is inappropriate.

This commit slightly changes resolve semantics,
replacing WRONG_RECEIVER with UNRESOLVED_REFERENCE in certain situations.
However, it provides significant performance boost.
2019-06-19 22:45:15 +03:00
Mikhail Glukhikh
d820b6ca52 More accurate messages about types in FirResolveBench 2019-06-19 22:45:14 +03:00
Dmitry Gridin
22a73bc09d ChangeFunctionSignatureFix: fix wrong result
#KT-32001 Fixed
2019-06-19 18:52:53 +07:00
Pavel Punegov
85210d5db0 Update zipTestData: use zip64, add coroutineTestUtil and remove stdlib tests 2019-06-19 14:43:36 +03:00
Natalia Selezneva
b2109a2e65 Get rid of bunch file in AbstractScratchRunActionTest 2019-06-19 13:39:32 +03:00
Vladimir Dolzhenko
47a16cb252 Fixed and extended performance tests 2019-06-19 11:39:29 +02:00
Natalia Selezneva
5010824167 Fix compilation for 182, 183 branches 2019-06-19 12:17:23 +03:00
Alexander Podkhalyuzin
661d50de18 Do not search for Kotlin classes, when looking for Java classes 2019-06-19 11:03:54 +02:00
Natalia Selezneva
91ac38aaf4 Scratch: get editor from data context if possible 2019-06-19 11:29:15 +03:00
Natalia Selezneva
a1564fe696 Scratch: get scratch expression using last commited version of document to avoid differences between PsiFile and Document 2019-06-19 11:29:14 +03:00
Natalia Selezneva
414f98aa29 Implement REPL Mode for scratches
^KT-27963 Fixed
2019-06-19 11:29:14 +03:00
Natalia Selezneva
8bc03e54f7 Scratch: do not clear inlays in onStart
This is needed for sequential executor
2019-06-19 11:22:20 +03:00
Natalia Selezneva
b5b35a9037 Extract ScratchCompilingSession to allow calling executor multiple times 2019-06-19 11:22:20 +03:00
Natalia Selezneva
7038d9b8db Do not use ConfigurationFileCrcFactory comparing scratch content because it needed the document to be saved
Check only if new fragment is not empty to avoid recompilation on minor changes
2019-06-19 11:22:20 +03:00
Natalia Selezneva
ab0877390b Use after line end inlays to avoid moving inlay on the next line pressing enter
^KT-29534 Fixed
2019-06-19 11:22:19 +03:00
Natalia Selezneva
5bff3ac927 Report errors from REPL to Scratch Console 2019-06-19 11:22:19 +03:00
Natalia Selezneva
a6221cf594 Refactor scratch tests: add ability to set scratch options in test file 2019-06-19 11:22:19 +03:00
Alexander Podkhalyuzin
b59bd9d6a6 Faster component loading (better cache data structures) 2019-06-19 10:13:09 +02:00
Mikhail Zarechenskiy
796cdea50e [NI] Require all proper constraints for Exact return type
Consider call `foo(bar())` where bar() returns some type variable `T`;
 We had a contract that call `bar` can be completed without completion
 of foo (type variables can be inferred from the current context) if `T`
 has at least one proper lower constraint (ProperType <: T).
 Indeed, new constraints can be added only as upper ones, so there is
 no need to grow constraint system.

 Unfortunately, we have Exact annotation that is used on return type of
 elvis. Now, consider the following situation:
 ```
 fun foo(a: Any) {}
 fun bar(e: T): @Exact T

 foo(bar("str"))
 ```

 Here, because of Exact annotation, constraint with `Any`-type will be
 added as an equal one => our prerequisite that there will be no new
 lower constraints is false. `bar("str")` is inferred to Any in OI,
 this seems conceptually wrong, but it's another topic of discussion.

 In NI we can't just grow constraint system to use outer call because
 of another important use-case:
 ```
 fun <T> generic(i: Inv<T>) {}

 fun test(a: Inv<*>?, b: Inv<*>) {
     generic(a ?: b)
 }
 ```

 Common constraint system for these two calls can't be solved
 (fundamentally) for this example, only if (a ?: b) and generic(result)
 are computed separately.

 So, to mitigate initial issue, we'll grow constraint system only if
 there is at least one non-proper constraint.

 #KT-31969 Fixed
2019-06-19 11:07:31 +03:00
Mikhail Zarechenskiy
ca997de6a7 [NI] Test data to understand changes in the next commit
##KT-31969 In Progress
2019-06-19 10:47:05 +03:00
Roman Artemev
50ad21e388 [IR BE] Fix symbol remapping for IrField/IrProperty
- Use appropriate wrapped descriptor
 - Add test
2019-06-19 10:24:15 +03:00
Vladimir Dolzhenko
f11a87e0c5 Revert "Do not resolve import to get imported name"
This reverts commit 60c3e644
2019-06-19 09:20:28 +02:00
Dmitry Gridin
7040639c38 Fix false positive "Not-null extension receiver of inline function can be made nullable" with operator fun invoke
#KT-25786 Fixed
2019-06-19 12:16:41 +07:00
Ilya Gorbunov
eae1813ead stdlib-js(-v1/-ir): rename source files to avoid duplicates in sources
Prohibit having duplicates in sources jar and rename those source files,
that clash with the same named source files coming from
the common js source root.

Relates to KT-31965
2019-06-18 20:03:04 +03:00
Ilya Gorbunov
5bafba6bff stdlib-js-ir: preserve source directory structure of common js sources 2019-06-18 19:58:47 +03:00
Ilya Gorbunov
ff9d2744ce Provide conversions between Kotlin and Java time durations 2019-06-18 19:49:50 +03:00
Ilya Gorbunov
d7252548fc Add symmetric number * duration operators 2019-06-18 19:49:50 +03:00
Ilya Gorbunov
a2b1c537af Change Duration.toString scientific exponent formatting
- use 'e+' for positive exponents in scientific format
2019-06-18 19:49:35 +03:00
Ilya Gorbunov
a5b7c270ae Change Duration.toString(unit, decimals) formatting
- switch to scientific notation when value is too big (greater than 1e14)
- allow at most 12 decimals, larger values are coerced to 12
- use scientific format with exactly two decimals in mantissa in JVM
2019-06-18 19:49:35 +03:00
Mikhail Zarechenskiy
5cf7c7e5bf [NI] Fix composite substitution for stubbed type in builder-inference
#KT-32038 Fixed
2019-06-18 19:38:04 +03:00
Mikhail Zarechenskiy
7df13c986e [NI] Coerce to Unit expression in last block with explicit Unit
#KT-32037 Fixed
2019-06-18 19:38:02 +03:00
Alexander Podkhalyuzin
25342240b5 Do not resolve top level annotation even in case of inner class conflict 2019-06-18 17:55:50 +02:00
Alexander Podkhalyuzin
60c3e6442f Do not resolve import to get imported name 2019-06-18 17:51:23 +02:00
Denis Zharkov
9d02fe564c FIR: Avoid calling ClassId::asString from ConeTypeContext 2019-06-18 17:20:23 +03:00
Sergey Rostov
7d7f4a8783 Gradle, JS: fix TCServiceMessageOutputStreamHandlerTest on windows 2019-06-18 15:11:08 +03:00
Alexander Podkhalyuzin
4babde5b46 Faster startup avoiding unnecessary class loading in HelloWorld.java 2019-06-18 12:08:28 +02:00
Alexander Podkhalyuzin
c853ae49a2 Faster startup avoiding unnecessary class loading 2019-06-18 12:08:04 +02:00
Denis Zharkov
f7d0be980b FIR: Optimize ConeTypeContext::isIntegerLiteralType
See ConeTypeContext::isIntegerLiteralTypeConstructor
2019-06-18 11:55:15 +03:00
Denis Zharkov
3c8ed21e59 Optimize ConstraintInjector::isMyTypeVariable
Do not look into the map for constructors that are not
type variables
2019-06-18 11:55:15 +03:00
Denis Zharkov
b43f717f6d Optimize AbstractTypeChecker::hasNothingSupertype
It doesn't make sense to go through all supertypes because
Nothing is a final class
2019-06-18 11:55:15 +03:00
Denis Zharkov
115ab38423 FIR: Optimize ConeTypeContext::captureFromArguments 2019-06-18 11:55:15 +03:00
Simon Ogorodnik
2c5bd46a97 [FIR] Handle non-kotlin class results from findKotlinClassOrContent 2019-06-18 11:36:42 +03:00
Simon Ogorodnik
2f53bd24dd [FIR] Reorder providers to make builtins load first 2019-06-18 11:34:18 +03:00
Simon Ogorodnik
03c3469a14 [FIR] Enhance caches in providers 2019-06-18 11:33:11 +03:00
Simon Ogorodnik
f88fafea9d [FIR] Use proper collections for override scope 2019-06-18 11:14:58 +03:00
Simon Ogorodnik
321e948eca [FIR] Improve typing to get rid of cast 2019-06-18 11:14:57 +03:00
Simon Ogorodnik
95409b35ca [FIR] Use abstract classes for FIR scopes 2019-06-18 11:14:56 +03:00
Simon Ogorodnik
810fa9c171 [FIR] Make session & symbolProvider abstract classes 2019-06-18 11:14:55 +03:00
Simon Ogorodnik
5a06027c53 [FIR] Avoid instanceof List in transformInplace 2019-06-18 11:14:54 +03:00
ilgonmic
024636f704 Gradle, JS, webpack: run js directly (don't use bin script)
On windows, bin script wrapped with bashsh and cmd shell, so node failed
 to run it

#KT-31985 Fixed
2019-06-18 10:50:41 +03:00
ilgonmic
a4427773a5 Gradle, JS, webpack: escape strings inside webpack config
#KT-31985
2019-06-18 10:50:40 +03:00
Ilya Gorbunov
aa69933ee0 Update EXPECTED_REACHABLE_NODES
DCE doesn't remove DurationUnit and some other kotlin.time stuff in these cases
2019-06-18 04:02:36 +03:00
Ilya Gorbunov
58b04c7974 Add remaining docs for Duration members, runnable samples for toString 2019-06-18 04:02:35 +03:00
Ilya Gorbunov
ffd9d8c71d Remove unneeded buildString from Duration.toString 2019-06-18 04:02:35 +03:00
Ilya Gorbunov
155dfeaf35 Generate kotlin.time package public API dump 2019-06-18 04:02:35 +03:00
Ilya Gorbunov
c66740a7ed Explicit public visibility, SinceKotlin and ExperimentalTime status
Use file level ExperimentalTime opt-in in tests.
2019-06-18 04:02:35 +03:00
Ilya Gorbunov
16111ab79f Opt-in for Experimental/UseExperimental annotation usage in tests 2019-06-18 04:02:34 +03:00
Ilya Gorbunov
3b989cc815 Avoid using 'D' component in ISO duration string representation
Days in ISO have nominal duration, they are not always equal to 24H
2019-06-18 04:02:34 +03:00
Ilya Gorbunov
6dbc2eeb90 Provide more efficient ClockMark implementation
Do not use default 'plus' operator implementation, that creates a wrapping
AdjustedClockMark instance, create instance of the same type instead.
2019-06-18 04:02:34 +03:00
Ilya Gorbunov
8c730e180c Make ClockMark an abstract class instead of an interface 2019-06-18 04:02:34 +03:00
Ilya Gorbunov
04ec90164e Use ThreadLocals to cache DecimalFormat instances 2019-06-18 04:02:34 +03:00
Ilya Gorbunov
368452748b Move convertDurationUnit into Duration companion 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
ca10d13f34 Rename Duration storage property to 'value' 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
365cbb94cd Change Duration.absoluteValue to property 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
3f7a0d0845 Rename DurationMeasured to TimedValue, withMeasureTime to measuredTimeValue
Add measureTime docs
2019-06-18 04:02:33 +03:00
Ilya Gorbunov
9deac2a591 Rename withComponents to toComponents and add two overloads of them 2019-06-18 04:02:33 +03:00
Ilya Gorbunov
796ad29637 Add shortcuts to convert duration to milliseconds and nanoseconds 2019-06-18 04:02:32 +03:00
Ilya Gorbunov
8004c34e44 Reduce Duration API surface, add top-level docs
- toDuration(unit) extension instead of constructors
- toDouble/Long/Int(unit) function instead of inUnits()
- remove static factory functions
- remove MIN_VALUE/MAX_VALUE constants
2019-06-18 04:02:32 +03:00
Ilya Gorbunov
682430766b Add ClockMark and measureTime tests with test clock 2019-06-18 04:02:32 +03:00
Ilya Gorbunov
b5d16f1a9b Simplify Clock/ClockMark design
- Do not require initialElapsed parameter
- Introduce instead ClockMark +- Duration operators
- Do not require ClockMark to expose its originating Clock back
- Turn elapsedFrom property into elapsed() function
- Rename abstract clock classes
- Fix unit of abstract clocks when constructing them

Add top-level docs for Clocks
2019-06-18 04:02:32 +03:00
Ilya Gorbunov
ca29cfb88d Implement MonoClock in JS
It uses either process.hrtime() in node.js or performance.now() in browser,
falling back to Date.now() if the latter is not available
2019-06-18 04:02:31 +03:00
Ilya Gorbunov
b816f50d4d Implement and test default string formatting in JVM and JS
Relax Duration.toString tests for JS and Native rounding specifics
2019-06-18 04:01:55 +03:00
Ilya Gorbunov
804d2b2d8c Helper utilities to execute test code on particular platforms 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
95139252b7 Exclude kotlin.time.* from reduced js runtime 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
c1f7fd0281 Duration: test toString in particular units 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
b9c56af9ba Change Duration value storage unit to ns 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
690049c082 Duration unit tests 2019-06-18 03:59:52 +03:00
Ilya Gorbunov
7977b6cdb8 Implement DurationUnit in JS, add doc summary and conversion test 2019-06-18 03:59:51 +03:00
Ilya Gorbunov
37c5f2c54f Initial prototype of Duration and Clocks API 2019-06-18 03:59:51 +03:00
Mikhail Zarechenskiy
7749afb13e [NI] Fix exception for type check callable reference against error type
#KT-32029 Fixed
 #EA-145311 Fixed
2019-06-17 19:18:04 +03:00
Mikhail Zarechenskiy
8fe632f52b [NI] Record DFI for callable reference arguments
#KT-31941 Fixed
2019-06-17 19:18:04 +03:00
Roman Artemev
1f70284b18 [JS IR BE] Fix charSequenceLength function for JS IR 2019-06-17 18:10:53 +03:00
Vyacheslav Gerasimov
e69ae451cf Build: Fix performanceTestCompileOnly configuration 2019-06-17 17:49:12 +03:00
Sergey Igushkin
41d8c536c3 Update Gradle module metadata warnings: don't warn when it's enabled
Also add a suggestion to enable the module metadata publishing in
Gradle 5.3+ projects that consume Gradle module metadata by default but
don't produce it unless explicitly enabled.

Issue #KT-31023 Fixed
2019-06-17 17:29:41 +03:00
Mikhail Zarechenskiy
2964be8caa Remove "experimental" suffix from IDE settings for NI 2019-06-17 16:59:18 +03:00
Vyacheslav Gerasimov
54222bd429 Build: compiler tests-common test runtime 2019-06-17 16:30:14 +03:00
Vyacheslav Gerasimov
1da2bc5dab Build: Fix idea performance tests runtime 2019-06-17 15:52:18 +03:00
Ilya Kirillov
d6dec2a066 New J2K: use PsiModifierListOwner instead of JvmAnnotatedElement for getting annotations from declaration while building AST as PsiLocalVariable is no longer a JvmAnnotatedElement in 192
#KT-31821 fixed
2019-06-17 12:18:05 +03:00
Andrey Uskov
ae2ef0ac79 Fix MultiModuleHighlightingTest 2019-06-17 11:53:10 +03:00
Mikhail Glukhikh
5f896936ae Fix broken test (related to "Convert to lazy property") 2019-06-17 11:06:38 +03:00
Natalia Selezneva
20d19ee66f Temporary workaround for ProcessCanceledException that may happen during dependencies update
This happens during finding script definition (especially during virtual file to psi file search)
In this case dependencies may be already saved to cache, so makeRootChangeEvent should be generated, otherwise indexes aren't updated and highlighting in the script can be broken
2019-06-17 10:30:58 +03:00
Natalia Selezneva
233c37db57 Scripts: provide more concrete scope for files from script dependencies 2019-06-17 10:30:58 +03:00
Natalia Selezneva
213b0a37d1 Do not include jdks dependencies into run configuration of script
^KT-25187 Fixed
2019-06-17 10:30:57 +03:00
Natalia Selezneva
151c12dd85 Scripts: clear modification stamps cache when script dependencies cache is cleared
Otherwise it prevents script dependencies reloading
It may occur when script definitions are reloaded, cache is cleared, but dependencies aren't reloaded

^KT-31826 Fixed
2019-06-17 10:30:57 +03:00
Natalia Selezneva
2b748ccd9a Scripts: if sdk isn't use for some module in project, PsiElementFinder doesn't return jdk classes
For example in Android project all modules can have AndroidSDK, but JavaSDK can be set as ProjectSdk
In this case build.gradle.kts couldn't resolve jdk classes
2019-06-17 10:30:56 +03:00
Natalia Selezneva
a69b5345d5 Fix RunConfigurationTest 2019-06-17 10:30:56 +03:00
Natalia Selezneva
39f6a6b249 Scripts: replace notification with traffic light icon
When script dependencies aren't loaded yet prevent editor to show green arrow in the top right corner.
Now pause is shown with the correct status
Remove tray notification as obsolete

^KT-31779 Fixed
2019-06-17 10:30:56 +03:00
Denis Zharkov
fdebb38706 Disable slow assertions in type checker everywhere except for tests 2019-06-17 10:29:23 +03:00
Dmitry Gridin
46d8f45c11 Apply LiftReturnOrAssignmentInspection on idea 2019-06-17 11:24:28 +07:00
Toshiaki Kameyama
05a132357b Lift assignment: suggest for assignment of null
#KT-30191 Fixed
 #KT-28595 Fixed
2019-06-17 11:24:28 +07:00
Toshiaki Kameyama
4b4be07942 Add Inspection for lateinit var overrides another lateinit var
#KT-30775 Fixed
2019-06-17 01:28:55 +03:00
Toshiaki Kameyama
fbd992f8c7 Add intentions to convert lazy <--> ordinary property
#KT-23501 Fixed
2019-06-17 01:10:19 +03:00
Toshiaki Kameyama
a2205cfc98 Add "'equals()' between objects of inconvertible types" inspection
#KT-25006 Fixed
2019-06-17 01:09:54 +03:00
Ilya Gorbunov
a1979677d0 Docs: mark all experimental annotations as MustBeDocumented
So that they are shown in the docs of annotated experimental API
2019-06-15 16:37:45 +03:00
Ilya Gorbunov
a55563f5ec Docs: suppress docs for newly introduced hidden API 2019-06-15 16:37:44 +03:00
Kirill Shmakov
ae45bbcead Explicit misconfiguration signalization 2019-06-15 12:47:56 +03:00
Kirill Shmakov
47afd9ec1c Remove ultimate dir 2019-06-15 11:27:37 +03:00
Kirill Shmakov
0df8b7f610 Support ultimate transition
KOTLIN-CR-3025
2019-06-15 11:25:43 +03:00
Nicolay Mitropolsky
a1e9259465 Revert "Remove broken 192 bunch files"
They are not broken anymore as long as we build with "real" IDEA 192
This reverts commit 67a194fa
2019-06-14 20:05:23 +03:00
Nicolay Mitropolsky
2a5be78db3 Kotlinx-coroutines version set to 1.2.1 for IDEA 192 2019-06-14 20:05:23 +03:00
Vyacheslav Gerasimov
55f86af67f Build: Fix test runtime for source-sections-compiler-plugin tests 2019-06-14 19:42:28 +03:00
Vyacheslav Gerasimov
986e1ceefb Build: Fix test runtime for sam-with-receiver-compiler-plugin tests 2019-06-14 19:38:13 +03:00
Nikolay Krasko
61a6c646ab Explicitly call virtual method to be compatible with 192 branch 2019-06-14 19:30:43 +03:00
Roman Artemev
8015152bfc [JS IR BE] Support JS IR in maven plugin 2019-06-14 18:41:00 +03:00
Roman Artemev
cc46657c99 [JS IR BE] Fix misprint 2019-06-14 18:40:59 +03:00
Roman Artemev
6d2ad63db3 [IR] Support IrLocalDelegatedPropertyReference in klib 2019-06-14 18:40:59 +03:00
Roman Artemev
008cf03b06 [IR] Consider TypeParameter as public declaration and serialize it properly
- Add test case when TypeParameter of generic property is exposed outside its module
2019-06-14 18:40:59 +03:00
Roman Artemev
efaf5a9947 [IR] Fix serialization of ENUM_SPECIAL members 2019-06-14 18:40:59 +03:00
Vyacheslav Gerasimov
e32bbcecc2 Build: Fix test runtime for kotlinx-serialization-compiler-plugin tests 2019-06-14 18:18:08 +03:00
Vyacheslav Gerasimov
5a664a86a8 Build: Fix test runtime for kotlin-scripting-compiler tests 2019-06-14 18:10:24 +03:00
Vyacheslav Gerasimov
52303d65ab Build: Fix test runtime for kotlinp tests 2019-06-14 18:06:04 +03:00
Vyacheslav Gerasimov
f18b3bcfda Build: Fix test runtime for descriptors tests 2019-06-14 17:59:17 +03:00
Alexander Gorshenev
a816de4865 Added a test for members of EnumEntry in a library. 2019-06-14 17:12:39 +03:00
Alexander Gorshenev
d13b350716 Don't serialize descriptor references for EnumEntry members 2019-06-14 17:12:39 +03:00
Vyacheslav Gerasimov
33a5a3ff81 Build: Fix test runtime for incremental compilation tests 2019-06-14 17:09:36 +03:00
Natalia Selezneva
fea3001dac Fix target platform for scripts
^KT-31837 Fixed
2019-06-14 12:27:21 +03:00
Natalia Selezneva
8d6bbb9e2e Check that file is in common module sources before enlarging its scope
This is needed for build.gradle.kts files that are in module content, but not is source
2019-06-14 12:27:21 +03:00
Toshiaki Kameyama
b650c7ab00 Add "Redundant empty initializer block" inspection
^KT-5008 Fixed
2019-06-14 12:27:21 +03:00
Dmitry Gridin
c155bf680f MoveVariableDeclarationIntoWhenInspection should move caret to subject expression
#KT-31954 Fixed
2019-06-14 15:28:06 +07:00
Yan Zhulanow
a9057e914b Move back the hardcoded artifacts needed for JPS build 2019-06-14 17:13:50 +09:00
Sergey Rostov
99275deb30 JPS Build: fix building buildSrc 2019-06-14 10:21:05 +03:00
Vyacheslav Gerasimov
9f5b1a5101 Build: Fix runtime for generateFullRuntimeKLib 2019-06-14 01:06:06 +03:00
Vyacheslav Gerasimov
c4e33728a8 Build: Fix test runtime for gradle plugin tests 2019-06-14 00:44:36 +03:00
Vyacheslav Gerasimov
dc2a7fdc13 Build: Fix compiler tests, add missing test runtime dependencies 2019-06-14 00:35:01 +03:00
Toshiaki Kameyama
5dd0110a59 Use safe cast 2019-06-13 23:16:31 +03:00
Toshiaki Kameyama
0fad3fafa8 Replace deprecated symbol usage: fix message in case of generic parameter
#KT-8958 Fixed
2019-06-13 23:16:31 +03:00
Vyacheslav Gerasimov
e8e457a16c Build: Fix uast compilation against 192 platform 2019-06-13 21:57:57 +03:00
Ilya Gorbunov
1960161e78 Exclude inline reified functions and properties from public API
Public inline reified functions are getting into public API dump after
changing their visibility generation strategy (see KT-18563)
from always private to public synthetic. However, they still do not
constitute public binary API, since they can be removed without breaking
compatibility with an already compiled code.
2019-06-13 21:23:21 +03:00
Vyacheslav Gerasimov
95a71f60ca Build: Fix Ide performance tests configuration for jps build 2019-06-13 21:03:55 +03:00
Vyacheslav Gerasimov
0514437fba Build: Workaround scripting dependencies on full Idea 2019-06-13 21:03:55 +03:00
Vyacheslav Gerasimov
5a39c637c2 Build: Fix intellij dependency leak from ir tree module 2019-06-13 21:03:55 +03:00
Kevin Peek
4c91ba90bb Add links to Scope Functions docs (PR #2407)
Add links to Scope Functions docs on kotlinlang.org to 'with', 'run', 'let', 'apply', and 'also' extension function docs
2019-06-13 20:49:38 +03:00
Andrey Uskov
1f17ff5d38 Fix compilation of KotlinAndroidGradle MPPModuleDataService
in bunch 182
2019-06-13 20:31:12 +03:00
Alexander Udalov
18a4247226 Add kdoc for new API of kotlinx-metadata-jvm
#KT-26602
2019-06-13 18:00:42 +02:00
Alexander Udalov
980b7ace40 Minor, fix kdoc of KmModuleVisitor.visitPackageParts
Implementation implies that this method is called exactly once for each
package, and that makes more sense to require in the function contract
2019-06-13 18:00:42 +02:00
Alexander Udalov
41eedb69ca Update kotlinx-metadata-jvm usage example in MetadataSmokeTest and ReadMe 2019-06-13 18:00:42 +02:00
Alexander Udalov
a680067ac3 Use new kotlinx-metadata API in binary-compatibility-validator 2019-06-13 18:00:42 +02:00
Alexander Udalov
5ee34503c0 Introduce new API for kotlinx-metadata-jvm
Kdocs are provided in a subsequent commit

 #KT-26602 Fixed
2019-06-13 18:00:33 +02:00
Alexander Udalov
aa54a7e11a Minor, move jvmExtensions.kt -> jvmExtensionVisitors.kt 2019-06-13 17:55:46 +02:00
Andrey Uskov
d02bf74215 Fixed creation of module dependencies on MPP module from non-mpp modules. Case when one artifact is produced by several mpp actualized sources sets is supported.
#KT-30667 Fixed
2019-06-13 18:30:54 +03:00
Andrey Uskov
c0bf5a6566 Import of middle HMPP target platforms is supported 2019-06-13 18:30:01 +03:00
Vyacheslav Gerasimov
c0594c2ee3 Build: Remove dependency on internal indenting stream writer 2019-06-13 18:27:12 +03:00
Andrey Uskov
98a443c12f Fix compatibility with IDEA after unlinking external api from java
#KT-31952 Fixed
2019-06-13 17:42:12 +03:00
Yan Zhulanow
1ec6ca7dd6 Fix rebase issue, move KotlinDebuggerEvaluator to the debugger-util module 2019-06-13 22:34:33 +09:00
Yan Zhulanow
2754deca98 Move FUS components to the 'idea-core' module 2019-06-13 21:58:23 +09:00
Yan Zhulanow
7e564e94ed Debugger: Implement error reporting for evaluator 2019-06-13 21:58:23 +09:00
Anton Yalyshev
8a5fd44a55 created FUS Group for Debugger Evaluator 2019-06-13 21:58:23 +09:00
Yan Zhulanow
6fdcb69b43 Fix Spring tests for ultimate build 2019-06-13 21:58:22 +09:00
Steven Schäfer
41ce88cb9b Move eraseTypeParameters to IrUtils and use it in PromisedValue.coerce 2019-06-13 12:25:06 +02:00
Steven Schäfer
3ce0c336bc Move IrReturnTarget.returnType to IrUtils 2019-06-13 12:25:06 +02:00
Steven Schäfer
ea3bae5fc9 Split voidValue into immaterialUnitValue and defaultValue 2019-06-13 12:25:06 +02:00
Steven Schäfer
27a850be92 Fix genValueAndPut in IrInlineCodegen 2019-06-13 12:25:06 +02:00
Steven Schäfer
917ef250cf Add and (un)mute inline class tests 2019-06-13 12:25:06 +02:00
Steven Schäfer
f1f0c7e0a0 Take inline classes into account in JvmBuiltinOptimizationLowering 2019-06-13 11:24:16 +02:00
Steven Schäfer
69cf8d4df4 Produce source function names in CallableReferenceLowering 2019-06-13 11:24:15 +02:00
Steven Schäfer
9c957edcea Implement inline classes in the JVM_IR backend 2019-06-13 11:24:15 +02:00
Steven Schäfer
ad3e03bdbd Disable type mapper name mangling for inline classes in the JVM_IR backend 2019-06-13 11:24:15 +02:00
Steven Schäfer
f5b9eee83a Add builder for variable declarations without initializers 2019-06-13 11:24:15 +02:00
Yan Zhulanow
f450a8ed89 Disable Kapt tests for new multiplatform in Android Studio 2019-06-13 17:35:27 +09:00
Yan Zhulanow
bd342e765d SamWithReceiver: Fix IDE plugin JAR name 2019-06-13 17:33:24 +09:00
Yan Zhulanow
12861595f5 MPP: Attach all classes/resources directories to the runtime classpath (KT-30710) 2019-06-13 17:33:24 +09:00
Yan Zhulanow
bc0f10449a Kapt: Fix source root importing in MPP projects 2019-06-13 17:33:24 +09:00
Yan Zhulanow
9eab9f386d Activate Kapt importer only for JVM compilations (KT-30578) 2019-06-13 17:33:24 +09:00
Mikhail Zarechenskiy
d9dca067f6 [NI] Propagate non-null info on supertypes for capturing from bounds
#KT-31941 Fixed
2019-06-13 00:57:51 +03:00
Sergey Rostov
b2607b47e2 Gradle, tests runner, output stream handler: don't treat flush as new line
#KT-31931 Fixed
2019-06-12 17:03:22 +03:00
Leonid Startsev
2488b40d52 Fix accidentally added comment which broke 183 bunch 2019-06-12 15:30:31 +03:00
Ting-Yuan Huang
f07be024b7 JVM_IR: handle JvmDefault for bridges. 2019-06-12 07:43:45 +02:00
Leonid Startsev
b78d84c120 Add some tests for kotlinx.serialization plugin:
- declaration checker
- bytecode listings
- JVM IR

Improve @Transient redundant reporting
2019-06-11 19:32:40 +03:00
Ilya Kirillov
2dd604cd70 New J2K, minor: remove unused declarations, fix typos 2019-06-11 18:16:06 +03:00
Ilya Kirillov
b80f2c78a0 New J2K, minor: reformat code, optimize imports 2019-06-11 18:16:06 +03:00
Ilya Kirillov
59f66d5882 New J2K: split diagnostic based processing from inspection ones
Analysing file file with diagnostics on each step of post-processings is rather expensive operation so the inspection-like post-processings which don't require diagnostic information was separated from ones that need it

Related to #KT-31848
2019-06-11 18:16:06 +03:00
Dmitry Savvinov
2f8e83d6b9 Minor: regenerate tests 2019-06-11 18:11:44 +03:00
Alexander Udalov
c67517cb2b JVM IR: use fast class reading mode in boxAgainstJava tests
annotationsViaActualTypeAliasFromBinary.kt is ignored because
ExpectActualRemover can't find actual for the expected constructor of
Anno now, because `ExpectedActualResolver.findActualForExpected`
incorrectly filters out actual declarations without any source file, and
Java classes loaded in the fast mode don't have any source files.

This will need to be fixed separately, probably by making
ExpectedActualResolver look for the actual class of an expected class
member first (with source file-based filtering), and then
unconditionally locating the corresponding member there
2019-06-11 15:26:07 +02:00
Alexander Udalov
c6d61346dd Avoid compiling Java files twice in boxAgainstJava tests
After b602c08773, this test started to put all .java files to the
dependencies when compiling .kt files, _in addition_ to the already
compiled class files from those Java sources. This is incorrect because
the test should actually check how Kotlin compiles _against_ Java
binaries. The other behavior (compiling against Java sources) is already
supported and used in normal box tests with .java sources.

However, we can't simply filter out all .java files before calling
`super.doMultiFileTest` because many of those contain directives
(WITH_RUNTIME, FULL_JDK, etc.) and we should load them in
`CodegenTestCase.compile`. As a workaround, remove '.java' file
extension to prevent their compilation but still be able to resolve
directives.
2019-06-11 15:26:07 +02:00
Vasily Levchenko
e3d2419beb [tests][codegen][coroutines] disable test simpleSuspendCallableReference for NATIVE too. 2019-06-11 12:07:58 +03:00
Dmitry Savvinov
32a102a99d Fix bug in ExpectedActualResolver
'getContributedDescriptors' isn't obliged to apply filters, inlcuding
kindFilter, and may return declarations of different kind, so we have to
call 'filterIsInstance' explicitly
2019-06-11 11:07:01 +03:00
Ilya Kirillov
3854a323fa New J2K: do not ignore errors in new j2k tests comparison 2019-06-11 10:37:26 +03:00
Ilya Kirillov
ce569ca6e0 New J2K: remove static modifier for the case when member is converted without containing class 2019-06-11 10:37:25 +03:00
Ilya Kirillov
9929dba74d New J2K: fix ConcurrentModificationException while analysing implicit initializers 2019-06-11 10:35:32 +03:00
Ilya Kirillov
184825d59d New J2K: remove open modifier for top level functions on post-processing
#KT-31678 fixed
2019-06-11 10:35:32 +03:00
Ilya Kirillov
6d3967d922 New J2K: add tests for some obsolete J2K issues 2019-06-11 10:35:31 +03:00
Ilya Kirillov
04fe51b0aa New J2K: use default test file directives for choosing SDK in tests instead of by filename approach 2019-06-11 10:35:31 +03:00
Ilya Kirillov
8375a12733 New J2K: properly remove redundant modifiers in post-processing as #KT-30804 is fixed 2019-06-11 10:35:31 +03:00
Ilya Kirillov
2aa20d003d New J2K: convert vararg type parameter Java length call to Kotlin size call 2019-06-11 10:35:30 +03:00
Ilya Kirillov
b211ae1070 New J2K: correctly convert Kotlin function type 2019-06-11 10:35:30 +03:00
Ilya Kirillov
a2b832e5be New J2K: correctly convert Java String type to Kotlin String 2019-06-11 10:35:30 +03:00
Ilya Kirillov
0fc0f99acb New J2K: do not commit document after each inspection in post-processing
Related to #KT-31848
2019-06-11 10:35:29 +03:00
Ilya Kirillov
110611d690 New J2K: group post-processings to named groups 2019-06-11 10:35:29 +03:00
Ilya Kirillov
cacb4ed9f3 New J2K: correctly handle field symbol in EnumFieldAccessConversion 2019-06-11 10:35:29 +03:00
Ilya Kirillov
ca34c55dde New J2K: do not call shortenClassReferences on AST building for addTypeArguments 2019-06-11 10:35:28 +03:00
Ilya Kirillov
417717914d New J2K: use IDEA indexes for resolving
Related to #KT-31848
2019-06-11 10:35:28 +03:00
Ilya Kirillov
5f8b5efd66 New J2K: do not find import usages in AST building phase
It is a rather heavy operation and it increases conversion time
Related to #KT-31848
2019-06-11 10:34:34 +03:00
Sergey Rostov
d0e3ab1beb Gradle, tests runner: don't use separate thread to parse process output
Or --scan will fail (see KT-31891 for more details).
To do it in same thread we should parse output on output stream calls.
TCServiceMessageOutputStreamHandler will do that.

Also, all new lines now preserved, so TCServiceMessagesClient should
ignore new lines after messages. New ignoreLineEndingAfterMessage setting
will do that.

#KT-31891 Fixed
2019-06-11 09:18:27 +03:00
Sergey Rostov
84b87a22e6 Gradle, tests runner: use OperationIdentifier object as id (not long)
#KT-31448 Fixed
#KT-30691 Fixed
2019-06-11 09:18:26 +03:00
Mikhail Zarechenskiy
991e60c9e4 Add tests for obsolete issues
#KT-31784 Obsolete
 #KT-31757 Obsolete
2019-06-10 17:37:52 +03:00
Leonid Startsev
414c116d93 Fix too strict serializer lookup for generic type parameters 2019-06-10 16:49:19 +03:00
Igor Chevdar
acf9670306 Fixed bug with file descriptors leakage 2019-06-10 13:41:57 +03:00
Igor Chevdar
3e8f3e6f00 [Klib] Split up IR header tables onto three parts
There was one monolith protobuf at irHeader.knd, it was
split up onto 4 parts due to performance issues:
  - a small irHeader with some basic info about a module
  - symbols table
  - types table
  - strings table
These 3 tables are then mmapped and accessed by index.
2019-06-10 13:41:57 +03:00
Alexander Gorshenev
5faccaa49e Got rid of delegation in library impl hierarchy 2019-06-10 13:41:57 +03:00
Dmitry Savvinov
65a6b08fd3 Fix lines joining of TextDiagnostics on Windows
The initial assumption were that inside compiler and test framework all
line breaks are normalized, because we read text files only through IDEA
utils (which do normalization).

The mistake was that 'StringBuilder.appendln()' appends
'System.lineSeparator()' as well, so it's not enough to only check that
we don't load files from disk without normalizing whitespaces.

Note that using 'it.replace(System.lineSeparator(), ...)' would be
incorrect too, because actually we have strings with two kinds of line
breaks here (normalized and not normalized), so we're looking for both
via simple regex.
2019-06-10 13:34:28 +03:00
Dmitry Savvinov
8df759b05c [Expect/Actual] Adjust IdeaModuleStructureOracle to old IDE Resolve
The main issue is that we have CombinedModuleInfo in old IDE Resolve,
which essentially merges platfor-modules together with its
dependsOn-parents. It conceals real module structure, which is fine for
practically all clients except for ExpectedActualDeclarationChecker.

In particular, it is nearly impossible to check expect/actual via
ModuleDescriptors, because you'll always get one and the same
'merged'-module descriptor.

So, this commit rewrites IdeaModuleStructureOracle in the following way:
- use ModuleInfos instead of ModuleDescriptor, as they allow more
fine-grained way to work with modules
- use 'unwrapModuleSourceInfo' in seemingly random places in order to
get real, non-merged moduleInfos
- carefully convert them back to ModuleDescriptors, because EADC work
with descriptors

This is still not an ideal solution. In particular, last step is flawed:
conversion back to ModuleDescriptors will always return merged
moduleDescriptor for platform-modules. There's no easy way to fix that
except for removing CombinedModuleInfo altogether, so we leave it as
known issue.

Also, there are some weird changes in testdata (again, because sometimes
we see several modules merged together), but they are mostly confusing
rather than plain incorrect.
2019-06-10 13:34:28 +03:00
Dmitry Savvinov
54b8f9da28 [Expect/Actual] Add testdata on hierarchical expect/actual matching 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
cac326bf4a [Expect/Actual] Adjust old testdata after changes in expect/actual
matching

This commit makes several changes in testdata:

- compiler multiplatform tests now contain newly introduced diagnostics
about AMBIGIOUTS_ACTUALS
- MultiModuleHighlighitng tests now contain proper reports about
ACTUAL_MISSING:
  - ACTUAL_MISSING should be indeed reported in them, because those
  tests don't contain dependsOn edges, only usual intermodule
  dependencies
  - This error wasn't reported here because expect/actual diagnostics in
  common module used to be reported by PlatformExpectedAnnotator, which
  had a bit flawed logic for deremining common-modules: it checked for
  presence of implementing modules. In those tests, common module has no
  implementing modules, so Annotator was returning silently
  Note that such configurations (common module without implementing
  modules) are almost impossible in real-life projects
  - After removal of PlatformExpectedAnnotator, we use
  ExpectedActualDeclarationChecker in common modules, which launches all
  checks properly
- some QuickFixMultuModuleTests now contain proper reports about
ACTUAL_MISSING. This change is also connected with
PlatformExpectedAnnotator, but now for different reason:
  - QuickFixMultiModuleTest used to check for errors in file by running
  'analyzeWithAllCompilerChecks' and inspecting returned BindingTrace.
  For common modules, there were no diagnostics about expect/actuals in
  that trace, because there were no ExpectedActualDeclarationChecker
  (and PlatformExpectedAnnotator was reporting diagnostics in ad hoc
  trace).
  - Again, now we inject EADC in common modules properly, so we see
  those errors in trace and report them in test
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
174ef56991 [Expect/Actual] Remove PlatformExpectedAnnotator 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
29beed9b21 [Expect/Actual] Support matching of expect/actual in hierarchical MPP 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
4e12701145 [Expect/Actual] Introduce ModuleStructureOracle 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
0915f0c78a [Expect/Actual] Let DI instantiate ExpectedActualDeclarationChecker
Inject it instead of calling constructor manually and passing instance
directly into the container. This allows to accept some components in
constructor of ExpectedActualDeclarationChecker
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
44cbdd142b [Expect/Actual] Collect expectedBy modules correctly in case of HMPP 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
de2944ff43 [Misc] Fix errors checking in QuickFixMultiModuleTest
This test was checking errors *before* applying action, rather than
*after*, like all other QuickFix-tests do. This commit moves
errors-check after performing quick-fix action, and changes testdata:

- for most tests errors are simply gone (as quickfix usually fixes that
error)
- also, for implementMembersInActualClassNoExpectMember we add
'DISABLE-ERROR', similarly to
implementMembersInImplClassNonImplInheritor. This is needed because
'Implement Members'-fix created 'TODO'-calls, which are not resolved in
those tests due to the lack of stdlib. Previously, there were no errors
in this test exactly because file was checked *before* applying quickfix
(i.e. when there were no 'TODO()' in file)
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
d458821565 [Misc] Get rid of IdePlatformKind.IDE_KINDS_BY_COMPILER_PLATFORM
It works incorrectly for cases of non-trivial common platforms (works
fine for 'JVM/JS/Native', but doesn't work for 'JVM/JS')
2019-06-10 13:34:27 +03:00
Dmitry Savvinov
fbbd1a268b [Misc] Minor: generalize TypeUtils.closure 2019-06-10 13:34:27 +03:00
Dmitry Savvinov
935c9fce17 [Misc] Extract method in ExpectedActualDeclarationChecker for clarity 2019-06-10 13:34:27 +03:00
Mikhail Glukhikh
309708f433 Do not visit FirBlock type twice 2019-06-10 11:03:10 +03:00
Simon Ogorodnik
df9479b607 Cache declared member scope 2019-06-10 11:03:09 +03:00
Simon Ogorodnik
3aadf58354 Fix leak of BodyResolveTransformer due to inference components capture 2019-06-10 11:03:09 +03:00
Simon Ogorodnik
146a53f18c Change lookup tags from interfaces to abstract classes 2019-06-10 11:03:09 +03:00
Mikhail Glukhikh
a10deb5f69 Remove classId from FirClassSymbol equals / hashCode 2019-06-10 11:03:09 +03:00
Mikhail Glukhikh
792c26decc FirClassDeclaredMemberScope: do not create nested one for constructors 2019-06-10 11:03:09 +03:00
Mikhail Glukhikh
73a6714ad1 FirClassDeclaredMemberScope: rewrite index calculation imperatively
This should save some performance at this point
2019-06-10 11:03:09 +03:00
Simon Ogorodnik
8ae77da250 Transform only block children, to avoid unresolved type in-between 2019-06-10 11:03:08 +03:00
Mikhail Glukhikh
4ad3e429aa FirClassDeclaredMemberScope: use just Name instead of ClassId/CallableId
This should decrease amount of created garbage a little bit
2019-06-10 11:03:08 +03:00
Mikhail Glukhikh
e403195684 Cleanup: FirTopLevelDeclaredMemberScope 2019-06-10 11:03:08 +03:00
Denis Zharkov
373283dcae FIR: Cache ConeClassifierSymbol in ConeClassLikeLookupTagImpl 2019-06-10 11:03:08 +03:00
Denis Zharkov
91d8f1fc88 FIR: Optimize access to FirSymbolProvider via session 2019-06-10 11:03:08 +03:00
Mikhail Glukhikh
5e42f0c31d Use sink.yield in FIR resolve check receivers 2019-06-10 11:03:08 +03:00
Sergey Rostov
e37c86b85f IDE, wizards, .kts, Kotlin/JS for Node.js: fix DSL
#KT-31895 Fixed
2019-06-10 08:20:48 +03:00
Sergey Rostov
92be12f27b IDE, wizards, kotlin jvm server / js client: fix jvmJar configuration
There should be `from(new File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))`
instead of `from(jsBrowserWebpack.outputPath)in jvmJar task configuration`.

`jsBrowserWebpack.outputPath` may be (and will) inside the same dir as
jvmJar. So jvmJar build hangs.
2019-06-09 14:33:23 +03:00
Sergey Rostov
41347abf56 IDE, wizards: update Kotlin/JS support in jvm server / js client
Configure js browser sub target to use new test and application runners.
Rework js linking and packaging:
- get rid of required.js
- use builtin jsBrowserWebpack task, embed js bundle into jvm jar, remove gradle boilerplate
- ktor server: serve js bundle resource, remove boilerplate

#KT-31695 Fixed
#KT-31099 Fixed
2019-06-08 20:36:09 +03:00
Sergey Rostov
ac044a8c33 IDE, wizards: update Kotlin/JS support in mpp lib wizard
Configure js sub targets to use new test and application runners.

#KT-31695
#KT-31099
2019-06-08 20:36:09 +03:00
Sergey Rostov
f49907092b IDE, wizards: update Gradle Kotlin/JS support
Split Kotlin/JS configuration for browser and nodejs.
Add corresponding Kotlin/JS sub targets DSL calling.
2019-06-08 20:36:09 +03:00
Sergey Rostov
560f34bde5 Gradle, JS, webpack: add dependency to compile classpath 2019-06-08 20:36:09 +03:00
Sergey Rostov
354bf1f308 Gradle, JS, run: don't add dependency from project run task
As js webpack-dev-server will not finish
2019-06-08 20:36:09 +03:00
Sergey Rostov
45d4a9d67c Gradle, js: rename objects to avoid clashing with moowork nodejs plugin
#KT-31834 Fixed
2019-06-08 20:36:09 +03:00
Sergey Rostov
b5515a31eb Gradle, js, karma: useConfigDirectory DSL
#KT-31686 Fixed
2019-06-08 20:36:08 +03:00
Vyacheslav Gerasimov
5bde9720b7 Build: Fix dependencies on :kotlin-compiler project
Dependencies on :kotlin-compiler should never be used in configurations
which are imported transitively because ide fails to import it as
project dependency. When :kotlin-compiler dependency is imported as
kotlin-compiler.jar dependency ide re-indexes it on every change. This
behaviour is super annoying.

 #KT-31120 Fixed
2019-06-08 19:36:28 +03:00
Ilya Chernikov
c39896165e Fix script compiler options processing 2019-06-07 23:19:16 +02:00
Alexey Tsvetkov
38a692abcf Add experimental support for bytecode instrumentation with JPS
#KT-13563 Fixed
2019-06-07 21:06:25 +03:00
Igor Yakovlev
545fdb5a37 Add UL-inline class overrided interface methods 2019-06-07 20:33:07 +03:00
Igor Yakovlev
7d542eda00 Fix UL classes test for inline classes support 2019-06-07 20:33:07 +03:00
Igor Yakovlev
44f19e1225 Add UL support for classes 2019-06-07 20:33:07 +03:00
Mikhail Zarechenskiy
b7849da19e [NI] Introduce flag to change constraint system for overload resolution
This commit doesn't change behaviour of any inference algorithm, it
 introduces opportunity to switch constraint system that is used for
 overload resolution and fix problematic cases by changing one enum
 entry.

 Due to fundamental changes, there are cases where a new inference
 algorithm reports overload resolution ambiguity errors (#KT-31670,
 #KT-31758), which is correct from its point of view. However, this is
 a breaking change and to really make it, we should be very confident
 and have enough motivation for it, therefore, we don't change behavior
 now in order to collect more examples (if there are any). And if we
 find a lot of erroneous examples, we'll be able to change the behavior
 quite simply
2019-06-07 18:38:00 +03:00
Mikhail Zarechenskiy
e7064f5b77 [NI] Move creation of constraint system under callbacks
This will be needed in the next commit to have access to constraint
 system that is used for old inference
2019-06-07 18:37:18 +03:00
Igor Yakovlev
ada41fb23f Add copy method to KtUltraLightSuspendContinuationParameter 2019-06-07 17:54:03 +03:00
Igor Yakovlev
2a1293e3ef Fix test data for UL suspend declatations
(remove should-load-cls flag)
2019-06-07 17:54:03 +03:00
Igor Yakovlev
63d7e479c6 Fix invalid nullability annotation for suspend functions in LightClasses 2019-06-07 17:54:03 +03:00
Igor Yakovlev
d005dc685f Add nullability support to KtUltraLightSuspendContinuationParameter 2019-06-07 17:54:03 +03:00
Igor Yakovlev
0d51a2ec43 Optimize for void return type for functions with no return type
+ small refacroring
2019-06-07 17:54:03 +03:00
Igor Yakovlev
9e904598fb Add coroutines as parameters 2019-06-07 17:54:03 +03:00
Igor Yakovlev
fc30e564ba Add support ultra light suspend functions declarations 2019-06-07 17:54:03 +03:00
Vyacheslav Gerasimov
16b9c15133 Build: Don't run checkBuild tasks on check, add checkBuild to buildSrc 2019-06-07 17:38:16 +03:00
Vyacheslav Gerasimov
2769dc8359 Build: Improve sourcesJar helper
- Add sources from embedded projects
 - Add artifact to sources configuration
 - Use register instead of create

 #KT-30237 Fixed
2019-06-07 17:37:46 +03:00
Vyacheslav Gerasimov
547b10ee29 Build: Write ivy.xml without usage of internal gradle apis 2019-06-07 17:37:39 +03:00
Alexander Udalov
bbbd47ead3 Minor, rename codegen test 2019-06-07 15:01:44 +02:00
Alexander Podkhalyuzin
ea86ebf995 Do not expect that KDoc reference contains importable fqName
#KT-31768 Fixed
2019-06-07 15:25:15 +03:00
Mads Ager
71604851fe JVM_IR: Allow delegated companion objects.
This currently leads to a compilation error due to metadata
generation.
2019-06-07 13:26:20 +02:00
Mikhail Zarechenskiy
4ddd9f081b [NI] Consider explicitly specified type argument as an input type
#KT-31860 Fixed
2019-06-07 12:31:42 +03:00
Mikhail Zarechenskiy
787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitry Gridin
f48640f91c Fix test for UnsafeCastFromDynamicInspection 2019-06-07 12:23:55 +07:00
Dmitry Gridin
8eb11d9d3d Fix some tests 2019-06-07 12:23:54 +07:00
Dmitry Gridin
4f8c0653c5 Change API in AbstractApplicabilityBasedInspection
Replace all inspectionTarget with inspectionHighlightRangeInElement & change type of element in applyTo from PsiElement to TElement
2019-06-07 12:23:54 +07:00
Dmitry Gridin
1ad7a50087 IfThenToElvis & FoldInitializerAndIfToElvis should add new line for long expression
Relates to #KT-19643 #KT-16067
2019-06-07 12:23:54 +07:00
Dmitry Gridin
9c1ff75efc Minor: change highlight range for '...ToElvis' & '...ToSafeAccess' inspections
New range: from `if` keyword to right parenthesis
Relates to #KT-19643 #KT-16067
2019-06-07 12:23:54 +07:00
Dmitry Gridin
984c781588 FoldInitializerAndIfToElvisInspection: decrease severity level to INFORMATION for is
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
b3fe830b6e Fix false positive "Foldable if-then" with Result type
#KT-27074 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
f2accb7b9e Convert IfThenToElvisIntention to inspection & decrease severity to INFO
#KT-16067 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
d8f32b1a0c Cleanup J2KPostProcessingRegistrarImpl 2019-06-07 12:23:54 +07:00
Dmitry Gridin
b4949a1683 Cleanup branchedTransformations & update copyright 2019-06-07 12:23:54 +07:00
Dmitry Gridin
74c177fd26 Convert FoldInitializerAndIfToElvisIntention to inspection and decrease severity to INFO
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin
8b0b135112 Add new line after modifier list if last child is comment
#KT-30804 Fixed
2019-06-07 12:23:06 +07:00
Alexander Udalov
fec9ee6408 Minor, add kdoc for typeOf 2019-06-07 00:29:35 +02:00
Mikhail Zarechenskiy
42b7552d17 Fix exception on attempt to map inner non-fixed type variable
#KT-31842 Fixed
2019-06-07 01:18:47 +03:00
Ilya Chernikov
e542c9ea84 Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers
- make old API deprecated (with error where possible)
- drop old internal classes related to the old API
- refactor usages accordingly
- fix and add missing features to the scripting API where necessary
2019-06-06 17:21:00 +02:00
Ilya Chernikov
e5054f9648 Refactoring scripting infrastructure:
- add a helper for new constructing Compilation Configuration only when necessary
- add more converters for legacy diagnostics
- add helpers for simpler creating of failure results
2019-06-06 17:21:00 +02:00
Ilya Chernikov
b7fd898bb8 Add explicit return types to helpers
also workarounds a problem (KT-30297) with new inference
2019-06-06 17:21:00 +02:00
Ilya Chernikov
4fb2f81134 Refactor scripting - prepare utilities for refactoring of the script definitions handling 2019-06-06 17:20:59 +02:00
Andrey Uskov
5efd55f530 Fix memory leak on project reimport
#KT-31843 Fixed
2019-06-06 17:11:07 +03:00
Ting-Yuan Huang
a447c748bc JVM_IR: support @JvmDefaults in compatibility mode. 2019-06-06 14:10:28 +02:00
Toshiaki Kameyama
1c32941949 Use property access syntax: don't report when setter argument is lambda
#KT-30627 Fixed
2019-06-06 18:53:15 +07:00
Sergey Rostov
a3f8987255 JPS Build: fix importing artifacts
For some reason, gradle.projectsEvaluated callback evaluates after IDEA
import script gathers all project models. So, all jps related project
settings (including artifacts configurations) won't be imported.

We need only :prepare:idea-plugin evaluated. So replacing
gradle.projectsEvaluated to root Project.afterEvaluate and
 forcing evaluation of :prepare:idea-plugin fixes the problem.
2019-06-06 11:00:58 +03:00
Sergey Rostov
8995d89599 Gradle, js, karma: don't run karma if no browsers configured
#KT-31662 Fixed
2019-06-06 09:15:40 +03:00
Sergey Rostov
97fc3fe989 Gradle, js, karma: use ^4.0.0-rc.6 to use webpack 3, require webpack
#KT-31564 Fixed
2019-06-06 09:15:40 +03:00
Sergey Rostov
eab577001b Gradle, js, npm simple linker: fix creating junction on windows 2019-06-06 09:15:40 +03:00
Sergey Rostov
96fc06c7fb Gradle, js, tests: use compilation runtime classpath as input
#KT-31814 Fixed
2019-06-06 09:15:39 +03:00
Ilya Matveev
f32d48c66d Gradle, tests: Fix native interop test for Win x86 2019-06-06 12:53:02 +07:00
Ilya Matveev
dd941ffa93 Project wizard tests: Bump Gradle plugin version to use test binaries 2019-06-06 12:53:01 +07:00
Ilya Matveev
e8e2a5654e IDEA plugin: Use new test binary getter in project templates
Issue #KT-31724 fixed
2019-06-06 12:53:01 +07:00
Ilya Matveev
2ab0760e35 Gradle, native: Fix creating test binaries for non-host platforms
Issue #KT-31725 fixed
2019-06-06 12:53:01 +07:00
Dmitry Gridin
afa9a80b3a Fix multi module tests for AddOperatorModifierInspection 2019-06-06 12:09:28 +07:00
Ilya Kirillov
201bf328ca New J2K: print new line before init section because of bad formatting 2019-06-05 23:41:49 +03:00
Ilya Kirillov
ca23eb44a1 New J2K: add type star projections for converted classes raw references
#KT-31818 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov
845cde2d23 New J2K: do not add star projection type for raw class literal expression
#KT-15791 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov
f75a7cbfc9 New J2K: fix test data for java8MapForEachWithFullJdk test 2019-06-05 23:33:12 +03:00
Ilya Kirillov
a56155ca73 New J2K: correctly handle vararg annotation parameter of external Java class
#KT-31726 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov
58611ec417 New J2K: add test data for #KT-16662, #KT-15991, #KT-12050 2019-06-05 23:33:12 +03:00
Ilya Kirillov
c1e24d818b New J2K: fix NPEs in nullability analysis
#KT-31817 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov
1a9deed5d8 New J2K: add conversion progress bar
Relates to #KT-31812
2019-06-05 23:33:11 +03:00
Ilya Kirillov
f51e28ea68 New J2K: commit file after each post-processing
#KT-31809 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov
0623fa4349 New J2K: reformat JavaToKotlinAction.kt 2019-06-05 23:33:11 +03:00
Ilya Kirillov
aaab1fe134 New J2K: suggest user to configure Kotlin in a project before nj2k conversion 2019-06-05 23:33:11 +03:00
Leonid Startsev
3792c44378 Make short path for non-serializable classes and other improvements:
Adjust some error messages
Add 'fallbackElement' to report on when property is implicitly typed
Split findTypeSerializerOrContext into checked and unchecked versions
2019-06-05 19:13:03 +03:00
Leonid Startsev
dc79b99dd2 Implement inspection about no-arg constructor in non-serializable supertype 2019-06-05 19:11:18 +03:00
Leonid Startsev
8f77b55ada Retrieve serializable properties from binding context in most of the places
Remove unused record 'SERIALIZER_FOR_PROPERTY'
2019-06-05 19:11:18 +03:00
Leonid Startsev
fe1f36bc02 Report an error on @Serializable inline classes and missing @Transient initializers 2019-06-05 19:12:34 +03:00
Leonid Startsev
e6d96f1de9 Implement diagnostic about nullable serializer for non-nullable type 2019-06-05 19:12:00 +03:00
Leonid Startsev
6895184b84 Implement basics diagnostics reporting from the serialization plugin similarly to noArg and allOpen plugins 2019-06-05 19:11:20 +03:00
Leonid Startsev
d3a596e3c2 Correctly copy init blocks code to deserialization constructor
Fixes https://github.com/JetBrains/kotlin-native/issues/3019

Workaround problem with proguard and inline reified functions
2019-06-05 17:44:34 +03:00
Leonid Startsev
6370f0b3be Correctly reference deserialization constructor added by plugin
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/472
2019-06-05 17:43:46 +03:00
Alexander Udalov
43cb17cdd5 Check expected type of annotation parameter correctly in AnnotationDeserializer
The main idea of this refactoring is to separate two usages of
`AnnotationDeserializer.resolveValue`: the one where we load annotation
argument values, and the one where we load constant values of properties
for JS/Native/Common
(`AnnotationAndConstantLoaderImpl.loadPropertyConstant`).

In the latter case, `expectedType` is the type of the property and it
can be a supertype of the actual value (e.g. see `arrayConst` in
compiler/testData/serialization/builtinsSerializer/compileTimeConstants.kt).
But in the former case, we need to check that the value conforms to the
expected type and disregard it if it's not the case, which is possible
if the annotation was recompiled separately.

 #KT-28927
2019-06-05 14:44:15 +02:00
Alexander Udalov
c666b60ca3 Support arrays of class literals in AnnotationDeserializer
#KT-28927 Fixed
2019-06-05 14:44:14 +02:00
Dmitry Gridin
52ec9e0fa8 Extract resolve from write action & cleanup AddOperatorModifierInspection
Relates to #KT-31533
2019-06-05 19:27:52 +07:00
Toshiaki Kameyama
4c62788c3e Make "Add operator modifier" an inspection instead of intention
#KT-31533 Fixed
2019-06-05 19:27:52 +07:00
Mikhael Bogdanov
5123e1f078 Add project property for workers count 2019-06-05 14:24:26 +02:00
Ivan Gavrilovic
7a2332fe36 KT-31714: Close files after analysis in incremental KAPT
Artifact transform used to analyze classpath was not closing files, which
caused java.nio.file.FileSystemException. This commit fixes that, and all
input streams are closed after use.

Fixes: KT-31714
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic
695f202e46 KT-31127: add only generated Java sources to JavaCompile inputs
This commit changes how generated sources are added to the Gradle JavaCompile
task. Previously, directory was added to sources which caused issues with
annotation processors that only generate Kotlin sources. I.e. JavaCompile task
was executed but no java sources existed.

Now, only generated Java sources are added to the JavaCompile task. This
means that if only Kotlin sources are generated JavaCompile task will be
skipped.

Fixes: KT-31127
Test: Kapt3IT.testKotlinProcessorUsingFiler
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic
55ba985cd2 KAPT: do not discover incremental APs only if cache is not set
KaptFlag.INCREMENTAL_APT is used to indicate that KAPT run
should try to be incremental because changes to input files and
classpath have been detected. However, first run of the Gradle
task will set this flag to false, which means that all APs will be
detected as non-incremental in the first run. Further on, this means
that the dependency caches will be invalid, and all subsequent runs
will be non-incremental as well.

This commit uses existence of dependency cache to determine if incremental
APs should be discovered. The regression was introduced in
72fdc648ff.

Test: ./gradlew :kotlin-gradle-plugin-integration-tests:testAdvanceGradleVersion --tests *KaptIncrementalWith*\
 && ./gradlew :kotlin-gradle-plugin-integration-tests:test --tests *KaptIncrementalWith*
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic
1fa990b063 Support isolating APs that report multiple originating elements from the same file
It is possible for isolating annotation processor to report two or more
originating elements from the same source file when generating
sources/classes/resources. This commit makes sure the source file are
de-duped, so assertion that there is a single source file does not fail.

Test: IsolatingIncrementalProcessorsTest.testIsolatingWithMultipleOriginatingElements

This is improvement to https://youtrack.jetbrains.com/issue/KT-23880
2019-06-05 18:19:49 +09:00
Ivan Gavrilovic
76f62da6ae Improve constants analysis in KAPT
When analyzing source files in KAPT for incremental annotation processing,
avoid creating TreePath instances for initializers that are literals. E.g.
if it is just a boolean/int literal, we do not need to visit the tree nor
create expensive TreePath instance.

For classes that contain only constants (such as R.java for Android projects)
this is a significant improvement. Class that contains 16000 constants took
more than 10 seconds to analyze, now it is 70ms.
2019-06-05 18:19:49 +09:00
Yan Zhulanow
84c048ca81 Do not run task verification in NMPP tests on 183 platform as well 2019-06-05 18:17:45 +09:00
Ting-Yuan Huang
1b4d26e490 psi2ir: keep the type of when when possible
Ideally, the type of `IrWhen` should be provided by type inference for
a consistent behavior. `USED_AS_EXPRESSION` from CFG isn't always
consistent with type inference, unfortunately.

The behavior is now aligned with `if`. The type of `when` is kept when
it *can* be an expression, instead of whether it is used or not.
2019-06-05 10:23:44 +02:00
Svyatoslav Kuzmich
cd651be461 [JS IR BE] Migrate JS BE to common klib utils 2019-06-05 11:15:45 +03:00
Mads Ager
0c586ef5c1 JVM_IR: Maintain annotations in SAM conversion.
Copy method and parameter annotations to the generated SAM
implementation method.
2019-06-05 08:21:59 +02:00
Dmitry Gridin
bf9dde5c32 Fix assert from createExpression in RemoveRedundantQualifierNameInspection 2019-06-05 13:17:12 +07:00
Yan Zhulanow
09ff9a65a5 Fix 182 bunch tests, do not perform task tests on older platform versions 2019-06-05 13:27:38 +09:00
Yan Zhulanow
a575c7e5b5 Minor: Fix NPE in BinaryModuleInfo, handle empty scopes 2019-06-05 13:27:38 +09:00
Mikhail Glukhikh
71590b6735 Introduce Kotlin language substitutor to fix exceptions in velocity files
Related to KT-31470 (should fix the problem or at least soften it)
May be related also to KT-30977
#KT-30886 Fixed
2019-06-04 23:30:02 +03:00
Abduqodiri Qurbonzoda
37dfbb3eba Workaround unpaired surrogates replacement with ? (KT-31614) 2019-06-04 21:25:41 +03:00
Sergey Rostov
1c0519b0a2 Gradle, js, npm: fix resolving transitive npm dependencies using yarn.lock
- already visited transitive npm dependencies should be stored in parent dependencies
- child NpmDependency should search resolved project data in parent NpmDependencies
2019-06-04 19:32:10 +03:00
Sergey Rostov
465a47a194 Gradle, js, npm: fix idea gradle sync for multiproject builds
npm resolver ProjectData stored per project (not in root project)
2019-06-04 19:32:10 +03:00
Sergey Rostov
b5080bda75 Gradle, js, npm: fix reading package.json files
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
Sergey Rostov
32a0bb9f0e Gradle, js, npm: fix npm aggregated configuration attributes
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
ilgonmic
16200181cc KT-31645 Fix yarn downloading on Windows 2019-06-04 17:38:24 +03:00
Vyacheslav Gerasimov
7d38977f5e 192: Update since & until versions for 192 plugin 2019-06-04 16:34:33 +03:00
Mikhael Bogdanov
79074a7650 Specify JVM target for inline tests 2019-06-04 14:56:14 +02:00
Mikhael Bogdanov
81e6416bfe Support bound callable reference inlining in IR 2019-06-04 14:56:13 +02:00
Mikhael Bogdanov
3c093f321d Support unbound callable function references in inliner 2019-06-04 14:56:12 +02:00
Sergey Igushkin
0b59d0b416 Fix testAndroidMppProductionDependenciesInTests Gradle version too low
The required Gradle version for AGP 3.3 is 4.10.1+. Use 5.0.
2019-06-04 15:36:22 +03:00
Dmitriy Dolovov
ef680cf332 KLIB reader: Add missed JARs to IDEA plugin 2019-06-04 12:40:56 +03:00
Yan Zhulanow
bc6f01805e Fix JVM test running in MPP projects (KT-30814) 2019-06-04 17:56:05 +09:00
Mikhail Zarechenskiy
6d3a7102d5 Fix evaluation of local functions for new-inference
Plus, additionally fix evaluation of generic local functions everywhere

 The problem was that in new-inference we create more substituted
 descriptors while old inference tries to preserve original ones.
 Later, backend fails to retrieve those descriptors as it uses originals.
 But, again, this worked only for simple functions, for generic functions
 debugger with new and old inference worked incorrectly

 #KT-31785 Fixed
2019-06-04 11:07:50 +03:00
Sergey Rostov
8dabf24b41 Gradle: provide descriptions for JS tasks
#KT-31560 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov
fbefa17337 Gradle, NPM, windows: creating symlink without administrator privilege
#KT-31694 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov
85adee9804 Gradle, js, npm: resolve and warn about clashes in packages_imported
#KT-31697 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov
46a1ec28bf Gradle, npm: implement semver comparision 2019-06-04 10:00:58 +03:00
Sergey Rostov
619ee8717b Gradle, npm: extract semver utils to separate file 2019-06-04 10:00:58 +03:00
Sergey Rostov
42bcb81c08 Gradle, npm, imported packages: import multiple version to different dirs 2019-06-04 10:00:58 +03:00
Sergey Rostov
e557a3c3f2 Gradle, ProcessedFilesCache: delete everything on version change 2019-06-04 10:00:57 +03:00
Sergey Rostov
5b6c467e22 Gradle, ProcessedFilesCache: report target values clash 2019-06-04 10:00:57 +03:00
Sergey Rostov
5b21c935a4 Gradle, JS, NpmResolver: save imported packages cache state before calling npm 2019-06-04 10:00:56 +03:00
Sergey Rostov
fdbee7a99a Gradle, js, NPM: select one version between tools and all of compile configurations
#KT-31696 Fixed
2019-06-04 10:00:56 +03:00
Sergey Rostov
a37b38e891 Gradle, minor: remove unused import 2019-06-04 10:00:56 +03:00
Mikhael Bogdanov
bce774eda5 Jvm Ir. IrIntrinsicMethods.kt optimization: avoid 'IrClass.functions' call if it not necessary 2019-06-04 08:45:46 +02:00
Mikhael Bogdanov
30ab11575d Jvm Ir. Optimization: avoid 'IrClass.functions' call if it not necessary 2019-06-04 08:45:45 +02:00
Dmitriy Dolovov
171e226d58 Move 'cidrPluginsEnabled' Gradle flag to local.properties 2019-06-04 08:42:47 +03:00
Dmitriy Dolovov
bbdb5e5f0f Reworked joint build (kotlin + kotlin-ultimate)
- Root buildscript classpath no more depends on buildSrc.jar from kotlin-ultimate. This allows to have stable joint builds - w/o occasional "Unresolved reference" errors in buildscripts.
- kotlin-ultimate modules are now included into Kotlin project when two conditions are met: 1) Gradle parameter 'cidrPluginsEnabled' is turned on; 2) kotlin-ultimate Git repo is checked out right to the Kotlin project root (assuming there is 'kotlin-ultimate' directory inside the project root).
2019-06-04 08:42:22 +03:00
Igor Yakovlev
db4ba238eb Avoid to call delegate from isInheritorDeep in UL-class
(plus small refacrotoring)
2019-06-03 17:23:41 +03:00
Igor Yakovlev
eaa36d4d27 Fix kotlin.Deprecated annotation for UL-classes 2019-06-03 17:23:41 +03:00
Igor Yakovlev
2a729082a0 Add UltraLightFacadeClassTest 2019-06-03 17:23:41 +03:00
Igor Yakovlev
8707edfaa3 Disable to mangling facade functions + refactoring 2019-06-03 17:23:40 +03:00
Igor Yakovlev
ac85849721 Avoid access to delegate from KtUltraLightClass 2019-06-03 17:23:40 +03:00
Igor Yakovlev
3889b70f1e Avoid clsDelegate access from (UL-)KtLightClassForFacade 2019-06-03 17:23:40 +03:00
Igor Yakovlev
fa6b21357b Add cache to KLightClassForFacade 2019-06-03 17:23:40 +03:00
Igor Yakovlev
24253e21d0 Add ultraKtLightClassForFacade multifile support 2019-06-03 17:23:40 +03:00
Igor Yakovlev
86e9018f49 Add text functions to KtLightClassForFacade 2019-06-03 17:23:39 +03:00
Igor Yakovlev
852a4bc0ca Add support UL for FileFacade 2019-06-03 17:23:39 +03:00
Anton Bannykh
e996705b45 JS: simplify package metadata cache invalidation 2019-06-03 15:53:00 +03:00
Anton Bannykh
8ab9ef2afa JS: don't visit all descriptors on metadata serialization 2019-06-03 15:53:00 +03:00
Ilya Chernikov
0a6ade88cc Fix classpath detection from classloader resources 2019-06-03 13:57:20 +02:00
Sergey Igushkin
27aa3a573e Fix MPP source set dependencies missing in Android tests (KT-29343)
Add Kotlin source set dependencies to the Android source sets, and also
add aggregated Kotlin compilation dependencies to the dedicated
Android source sets of the Android variants.

Issue #KT-29343 Fixed
2019-06-03 14:53:38 +03:00
Sergey Igushkin
988df517dd Gradle HMPP support fixes after review
* Add version to project structure metadata
* Use a data class for module dependencies in project structure
* Use task registering API for new tasks
* Simplify code
* Extract compatibility wrappers
* Fix multi-file dependencies that transformations silently ignored
2019-06-03 14:47:09 +03:00
Sergey Igushkin
5d7bd6c01a Add API for IDE import of metadata dependency transformations 2019-06-03 14:47:08 +03:00
Sergey Igushkin
3c3a338770 Setup versions consistently only among published source sets
The common source sets that are not published (like commonTest) should
not affect dependency resolution for other source sets.

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
2019-06-03 14:47:07 +03:00
Sergey Igushkin
0c9d962f9f MPP granular source set metadata support 2019-06-03 14:47:07 +03:00
Sergey Igushkin
fcb006b42a (minor) Rewrite CompilationSourceSetUtil
Add the API to access compilations by source set, which will be widely
needed for further MPP logic.
2019-06-03 14:46:51 +03:00
Alexander Gorshenev
10a54c2581 Moved the common klib writer from Kotlin/Native to util-klib 2019-06-03 14:38:48 +03:00
Alexander Gorshenev
7ddbd8ca80 Moved the common klib reader functionality from Kotlin/Native to util-klib 2019-06-03 14:38:48 +03:00
Alexander Gorshenev
d1390365de Moved basic classes from konan/utils to util-io 2019-06-03 14:38:48 +03:00
Igor Yakovlev
f5190f195d Add correct UL-method hasTypeParameters realization (#KT-30970 Fixed)
Incorrect realization is breaking-down of IDEA generic-type inference algorithm that leads to SOE.
2019-06-03 14:11:06 +03:00
Ilya Kirillov
f660faed97 New J2K: Wrap single annotation parameter to arrayOf if array type is required
#KT-31726 fixed
2019-06-03 13:02:48 +03:00
Dmitry Gridin
7bc2fcd657 Convert RemoveCurlyBracesFromTemplateIntention to inspection
Relates to #KT-31717
2019-06-03 16:37:37 +07:00
Dmitry Gridin
7f4d2891e8 Cleanup ReplacementPerformer 2019-06-03 16:36:50 +07:00
Dmitry Gridin
f5e83d7b47 Explicit package prefix should override implicit
#KT-29716 Fixed
2019-06-03 16:35:58 +07:00
Dmitry Gridin
20114a0868 Minor: cleanup packageUtils 2019-06-03 16:35:58 +07:00
Dmitry Gridin
f6a61e8034 Minor: cleanup ChangePackageIntention 2019-06-03 16:35:58 +07:00
Dmitry Gridin
4fa83a2fd7 Decrease severity of PackageDirectoryMismatchInspection to INFO
#KT-31716 Fixed
2019-06-03 16:35:58 +07:00
Dmitriy Novozhilov
ef91960fe9 [NI] Fix testdata after enabling NI in IDE tests 2019-06-03 12:13:31 +03:00
Dmitry Savvinov
dca23f871c Allow to force-require syntetic SAM-adapters even in NI
This is needed for some IDE clients, particularly, completion: even
though presenting only non-converted member (e.g., 'foo(Consumer<Int>')
is nominally OK, as resolution with NI is smart enough to accept 'foo { }'
for such a call, it is inconvenient for users (for example, hitting
enter would insert round brackets instead of a figure brackets)

This commit adds very-very narrow API (borderline hacky) in
JavaSyntheticScopes, to allow clients explicitly ask for a scopes with
force-enabled synthetic conversions. It fixes several tests, which had
started to fail after corresponding commit about NI and SAM-adapters
(fe5976d7f4), e.g.:
- Java8BasicCompletionTestGenerated.testCollectionMethods
- Java8BasicCompletionTestGenerated.testStreamMethods
- JvmBasicCompletionTestGenerated$Common$StaticMembers.testJavaStaticMethods
- JvmBasicCompletionTestGenerated$Java.testSAMAdaptersStatic
- JvmWithLibBasicCompletionTestGenerated.testSamAdapter
- JvmWithLibBasicCompletionTestGenerated.testSamAdapterAndGenerics

Note that changes are made in ReferenceVariantsHelper, which is used by
several other clients in IDE. Presumably, those changes are needed for
them too.
2019-06-03 10:46:53 +03:00
Dmitry Savvinov
eda975d317 Minor: reformat ReferenceVariantsHelper.kt 2019-06-03 10:46:53 +03:00
Sergey Rostov
00f8f09274 Gradle, js, npm: don't setup package manager without npm dependencies
#KT-31729 Fixed
2019-06-03 10:00:27 +03:00
Dmitry Savvinov
8caafa874e Advance Kotlin versions in some Gradle Tests
Those versions have been resolved from -dev repository, which got
cleared and those tests started to fail.

In long term, it would be nice to not use fixed Kotlin versions in
tests, but for now we just advance it to prevent tests from failing.
2019-06-03 08:17:25 +03:00
Mikhail Zarechenskiy
e15cb67e29 Fix exception from UAST on attempt to map non-fixed type variable
#KT-31723 Fixed
 #EA-126269 Fixed
 #EA-143705 Fixed
 #EA-143703 Fixed
 #EA-143694 Fixed
2019-06-03 02:04:56 +03:00
Mikhail Zarechenskiy
91bd11a6db Fix UAST tests for new-inference: adapt SAM-converted descriptors 2019-06-03 02:04:55 +03:00
Mikhail Zarechenskiy
010ac50243 Enable new type inference for UAST tests as for IDE tests 2019-06-03 02:04:53 +03:00
Roman
0163019295 [JVM IR] Unmute fixed test 2019-05-31 18:49:54 +03:00
Mikhail Zarechenskiy
268dddcb3d Remove restriction about JS_IR backend for test 2019-05-31 17:23:58 +03:00
Vyacheslav Gerasimov
cb7cdff2e0 192: Fix ultimate tests compilation for 192 platform 2019-05-31 16:32:11 +03:00
Vyacheslav Gerasimov
cf3a98123f 192: Fix uast tests compilation for 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
15c46aa9cc 192: Fix compiler.pro for 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
91bff66f29 192: Remove accessors for module introduces in 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
b7be99ffde 192: Fix variance related problems for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
637f7a8cab 192: Fix InlayHintTypeTestUtil for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
fac959ba1e 192: Fix FormatSettingsUtil for 192, can't access getProject any more 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
d5b7b520e0 192: Fix completion KotlinConfidenceTest for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
d58df2c107 192: Fix AbstractJavaToKotlinConverterForWebDemoTest for 192 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
f935cfeda2 192: Remove override createAddPropertyActions, no more in JvmElementActionsFactory 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov
979df225a7 192: Fix uast-kotlin for 192 platform 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
c2522535d9 192: Fix KotlinMPPGradleProjectTaskRunnerUtil usages of deprecated api 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
cd18d9d534 192: Add property accessor for myModule which is removed in 192 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
cf1e1e3a0c 192: Fix accessors to module & project in tests 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
05a2f5bda5 192: Fix nullability related problems for 192 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
57943768bf Build: Remove bunches for kotlin-compiler build script 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
593e67d47d 192: Add 192 platform IdeCompatibilityDsl 2019-05-31 16:32:09 +03:00
Vyacheslav Gerasimov
2d74560523 192: Build against Idea 192.4205.45 2019-05-31 16:32:08 +03:00
Vyacheslav Gerasimov
d740455e9f Build: Update list of redirected repositories 2019-05-31 16:32:08 +03:00
Ilya Chernikov
f986856d03 Improve classpath extraction from classloader:
- implement opt-in unpacking/caching of the jar collection archives,
  such as spring boot fat jars and WARs, to the temp dir, and creating
  a valid classpath from extracted archive
- turning it on for the new default jsr223 engine
- fallback to extracting classpath from resource URLs if the classloader
  is not known url-based one
- refactor and optimize extraction
- cache the last retrieved classpath in the default JSR-223 script engine
  factory
2019-05-31 14:06:25 +02:00
Ilya Chernikov
e95569a273 Report definition-related error diagnostic on the whole script file
#KT-31452 fixed
2019-05-31 13:34:17 +02:00
Dmitry Gridin
21c10af1a7 Fix tests in quickfix 2019-05-31 18:00:56 +07:00
Dmitry Gridin
605ee041a9 Remove CreateTypeAliasFromUsageFix
Relates to #KT-31519
2019-05-31 18:00:56 +07:00
Alexander Udalov
4c9e9b1f3a Fix KotlinReflectionInternalError on encountering 'clone' in a class
`RuntimeTypeMapper.mapSignature` threw exception because the descriptor
for `clone` was created manually in CloneableClassScope and therefore it
didn't have a JVM signature as in deserialized descriptors, and wasn't
recognized as a Java method either.

 #KT-22923 Fixed
2019-05-31 12:29:20 +02:00
Dmitriy Dolovov
2857c62dba Don't use plugin classloader to get Kotlin plugin info
Issue #KT-31598 Fixed
2019-05-31 13:26:39 +03:00
Roman Artemev
c2d118cb75 [JS IR BE] Improve error reporting 2019-05-31 13:14:43 +03:00
Roman Artemev
beb1ce55f8 [IR BE] Fix capturing of var-locals inside class/field initializers 2019-05-31 13:14:43 +03:00
Roman Artemev
5686de7e09 [JS IR BE] Make kotlinx.io compile
- Fix expect/actual default arguments
 - Fix dynamic type in inliner
 - Fix external varargs
2019-05-31 13:14:43 +03:00
Denis Zharkov
753a9a1c36 Fix performance regression caused by contracts
Do not obtain all children from KtBlockExpression when you only need
the first one.
It might be crucial for a huge blocks of code
2019-05-31 11:21:15 +03:00
Dmitriy Dolovov
16d05b6129 Get IDE plugin path from KotlinPluginUtil 2019-05-31 10:02:02 +03:00
Dmitriy Dolovov
fdf7b0c9fb Convert KotlinPluginUtil to Kotlin 2019-05-31 10:01:54 +03:00
Mikhael Bogdanov
79d855f7a4 Minor. Revert deleted by mistake test directive 2019-05-31 07:09:28 +02:00
Ilya Kirillov
72bedb63fa New J2K: add more string operations conversions 2019-05-31 00:25:53 +03:00
Ilya Kirillov
f03965995d New J2K: generate nj2k tests 2019-05-31 00:25:53 +03:00
Ilya Kirillov
c136e81427 New J2K: optimize imports in post-processings 2019-05-31 00:25:52 +03:00
Ilya Kirillov
269ca20950 New J2K: add number types conversions to post-processing 2019-05-31 00:25:52 +03:00
Ilya Kirillov
3944a976df New J2K: handle static imports from Java correctly & do not ignore imports in tests 2019-05-31 00:25:52 +03:00
Ilya Kirillov
879abdafc2 Preserve comments in shorten references processor for qualified expressions 2019-05-31 00:25:52 +03:00
Ilya Kirillov
39dfa631bf New J2K: do not ignore long expressions in LiftReturnOrAssignmentInspection in post-processing 2019-05-31 00:25:52 +03:00
Ilya Kirillov
8fa9b9923f Allow removing trivial property accessor body when the accessor can not be fully deleted in redundant getter/setter inspections 2019-05-31 00:25:52 +03:00
Ilya Kirillov
95a6f59c62 New J2K: preserve declarations order & place init sections to the end 2019-05-31 00:25:52 +03:00
Ilya Kirillov
ab26061b5e New J2K: fix testData 2019-05-31 00:25:52 +03:00
Ilya Kirillov
3a98b49556 New J2K: fix type in ast conversion name 2019-05-31 00:25:51 +03:00
Ilya Kirillov
621ae80f1d New J2K: rewrite getters and setters conversion in post-processing
KT-31700 fixed
2019-05-31 00:25:51 +03:00
Ilya Kirillov
63434fc46c New J2K: separate inspection like processings from others & remove boilerplate code in processings 2019-05-31 00:25:51 +03:00
Ilya Kirillov
d6e07ca693 New J2K: calculate type correctly for vararg parameter in nullability analysis 2019-05-31 00:25:51 +03:00
Ilya Kirillov
419f6c80de New J2K: filter out noinspection comments in resulted code 2019-05-31 00:25:51 +03:00
Ilya Kirillov
e04c984e48 New J2K: move all literal conversion stuff to LiteralConversion & add octal literals conversion 2019-05-31 00:25:51 +03:00
Ilya Kirillov
60b2b81e9c New J2K: preserve comments in DefaultArgumentsConversion 2019-05-31 00:25:51 +03:00
Ilya Kirillov
eed55a11ca New J2K: preserve comments in BuiltinMembersConversion 2019-05-31 00:25:51 +03:00
Alexander Udalov
ceecbfdcea Minor, fix kapt test data on comments
ClassFileToSourceStubConverter relies on JvmDeclarationOrigin which is
used in the codegen, and that origin has slightly changed for the
synthetic '$annotations' method (see
`MemberCodegen.generateSyntheticAnnotationsMethod`) in e9b50157
2019-05-30 19:30:46 +02:00
Ting-Yuan Huang
74e8c7c1c5 JVM_IR: generate default constructor
Quoted from https://kotlinlang.org/docs/reference/classes.html

"On the JVM, if all of the parameters of the primary constructor have
 default values, the compiler will generate an additional parameterless
 constructor which will use the default values. This makes it easier to
 use Kotlin with libraries such as Jackson or JPA that create class
 instances through parameterless constructors."
2019-05-30 18:53:27 +02:00
Georgy Bronnikov
440f327e74 JVM_IR: fix a typo in EnumWhenLowering 2019-05-30 19:04:31 +03:00
Georgy Bronnikov
d7dacef9af JVM_IR: correct RetentionPolicy annotation generation 2019-05-30 19:04:31 +03:00
Dmitry Savvinov
4f6d0ca1d1 Update missed tesdata
Was missed after 7daf12fa6d
2019-05-30 18:58:12 +03:00
Mikhail Zarechenskiy
0bc4022242 Revert "Temporary remove failing test for new inference about SAM conversions"
This reverts commit 5bcd974944.

 Fixed in 7c4101e2

 #KT-29561 Obsolete
2019-05-30 16:45:31 +03:00
Nikolay Krasko
465d21e6c5 Don't process invalid files in ReturnHintLinePainter (EA-141914) 2019-05-30 16:37:16 +03:00
Nikolay Krasko
7d00106813 Allow resolve on collecting reference data in copy-paste 2019-05-30 16:37:16 +03:00
Nikolay Krasko
a9329c5284 Minor refactoring in ModuleData tracker 2019-05-30 16:37:16 +03:00
Alexander Udalov
e72388895b JVM IR: invoke codegen after lowering all files in the module
Inspired by discussion in #2316
2019-05-30 13:28:31 +02:00
Igor Chevdar
b060acf01d KotlinMangler: added IrType.isInlined
Added possibility to specify when IrType corresponds to an inline class
2019-05-30 14:12:03 +03:00
Dmitry Savvinov
8e579855f2 [Testing] Support test roots in dependencies.txt 2019-05-30 12:32:39 +03:00
Dmitry Savvinov
f011c21c94 [Testing] Introduce ProjectResolveModel and parsing it from txt 2019-05-30 12:32:39 +03:00
Dmitry Savvinov
a59daafbb4 [Testing] Add more flexiblity to AbstractMultiModuleTest
- Preserve root names
- Provide an ability to transform copied file
- Allow passing several implemented modules in AbstractMultiModuleTest
2019-05-30 12:32:39 +03:00
Dmitry Savvinov
7daf12fa6d [Testing] Remove duplicate logic, clean-up CheckerTestUtil 2019-05-30 12:32:39 +03:00
Dmitriy Novozhilov
bcbbf4aba3 [NI] Fix replacing original in PropertyDescriptor 2019-05-30 11:01:10 +03:00
Simon Ogorodnik
88a9349f32 Use intersection of star projection type-param bounds instead of type 2019-05-30 09:52:02 +03:00
Yan Zhulanow
b48e0a89c5 Debugger: Hide synthetic '$completion' variable in Kotlin variables mode 2019-05-30 15:27:11 +09:00
Yan Zhulanow
bfb1d53ddf Debugger: Run control flow on code fragments (KT-30120) 2019-05-30 15:27:11 +09:00
Yan Zhulanow
35c63db9bc Debugger: Support coroutineContext for suspend functions without suspend calls (KT-24829) 2019-05-30 15:27:11 +09:00
Yan Zhulanow
b5f5149fc0 Add tooltip for Kotlin variables mode button (KT-30730) 2019-05-30 15:27:11 +09:00
Yan Zhulanow
c17c15db42 Debugger: Fix memory leak in conditional breakpoints (KT-31195) 2019-05-30 15:27:10 +09:00
Yan Zhulanow
999d5ce3bb Debugger: Fix VariableAsFunctionResolvedCall evaluation 2019-05-30 15:27:10 +09:00
Yan Zhulanow
4a90e9d0ab Debugger: Handle exceptions in async stack trace handler more gracefully (EA-141924) 2019-05-30 15:27:10 +09:00
Yan Zhulanow
0a6a811c57 Debugger: Fix lvalue evaluation (KT-11663, KT-19980) 2019-05-30 15:27:10 +09:00
Yan Zhulanow
bb0bc8a38a Debugger: Fix toTypedArray() evaluation (KT-8579) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
9ae8a8abf1 Debugger: Fix method evaluation on arrays (KT-11706) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
38dba20e24 Debugger: Allow super calls (KT-20560) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
cbbb3c35da Debugger: Fix evaluation for local extension functions (KT-13188) 2019-05-30 15:27:09 +09:00
Yan Zhulanow
8b3c22cea6 Debugger: Support hypothetical synchronized methods in the main class 2019-05-30 15:27:08 +09:00
Yan Zhulanow
ee0daae2ab Debugger: Support synchronized blocks and functions in evaluator (KT-11888) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
55bbcc4601 Generate line numbers for closing '}' in 'init {}' blocks (KT-12787) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
a385b4d9d0 Debugger: Fix evaluation on value parameter name position (KT-30976) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
577b3e096f Debugger: Fix test (lines were changed because of the updated copyright) 2019-05-30 15:27:08 +09:00
Yan Zhulanow
ae7550c5af Move out JVM debugger functionality 2019-05-30 15:27:07 +09:00
Dmitriy Novozhilov
5843336d42 Fix compiler errors in nj2k detected after changes in NI 2019-05-29 16:55:07 +03:00
Mads Ager
dc5f4ab240 Add annotation to static methods on DefaultImpls. 2019-05-29 15:37:09 +02:00
Vyacheslav Gerasimov
2fc2c8fa4c Minor: Cleanup android-sdk, remove obsolete comment & unused configuration 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
1152286ee3 Build: Add kotlin-dependencies to cache-redirector list 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
6b3f341ab5 Build: Publish jcabi-aether-1.0-SNAPSHOT to kotlin-dependencies as 1.0-dev-3
This allows to remove dependency on snapshot repository
https://oss.sonatype.org/content/repositories/snapshots
2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
9a9acd0fc1 Minor: Cleanup kotlin.buildSrc.prepare-deps/build.gradle.kts 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
0e1d15df5a Build: Drop android-dx from buildSrc 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
6a38cb050f Build: Add property for internal kotlin repo 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
2ce961a662 Build: Add kotlin-dependencies repo & update dx coordinates 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
aa79c1bcf6 Build: Extract publication for dependencies to publishing.gradle.kts 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
f5825a45f7 Build: Add bintray publication for dependencies/android-dx 2019-05-29 15:08:05 +03:00
Vyacheslav Gerasimov
10779ea397 Build: Extract android-dx to separate project with publishing 2019-05-29 15:08:04 +03:00
Vyacheslav Gerasimov
d0db006614 Build: Determine versions.properties location by buildscript.sourceURI 2019-05-29 15:08:04 +03:00
Alexander Udalov
2292a1a10e Ignore new daemon tests instead of muting them on buildserver 2019-05-29 13:18:27 +02:00
Mads Ager
5be0bd4a56 JVM_IR: Enable loadJava tests 2019-05-29 13:10:47 +02:00
Toshiaki Kameyama
65f06454be Add "Control flow with empty body" inspection
#KT-30970 Fixed
2019-05-29 18:04:24 +07:00
Alexander Udalov
d2fcb8cc6a Get rid of copy-pasted code from JavaSdkUtil
#KT-30973 Fixed
2019-05-29 10:50:37 +02:00
Dmitry Gridin
1c4fb9b00b ConstantConditionIfInspection.replaceWithBranch shouldn't remove subjectVariable with side effects
Relates to #KT-30975
2019-05-29 15:40:10 +07:00
Dmitry Gridin
e2d5e9a184 Only when keyword should be highlighted in WhenWithOnlyElseInspection
#KT-31673 Fixed
2019-05-29 15:40:10 +07:00
Toshiaki Kameyama
e955dcfc14 WhenWithOnlyElse: don't remove when subject variable if needed
#KT-30975 Fixed
2019-05-29 15:40:10 +07:00
Alexey Tsvetkov
7f1d30058a Fix IC test for multifile part with property
Our JPS and Gradle plugins handle
recompilation of multifile classes differently.

JPS plugin delegates handling to the JPS itself,
which tracks dependencies via bytecode,
and marks classes as dirty when they are affected.
So in JPS other parts of multifile classes are recompiled only
when a part's signature is changed.

In Gradle plugin we handle recompilation ourselves in
simpler way: any change in any part leads to a recompilation
of all parts of the same multifile class.

In future we should improve our Gradle plugin, but for now
I'm changing the test so that both JPS and Gradle tests
recompile all parts.

Also the dummy function is added to make sure that we
don't blindly recompile everything when a part is changed.
2019-05-29 10:23:19 +02:00
Alexander Udalov
c13bec0e41 Minor, simplify code in PropertyCodegen 2019-05-29 10:23:19 +02:00
Alexander Udalov
967a6bd80d Remove NotNull PSI element parameter from PropertyCodegen.generateBackingField
#KT-31131 Fixed
2019-05-29 10:23:19 +02:00
Alexander Udalov
e9b50157da Try loading PSI from descriptor in OtherOrigin constructor
To simplify several call sites
2019-05-29 10:23:19 +02:00
Alexey Tsvetkov
56d5846ef1 Add test for KT-31131 2019-05-29 10:23:18 +02:00
Dmitriy Novozhilov
bd87332b0c Fix compiler errors in compiler detected after enabling @OnlyInputTypes in NI 2019-05-29 10:57:08 +03:00
Dmitriy Novozhilov
e574106799 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed 2019-05-29 10:54:41 +03:00
Dmitriy Novozhilov
0f7e91ff6d [NI] Update testdata for stdlib diagnostic tests 2019-05-29 10:53:34 +03:00
Dmitriy Novozhilov
139497bafb [NI] Add checking @NotNull parameters for candidates 2019-05-29 10:53:07 +03:00
Dmitriy Novozhilov
7c4101e21c [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI 2019-05-29 10:35:46 +03:00
Anton Bannykh
dad334ffcd JS IR: ignore the new suspend callable reference test 2019-05-29 10:17:15 +03:00
Dmitry Gridin
f5796a303d Fix tests
Relates to #KT-30622
2019-05-29 11:00:28 +07:00
Dmitry Gridin
8988b4b344 Convert ReplaceSubstringIntention to ReplaceSubstringInspection
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
2310826ec9 Remove MergeWhenIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
41daf99346 Remove IfThenToDoubleBangIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
afcb2f3436 Remove ConvertIfWithThrowToAssertIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
d3339cae46 Merge ReplaceMathMaxWithCoerceAtLeastIntention & ReplaceMathMinWithCoerceAtMostIntention with ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
26478b1374 Remove ConvertTrimMarginToTrimIndentIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin
0b9b49d7bc Remove ConvertTrimIndentToTrimMarginIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Dmitry Gridin
91e9ed25f7 Remove ConvertNegatedBooleanSequenceIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Dmitry Gridin
dd03a81309 Remove ConvertClassToSealedClassIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Dmitry Gridin
1adc2ae4c8 Remove ConvertAssertToIfWithThrowIntention
Relates to #KT-31502
2019-05-29 11:00:27 +07:00
Ilya Gorbunov
fe9bd9ee20 Fix method reference ambiguity in test after introducing 'capitalize' overload 2019-05-29 06:49:05 +03:00
George Gastaldi
d0d4d00379 build: add kotlin-compiler-embeddable to BOM 2019-05-29 05:21:49 +03:00
Ilya Gorbunov
8badfca459 Fix titlecase lowering in decapitalize
Replace isUpperCase() with !isLowerCase check to lower both
upper- and titlecased first chars.
2019-05-29 03:54:46 +03:00
Ilya Gorbunov
a921bd04e0 capitalize/decapitalize: improve docs, add one test 2019-05-29 03:54:46 +03:00
Jake Wharton
af31794f60 Add Locale-accepting overloads for (de)capitalize in JDK stdlib
#KT-28933 fixed
2019-05-29 03:35:33 +03:00
Mikhail Zarechenskiy
f702417655 [NI] Relax rules for call completion: require at least one constraint
It's enough to have at least one good constraint.

 Note that the whole algorithm can be a bit more general:
 we could check also Out<T>, In<T> and verify that T has good only
 lower constraint or upper constraint, but there are questions for
 types like Inv<Out<T>>, where T should have lower and upper constraints

 #KT-31514 Fixed
2019-05-29 02:14:00 +03:00
Mikhail Zarechenskiy
848640253a Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit f20ec3e0a6.
2019-05-29 01:31:28 +03:00
Mikhail Zarechenskiy
86a95e1a7b Revert "[NI] Add checking @NotNull parameters for candidates"
This reverts commit 910177ab17.
2019-05-29 01:31:27 +03:00
Sergey Igushkin
25371734e8 Make withJava() safe to call repeatedlt on same target 2019-05-29 01:06:27 +03:00
Andrey Uskov
9a4596eaba Fix compilation of of KotlinMPPGradleTaskRunner 2019-05-29 00:05:18 +03:00
Anton Bannykh
c3170d1908 JS: cache metadata, grouped by package FQN 2019-05-28 23:33:17 +03:00
Anton Bannykh
c1f69ca8d6 JS: prepare to cache package metadata 2019-05-28 23:33:17 +03:00
Anton Bannykh
fc7fea4863 JS: make .meta.js the same as before 2019-05-28 23:33:17 +03:00
Anton Bannykh
145ca7b6a9 JS: merge proto parts as bytes 2019-05-28 23:33:17 +03:00
Anton Bannykh
fbd59ba68a JS: lazy load special functions and source maps 2019-05-28 23:33:17 +03:00
Anton Bannykh
a3aca662c1 JS: improve json parsestring 2019-05-28 23:33:17 +03:00
Anton Bannykh
56915d1c07 JS: optimize JSON parser 2019-05-28 23:33:17 +03:00
Dmitry Savvinov
675f930566 Fix compilation in bunches
Change in bunches was forgotten in aeb7f8400a
2019-05-28 21:25:32 +03:00
Ilya Matveev
78ce34f223 Gradle, native: Remove K/N repo from Gradle integration tests 2019-05-28 20:26:29 +03:00
Ilya Matveev
5b64410259 Gradle, native: Remove kotlin native repo in DSL codegen 2019-05-28 20:26:29 +03:00
Ilya Matveev
5e66399284 Move some classes used by Gradle plugin from K/N shared 2019-05-28 20:26:29 +03:00
Ilya Matveev
b002d572fb Gradle, native: Correct path to LLVM in K/N tool runner
Currently we have the same directory as llvmHome and targetToolchain
but strictly speaking we need to use llvmHome.
2019-05-28 20:26:29 +03:00
Ilya Matveev
cfb8e75829 Revert "Use kotlin-native-shared in the Gradle plugin"
This reverts commit c9ed648303.
2019-05-28 20:26:29 +03:00
Ilya Matveev
9a5c9a2180 Revert "Store kotlin-native-shared version in the jar of the Gradle plugin"
This reverts commit 24588263ed.
2019-05-28 20:26:28 +03:00
Ilya Matveev
49bcbf00fe Revert "Fix IDEA import after including kotlin-native-shared in Gradle plugin"
This reverts commit 774dbcd6c0.
2019-05-28 20:26:28 +03:00
Ilya Matveev
02ffc4bb22 Split shared: Create KonanVersion from string 2019-05-28 20:26:28 +03:00
Anton Bannykh
052ddd60ce JS: support callable references on suspend functions (KT-30987 fixed) 2019-05-28 19:13:08 +03:00
Dmitry Gridin
aff8a3f97f Fix KNPE in OptimizedImportsBuilder
#KT-31637 Fixed
2019-05-28 21:46:48 +07:00
Alexander Udalov
f9d61f2dc7 Make inline+reified functions synthetic instead of private in bytecode
#KT-18563 Fixed
2019-05-28 16:17:49 +02:00
Alexander Udalov
a645b36688 Minor, restructure InlineOnly-related utilities 2019-05-28 15:56:15 +02:00
Alexander Udalov
b42adcd73d Restructure bytecode listing tests on InlineOnly/inline+reified 2019-05-28 15:56:15 +02:00
Sergey Rostov
1c6ce208a6 Gradle, JS: support exotic versions while converting to semver
#KT-31563
2019-05-28 16:40:41 +03:00
Ilmir Usmanov
5631306165 Wrap result method node with max stack calculator in inliner
#KT-31347 Fixed
2019-05-28 16:37:45 +03:00
Mads Ager
3f6492ab2a JVM_IR: Restore lost top-level declaration check in annotation gen.
When moving away from descriptors, this top-level declaration check
was lost. That leads to many useless annotation elements in
inner classes attributes for annotations that are not inner classes.
2019-05-28 16:12:49 +03:00
Ilya Matveev
7929a05ee3 Build: Add K/N repo into Gradle integration tests to fix JPS build 2019-05-28 16:08:27 +03:00
Natalia Selezneva
b5dbdc53d1 Pass environment variables resolving script dependencies
There is no option in UI to enable/disable passing those variables,
but during Gradle Sync environment variables are passed by default
Also Gradle expect that gradleOptions are passed but there is also no option in UI
(during Gradle Sync IDEA add some options but they shouldn't affect dependencies resolution process)
see GradleExeSettings.resolverExtension.getExtraCommandLineArgs

gradleWithConnection was removed because it isn't used by gradle because they need to manage the TAPI project directory

projectRoot was fixed to externalProjectPath because it can be overrided in settings.gradle

^KT-30974 Fixed
2019-05-28 16:05:46 +03:00
Dmitry Savvinov
893ac735bc Convert property initializer to getter in
JvmPlatforms.unspecifiedJvmPlatform

This unties static initialization loop which lead to NCDFE and other
issues.
2019-05-28 16:03:05 +03:00
Dmitry Savvinov
aeb7f8400a Rename platform to targetPlatform in KotlinFacetSettings to avoid ambiguity in Java 2019-05-28 16:03:05 +03:00
Andrey Uskov
6ff5dc179c Fix exception during mpp run task creation due to usage of deprecated api
#KT-31482 Fixed
2019-05-28 15:17:32 +03:00
Andrey Uskov
ec1d313ecb Fix ClassCastException during search of overriders
#EA-115095 Fixed
2019-05-28 15:16:33 +03:00
Andrey Uskov
08d1220728 Do not show UI dialog from a write action during work of intention
#EA-100676 Fixed
2019-05-28 15:15:58 +03:00
Mikhail Zarechenskiy
e366bac713 Fix debugger tests for new-inference
There is new child of `VariableAsFunctionResolvedCall` in
 new-inference: `NewVariableAsFunctionResolvedCallImpl`. So, in order to
 support both versions, just use parent class
2019-05-28 14:46:38 +03:00
Dmitry Savvinov
dd85dfbfde Extract common logic for parsing platform from test module name 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
8997fa52df Introduce unspecifiedJvmPlatform for clients without jvmTarget
Previously, a lot of clients used JvmPlatform as platform-marker,
without thinking about jvmTarget.

For the sake of migration, this commits introduced so-called
UnspecifiedJvmPlatform, which can be used for a time being, but
generally, all usages should be removed in  future.
2019-05-28 13:08:09 +03:00
Dmitry Savvinov
ef39e2a68f [Compatibility] Restore KotlinFacetSettings.getTargetPlatform() 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
716e55d171 [Compatibility] Restore KotlinProjectConfugirator.getTargetPlatform() 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
dfe0493f9a [Compatiblity] Restore IdePlatform as well as some related methods 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
1a11eaa4c6 Overload equals for JdkPlatform 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
9d0f518d62 Rename PlatformDependentCompilerServices -> PlatformDependentAnalyzerServices 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
3332cdfce8 [Compatibility] Restore ModuleSourceInfo.getPlatform() for compatibility 2019-05-28 13:08:09 +03:00
Dmitry Savvinov
2caa1c3dd6 [Compatibility] Restore old TargetPlatform and subtypes for compatibility 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
bbe7a9790e Imitate old comparison behaviour when collecting dependencies
This is needed, because previously such code were not distinguishing
between different flavours of JVM or Common. Now we do, and, for
example, JdkPlatform(1.6) != JdkPlatform(1.8), which causes such
dependencies to be erroneously dropped
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
4116815a8d [Misc] Provide meaningful debugName for StorageManager everywhere 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
602f642018 [Injection] Make component containers composition more granular and flexible
Previously, containers set-up was performed by calls to static functions
like 'createContainerForLazyResolve', which would set-up whole container
from scratch.

This has several issues:
- complicates code re-use and encourages copy-paste of one and the same
set-up logic
- complicates composition of multiplatform containers (because each
set-up method relies on the fact that it should take an empty
container and compose it completely)

The idea of this commit is to split set-up methods into smaller ones,
with finer areas of responsibility, which allows to re-use them
in various scenarios (and, in particularly motivating composition
of multiplatform container)
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
72e28d37fc [Injection] Introduce PlatformSpecificExtensions and PlatformExtensionsClashResolver
This commit introduces the ability to register a PlatformExtensionClashResolver
in a container. Each PlatformExtensionClashResolver has a corresponding
PlatformSpecificExtensions.

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

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

This makes containers more composable, e.g., it is now possible to put
several containers together as long as all except one provide default
implemenetation for some particular service (non-default implementation
will be automatically chosen, and all defaults will be discarded).
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
398d715fc6 [Injection] Minor: remove explicit injection of ExpressionTypingServices
They will be injected automatically anyways
2019-05-28 13:08:08 +03:00
Dmitry Savvinov
c97138c0eb [Injection] Pull languageVersionSettings injection to 'configureModule' 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
89603327c5 [Injection] Minor: inline createLazyResolveSession 2019-05-28 13:08:08 +03:00
Dmitry Savvinov
eb155dcf3b [Injection] Minor: inline configureModule overload without trace 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
b81b388b33 [Injection] Minor: inline createContainerForTopDownAnalyzerForJvm
Essentially, this function was used solely for setting
'useBuiltInsProvider' to 'true'; otherwise it were just delegating to
createContainerForLazyResolveWithJava, which were just increasing the
noise.
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
70be224f0f [Injection] Minor: inline configureJavaTopDownAnalysis
It was used called only once, and hasn't provided any useful
abstraction.

Actually, this "cosmetic" refactoring makes similarities with other
platform-specific container set-ups cleare, which allows to make further
generalizations and simplifications.
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
b54982a29a [Injection] Minor: reformat injection.kt 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
1606b3bf23 [Platform API] Make 'ModuleInfo.platform' non-nullable 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
2d528c6396 [Platform API] Remove IdePlatform, use TargetPlatform instead 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
2ebdd7d2b9 Add platform suffix to the name of created module in tests
This is needed because platform of the module is determined by the
suffix after last '-' in 'createModule', and for string 'test-module'
that would be 'module', which obviously doesn't make any sense.

Howwever, due to how MultiTargetPlatform was implemented, it was
possible to create platform with such name, and everything was fine
as long as no one actually tried to switch on such a malformed
"platform".

After switching to more strict TargetPlatform representation, some tests
that had been trying to create platforms with such names started failing.

Seems that it was purely a mistake introduced in the
af1264a46d, so this commit fixes it by
specifying proper module name
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
d5fbe59a3e [Platform API] Introduce fundamental abstraction of Platform
This is a large commit, which introduces general API for working with
abstraction of Platform.

- Add new abstraction to 'core' - SimplePlatform - which represents
exactly one platform
  - Clients are strongly prohibited to create instances of SimplePlatform
  by hand, instead, corresponding *Platforms abstraction should be used
  (e.g. JvmPlatforms, JsPlatforms, KonanPlatforms)

- Move TargetPlatform to 'core', it represents now a collection of
SimplePlatforms
  - Clients are strongly encouraged to use TargetPlatform
    (not SimplePlatform) in API, to enforce checks for multiplatform

- Provide a helper-extensions to work with TargetPlatform
(in particular, for getting a specific component platform)

- Remove MultiTargetPlatform in favour of TargetPlatform
  - Notably, this commit leaves another widely used duplicated abstraction,
    namely, IdePlatform. For the sake sanity, removal of IdePlatform is
    extracted in the separate commit.
2019-05-28 13:08:07 +03:00
Dmitry Savvinov
451d14e504 [Platform API] Minor: move some classes to separate files 2019-05-28 13:08:07 +03:00
Dmitry Savvinov
bf51a402b9 Remove deprecated method 2019-05-28 13:08:06 +03:00
Dmitry Savvinov
f2a0a809f1 [Platform API] Split TargetPlatform into lightweight TargetPlatform and CompilerServices
This decouples simple data (TargetPlatform) from other subsystem-specific
logic (like default imports, built-ins, etc.).

Aside from purely aesthetic improvements, it also makes it easier
to move 'TargetPlatform' into core (see next commits)
2019-05-28 13:08:06 +03:00
Dmitry Savvinov
83914614b9 [Platform API] Clean-up some usages of Platform
Mostly unused imports. Also, in some places,
TargetPlatform/MultiTargetPlatform were just passed around without
actually using (e.g. in deserialization)
2019-05-28 13:08:06 +03:00
Dmitry Savvinov
7e1afdcd28 Remove internal API method which was deprecated in 1.3.0 2019-05-28 13:08:06 +03:00
Dmitry Savvinov
520e871280 Rename *AnalyzerFacade to *ResolverForModuleFactory to prevent confusion with other similar names 2019-05-28 13:08:06 +03:00
Alexander Udalov
082c337faa Support fake Java property overrides in function equality in bridges
A synthetic property descriptor created for `B.value` (see the added
test) should not be equal to the normal descriptor created by the fake
override construction algorithm. Otherwise we can't reach this synthetic
non-abstract descriptor when building bridges in `C`, which results in
exception.

 #KT-31367 Fixed
2019-05-28 11:50:13 +02:00
Alexander Udalov
d05e72dda8 Update bootstrap to 1.3.50-dev-526 2019-05-28 11:33:34 +02:00
Dmitriy Novozhilov
910177ab17 [NI] Add checking @NotNull parameters for candidates 2019-05-28 11:18:33 +03:00
Dmitriy Novozhilov
f20ec3e0a6 [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
There is added a new service named `SubstitutingScopeProvider`, that
  provides factory that creates captured types and approximator for them.
  In OI they are the same as before commit, for NI they are empty, because
  that approximation interferes with NI algorithm

That service is injected into function descriptors and property descriptors
  and used for creating `SubstitutingScope` with correct services

Also there is changed time when we approximate captured types in NI
  (after all call checkers)

#KT-25290 Fixed
2019-05-28 11:18:33 +03:00
Ilya Matveev
f47aafc471 Gradle, native: Rename test binary class: Test -> TestExecutable 2019-05-28 10:46:23 +03:00
Ilya Matveev
954fedc6f9 Gradle, native: Don't treat test output as stacktrace
Currently native test runner reports stacktraces using TC
service messages.
2019-05-28 10:46:23 +03:00
Ilya Matveev
48b1f71cef Gradle, native: Introduce separate binary type for tests
Earlier native tests were represented by the same binary type as product
executables. We also used to create test tasks in the same manner as run
tasks for product executables. Such tasks could be obtained used a property
of an executable binary with type Exec.

But now we have a separate class for test tasks. Also we probably will want
to create several tasks for the same test. So we cannot use the same run task
property for both test and product executables. Also representing test and
product executables by the same binary type leads to the fact that assemble
task execution causes building not only product binaries but also the test
ones.

This patch solves the issues described above by introducing a separate binary
type for tests. Such a test binary can be created in the same manner as other
binaries:

    kotlin.macosX64 {
        binaries {
            test("integration") { ... }
        }
    }

One test binary and a task executing it is created by the plugin out of the box.
This test binary replaces a test executable used to be created earlier.

Issue #KT-31609 Fixed
2019-05-28 10:46:23 +03:00
Mikhail Glukhikh
2db8409d85 FIR: introduce & resolve spread named arguments #KT-31575 Fixed 2019-05-28 10:20:42 +03:00
Mikhail Glukhikh
806d2d628c FIR Java: correctly handle overridden Kotlin properties in use-site scope 2019-05-28 10:20:41 +03:00
Mikhail Glukhikh
56435fa283 FIR Java: add default constructors 2019-05-28 10:20:40 +03:00
Mikhail Glukhikh
d0404b2c2a FIR resolve: check number of parameters when handling Java accessors 2019-05-28 10:20:38 +03:00
Mikhail Glukhikh
eaf7e46da3 FIR resolve bench: count implicit built-in type refs as resolved 2019-05-28 10:20:37 +03:00
Mikhail Glukhikh
459dcb4f57 FIR resolve: set implicit Unit type for block without result expression
This fixes most of "implicit error types"
2019-05-28 10:20:36 +03:00
Mikhail Glukhikh
d2bdbd8978 FIR resolve: record & check implicit extension receiver type properly 2019-05-28 10:20:35 +03:00
Mikhail Glukhikh
d9d582b226 FIR tower resolve: add level with implicit extension receiver 2019-05-28 10:20:33 +03:00
Mikhail Glukhikh
45b0f5a0ca Add FIR resolve test (call extension from extension) 2019-05-28 10:20:32 +03:00
Mikhail Glukhikh
bc336650ff More top-level FIR resolve tests (map, with) 2019-05-28 10:20:31 +03:00
Simon Ogorodnik
94dca1d467 Suspend resolution sequence on first inapplicability report 2019-05-28 10:20:29 +03:00
Mikhail Glukhikh
cb76ea5d14 FIR resolve: do not launch overload conflict resolve for erroneous 2019-05-28 10:20:28 +03:00
Mikhail Glukhikh
4d145db9f7 FIR resolve (by semoro): support correct type inference for generic args
This commit includes additional test and fixes e.g.
resolve of listOf() + listOf()
2019-05-28 10:19:12 +03:00
Mikhail Glukhikh
3cede7e827 Make FIR cone flexible type data class to improve constraint comparison 2019-05-28 10:19:08 +03:00
Mikhail Glukhikh
0d35c68f88 Use abstract 'createErrorType' in TypeApproximator to fix FIR assertion
NB: each type system should use its own error types
2019-05-28 10:18:36 +03:00
Simon Ogorodnik
36ab325394 Abstract FIR modularized tests 2019-05-28 10:18:35 +03:00
Simon Ogorodnik
60a73ca13f Report percents in FirResolveBench 2019-05-28 10:18:34 +03:00
Simon Ogorodnik
d3f00280e9 Disable data class copy function body in raw FIR
After this commit we require 'copy' body generation in FIR2IR converter
2019-05-28 10:18:00 +03:00
Simon Ogorodnik
a849cc7da4 Store type for already resolved FIR references properly 2019-05-28 10:17:59 +03:00
Simon Ogorodnik
58873b2d7b FIR resolve: set setter value-parameter type properly 2019-05-28 10:17:57 +03:00
Simon Ogorodnik
38d3438101 [FIR] Support withNullability for captured type 2019-05-28 10:17:56 +03:00
Mikhail Glukhikh
05e4539019 Set resolved type for lambdas properly during FIR resolve
Partially done by semoro
2019-05-28 10:17:31 +03:00
Mikhail Glukhikh
963ed44ce1 FIR: fix exception in ConeKotlinType.returnType 2019-05-28 10:17:25 +03:00
Mikhail Glukhikh
5c96fa0844 Raw FIR: set enum entry types to kotlin.Enum to avoid their resolve 2019-05-28 10:17:23 +03:00
Mikhail Glukhikh
6589fbbfbb Raw FIR: set val setter to null instead of default one 2019-05-28 10:17:22 +03:00
Mikhail Glukhikh
0aaf8c7689 Fix FIR Java enhancement of java.util.Map & similar supertypes 2019-05-28 10:17:21 +03:00
Simon Ogorodnik
cef108a5ae FIR: implement qualifier resolver 2019-05-28 10:17:05 +03:00
Jiaxiang Chen
d3cc0e6ce9 JVM_IR: Optimize disjunction condition with intrinsic function call. 2019-05-28 08:48:43 +02:00
pyos
6d19eb1853 JVM_IR: sidestep defective getMethodAsmFlags when inlining lambdas
It uses isStaticMethod to determine whether to set ACC_STATIC, which is
not correct (see PR #2341). This results in using incorrectly typed
opcodes (as all arguments are shifted by 1) when modifying the inlined
lambda's bytecode. For example, in the test added by this commit, these
opcodes are inserted to spill the stack into locals before calling
another inline function.

Because getMethodAsmFlags is used by the non-IR backend (see PR #2341
again for why changing stuff might not be a good idea), the proposed
solution is to ditch it completely and override generateLambdaBody in
IrExpressionLambdaImpl to use FunctionCodegen's IR-based flag
computation logic.
2019-05-28 08:38:16 +02:00
Steven Schäfer
82e4985aa0 Fix dispatch receiver in JvmStaticAnnotationLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
0d31106738 Fix return type in ToArrayLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
64120e8220 Fix return type in SyntheticAccessorLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
e6f65d4260 Fix return types in EnumClassLowering 2019-05-28 08:10:45 +02:00
Steven Schäfer
2da0315d2e Fix IR types in JVM_IR BridgeLowering
Properly implement the java erasure rules on IrTypes and fix the types
for dispatch and extension receivers.
2019-05-28 08:10:45 +02:00
Eduard Wolf
c885cadde4 KT-31639: Fix Iterables.drop integer overflow 2019-05-27 23:07:14 +03:00
Leonid Startsev
e5565b817b Create marker for Gradle Plugin Portal for kotlinx-serialization compiler plugin
#KT-27612 fixed
2019-05-27 19:59:13 +03:00
Sergey Igushkin
a4069c031e Fix Android 3.3 Gradle integration tests running with low Gradle version 2019-05-27 18:12:17 +03:00
Mikhail Zarechenskiy
9f62920556 Fix compilation against bootstrap compiler 2019-05-27 17:32:25 +03:00
Mikhail Zarechenskiy
c30e045b1b [NI] Don't consider Any!-constraint from upper bounds as more specific
#KT-31624 Fixed
2019-05-27 17:32:25 +03:00
Mikhail Zarechenskiy
8bef345f0f Duplicate test for NI and OI to avoid mismatch of diagnostics
There is a problem with different order of diagnostics for NI and OI,
 so, in order to fix this test, it was duplicated
2019-05-27 17:32:24 +03:00
Mikhail Zarechenskiy
95710f4087 [NI] Avoid forcing resolve for array access expression
#KT-31606 Fixed
 #EA-126523 Fixed
2019-05-27 17:32:24 +03:00
Mikhail Zarechenskiy
fe5976d7f4 [NI] Don't apply SAM-conversion for type that is subtype of function
Plus, don't get synthetic candidates as all candidates are creating
 by conversion

 #KT-31503 Fixed
2019-05-27 17:32:23 +03:00
Svyatoslav Kuzmich
ceaa64dfb1 [IR BE] Make lateinit fields and variables nullable 2019-05-27 16:24:22 +03:00
Kirill Shmakov
362e056b18 Expand acronym for K/N definitions file 2019-05-27 15:58:04 +03:00
Simon Ogorodnik
50a7d3f037 Adjust performanceTest jvm args 2019-05-27 15:00:46 +03:00
Alexander Udalov
a3d8fdf30a Fix compilation of kotlin-maven-plugin
Also remove the remaining usage (in a comment) of
JvmAbi.DEFAULT_MODULE_NAME
2019-05-27 13:21:31 +02:00
Alexey Tsvetkov
ad7de948f6 Update bootstrap
The new version fixes NSME from CoreJarFileSystem (KT-31574)
Also see 6addb24e4b
2019-05-27 13:08:34 +03:00
Mikhail Zarechenskiy
af15e9b93f [NI] Fix assertion: KotlinTypeMarker -> KotlinType 2019-05-27 01:01:09 +03:00
Mikhail Zarechenskiy
a0234241f5 [NI] Approximate components of raw types separately
This is needed as components can have different type arguments
2019-05-26 21:41:53 +03:00
Mikhail Zarechenskiy
8910859fd1 [NI] Implement various optimizations for incorporation algorithm
Mostly, these optimisations are picked from the old inference.
 Also, remove exponential complexity for flexible types in approximation,
 note that more correct fix for this would be to introduce new types
 that corresponds just to platform types to avoid nullability problems,
 but due to complexity it will be done later

 #KT-31415 Fixed
2019-05-26 21:32:46 +03:00
Mikhail Zarechenskiy
bbec3bf001 Fix exception on star import from typealias
#KT-30983 Fixed
2019-05-26 21:32:07 +03:00
Mikhail Zarechenskiy
b84b890250 Add tests to preserve current behavior for upcoming changes
##KT-30983 In Progress
2019-05-26 21:32:03 +03:00
Mikhail Zarechenskiy
5173d5e359 [NI] More accurate handle of capture types from subtyping
#KT-31520 Fixed
2019-05-26 21:31:59 +03:00
Mikhail Zarechenskiy
cc29ca02f8 [NI] Don't loose inference session during property resolve
#KT-31620 Fixed
2019-05-26 21:31:54 +03:00
Ilya Chernikov
e7c99cd494 Fix scripting-compiler tests, add them to the global scriptingTest task 2019-05-25 10:10:34 +02:00
Ilya Chernikov
deb74acc88 [minor] fixes after review 2019-05-25 10:10:34 +02:00
Ilya Chernikov
b97813f2b0 Implement test run on embeddable jars for jsr223 and scripting host tests...
also:
- add missing tests to the global scriptingTests task
- extract jsr223 tests into separate project
- fix dependency in jsr223 embeddable jar
2019-05-25 10:10:33 +02:00
Ilya Chernikov
a3d1fe312e Refactor default JSR-223 engine implementation:
- rename classes for clarity
- sort out dependencies
- move common pars to jvm-host jar
- switch to configurations only customization
2019-05-25 10:10:33 +02:00
Ilya Chernikov
8cd5b11da5 Add evaluation context passing to the evaluation config refiners 2019-05-25 10:10:33 +02:00
Ilya Chernikov
5d8c2ae429 Fix dependencies to compiler in scripting modules 2019-05-25 10:10:32 +02:00
Ilya Chernikov
37d859c122 Move scripting jvm host tests to a separate project...
to solve problems with testing with direct dependency on proguarded compiler
2019-05-25 10:10:32 +02:00
Ilya Chernikov
1527ef7640 Drop dependencies to script-util from new scripting infrastructure 2019-05-25 10:10:32 +02:00
Ilya Chernikov
59dc546a54 Convert JvmGetScriptingClass to object to simplify (de)serialization 2019-05-25 10:10:31 +02:00
Ilya Chernikov
7ae2054cba Add a link to hostConfiguration from compilation and evaluation ones
also add possibility to supply functional defaults for keys in PropertiesCollection
2019-05-25 10:10:31 +02:00
Ilya Chernikov
30c6147223 Get rid of UsefulTestCase to avoid dependencies, parallelize tests 2019-05-25 10:10:30 +02:00
Ilya Chernikov
8c7460451e [minor] fix some warnings 2019-05-25 10:10:30 +02:00
Ilya Chernikov
1dd197f201 Add missing scripting tests to the global task, make them parallel 2019-05-25 10:10:30 +02:00
Ilya Chernikov
29ba650c77 Fix main-kts script classpath calculation 2019-05-25 10:10:29 +02:00
Ilya Chernikov
ea068e483c Implement JSR-223 functionality on top of the "new" REPL 2019-05-25 10:10:29 +02:00
Ilya Chernikov
46915df56f Implement "legacy" REPL wrappers on top of the "new" scripting infrastructure 2019-05-25 10:10:29 +02:00
Ilya Chernikov
010ae5326d Create core environment in test mode properly 2019-05-25 10:10:28 +02:00
Ilya Chernikov
89006f16cd Prepare scripting infrastructure for REPL:
- refactor script compiler to simplify extending it for repl
- add repl snippet compilation functions to the new scripting compiler
- extract util functions into appropriate files
- extract repl part into separate class
- extract bridge definition and related definitions into separate file
2019-05-25 10:10:28 +02:00
Ilya Chernikov
a4c049d26e Replace message collector with reporting lambda
to simplify usages and slightly reduce dependencies
2019-05-25 10:10:28 +02:00
Ilya Chernikov
61c1312f1a Add another method for fetching classpath from classloader, refactor 2019-05-25 10:10:27 +02:00
Alexander Udalov
55f4c067e2 Fix compilation of uast-kotlin-idea for 182
Caused by 4e15b95d17
2019-05-24 18:06:57 +02:00
Alexander Udalov
0fb33b82ff Fix compilation of uast-kotlin for 182
Caused by 4e15b95d17
2019-05-24 17:02:28 +02:00
Alexander Udalov
5812d28b80 Update ReadMe of kotilnx-metadata-jvm
- remove the requirement to use Bintray repo; kotlinx-metadata-jvm is
  published to Maven Central now
- remove the note about kotlin.Metadata being internal; it's public
  since 1.3
2019-05-24 14:42:26 +02:00
Alexander Udalov
15bfbf59a7 Minor, unmute MetadataSmokeTest.lambdaVersionRequirement 2019-05-24 14:42:26 +02:00
Alexander Udalov
3564f4ae40 Make KmExtensionType.klass private, add KmExtensionVisitor.type
Since the only use case of KmExtensionType in user code is checking if
it equals some other KmExtensionType instance, we'd like to hide as much
of its implementation details as possible, in case we want to change it
in the future
2019-05-24 14:42:26 +02:00
Alexander Udalov
fd00999771 Render contracts in kotlinp, fix minor bug in kotlinx-metadata-jvm 2019-05-24 14:42:25 +02:00
Alexander Udalov
2a3786e3f8 Retain "is moved from interface companion" property flag in kotlinx-metadata-jvm
#KT-31338 Fixed
2019-05-24 14:42:25 +02:00
Alexander Udalov
cfa3509860 Add loadJava/compiledKotlinWithStdlib tests to KotlinpCompilerTestDataTest 2019-05-24 14:42:25 +02:00
Alexander Udalov
fe52f5fc7c Rename "desc" parameters in kotlinx-metadata-jvm to "signature" 2019-05-24 14:42:25 +02:00
Alexander Udalov
4e15b95d17 Minor, inline JvmAbi.DEFAULT_MODULE_NAME 2019-05-24 14:42:25 +02:00
Alexander Udalov
9e2733915b Add module name JVM extensions to class/package in kotlinx-metadata-jvm
#KT-31308 Fixed
2019-05-24 14:42:25 +02:00
Alexander Udalov
8ec466c2cc Fix compilation error in FlattenStringConcatenationLowering
See cf13293363 and 8dc34ae7b9, which were merged independently
2019-05-24 14:38:08 +02:00
Alexander Udalov
8dc34ae7b9 IR: rename {name,fqName}Safe -> {name,fqName}ForIrSerialization
These properties have a very specific detail in their behavior, in that
the constructor's name is set to be "<init>". While this is OK for the
IR serialization, this may not always be expected in other cases, and
their rather common names (`name`, `fqNameSafe`) suggested that these
properties could be used in generic contexts.

Change all usages outside IR serialization to use
`IrDeclarationWithName.name` and nullable
`IrDeclarationWithName.fqNameWhenAvailable` instead
2019-05-24 14:09:09 +02:00
Alexander Udalov
4e1effd065 Restore behavior in mapDefaultMethod for non-IR backend
Although the intention of the change 9894c216c1 (#2341) was sensible, it
unfortunately caused the type mapper to map a default method incorrectly
under certain _undiscovered_ circumstances, which leads to incorrect
bytecode being generated. Specifically, this led to an exception:

java.lang.NoSuchMethodError : org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches$Companion.compileCodeFragmentCacheAware$default(Lorg/jetbrains/kotlin/psi/KtCodeFragment;Lcom/intellij/debugger/SourcePosition;Lkotlin/jvm/functions/Function0;ZILjava/lang/Object;)Lkotlin/Pair;

in a developer branch where this class was refactored and moved to
another module. I was not able to determine the exact reason of this
error, so I'm workarounding it by limiting this change to the IR backend
only (where it's needed), and postponing the investigation of the
failure above for now.
2019-05-24 11:40:58 +02:00
Sergey Bogolepov
cc26fd143e Shiny new shared version. 2019-05-24 12:39:55 +03:00
pyos
4cd4ea126b JVM_IR: generate more accessors for use in inline functions 2019-05-24 11:27:19 +02:00
pyos
cf74b5e87b Mark callable reference classes as synthetic 2019-05-24 11:27:19 +02:00
pyos
e7dd41743f Prefix captured variables' names with $ 2019-05-24 11:27:19 +02:00
Dmitry Gridin
ba390202c8 Remove resolve from isEffectivelyActual && isExpectDeclaration
Relates to #KT-29731
2019-05-24 15:55:01 +07:00
Dmitry Gridin
61a740457d Suggest dialog if all members without actual modifier
Relates to #KT-31476
2019-05-24 15:55:01 +07:00
Dmitry Gridin
8dd1389979 Minor: remove redundant condition 2019-05-24 15:55:01 +07:00
Dmitry Gridin
9c4318a39c Minor: cleanup OverrideMemberChooserObject 2019-05-24 15:55:01 +07:00
Dmitry Gridin
76c2c2a5e9 Allow "Add val/var to primary constructor parameter" for inline & annotation classes
Relates to #KT-29731
2019-05-24 15:55:01 +07:00
Dmitry Gridin
f2bd58c030 Expand "Create expected..." also to a members if an expect class doesn't exist
#KT-31272 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
47e3a26749 Fix "Create expect function" for primary constructor
#KT-31518 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
b575ed390a Add a dialog to select members for export in expect class
#KT-31476 Fixed
#KT-31446 Fixed
#KT-31033 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
9a910ef144 Fix modifiers for ACTUAL_RENDERER 2019-05-24 15:55:01 +07:00
Dmitry Gridin
a9ed042199 Minor: refactoring 2019-05-24 15:55:01 +07:00
Dmitry Gridin
1097bc76af Don't suggest Add val/var to parameter at expect class constructor
#KT-29731 Fixed
2019-05-24 15:55:01 +07:00
Dmitry Gridin
af9d9eacb1 Minor: refactoring AddValVarToConstructorParameterAction 2019-05-24 15:55:00 +07:00
Dmitry Gridin
379152303c Minor: refactoring 'refactoring' package 2019-05-24 15:55:00 +07:00
Dmitry Gridin
98a4c4588e Don't suggest might be const on actual member declaration
#KT-27822 Fixed
2019-05-24 15:55:00 +07:00
Svyatoslav Kuzmich
142c9e2a8b [JS RUNTIME] Workaround invalid IR in ArraySorting 2019-05-24 11:50:47 +03:00
Svyatoslav Kuzmich
a3677d6fc0 [JS IR RUNTIME] Fix types in kotlin.js.captureStack 2019-05-24 11:50:47 +03:00
Svyatoslav Kuzmich
7aed8d2f75 [JS IR BE] Fix lowering types nullability 2019-05-24 11:50:46 +03:00
Svyatoslav Kuzmich
ec34cdaae9 [JS STDLIB] Fix: Object.keys() returns list of strings 2019-05-24 11:50:46 +03:00
Svyatoslav Kuzmich
cd55e6b1e5 [JS IR BE] Use static fields instead of variables in enum lowering 2019-05-24 11:50:46 +03:00
Svyatoslav Kuzmich
30ada0ccbb [JS] Fix type in vararg test 2019-05-24 11:50:46 +03:00
Ting-Yuan Huang
bdcd6f73b1 Move tailrecPhase before defaultArgumentStubPhase
So that default values can be copied to the recursive call sites.
2019-05-24 09:51:07 +02:00
Vadim Brilyantov
6addb24e4b #KT-31574 : Keep CoreJarFileSystem in compiler jar to save clearHandlersCache 2019-05-23 21:39:05 +03:00
Vyacheslav Gerasimov
af63ef2405 Build: Actualize repository list in cacheRedirector.gradle.kts 2019-05-23 18:11:30 +03:00
Vyacheslav Gerasimov
4e229437f3 Build: Remove unnecessary repositories from idl2k 2019-05-23 18:11:29 +03:00
Vyacheslav Gerasimov
b88d9d62b8 Build: Extract cache redirector to script & add verification task 2019-05-23 18:11:29 +03:00
Vyacheslav Gerasimov
2bbf92a6c3 Build: Remove unused ktor repo from buildscript block 2019-05-23 18:11:28 +03:00
Vyacheslav Gerasimov
bda676ed26 Build: Redirect all urls starting with mirrored urls 2019-05-23 18:11:28 +03:00
Vyacheslav Gerasimov
7e61183ee1 Build: Move kotlinNativeRepo to :kotlin-gradle-plugin
the only one project using it
2019-05-23 18:11:28 +03:00
Dmitriy Novozhilov
ffc0276215 Fix compiler testdata broken in 95544b0 2019-05-23 17:46:16 +03:00
Nikolay Krasko
e38ad3a513 Temporary allow resolve in write action for insert handler 2019-05-23 16:25:09 +03:00
Nikolay Krasko
78569c62c0 Additional test for multiple comments in copyright updater 2019-05-23 16:25:09 +03:00
Nikolay Krasko
136cbd195b Fix copyright updater in scripts (KT-30133)
#KT-30133 Fixed
2019-05-23 16:25:09 +03:00
Nikolay Krasko
aa01328d13 Add tests for copyright updater 2019-05-23 16:25:08 +03:00
Nikolay Krasko
d32d715cd1 Move copyright extension out of jvm to common idea module 2019-05-23 16:25:08 +03:00
Nikolay Krasko
314b29f223 Fix background for uneditable text panes in Kotlin update (KT-29667)
#KT-29667 Fixed
2019-05-23 16:25:08 +03:00
Sergey Rostov
00ed49df68 JPS Build: rename packedJars property to embedded, get rid of ShadowJar
Configuration should have name "embedded" for IDEA import.
ShadowJar doesn't required anymore as it is already embedded in
 default jar task.
2019-05-23 16:12:03 +03:00
Natalia Selezneva
710c2cd0a4 JPS Build: rename packedJars property to embedded 2019-05-23 15:14:30 +03:00
Toshiaki Kameyama
3bca1a50e3 Move variable declaration into when: fix comment place
#KT-31362 Fixed
2019-05-23 19:01:24 +07:00
Leonid Startsev
b5c4f3ecc8 Coerce property value from correct type after retrieving it
#KT-25497 fixed
 Fixes https://github.com/Kotlin/kotlinx.serialization/issues/434
2019-05-23 14:21:09 +03:00
Leonid Startsev
9ce1f843e3 Remove non-type annotations from type serializer analysis
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/450
2019-05-23 14:21:09 +03:00
Mikhail Glukhikh
728459a504 Add IR for-in-range test 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
139557e641 FIR2IR: support super-types & type parameters for external class 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
a973a21ec6 FIR2IR: support assignments of local variables 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
68da1a97d1 Add fib test to FIR resolve tests 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
f3960c9482 Preliminary implementation of parts & facade in FIR-based compiler 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
2bf80ff64e FIR: support copy functions in data classes 2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
d9261acdfc Raw FIR builder: extract 'generateComponentFunctions' for data class 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
672c172c99 [FIR] Make result type after safe-call nullable (for nullable receiver) 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
f7b6fec70c [FIR] Transform explicit receiver of QAE properly 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
27a1ec3817 [FIR] Allow nullable receiver type in case of safe-calls 2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
b28207deca FIR2IR: support fields in Java FIR 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
6c313895df [FIR] Do not enhance java fields to firProperty 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
397aaa189e [FIR] Allow type-variables in general subtyping with cone context 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
20ba15a429 [FIR] Typing for annotation calls 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
c168c22fba Render property accessors in html fir dump 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
9266a2cdba Add equals/hashCode to some FIR cone types 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
aa96837758 [FIR] Introduce unchecked not-null cast as internal operation for !!, ?: 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
b469eb293b [FIR] Typing for try-catch 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
30e097a1e0 Fix modifiers order and repeating in html fir dump 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
58fd62fd49 Fix try catch rendering in html fir dump 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
9398addb9d Fix cycle avoidance in FIR implicit type resolve
This commit fixes the following case:
transformer visiting it twice before reporting cycle
fun foo() = foo()
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
26974788e9 FIR2IR converter: handle receivers and parents more correctly 2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
90009f002c Add FIR test for 'Exception' constructor resolve ambiguity (type alias) 2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
b72f3aa206 Remove code duplication in KotlinToJvmCompiler (old FE vs FE IR)
Related to KT-31265
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
05154d24d4 Select stub or real symbol for java.lang.Class in IR dependent on mode
This commit fixes some black-box IR tests broken by stub introduction
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
f4fdc66a34 Introduce experimental FIR compiler #KT-31265 Fixed
This commit also includes several FIR2IR fixes which helps FIR compiler
to produce normal results
2019-05-23 14:02:06 +03:00
Mikhail Glukhikh
892419c08a Generate stub java.lang.Class in IR JvmSymbols instead of scope reading
Before this commit, java.lang.Class was read via JvmBackendContext,
its module descriptor and its package member scope.
However, this works only for old FE with descriptors and
descriptor-based scopes available.
2019-05-23 14:02:06 +03:00
Ting-Yuan Huang
0aee2d0568 Fix signature generation for calls to enum and inner class constructors
The synthesized arguments caused the size of default value mask off by
one when it is close to the boundary of Int.SIZE, which in turn
resulted in wrong signature at call sites.
2019-05-23 12:29:57 +02:00
Ivan Gavrilovic
72fdc648ff If incremental KAPT is disabled, do not analyze classpath
When incremental apt mode in KAPT is disabled, do not analyze
classpath to determine the type of the annotation processors. Instead,
just mark them all as non-incremental.
2019-05-23 19:09:28 +09:00
Peter Xu
a639607821 Revert obsolete code introduced in KT-12402
The classes being filtered have been renamed months ago. The change
committed in KT-12402 is no longer relevant as the underlying issue has
been fixed.
2019-05-23 19:09:28 +09:00
Ivan Gavrilovic
b609fe529c Handle return result of dir creation/deletion in kapt
#KT-31322
2019-05-23 19:09:27 +09:00
Ivan Gavrilovic
f60bfc34c0 Remove generated sources and classes for full KAPT build
When running incremental annotation processing in KAPT,
even if incremental flag is enabled, and full rebuild should
be performed (e.g. in presence of dynamic non-incremental APs),
make sure generated sources and classes are removed.

 #KT-31322 fixed
2019-05-23 19:09:27 +09:00
Vladimir Krivosheev
757b4b3910 Do not use constructor injection for app level extension KotlinClassWithDelegatedPropertyRenderer (KT-31266) 2019-05-23 19:09:27 +09:00
Yan Zhulanow
a0778ad703 Revert "Kapt: Always use raw types for annotation parameter types (KT-30346)"
This reverts commit 66754e62
2019-05-23 19:09:27 +09:00
Yan Zhulanow
9a5bbcb00b Pill: Recognize 'embedded' configuration as 'compile' in JPS 2019-05-23 19:09:27 +09:00
Dmitriy Novozhilov
95544b0970 Add wrappers on KotlinType in EffectSystem
Also that commit removes usages of builtins inside
  effect system and starts refactoring of functor
  composition via composition instead of inheritance.

There are some changes in testdata related to inference of recursive
  functions with implicit return types.

After this commit they all are marked as unresolved. It happens because
  those functions have DeferredType as return type, and computing this
  type produces recursive exception, which provides “typechecker
  recursive problem” diagnostic.

Before this commit, function call was completed successfully, because
  call completer didn’t computed that type, and computation of DeferredType
  were triggered only in `DataFlowAnalyzer.checkType`.
Now, effect system tries to compute that type while wrapping KotlinTypes
  into ESTypes, and effect system itself is triggered in in call completer,
  so, call completion doesn’t finish and function call is marked as unresolved.

#KT-31364
2019-05-23 12:23:22 +03:00
Dmitriy Novozhilov
fb77e1f0bd [NI] Fix recursion in contract declaration analysis.
#KT-30410 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
8d5c61f3ab [NI] Return error type for unsupported descriptors in callable reference inference 2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
b4c8c79931 [NI] Add check for non-null argument type in arguments check
#KT-31461 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
b323298b0e [NI] Remove deep types in commosn super type for recursive types
#KT-30411 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
f54653eb2b [NI] Fix error type approximation in ILTApproximatorConfiguration
#KT-31441 Fixed
2019-05-23 12:22:42 +03:00
Sergey Rostov
6f9ef0d4b6 Gradle, js: fix js test frameworks DSL for groovy
#KT-31566 Fixed
2019-05-23 10:09:14 +03:00
Sergey Rostov
ebe3ccee8b Gradle, test reports: NewMultiplatformIT.testJavaSupportInJvmTargets
"check" task, now creates aggregate report for all gradle versions,
so this test is affected too
2019-05-23 10:09:13 +03:00
Sergey Rostov
348e29f24b Gradle, tests: introduce kotlin.tests.individualTaskReports
This property required for getting individual junit.xml files that is
currently used in test run assertions.
2019-05-23 10:09:13 +03:00
Sergey Rostov
22bc99f527 Gradle, js, single platform projects: create single test aggregator
Extract KotlinTestsRegistry service for customizing aggregated test tasks
naming.
2019-05-23 10:09:13 +03:00
Sergey Rostov
a5664207d5 Gradle, js, tests: always create a jsTest task for compatibility
This requires runnable aggregate test task even if there are not tests in it.
That, in turn, requires support aggregate test tasks hierarchy.
Also TestReport integrated in aggregate for all gradle versions (was for 5 only).

#KT-31527 Fixed
2019-05-23 10:09:13 +03:00
Sergey Rostov
78fe2fde33 Gradle, libWithTests test: check js tests running, add test results assertion 2019-05-23 10:09:13 +03:00
Sergey Rostov
709afdfa45 Gradle, testing test execution: support asserting reports from multiple tasks at once 2019-05-23 10:09:13 +03:00
Sergey Rostov
a13f1a5e67 Gradle, js, webpack: fix compatibility with older gradle version 2019-05-23 10:09:12 +03:00
Sergey Rostov
603fb8a53d Gradle, js, npm: try fixing project version to semver
JS package managers requires it.

#KT-31563 Fixed
2019-05-23 10:09:12 +03:00
Ilmir Usmanov
e7c78d8d7e Update bootstrap
Update reference public API. Before 266976ac1e
suspend inline functions with crossinline parameters were effectively
inline-only. Fixing it exposed suspendCoroutine as public API.
Update jps artifacts after bootstrap.
2019-05-23 09:28:31 +03:00
Ilya Kirillov
ff774f6249 New J2K: Run nj2k tests by default 2019-05-22 22:20:18 +03:00
Ilya Kirillov
9ccedc5bc4 New J2K: Fix wrong line separators on windows
It causes some inspections in post-processing to work not properly
2019-05-22 22:20:18 +03:00
Ilya Kirillov
f0012de6ea New J2K: add string method conversions 2019-05-22 22:20:18 +03:00
Ilya Kirillov
54432448e3 New J2K: correctly remove redundant property type in a case of nullable initializer 2019-05-22 22:20:17 +03:00
Ilya Kirillov
8f5c690cdd New J2K: do not convert var to val if super property is var 2019-05-22 22:20:17 +03:00
Ilya Kirillov
fa8a067c85 Fix losing flexible type enhancement in type substituting
It breaks `org.jetbrains.kotlin.nj2k.NewJavaToKotlinConverterSingleFileTestGenerated.ToArray#testToArray` test due to losing external nullability annotations
2019-05-22 22:20:17 +03:00
Ilya Kirillov
0a974cd419 New J2K: remove unused dependency from nj2k-services 2019-05-22 22:20:16 +03:00
Ilya Kirillov
c9decd5dc9 New J2K: correctly retrieve all type variables in printing 2019-05-22 22:20:16 +03:00
Ilya Kirillov
7db4958a17 New J2K: fix tests due to changes in inspections behaviour 2019-05-22 22:20:16 +03:00
Ilya Kirillov
37f8d72756 New J2K: make inner private constructors public when accessed 2019-05-22 22:20:16 +03:00
Ilya Kirillov
78fd56bdf0 New J2K: Fix running some post processings in incorrect thread
#KT-31234 fixed
2019-05-22 22:20:15 +03:00
Ilya Kirillov
90ab39f50f New J2K: Fix CCE in post processing
#KT-31217 fixed
2019-05-22 22:15:28 +03:00
Sergey Igushkin
8b150d2b07 Fix Android 3.3 Gradle integration tests running with low Gradle version 2019-05-22 18:11:18 +03:00
victor.petukhov
d4515031de Report warning about implicitly inferred nothing only for return position
^KT-31535 Fixed
2019-05-22 15:45:59 +03:00
Roman Artemev
72f7287ad2 [IR BE] Fix array constructor loop. Use index parameter as immutable value 2019-05-22 15:18:13 +03:00
Roman Artemev
dfa38f4a4d [JS IR BE] Fix state machine generation in case of composition of loops, inline functions and finally blocks
* lower finally blocks in any cases
 * do not optimize exit blocks for if-statements
2019-05-22 15:18:13 +03:00
Roman Artemev
9c7d47789c [JS IR BE] Implement type check for SuspendFunctionN 2019-05-22 15:18:13 +03:00
Steven Schäfer
9894c216c1 Fix test for static default methods in KotlinTypeMapper 2019-05-22 13:33:08 +02:00
Steven Schäfer
cf13293363 Use FQ names for string plus intrinsic in FlattenStringConcatenationLowering 2019-05-22 12:14:43 +02:00
Alexander Udalov
43bf962d79 Fix CLI test data on -XXLanguage arguments
We should use '\:' instead of ':' because the latter is replaced to the
path separator in AbstractCliTest.readArg which is ';' on Windows.
2019-05-22 08:48:37 +02:00
Alexander Udalov
d340f6dc62 Minor, simplify code in parseCommandLineArguments 2019-05-22 08:48:37 +02:00
Ilmir Usmanov
effbcdaf70 Do not generate $$forInline suffix for enclosing method
in OUTERCLASS field.

The inliner generates two versions of suspend functions/lambdas in
inline functions: with state-machine and without. The former is used
to call the function from Java or via reflection and have ordinary
name, while the latter is used by inliner and have $$forInline suffix.
The inliner throws the state-machine version away, duplicates
$$forInline version and then call state-machine generator.

If these suspend functions/lambdas are not going to be inlined,
$$forInline version is not generated. However, all objects, which are
used in these suspend functions/lambdas, have $$forInline version
written to OUTERCLASS field. This leads to errors by proguard.
Since they are used in both state-machine version and for-inline ones,
we can simply remove $$forInline suffix from OUTERCLASS field and this
fixes the issue.

 #KT-31242 Fixed
2019-05-21 21:09:36 +03:00
Svyatoslav Kuzmich
dd6bc100ed [JS IR BE] Don't detach assignment operator from receiver 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
5495da5241 [JS IR BE] Allow empty call arguments only for external functions 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
e9ceee388e [JS IR BE] Don't transform toString with extension receiver 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
3153a7dd7e [JS IR BE] Fix boolean and/or generation 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
b8bbcb3f93 [JS IR BE] Copy type metadata for Boolean, Char and Long varargs 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
59617c97b4 [JS IR BE] Fix VarargLowering
- Enable empty vararg transformation for all IrFunctionAccessExpression
- Fix empty vararg boxing
- Refactor inline class boxing logic
- Fix types of generated expressions
2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
f80b6ff947 [JS IR BE] Put file names into JsDoc 2019-05-21 19:19:31 +03:00
Sergey Igushkin
71bd88bdb3 Fix the AGP deprecation warning on usage of getPackageLibrary, KT-30784
Use the new API that returns the task provider, if available.

Issue #KT-30784 Fixed
2019-05-21 19:08:29 +03:00
Ilya Gorbunov
0a3ebb5780 Unmute tests for JVM_IR that pass after making assertFailsWith inline 2019-05-21 18:53:53 +03:00
Ilya Gorbunov
6632cf5b1d Add hidden methods to keep binary compatibility in kotlin-test for JVM 2019-05-21 18:53:52 +03:00
Ilya Gorbunov
22694fa6b0 Make assertFails(With) inline-only functions
So that the lambda passed to these functions can capture suspend
function calls.

#KT-31194 Fixed
2019-05-21 18:53:52 +03:00
pyos
6b2d874ccc JVM_IR: generate non-null assertions for arguments 2019-05-21 18:30:27 +03:00
Ilmir Usmanov
266976ac1e Fix Java interop of inline suspend functions with suspend parameters
In 1.3.31 I fixed Java interop for inline function with coroutines
(TL;DR: when we need a state machine, generate two methods: one with
normal name, and the other one with $$forInline suffix, for the inliner
to use, just like inline suspend functions), however, I forgot a case
with inline suspend function with inline suspend function parameter.
In this case, the compiler a generated two functions, as needed, but,
neither of them had a state-machine. This change adds the state-machine
for the method with normal name. Note, that suspend inline functions
with crossinline parameter, which are also supported by the change,
did not cause incorrect behaviour, since until now they were generated
as synthetic.

 #KT-31354 Fixed
2019-05-21 17:50:25 +03:00
Georgy Bronnikov
2b9e05e30f JVM_IR: copy-paste parameter name generation from descriptor-based code 2019-05-21 17:24:53 +03:00
Jiaxiang Chen
afcbd76c9e Implement stub methods generation for Kotlin Immutable Collection classes.
This change is to fill the gap between Kotlin Collection
classes(immutable) and Java Collection classes(mutable), to avoid
calling an unsupported operation like remove() on an immutable class in
jvm.
2019-05-21 17:20:20 +03:00
Elena Lepilkina
8c3cef97bd New shared version 2019-05-21 16:56:39 +03:00
Mikhail Glukhikh
0cf318918c Clean & fix tests in "replace manual range with indices / iteration"
Related to KT-14344
2019-05-21 13:34:29 +03:00
Natalia Selezneva
7c46338181 Drop ScriptBinariesScopeCache from plugin.xml because it was moved to ScriptDependenciesCache
^KT-31521 Fixed
2019-05-21 12:07:11 +03:00
Mikhael Bogdanov
007af75e1e Properly calculate call site file in JVM IR inliner 2019-05-21 07:42:16 +02:00
Mikhael Bogdanov
6ef3e9ea42 Minor. Code clean 2019-05-21 07:42:15 +02:00
Mikhael Bogdanov
c630df3e49 Simplify code 2019-05-21 07:42:14 +02:00
Mikhael Bogdanov
de62f0123b Minor. Apply minor TODOs 2019-05-21 07:42:14 +02:00
Mikhael Bogdanov
b8b2607a02 Minor. Clean up code 2019-05-21 07:42:13 +02:00
Igor Yakovlev
f044d654f0 Fix KotlinLintTest.parcel test
Added plugin classpath of android compiler extensions to module facet
2019-05-20 19:54:46 +03:00
Benjamin Orsini
3e39f26379 Add map() documentation sample
* docs: add map() sample
* docs: add samples for Map and CharSequence
* docs: add another sample for Maps.map()
2019-05-20 19:20:09 +03:00
pyos
08ea982688 Remove imports of javafx from Gradle build files 2019-05-20 17:31:28 +02:00
Vyacheslav Gerasimov
c2a2d80d4c Build: Minor cleanup & format root build.gradle.kts 2019-05-20 15:16:22 +03:00
Vyacheslav Gerasimov
40e9f48bd0 Build: Fix cache redirector configuration for all projects
Since we forcing project evaluation in root build script cache redirector
should be configured before we do so, otherwise `afterEvaluate` is not called
2019-05-20 15:16:22 +03:00
Vadim Brilyantov
d5be5bd96e Fix obsolete compiler classpath in SourceSectionsTest 2019-05-20 14:23:34 +03:00
Igor Yakovlev
611b6f36ce Remove redundant import from QuickFixMultiFileTestGenerated 2019-05-20 12:50:09 +03:00
Mikhail Glukhikh
b68e536e2a Add note about inspection highlighting range 2019-05-20 12:31:58 +03:00
KilianCallebaut
3451c60f93 Suggest to replace manual range with explicit indices or iterable
#KT-14344 Fixed
2019-05-20 12:24:52 +03:00
Alexander Udalov
8cda5cb849 Regenerate tests 2019-05-20 11:18:54 +02:00
Toshiaki Kameyama
2c424afefa Elvis -> if intention: don't produce boilerplate code for return/break/continue/throw in RHS
#KT-14369 Fixed
2019-05-20 11:15:41 +03:00
Natalia Selezneva
160de2dbe2 Do not load script dependencies if all script templates aren't loaded 2019-05-20 10:41:15 +03:00
Natalia Selezneva
58eca451c4 Sdk passed in script dependencies should be used during script resolve
PsiElementFinder doesn't find classes from sdks that aren't Project SDK, so when Script Sdk differs from it we need to additionally search classes in script sdk using KotlinScriptDependenciesClassFinder (as we do for classes from ScriptDependencies.classpath)

^KT-31152 Fixed
2019-05-20 10:41:15 +03:00
Natalia Selezneva
5bc7b61497 Refactoring: move ScriptBinariesScopeCache to ScriptDependenciesCache 2019-05-20 10:41:14 +03:00
Natalia Selezneva
c2717b3006 Filter out all non JavaSdk from script sdks 2019-05-20 10:41:14 +03:00
Natalia Selezneva
144ff8ae91 Refactoring: move method that find sdk for script to ScriptDependenciesManager 2019-05-20 10:41:14 +03:00
Natalia Selezneva
2f5deefd0a Scripts refactoring: move all scripts caches to ScriptDependenciesCache
Introduce base class for caches based on SLRUMap (with write lock) to avoid exceptions with concurrent map modifications
2019-05-20 10:41:13 +03:00
Natalia Selezneva
1ef4d987d1 Add debug log for script dependencies loading process 2019-05-20 10:41:13 +03:00
Sergey Rostov
6388cdc3b7 Gradle, js, npm: skip KotlinProjectExtensions from different class loaders 2019-05-20 09:55:37 +03:00
Sergey Rostov
9a90627b32 Gradle, js: fix supporting sub targets DSL in build.gradle.kts 2019-05-20 09:55:36 +03:00
Sergey Rostov
3a9f3525f1 Gradle, js, npm: skip old Kotlin2JsPlugin compilations 2019-05-20 09:55:36 +03:00
Sergey Rostov
7589d89a59 Gradle, js: create run task only when project evaluated
As it may be created after js target configuration by java application plugin
2019-05-20 09:55:36 +03:00
Sergey Rostov
15e0d6af92 Gradle, js, npm: fix case when resolver visits dependents projects first 2019-05-20 09:55:36 +03:00
Sergey Rostov
52f01ef43f Gradle, js: implement NpmSimpleLinker for cases when there are no npm dependencies 2019-05-20 09:55:36 +03:00
Sergey Rostov
75708dad87 Gradle, js: fix task input annotations 2019-05-20 09:55:36 +03:00
Sergey Rostov
48fd3b6b87 Gradle, tests: don't use gradle testing internals by default 2019-05-20 09:55:35 +03:00
Ting-Yuan Huang
75646f97a4 MoveCompanionObjectFields: copy constants into interfaces
Fields having const attribute in companion objects are observable in
Java and should be copied to outer interfaces.
2019-05-20 08:43:00 +02:00
Toshiaki Kameyama
6ff776ba65 Convert property to function: fix incorrectly conversion when property has explicit generic type
#KT-29192 Fixed
2019-05-19 14:57:25 +07:00
Toshiaki Kameyama
354f8f0bf1 Redundant 'suspend' modifier inspection: don't report when function has suspend operator invoke
#KT-25465 Fixed
2019-05-18 11:54:57 +03:00
Sergey Rostov
cf5577dfa6 Gradle, tests: fix cleanAllTests task name 2019-05-18 08:15:43 +03:00
Sergey Rostov
cec2e8c61a Gradle, js: update npm packages versions 2019-05-18 08:15:42 +03:00
Sergey Rostov
775ed2f9e5 Gradle: introduce "target" DSL function for single platform plugins 2019-05-18 08:15:42 +03:00
Sergey Rostov
b8fd4f56bb Gradle, js: introduce commonJs() dsl function 2019-05-18 08:15:42 +03:00
Sergey Rostov
83042afd5c Gradle, js, webpack: report progress
#KT-31013
2019-05-18 08:15:41 +03:00
Sergey Rostov
77dd806742 Gradle, js, yarn: split into workspaces and simple implementations
#KT-31018
	#KT-31017
2019-05-18 08:15:41 +03:00
Sergey Rostov
fab879bf33 Gradle, js, npm: store imported packages as yarn workspaces
#KT-30530
2019-05-18 08:15:41 +03:00
Sergey Rostov
64f997daa4 Gradle, tests: fix type in "prepend" 2019-05-18 08:15:40 +03:00
Sergey Rostov
68cb28d76f Gradle, js, karma: source maps support
#KT-31478
	#KT-31011
	#KT-30573
2019-05-18 08:15:40 +03:00
Sergey Rostov
9a6a2e14a5 Gradle, js, tests: don't add prefix if platform and/or sub target name is null 2019-05-18 08:15:39 +03:00
Sergey Rostov
5d8f2acf5f Gradle, js: create npm packages per compilation
#KT-30530
2019-05-18 08:15:39 +03:00
Sergey Rostov
b195d18d2d Gradle, js: resolve npm dependencies without task only during IDEA import
#KT-30530
2019-05-18 08:15:39 +03:00
Sergey Rostov
09e81ddd21 Gradle, js: create one npmResolve per build (share between subprojects)
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
8166cfb054 Gradle, js, npm: remove hoisted gradle node modules. Split results collection from shared cache.
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
eb3c701040 Gradle, js, npm: resolver between projects
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
5cfe117fd7 Gradle, js: use project.whenEvaluated instead of project.afterEvaluate 2019-05-18 08:15:37 +03:00
Sergey Rostov
2d51e2bca5 Gradle, js, dsl: use ConfigureUtil.configure for Groovy compatibility 2019-05-18 08:15:37 +03:00
Sergey Rostov
04a5b5a367 Gradle, js, krama: use web pack config directory
#KT-31011
2019-05-18 08:15:37 +03:00
Sergey Rostov
c2a6654194 Gradle, js: don't use any subtarget by default 2019-05-18 08:15:36 +03:00
Sergey Rostov
2a2f59ae1c Gradle, js, run: fix run dependencies on browserRun and nodeRun 2019-05-18 08:15:36 +03:00
Sergey Rostov
156d50646d Gradle, js, test: add basic @Input for test frameworks settings 2019-05-18 08:15:36 +03:00
Sergey Rostov
e435b9352a Gradle, js: aggregate jsTest task should work the same way as all tests aggregator
E.g: individual test tasks should not fail build, aggregate reports should be created.
Also this task should not be included in check (as all tests should be already executed
from the all tests aggregated task).
2019-05-18 08:15:35 +03:00
Sergey Rostov
26c2afd8d5 Gradle, js, karma: show output as progress 2019-05-18 08:15:35 +03:00
Sergey Rostov
c7d52331f7 Gradle, js, yarn: remove outdated warning about yarn workspaces
#KT-31018
	#KT-31017
2019-05-18 08:15:35 +03:00
Sergey Rostov
3ede15b2b2 Gradle, js: fixes for groovy dsl 2019-05-18 08:15:34 +03:00
Sergey Rostov
7e4eaa8210 Gradle, js, browser: best effort for parsing karma suite names
#KT-31011
2019-05-18 08:15:34 +03:00
Sergey Rostov
236dfa98b6 Gradle, js, browser: fix karma.conf.js writer
#KT-31011
2019-05-18 08:15:34 +03:00
Sergey Rostov
14d399e9ab Gradle, js, browser: fix run 2019-05-18 08:15:33 +03:00
Sergey Rostov
422ad763e4 Gradle, js: fix resolving required dependencies
#KT-31011
2019-05-18 08:15:33 +03:00
Sergey Rostov
9610c60b17 Gradle, nodeJs: fix tests 2019-05-18 08:15:33 +03:00
Sergey Rostov
a13a86a543 Gradle, js: revert to storing compile output inside node_modules
#KT-30530
Currently kotlin JS compiler generated `require('a.js')` for test -> main
dependencies. This is not worked in layout with compile output at project
work dir (will work if compiler will generate `require('a_test.js')`).
2019-05-18 08:15:32 +03:00
Sergey Rostov
b9f69ffe79 Gradle, js: extract NpmProjectModules to separate file
#KT-30530
2019-05-18 08:15:32 +03:00
Sergey Rostov
e2aafd5512 Gradle, js, node: fix source map support configuration
#KT-30573 Fixed
2019-05-18 08:15:31 +03:00
Sergey Rostov
1c3bb8529a Gradle, js: fix nodejs run target 2019-05-18 08:15:31 +03:00
Sergey Rostov
c8e8224005 Gradle, js: restore umd by default 2019-05-18 08:15:31 +03:00
Sergey Rostov
6229b8682e Gradle, js: fix karma.conf.js by wrapping config in function
#KT-31011
2019-05-18 08:15:30 +03:00
Sergey Rostov
8e2075ebcc Gradle, js: implement resolving node modules according to https://nodejs.org/api/modules.html
#KT-30530
2019-05-18 08:15:30 +03:00
Sergey Rostov
d08402a00c Gradle, js: fix requiredDependencies resolve 2019-05-18 08:15:30 +03:00
Sergey Rostov
1fe84c71e4 Gradle, js: fix NodeJsExec 2019-05-18 08:15:29 +03:00
Sergey Rostov
77959cc0af Gradle, js: use js compilation only after target configuration 2019-05-18 08:15:29 +03:00
Sergey Rostov
baf9ecd641 Gradle, JS: make KotlinWebpack.configDirectory optional
#KT-31013
2019-05-18 08:15:29 +03:00
Sergey Rostov
c0deea33bb Gradle, JS: resolve NPM dependencies inside task when possible
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
a69881850b Gradle, JS: introduce RequiresNpmDependencies
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
5ec501dce0 Gradle, JS: extract npm package constants
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
3797ec9255 Gradle, JS: introduce inner browser and nodejs inner targets
#KT-30747 Fixed
2019-05-18 08:15:27 +03:00
Sergey Rostov
066efc3732 Gradle, JS: nodejs target 2019-05-18 08:15:27 +03:00
Sergey Rostov
a609476245 Gradle, JS, webpack: source maps support
#KT-31013
2019-05-18 08:15:27 +03:00
Sergey Rostov
f28ff64e9f Gradle, JS: new nodejs project layout
#KT-30530
2019-05-18 08:15:26 +03:00
Sergey Rostov
eb7d09a562 Gradle, JS: webpack support
#KT-31013
2019-05-18 08:15:26 +03:00
Sergey Rostov
32ddc2318a Gradle, tests: clean should depend on cleanAllTests 2019-05-18 08:15:26 +03:00
Sergey Rostov
101c3588b3 Gradle, testsL fix ijListenTestTask 2019-05-18 08:15:25 +03:00
Sergey Rostov
312830ac4b Gradle, npm: resolve node_modules at parents, return local NodeJsExtension at NodeJsPlugin.apply 2019-05-18 08:15:25 +03:00
Sergey Rostov
4f4fc74b16 Gradle, yarn: get recursively resolved dependencies
#KT-31018 Fixed
	#KT-31016 Fixed
	#KT-31017 Fixed
2019-05-18 08:15:25 +03:00
Sergey Rostov
b96f26cc77 Gradle: improve tasks registration API, fix test tasks registration
Previously test tasks may be created inside other registration task
lambda which may be called lazily. This is illegal in Gradle.

Also let introduce Project.createOrRegisterTask on Project receiver
and reified type parameter.
2019-05-18 08:15:25 +03:00
Sergey Rostov
39ce257e64 Gradle: webpack
#KT-31013 Fixed
	#KT-31014 Fixed
2019-05-18 08:15:24 +03:00
Sergey Rostov
5372fcef69 Gradle, tests: remove "Task" suffix from KotlinTest tasks (as for jvm) 2019-05-18 08:15:24 +03:00
Sergey Rostov
3dae2739a4 Gradle, js: karma
#KT-31011 fixed
2019-05-18 08:15:24 +03:00
Sergey Rostov
92910ec3e9 Gradle, js: mocha
#KT-31010 Fixed
2019-05-18 08:15:23 +03:00
Sergey Rostov
4c2c8a1788 Gradle, npm: disable manageNodeModules by default
#KT-30530
2019-05-18 08:15:23 +03:00
Sergey Rostov
d82725718a Gradle, js: run tests using the new project-wide node_modules
#KT-30530
2019-05-18 08:15:23 +03:00
Sergey Rostov
a8799f5a8d Gradle: npm integration using yarn
#KT-31018 Fixed
2019-05-18 08:15:22 +03:00
Sergey Rostov
69f9e30e5a Gradle, Tests runner: update tests, fix tests on Windows 2019-05-18 08:15:22 +03:00
Sergey Rostov
9938b7fcd0 Gradle, Native: don't capture output if treatOutputAsStracktrace enabled
#KT-30529
2019-05-18 08:15:22 +03:00
Sergey Rostov
7830d204aa Gradle, tests: cleanAllTests task
#KT-29946
2019-05-18 08:15:21 +03:00
Sergey Rostov
8b16f182f6 Gradle, tests: show test results in IDE
#KT-29946
2019-05-18 08:15:21 +03:00
Sergey Rostov
125dc65178 Gradle: Kotlin/Native stack trace parser
#KT-30526
	#KT-30529
2019-05-18 08:15:21 +03:00
Sergey Rostov
0304f090e8 Gradle: JS stack trace parser
#KT-30526
2019-05-18 08:15:20 +03:00
Sergey Rostov
e013645d87 Gradle, test: allTests task, same class and method names for jvm, js and native
#KT-30691 Fixed
	#KT-31448 Fixed
2019-05-18 08:15:20 +03:00
Ilya Gorbunov
a83d301b50 Pack stdlib tests into a separate archive
So that kotlin-native could download stdlib tests and compiler test data
from different builds.
2019-05-18 04:41:29 +03:00
Nikolay Krasko
ef70e9db19 Don't use light classes for navigation element (KT-10215)
Place KotlinNavBarModelExtension before Java extension because it
substitutes non-java elements to files.

 #KT-10215 Fixed
2019-05-17 21:43:58 +03:00
Toshiaki Kameyama
0a4d21c51f Sort by class name in navigation bar (KT-10215)
#KT-10215 Fixed
2019-05-17 18:15:58 +03:00
Vadim Brilyantov
9052c5e529 Fix typo in new-daemon ignored tests that was leading to compile errors 2019-05-17 18:13:46 +03:00
Vadim Brilyantov
caaf847052 Mute all new-daemon tests 2019-05-17 15:51:53 +03:00
Vadim Brilyantov
01a05a5495 Move daemon jar from compiler 2019-05-17 15:51:52 +03:00
Vadim Brilyantov
ced973b707 Introduce new Kotlin Daemon without RMI abstraction 2019-05-17 15:51:51 +03:00
Igor Yakovlev
a3f718733d Fix of ConvertJavaInterfaceToClass test
Platform is trying to modify the class inheritance list during intension (see the test name above) action process but it cause a cross-language changes via PSI.
To make this possible LightClasses are supports this behaviour with a little support of it (inheritance list Add and inheritance list element Delete are supported).
It need's to be done for UL-classes in same way.
2019-05-17 14:48:47 +03:00
Toshiaki Kameyama
04638eea6b Remove braces intention: fix caret position
#KT-31443 Fixed
2019-05-17 11:18:44 +07:00
Steven Schäfer
90c3269502 Fix type parameters in WrappedClassConstructorDescriptor
IrConstructorCall gets type parameters from the class in addition to the
constructor declaration. This behavior is already implemented for
ClassConstructorDescriptorImpl, but was not implemented for
WrappedClassConstructorDescriptor, leading to missing type arguments for calls
to constructors generated in a lowering pass.
2019-05-16 20:26:18 +02:00
Roman Artemev
77c0e591af Set correct target backend 2019-05-16 19:27:41 +03:00
Roman Artemev
c352117eab [JS IR BE] Set correct runtime for JS IR BE tests 2019-05-16 19:27:41 +03:00
Roman Artemev
fabd306437 [JS IR BE] Fix varargs for inline arrays 2019-05-16 19:27:41 +03:00
Roman Artemev
600ad7e088 [JS IR BE] Fix KProperty access in case of both receivers 2019-05-16 19:27:41 +03:00
Roman Artemev
cd3fd60dd7 [JS BE] Extract backend specific code from shared stdlib sources 2019-05-16 19:27:41 +03:00
Roman Artemev
02d84bf061 [IR BE] Delegate coroutine naming strategy to platform part 2019-05-16 19:18:54 +03:00
Alexander Udalov
21d0beb94b Do not render stack traces and bytecode on muted failed tests locally
This was already disabled on buildserver with a35f368ce0, but makes
sense locally too because otherwise IntelliJ renders a lot of output
which takes lots of memory and slows down the test runner
2019-05-16 17:30:21 +02:00
Mads Ager
34cf5a19df JVM_IR: Support @JvmSynthetic annotations. 2019-05-16 17:07:22 +03:00
victor.petukhov
8bdc5f981e Actualize spec tests 2019-05-16 12:24:18 +03:00
Dmitriy Novozhilov
96a3831feb [NI] Add capturing receiver type for callable references
#KT-30292 Fixed
2019-05-16 10:50:30 +03:00
Steven Schäfer
f5a78213b2 Fix type of super 2019-05-16 07:58:45 +02:00
Alexey Tsvetkov
209a5d8464 Do not expose paths with placeholders in JS IC caches
#KT-31310 Fixed
2019-05-16 04:01:26 +03:00
Mads Ager
d2c372a4f7 JVM_IR: No EnclosingMethod attribute for member classes.
The comment in the code is correct that EnclosingMethod
attributes should only be generated for local and
anonymous classes. We were generating them for member
classes as well which leads to invalid class files.

With this change I had to mute one more tests. That is
because we lose the parent method and therefore we
see a class as a member class instead of a local class.
With the old descriptor based check that test still
passes.
2019-05-15 19:22:38 +02:00
Igor Yakovlev
79aa954682 Fix render of classpath log message for UL-classes 2019-05-15 18:48:53 +03:00
Elena Lepilkina
1c4ad193b3 Update kotlin-native-shared version 2019-05-15 16:07:54 +03:00
Mikhael Bogdanov
fe5a9f16a1 Minor. Remove obsolete workaround 2019-05-15 14:21:11 +02:00
Mikhael Bogdanov
812b766894 Remove hack with targets. Add target for most recent jdk 2019-05-15 14:21:11 +02:00
Alexander Udalov
a53fa0dfbf Minor, optimize newly added tests on unsigned intrinsics
Remove "JVM_TARGET: 1.6" directive from box tests and remove tests with
JVM target 1.8. By default, box tests are run with JVM target 1.6, and
there's an additional configuration `codegenTarget8Jvm8Test` that runs
all box tests with JVM target 1.8.

Also, remove box tests with JVM target 1.6. They aren't needed because
even if we manage to generate incorrect bytecode with target 1.6, the
corresponding box tests will catch that
2019-05-15 13:30:16 +02:00
pyos
f392b027fa JVM_IR: support references to Java fields 2019-05-15 13:29:48 +02:00
Alexander Udalov
e191eef10a Minor, refactor system properties in CodegenTestCase 2019-05-15 13:25:47 +02:00
Alexander Udalov
b602c08773 Remove javaFilesDir parameter of CodegenTestCase.doMultiFileTest
Create TestFile instances for .java sources similarly to .kt sources,
and write them to a temporary directory via writeJavaFiles in each test
where this is needed
2019-05-15 13:25:14 +02:00
Alexander Udalov
7fdb9c990e Reformat and cleanup most JVM codegen test classes 2019-05-15 13:25:14 +02:00
Svyatoslav Kuzmich
23a214710b [JS IR BE] Add Unit return type to function signature 2019-05-15 14:09:02 +03:00
Svyatoslav Kuzmich
e8933738ac [JS IR BE] Remove conservative unit materialization
Remove UnitMaterializationLowering
Remove Unit insertion in BridgeConstruction
Fix codegen for when expressions without else branch
2019-05-15 14:09:02 +03:00
Mikhael Bogdanov
c448def95f Add custom JDK tests on recent JDK avaliable in project 2019-05-15 12:55:14 +02:00
Mikhael Bogdanov
2f7f05c3bc Update proguard version 2019-05-15 12:55:13 +02:00
Dmitriy Novozhilov
07394bd6d3 [NI] Add test for KT-30300 with complex constraint system problem 2019-05-15 13:42:36 +03:00
Igor Yakovlev
e3ec501419 Fix realization of LightClass methods by KtLightClassForSourceDeclaration
#KT-31022 Fixed
2019-05-15 13:18:24 +03:00
Steven Schäfer
076f5e2ef9 Move jvm specific phases to JvmLower 2019-05-15 12:32:42 +03:00
Ilya Matveev
049269ba4f Gradle plugin: remove old native binary APIs
This patch removes APIs for native binary configuring
introduced in 1.3.0 and deprecated in 1.3.30.

Issue #KT-31229 Fixed
2019-05-15 13:12:01 +07:00
Ilya Gorbunov
18f9b20610 Remove internal visibility suppressions in kotlin.test
Internal visibility works fine in MPP, so they are no longer required.
2019-05-15 06:18:27 +03:00
Toshiaki Kameyama
fef0cc5d2b "Introduce 'when' subject" intention: suggest for "this" expression
#KT-12567 Fixed
2019-05-14 23:25:10 +03:00
Jake Wharton
aaf533df16 IR lowering for computing trimIndent/trimMargin on constants 2019-05-14 20:19:43 +02:00
Vyacheslav Gerasimov
d765bebcfc Build: Import embedded configuration as runtime in JPS build
This makes Idea import all embedded modules as transitive dependencies

 #KT-29548
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov
5782267d26 Build: Fix import of kotlin-reflect in JPS build
#KT-29548 Fixed
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov
b9fe6875e3 Build: Minor cleanup kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
c672300da1 Build: Use embedded configuration in kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
a6e3a0f5c3 Build: Use embedded configuration in kotlin-main-kts project 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
9a4cf2d835 Build: Add accessor for embedded configuration 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
0babddfc00 Build: update idea-ext to v0.5 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
68f776ebb1 Build: add kotlinManifest.properties to kotlin-plugin.jar 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
346478a5d3 Build: configure jps artifacts in gradle.projectsEvaluated 2019-05-14 18:07:16 +03:00
Dmitry Gridin
eee8d0263d Fix "Unused import" for 'provideDelegate'
#KT-31319 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin
3914530fa8 Don't delete import from stdlib if alias exists and used
#KT-31414 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin
32298522dd Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-14 21:01:20 +07:00
Dmitry Gridin
23e51268ad Minor: refactoring AbstractImportsTest 2019-05-14 21:01:20 +07:00
Mikhael Bogdanov
8050e94c0d Minor. Remove obsolete code for emulator shutdown 2019-05-14 15:46:23 +02:00
Mikhael Bogdanov
53856daaa4 Add system property to filter android test execution 2019-05-14 15:46:22 +02:00
Mikhael Bogdanov
d3c0937c67 Run android test locally with X86 emulator 2019-05-14 15:46:21 +02:00
Svyatoslav Kuzmich
28406b6bc4 [JS IR BE] Enable unconditional validation 2019-05-14 16:23:43 +03:00
Svyatoslav Kuzmich
b07690fccf Phaser: Implement dumper and verifier as general actions 2019-05-14 16:23:43 +03:00
Svyatoslav Kuzmich
0702b88bf3 [IR BE] Update parents in ArrayConstructorLowering 2019-05-14 16:23:42 +03:00
Mikhail Glukhikh
2d5f41cfe3 Fix .inspection file for ConvertNaNEquality tests 2019-05-14 16:23:08 +03:00
Mads Ager
b1e8a7cfce JVM: Generate LVT entry for this in @JvmOverload methods.
This change also makes sure that no line numbers are generated
in the wrappers in the JVM_IR backend.

Change-Id: If6c37f8a20894455abddb526039df059e02015a3
2019-05-14 15:14:07 +02:00
Ilmir Usmanov
360e30c133 Remove redundant continuation classes and INNERCLASS nodes
#KT-31339 Fixed
2019-05-14 16:00:39 +03:00
Martin Petrov
ccf2941f4a Use spaces instead of tabs to indent -Xlist-phases.
In Terminal.app and xterm the output columns get misaligned when using tabs.
Tabbed output only renders correctly when `tabstop=1`.
2019-05-14 15:54:01 +03:00
Svyatoslav Kuzmich
91d16ee947 [CLI] Extract :compiler:cli-js from :compiler:cli 2019-05-14 15:49:50 +03:00
Mark Punzalan
7efc29df7e Split up generation of test data for codegen/box/ranges into signed and
unsigned ranges/progressions.

The tests pass in JVM_IR for signed, but fail for unsigned due to
inlining being broken. We can disable the JVM_IR tests for unsigned,
while keeping them enabled for signed, to get better test coverage in
the interim until inlining is fixed.
2019-05-14 14:26:15 +02:00
Yan Zhulanow
331891b0d7 Pill: Fix getSerializedCompilerArguments()
There is an other method that starts with 'getSerializedCompilerArguments' – serializedCompilerArgumentsIgnoreClasspathIssues().
Fix the clash by exact matching: the getSerializedCompilerArguments() is not internal anyway.
2019-05-14 12:25:54 +09:00
Igor Yakovlev
bf8cbfc6b5 Temporary ignore ConvertJavaInterfaceToClass test 2019-05-14 00:10:28 +03:00
Igor Yakovlev
d44f37d3d5 Fix misspelling of KtUltraLightMethodForSourceDeclaration 2019-05-13 19:56:04 +03:00
pyos
40696f65c3 JVM_IR: generate WhenMappings for enum ordinal subjects 2019-05-13 19:09:07 +03:00
pyos
fb194e982e Copy EnumWhenLowering from Kotlin/Native 2019-05-13 19:09:07 +03:00
Andrey Uskov
52315106e8 Create source sets for generated by kapt sources during import
#KT-30739 Fixed
2019-05-13 18:43:11 +03:00
Steven Schäfer
1e08b3c7da Simplify findLocalIndex in ExpressionCodegen 2019-05-13 18:34:00 +03:00
Steven Schäfer
b04dc69157 Access this through the dispatch parameter when available 2019-05-13 18:34:00 +03:00
Steven Schäfer
9b9236efcb Fix parameter indices in SyntheticAccessorLowering 2019-05-13 18:34:00 +03:00
Sergey Igushkin
be05095df5 Introduce Java support in JVM MPP targets (KT-26256)
Deprecate the `jvmWithJava` preset, add warning.

Add a function `withJava()` to JVM MPP targets which applies the 'java'
plugin and sets up the Kotlin & Java interoperation.

Issue #KT-26256 Fixed

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
2019-05-13 16:25:09 +03:00
Igor Yakovlev
4625002efe Fix invalid test data for CommonIntentionActionsTest 2019-05-13 16:10:52 +03:00
Matthew Runo
39f576d75c Migrate RetentionPolicy arguments in deprecated Java quick-fix
#KT-29666 Fixed
2019-05-13 15:35:46 +03:00
Roman Artemev
db5396c1c2 [JS IR BE] Fix main function detector
- Do not consider extension functions as main candidate
2019-05-13 15:26:09 +03:00
Mikhael Bogdanov
c8564e9ade Update jpsBuild dependencies 2019-05-13 14:18:33 +02:00
Svyatoslav Kuzmich
bd3953c09f [JS IR BE] Turn on strict mode in generated code.
Fix multiple import of the same javascript module.
2019-05-13 13:41:11 +03:00
Svyatoslav Kuzmich
0f90aa5f80 [JS IR BE] BridgeConstruction: Fix init order of receivers and type parameters 2019-05-13 13:40:30 +03:00
Toshiaki Kameyama
14259ca9e0 Implicit Nothing? type: don't report when declaration overrides nullable nothing type
#KT-30481 Fixed
2019-05-13 13:00:50 +03:00
Toshiaki Kameyama
cf4471ba53 "Redundant 'requireNotNull' or 'checkNotNull' call": don't remove first argument if function is used as expression
#KT-31404 Fixed
2019-05-13 16:59:01 +07:00
Dereck Bridie
574178882a KT-26629 Inspection to replace equality check with NaN with isNaN call 2019-05-13 12:55:53 +03:00
Dmitry Gridin
07e908f15f Fix incorrect quickfix "Replace with Kotlin analog" for conversion to an extension
where the first argument is an expression with an operation
 #KT-31341 Fixed
2019-05-13 16:38:08 +07:00
Mikhail Glukhikh
b4a63794e5 Add name to argument: support old-style comment deletion 2019-05-13 12:33:52 +03:00
Mikhail Glukhikh
b0d294b50c Use candidate descriptor to determine parameter name stability in IDEA
#KT-31349 Fixed
2019-05-13 12:33:52 +03:00
Mikhail Glukhikh
d517276a06 Apply "unnamed boolean literal" to idea & J2K + other style fixes 2019-05-13 12:33:46 +03:00
Mikhail Glukhikh
955bfd6e7b Introduce "add parameter names to following arguments"
This commit also refactors relevant intentions & inspections,
like "add name to argument", "add names to call arguments",
"unnamed boolean literal argument"

#KT-30622 Fixed
2019-05-13 12:33:39 +03:00
LepilkinaElena
f26a4e06bd Test for compilerOpts in cinterop part of MPP plugin (#2300) 2019-05-13 12:05:33 +03:00
Igor Yakovlev
bb071263b0 Fix JVMStatic annotation for UL-properties 2019-05-13 11:21:12 +03:00
Igor Yakovlev
5da6d9d438 Update license agreement 2019-05-13 11:21:12 +03:00
Igor Yakovlev
0d31df7fb7 Fix invalid test data for static import quick fix 2019-05-13 11:21:12 +03:00
Igor Yakovlev
9870585eb8 Fix KotlinShortNamesCacheTest to not use clsDelegate 2019-05-13 11:21:12 +03:00
Igor Yakovlev
ab852750cc Fix testdata for find usages of properties 2019-05-13 11:21:12 +03:00
Igor Yakovlev
7608b11691 Fix testdata for abstract method implementing intention 2019-05-13 11:21:12 +03:00
Igor Yakovlev
48136d64cf KtUltraLightMethod now use null for MemberIndex 2019-05-13 11:21:12 +03:00
Igor Yakovlev
b485819a30 Move refactorings, fix annotations and fix cls-delegate tests 2019-05-13 11:21:11 +03:00
Igor Yakovlev
8e103b6559 Fix origin for TypeParameter + refactoring 2019-05-13 11:21:11 +03:00
Igor Yakovlev
f20ba9ddc2 Fix rename refactoring for UltraLightParameters 2019-05-13 11:21:11 +03:00
Igor Yakovlev
33126b273c Update StubTracker test data for completion tests 2019-05-13 11:21:11 +03:00
Igor Yakovlev
ab9e8c2d3a Add @get/@set JvmName support for properties 2019-05-13 11:21:11 +03:00
Denis Zharkov
1b5f72bd59 Enable ultra-light classes by default
^KT-29267 Fixed
2019-05-13 11:21:11 +03:00
Mads Ager
e8fbd42f7c JVM_IR: Support access flag jvm annotations on fields and methods. 2019-05-13 08:34:52 +02:00
Jiaxiang Chen
0020e953e1 Change order of line number geneartion for function call, and also force
line number generation after visiting inline functions.
2019-05-11 13:38:24 +02:00
max-kammerer
eeb1c0a0fc Merge pull request #2321 from neetopia/irLineNumberTestFix
Fix compareCustom function in IrLineNumberTest class, to exclude comment
2019-05-10 11:40:19 +02:00
Mikhael Bogdanov
021e94dced Fix maven test on parallel execution: don't miss to create dir 2019-05-10 11:37:18 +02:00
Steven Schäfer
570ee38256 Implement special cases for the hashCode intrinsic in JVM_IR 2019-05-10 09:40:57 +02:00
Ting-Yuan Huang
1c3b895fc0 Generate accessors for super calls if necessary
Current implementation of calls with super qualifier relies on
invokespecial, which has some more constraints than regular virtual
invocations. When those constraints aren't met, accessors are needed.
2019-05-10 08:57:37 +02:00
Mikhael Bogdanov
c90e6c1f18 Delete test temp root folders after test execution
Don't waste space on TeamCity
2019-05-10 08:12:03 +02:00
Mads Ager
99e7ae6b3f Fix typo in expectation files for command line tests.
The expectations contained ';' instead of ':' which makes two
CLI tests fail.
2019-05-09 16:57:29 +02:00
Mikhael Bogdanov
054febe57f Update bootstrap 2019-05-09 11:56:09 +02:00
pyos
4d9661890a Test reification of type parameters into Array(size, init)
(cherry picked from commit 6daa61ef5f)
2019-05-09 11:54:43 +02:00
pyos
3171129c3c JS_IR: remove traces of @kotlin.native.internal.InlineConstructor
This is a hack used by Kotlin/Native purely to implement Array
constructors. Since there's a lowering that does that, and inline
constructors are not part of the language (although they theoretically
could be), the code is redundant.

(cherry picked from commit a74fae246b)
2019-05-09 11:54:35 +02:00
pyos
08da078842 JVM_IR: implement IrReturnableBlock codegen
(cherry picked from commit 530ad368fe)
2019-05-09 11:54:26 +02:00
pyos
683f8417d3 Add a common JVM/JS lowering for Array(size, function)
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.

(cherry picked from commit 4a29e3cfcf)
2019-05-09 11:54:18 +02:00
max-kammerer
e74e0ea013 Revert "Add a common JVM/JS lowering for Array(size, function)"
This reverts commit 4a29e3cfcf.
2019-05-09 11:49:34 +02:00
max-kammerer
856a1649c6 Revert "JVM_IR: implement IrReturnableBlock codegen"
This reverts commit 530ad368fe.
2019-05-09 11:49:34 +02:00
max-kammerer
05d352769b Revert "JS_IR: remove traces of @kotlin.native.internal.InlineConstructor"
This reverts commit a74fae246b.
2019-05-09 11:49:34 +02:00
max-kammerer
8560459dc6 Revert "Test reification of type parameters into Array(size, init)"
This reverts commit 6daa61ef5f.
2019-05-09 11:49:34 +02:00
pyos
6daa61ef5f Test reification of type parameters into Array(size, init) 2019-05-09 08:03:18 +02:00
pyos
a74fae246b JS_IR: remove traces of @kotlin.native.internal.InlineConstructor
This is a hack used by Kotlin/Native purely to implement Array
constructors. Since there's a lowering that does that, and inline
constructors are not part of the language (although they theoretically
could be), the code is redundant.
2019-05-09 08:03:18 +02:00
pyos
530ad368fe JVM_IR: implement IrReturnableBlock codegen 2019-05-09 08:03:18 +02:00
pyos
4a29e3cfcf Add a common JVM/JS lowering for Array(size, function)
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.
2019-05-09 08:03:18 +02:00
Svyatoslav Kuzmich
f4bb1354c9 [JS IR BE] Support friend modules 2019-05-08 23:34:00 +03:00
Jiaxiang Chen
2c5ebf3ab2 Fix compareCustom function in IrLineNumberTest class, to exclude comment
lines that are not related for line number verification.

Unmute a test case should have been unmuted but shadowed by this bug.
2019-05-08 12:53:45 -07:00
Nikolay Krasko
ad02700200 Update to bootstrap 1.3.50-dev-2
Fix Compiler and all IDE plugins configuration struggling to build
stdlib because of circular dependency.

See 1.3.50-dev-2 build in https://teamcity.jetbrains.com/app/buildConfiguration/Kotlin_dev_CompilerAllPlugins?branch=%3Cdefault%3E&buildTypeTab=builds
2019-05-08 20:01:01 +03:00
Dmitriy Dolovov
ca9bff010b Fix: Make "cidrPluginsEnabled" Gradle parameter checks consistent
Also add logging.
2019-05-08 17:16:40 +03:00
Natalia Selezneva
e158875a14 Fix NPE in SLRUMap in ScriptDefinitionsManager
EA-138364 - NPE: LinkedHashMap$Entry.access$
2019-05-08 15:17:13 +03:00
Natalia Selezneva
2a2fe6b428 Do not provide 'add dependency' quick fix for unresolved references for non-project files
EA-126105 - NPE: JavaFileManagerImpl$LibSrcExcludingScope.<init> (KotlinAddOrderEntryActionFactory)
2019-05-08 15:17:12 +03:00
Natalia Selezneva
ba7d66eb4b Fix 'Invalid file' Exception during script definition search (EA-125840)
EA-125840 - assert: FileManagerImpl.findFile
2019-05-08 15:17:12 +03:00
Natalia Selezneva
836006b3f3 Do not use canonical paths in OutsidersPsiFileSupportUtils (EA-135551)
EA-135551 - IOE: OutsidersPsiFileSupportUtils$getOutsiderFileOrigin$.invoke
2019-05-08 15:17:11 +03:00
Natalia Selezneva
98235952ad Fix notification about highlighting for diff view in build.gradle.kts (KT-30638)
^KT-30638 Fixed
2019-05-08 15:17:11 +03:00
Natalia Selezneva
495d98f997 Fix highlighting for scripts in diff view (KT-30690)
^KT-30690 Fixed
2019-05-08 15:17:10 +03:00
Natalia Selezneva
88c6ecbbdf Minor: extract common parts 2019-05-08 15:17:09 +03:00
Natalia Selezneva
89bf7f991a Run indexes update after typing in script if needed 2019-05-08 15:17:09 +03:00
Natalia Selezneva
9e51f82248 Refactoring: add isApplicable method to ScriptDependenciesLoader 2019-05-08 15:17:08 +03:00
Natalia Selezneva
e990c61b55 Do not start script dependencies update if dependencies are already cached 2019-05-08 15:17:07 +03:00
Mikhail Zarechenskiy
516fccbe7b [NI] Complete call if return type contains only "good" type variables 2019-05-08 12:19:52 +03:00
Mikhail Zarechenskiy
61bd3a8d03 [NI] Complete call if return type has proper lower or equal constraints
There was a silly bug: equal constraint is actually a lower and an upper
 constraint, but we checked only presence of lower constraints.

 Test is important as here we have one equal constraint and should
 complete inner call `foo<Int>()` without propagating it to `bar` to
 avoid using `NoInfer` annotation multiple times
2019-05-08 12:19:50 +03:00
Mikhail Zarechenskiy
6c9394f0b2 [NI] Use original implicit receiver for DSL violation check
There is an inconsistency between old and new inference for storing
 receivers of resolved calls. In new inference, for captured types,
 receiver will be changed and to preserve behavior of the old inference,
 we use original one during important checks.
 This is more a workaround than a solution and should be revisited.

 #KT-31356 Fixed
 #KT-29948 Fixed
 #KT-31360 Fixed
2019-05-08 12:19:48 +03:00
Mikhail Zarechenskiy
c283e15425 [NI] Preserve annotations during type substitution
#KT-31346 Fixed
2019-05-08 11:26:20 +03:00
Ilya Gorbunov
2c26dc3af6 Add simplified overloads of String<->ByteArray/CharArray conversions
These overloads cover the most common cases of conversion of the entire
String or Byte/CharArray, avoiding extra index check and branching.

#KT-24810, KT-29265
2019-05-08 02:58:57 +03:00
Svyatoslav Kuzmich
f9c12db3b5 [JS IR] Unmute tests 2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
e3bcabeae3 [JS IR] stdlib: Fix bugs in Long.toString(radix) 2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
bc29a5b15c [JS IR] stdlib: port methods that use bit representation of numbers
- Port part of 'misc.js' from current backend to 'bitUtils.kt' in IR backend
- Enable toBits, toRawBits, fromBits extension function on Double and Float
- Enable Double.withSign
- Refactor getNumberHashCode using new utils
2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
362fbc8770 [JS IR] stdlib: Use comparator in CharArray.sort
CharArray is represented as a regular JS Array. Its default sort order is based
on string representation of elements.
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
179acf0789 [JS IR] stdlib: generate type-safe contentToString for primitive arrays
Avoid casting 'primitive' arrays to Array<*> because they fail on runtime
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
7687985442 [JS IR] Stdlib: use total-order comparasion for content equals 2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
3a506a372b [JS IR] stdlib: Use Nothing in return type of THROW helpers
Backend generated calls to those helpers inside expression which
resuleted in invalid type casts in IR (in dead code).
2019-05-07 21:48:50 +03:00
Nikolay Krasko
8c83beb086 Refactoring: drop unused AbstractKotlinReferenceContributor.kt 2019-05-07 16:12:25 +03:00
Nikolay Krasko
9b9bfe7ba3 Don't produce references for Kotlin block 2019-05-07 16:12:24 +03:00
Nikolay Krasko
78200dd38e Get Kotlin references through Kotlin contributors only (KT-31129)
Speed up getting references and protect Kotlin from slow
references contributors.

 #KT-31129 Fixed
2019-05-07 16:12:24 +03:00
Nikolay Krasko
b5918f4b5d Minor: move KotlinDefaultAnnotationMethodImplicitReferenceContributor.kt
Need this move to reference contributor from reference provider service.
2019-05-07 16:12:24 +03:00
Mikhail Zarechenskiy
3506c2047a Fix lint test: take into account diagnostic that is specific for NI 2019-05-07 15:56:15 +03:00
Mikhail Glukhikh
54411bd248 Simplifiable call: support case w/out receiver, add minor enhancements
Related to KT-30501
2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
8328af5694 Apply "library call could be simplified" to idea + other style fixes 2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
e934eba6e4 Simplifiable call inspection: add filter -> filterIsInstance replacement
#KT-30501 Fixed
2019-05-07 14:28:18 +03:00
Mikhail Glukhikh
7f1643cfad Minor: simplify isCalling 2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
8913755e11 Simplifiable call inspection: add filter -> filterNotNull replacement
Related to KT-30501
2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
4a5cbe0443 Replace "flatMap -> flatten" inspection with abstract "simplifiable call"
Related to KT-30501
2019-05-07 14:28:16 +03:00
Nicolay Mitropolsky
6101b5e6ba KotlinAnnotatedElementsSearcher made support Kotlin objects (KT-31332) 2019-05-07 09:26:00 +03:00
Svyatoslav Kuzmich
824c51e7f0 [JS IR] Add stdlib regression tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0de1242f68 [JS IR BE] Unmute passed tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
331625a9bb [JS IR BE] Lower kotlin.js.Json external interface methods 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6c9375196 [JS IR BE] Preserve package fqName when moving external declarations out
Create separate package fragment for each fqName of external declaration package
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
2741ecaaad [JS IR BE] Materialize Unit object during upcasts in AutoBoxingTransformer 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
58bed0f932 [JS IR BE] Fix types of in secondary ctor lowering
Type of IrDelegatingConstructorCall is 'kotlin.Unit'
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6761d323c [JS IR BE] Fix return targets inside state machine 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
feeb6e9862 [JS IR BE] Fix type for lowered cast expression
Safe cast result type is different from its type operand.
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
fc0a0f41d2 [JS IR BE] Fix: patch parents problems
* Patch parents for state machine builder
* Patch parents for declarations inside default value of actual parameter
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
130d2d00c3 [JS IR BE] Fix unboxing empty inline class varargs 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0aae760469 [JS IR BE] Fix block decomposition lowering for dynamic expressions 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
17178628fb [JS IR BE] Support bridges for special methods
Mostly reused from JVM IR lowering.
Shared logic moved to common backend module.
2019-05-06 19:34:25 +03:00
Mikhael Bogdanov
ec6904afd1 Minor. Fix test data 2019-05-06 17:34:02 +02:00
Mikhail Zarechenskiy
c1c464eeb5 Enable new type inference algorithm for IDE analysis
Note that this change doesn't affect compilation: if a project used
 old inference, then it'll continue to use it.

 To use old inference one can uncheck "Enable new type inference..."
 option in "Kotlin Compiler" tab
2019-05-06 18:19:25 +03:00
Mikhail Zarechenskiy
1fecd15355 [NI] Fix exception on capturing stub type from coroutine-inference
#KT-30853 Fixed
2019-05-06 18:05:02 +03:00
pyos
90f11211d3 JVM_IR: wrap performInline in enterIntoInlining/exitFromInliningOf 2019-05-06 16:23:28 +02:00
Mikhail Zarechenskiy
931bbd8cec [NI] Support ad-hoc implicit integer coercion for Kotlin/Native 2019-05-06 16:59:30 +03:00
Abduqodiri Qurbonzoda
c8a4fa58cd Implement String to/from ByteArray conversion (KT-24810) 2019-05-06 15:54:28 +03:00
Abduqodiri Qurbonzoda
81d2d3cb6a Implement String to/from CharArray conversion (KT-29265) 2019-05-06 15:54:28 +03:00
Mikhail Zarechenskiy
a3247b1b92 Add option to enable new inference only for IDE analysis
#KT-30453 Fixed
2019-05-06 14:36:05 +03:00
Dmitry Gridin
e857425b35 Fix 'optimizeImports' tests 2019-05-06 18:12:39 +07:00
Dmitry Gridin
75fb74b262 Fix runtime instance for AbstractJvmOptimizeImportsTest 2019-05-06 18:12:39 +07:00
Dmitry Gridin
ff26acacf9 Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-06 18:12:39 +07:00
Dmitry Gridin
87b559562f Run 'Optimize Import' on idea/tests and idea/src 2019-05-06 18:12:39 +07:00
Dmitry Gridin
96ed33e357 Optimize Imports should remove unused import alias
#KT-17375 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
7fe0503337 Unused import: support also imports as alias
#KT-12392 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
9062a2fe72 Fix false positive "Unused import directive" for imports under several alias
#KT-30949 Fixed
2019-05-06 18:10:51 +07:00
Dmitry Gridin
c52abfda16 Minor: refactoring KotlinImportOptimizer, KotlinUnusedImportInspection, OptimizedmportsBuilder and AbstractOptimizeImportsTest 2019-05-06 18:10:51 +07:00
Mikhail Zarechenskiy
2f835ed66f Specify type arguments to fix compilation against bootstrap compiler 2019-05-06 14:00:19 +03:00
Mikhail Zarechenskiy
8446ea8a6b [NI] Avoid substituting type variables inside captured types
This fixes exception in CreateAnnotation#testAnnotationType test
2019-05-06 14:00:17 +03:00
Mikhail Zarechenskiy
e8e8f6f336 Don't forget to rollback configured compiler options in IDE tests 2019-05-06 13:59:33 +03:00
Mikhail Zarechenskiy
4ed5c5363f [NI] Update testdata after 03e5e55f 2019-05-06 13:59:32 +03:00
Mikhail Zarechenskiy
97a6b3436c Add diagnostics from NI for SAM with receiver tests 2019-05-06 13:59:30 +03:00
Mikhail Zarechenskiy
c95eddbbbe [IDE-NI-MIGRATE] Migrate few tests for new inference 2019-05-06 13:59:28 +03:00
Mikhail Zarechenskiy
c03dfd1522 [IDE-NI-MIGRATE] Migrate completion tests for new inference 2019-05-06 13:59:26 +03:00
Mikhail Zarechenskiy
d4d1648e1d [IDE-NI-MIGRATE] Migrate QuickFix tests for new inference 2019-05-06 13:59:24 +03:00
Mikhail Zarechenskiy
871925ba31 Fix compilation after rebase 2019-05-06 11:36:32 +03:00
Dmitriy Novozhilov
a79030aa0f [IDE-NI-MIGRATE] [BAD] Migrate testdata of MultiModuleSafeDelete tests
Bad tests in `MultiModuleSafeDeleteTestGenerated`:
- testByActualClassSecondaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassSecondaryConstructorParameter
- testByExpectClassSecondaryConstructorParameter_ExpectsAndActualsByExpectClassSecondaryConstructorParameter
- testByActualClassPrimaryConstructorPropertyLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorProperty
- testByActualClassPrimaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorParameter
- testByExpectClassPrimaryConstructorParameter_ExpectsAndActualsByExpectClassPrimaryConstructorParameter
2019-05-06 11:36:30 +03:00
Dmitriy Novozhilov
b66bbdf7a6 [IDE-NI-MIGRATE] [BAD] Migrate testdata of Extraction tests
Bad tests:
- IntroduceTypeParameter.testDuplicates
- IntroduceTypeParameter.testNullableType
- IntroduceTypeParameter.testUserType
- IntroduceTypeParameter.testFunctionType
- IntroduceTypeParameter.testInClass
- ExtractFunction.TypeParameters.testNoVarianceInFun
- ExtractFunction.Parameters.CandidateTypes.testNonNullableTypes
- ExtractFunction.Parameters.CandidateTypes.testMultipleTypes
- ExtractFunction.ControlFlow.OutputValues.testGenericPair
- IntroduceVariable.ExplicateTypeArguments.testDeeperNestedCall
2019-05-06 11:36:28 +03:00
Dmitriy Novozhilov
656c8a4fa7 [IDE] Add configuring compiler arguments in Extension tests 2019-05-06 11:36:27 +03:00
Dmitriy Novozhilov
03c34691af [NI] Expand TYPE_INFERENCE_ERRORS with diagnostics from NI 2019-05-06 11:36:25 +03:00
Dmitriy Novozhilov
3d5593c70c [IDE-NI-MIGRATE] [BAD] Migrate testdata of Intention tests
Issues:
- #KT-31263

Bad tests:
- SamConversionToAnonymousObject.testSimple3
- ConvertReferenceToLambda.testIf1
- ConvertReferenceToLambda.testIf2
- ConvertReferenceToLambda.testIf3
- ConvertReferenceToLambda.testIf4
- ConvertReferenceToLambda.testWhen1
- ConvertReferenceToLambda.testWhen2
- ConvertReferenceToLambda.testWhen3
- ConvertReferenceToLambda.testWhen4
- ConvertLambdaToReference.testVarargFunction2
2019-05-06 11:36:23 +03:00
Dmitriy Novozhilov
1a085516b0 [IDE-NI] Fix detecting error types in InsertExplicitTypeArgumentsIntention 2019-05-06 11:36:21 +03:00
Dmitriy Novozhilov
e46f552a8d [NI] Update testdata in diagnostic tests 2019-05-06 11:36:20 +03:00
Dmitriy Novozhilov
ad1b8a6fb1 [NI] Add substitution of lambda return type in diagnostics 2019-05-06 11:36:18 +03:00
Dmitriy Novozhilov
b4dbf0f9a4 [NI] Fix inference for constraints with captured in projection 2019-05-06 11:36:16 +03:00
Dmitriy Novozhilov
8f22d43d01 Typo: fix function name in kotlinToResolvedCallTransformer 2019-05-06 11:36:15 +03:00
Dmitriy Novozhilov
d18c55a412 [NI] Fix reporting type mismatch on lambda parameters 2019-05-06 11:36:13 +03:00
Dmitriy Novozhilov
f7091dd1e9 [NI] Uncapture captured types in diagnostics 2019-05-06 11:36:11 +03:00
Dmitriy Novozhilov
e6deaf3315 [NI] Fix reporting UNSAFE_IMPLICIT_INVOKE_CALL diagnostic 2019-05-06 11:36:09 +03:00
Dmitriy Novozhilov
251a02f71d [NI] Fix recording type of lambda in trace 2019-05-06 11:36:08 +03:00
Dmitriy Novozhilov
233dd3ffba [IDEA] Approximate IntegerLiteralType on IDEA side 2019-05-06 11:36:06 +03:00
Dmitriy Novozhilov
f2bbae6a63 [NI] Fix resolving callable references with typealias in ths
#KT-31199 Fixed
2019-05-06 11:36:04 +03:00
Dmitriy Novozhilov
65380f4eb4 [NI] Remove captured type approximation in type arguments of resolved call 2019-05-06 11:36:02 +03:00
Dmitriy Novozhilov
421fda6e92 [NI] Fix reporting smartcasts on arguments of binary expression 2019-05-06 11:36:01 +03:00
Dmitriy Novozhilov
5715c32216 [IDE-NI-MIGRATE] [OK] Enable only OI on some IDEA tests that unrelevant in NI 2019-05-06 11:35:59 +03:00
Dmitriy Novozhilov
48e450684b [TEST] Add configuration of language features in AbstractDiagnosticMessageTest 2019-05-06 11:35:57 +03:00
Dmitriy Novozhilov
05aa36a858 [IDE-NI-MIGRATE] [BAD] Migrate testdata of LocalInspection tests 2019-05-06 11:35:55 +03:00
Dmitriy Novozhilov
17df843bf1 [NI] Fix getting source psi in UnusedLambdaExpressionBodyInspection 2019-05-06 11:35:54 +03:00
Dmitriy Novozhilov
6f51415b4d [NI] Fix determining return type of lambda in IDEA
UselessCallOnCollection tests fixed
2019-05-06 11:35:50 +03:00
Sergey Rostov
956f27cc2d Gradle, JS Test: temporary disable js tests configuration
Test configuration will be reworked with new DSL for browser and nodejs
configuration.
2019-05-05 22:32:23 +03:00
Mikhael Bogdanov
5698d923eb Update dependencies for Android box tests 2019-05-03 15:36:48 +02:00
Mikhael Bogdanov
6dbbf0bb72 Move server process creation to JDK 6 suite
It's allow to avoid problem with wrong inherited output
 (gradle instead of test process)
2019-05-02 13:46:27 +02:00
Georgy Bronnikov
bfe148efd5 IR: mostly remove descriptors from codegen 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
9923d956aa JVM_IR: rework IrIntrinsicMethods 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
98d309d03b IR: declaration builders for receiver parameters 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
ad70a68671 JVM_IR: correct some type parameter bugs 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
3e6171aefc JVM_IR: redirect super calls to DefaultImpls where necessary 2019-05-01 11:47:44 +03:00
ilya-g
66fb47e715 Fix relative link in contributing guide 2019-05-01 07:59:15 +03:00
Ilya Gorbunov
5f2762ed20 Follow up: fix typos in coroutine docs 2019-05-01 05:40:35 +03:00
Svyatoslav Kuzmich
87415cb769 [JS IR] Help IDEA: Copy stdlib sources instead of sharing 2019-05-01 00:28:36 +03:00
Svyatoslav Kuzmich
54e6ee82ad Exclude :kotlin-stdlib-js-ir from coreLibProjects for local builds 2019-05-01 00:28:36 +03:00
Simon Ogorodnik
8a2b41c8cb Fix proguard 2019-04-30 19:28:17 +03:00
Mikhail Glukhikh
5262f0a53f Fir2Ir: apply major text data update after a bunch of resolve changes 2019-04-30 18:45:57 +03:00
Simon Ogorodnik
3e51cbc9dc FIR: move test to stdlib group thus fixing it 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
5b929b88e1 [FIR] Allow nullability mismatch in resolve 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
2111e56d2e FIR: introduce workaround to avoid type-aliases in ConeClassType 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
c06d521e78 FIR: support star projection in CreateFreshTypeVariableSubstitutorStage
This commit fixes a small pack of tests failing at this point
2019-04-30 18:45:56 +03:00
Simon Ogorodnik
4bcba000fd FIR: pass name resolver to annotation deserializer separately 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
1bb4b32c91 Fir2Ir converter: fix exception on FirUnitExpression 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
f2ff103ed7 Fir2Ir converter: fix KNPE during use-site scope building for local 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
8cb16cc06a FIR provider: support getClassUseSiteMemberScope for type aliases 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
f457cb099f FIR deserializer: handle context in more correct way 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
1e653226ef FIR deserializer: don't create symbol in advance for class literals 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
a4b4db5589 FIR resolve: process situation with both implicit receivers properly 2019-04-30 18:45:55 +03:00
victor.petukhov
3636046e2d [FIR] Add test with potential recursive call in compiler FE on when with sealed class inside it (KT-18583) 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
d1d6b8b77a FIR Java: handle primitive arrays in annotations correctly 2019-04-30 18:45:54 +03:00
Mikhail Glukhikh
be18134270 FIR multi-module: minor test data fixes after resolve enhancements 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
77817cb750 Raw FIR: copy class type-parameters into constructors properly 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
9cef9e4056 Remove isMarkedNullable from FirResolvedTypeRef 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
458080ca8b Raw FIR: create resolved references for desugared temporary variables 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
99994e6c41 FIR: provide super-type as the self-type for anonymous objects
This commit is a temporary approximation useful before we have
symbols for local classes & objects
2019-04-30 18:45:54 +03:00
Simon Ogorodnik
2f7ced2a8e FIR Java: bind overrides properly 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
d19a250cbe FIR: support proper overriding of generic functions 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
7b9f5293da FIR: resolve primary constructor parameters in initializers context 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
fa4ba82350 FIR: provide classifiers via class use-site scope 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
f99f06831c FIR resolve: support typing for get class 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
00ccea220e Raw FIR: allow implicit type of value parameter (helpful for lambda) 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
9169071d60 FIR resolve: introduce draft version of the visibility checker 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
adf845b2fd FIR: provide resolved super-type as the type of enum entry reference 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
8e200d8113 Filter out self output directory from classpath in FIR modularized test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e521e66c74 FIR deserializer: provide proper type for enum entries 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
ca350e64c2 FIR deserializer: add proper container class id to nested class members 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
daf9f927d4 FIR: add property case to companion test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e41a79fbe9 Unify building references to symbols in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
0c0f45791b Anchors instead of refs on declaration site in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
d28bb5bc70 Render value-parameter modifiers in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
efbf096879 Support ::class in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb19a586f4 Fold nullability flexible types in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
3e69838f48 FIR Java: map classes to make java type-parameters have correct bounds
Really, this commit implements early J2K mapping for all Java types.
It's questionable and probably wrong at least for super-types,
because, for example, we cannot resolve spliterator() in classes
derived from java.lang.Iterable
2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb91c6b977 Add abbreviated types rendering to html fir dump 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
6a0e3371ae FIR: resolve conflicts on multiple inheritance of fun with same signature 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
84fbf4ec25 Partially cache scopes in FIR body resolve transformer 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
861ea6a30f Provide hashCode and equals for lookup tag based types 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ce0b482413 FIR resolve: add work-around to support enum entries 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
d22eab680e FIR: provide nested classes and objects via declared member scope 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ee73d21d32 Expand type-aliases in cone (FIR) type context 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
6f9f9fc087 FIR types: relax requirements around flexible types 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
0ae2f992fa Raw FIR: provide receiver to ++, -- operators 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
dc4ccf8d23 FIR resolve: make receiver completion run independent from outer call 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
adb135d036 Provide title to symbol references in html fir dump 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
c1a9fee7e1 Implement break, continue, init in html fir 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
26119f0403 FIR: implement isDenotable on type constructor more accurately 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
21d002ab6f FIR: add function for copying type-parameters 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
cec10dac85 FIR deserializer: remove cycle in annotations loading 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
e3e7eea3fe FIR: support (partially) type annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
48cd9e3251 FIR: support class annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
a9db64989b FIR deserializer: support enum entries and their annotation usages 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
b839e50ee2 FIR: deserialize annotations (built-ins only, no enums & arrays yet)
Problems: enums aren't deserialized correctly; array aren't done at all;
Target annotation has no arguments in built-in for some reason.
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
092d10b1a8 FIR Java: fix creation & handling of type parameter symbols
Before this commit, we created type parameter symbols each time
when type parameter was referenced or created.
In this commit, we introduced class-bound Java type parameter stack
and use it to find referenced type parameter symbol.
So now they are created only when Java type parameter is created
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
f8bb1d161a Fir Java: add type parameters to constructors and their return types 2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
5bf489327d Minor fix of around flexible and not-null FIR types (by semoro) 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
c487c1443f FIR deserializer: provide type parameters for type-aliases 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
9d7d358836 FIR deserializer: support properties 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
b02b090bdf FIR inference: implement simple constraint system properly 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
ddb08777d9 Link type parameters in html fir dump 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
4469fec57b Enable local functions in fir html dump 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
f9feeac5e1 Raw FIR: generate data-class component1, component2, ... functions 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
bb7dcd9945 FIR: protect importing scopes from empty names 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
8324ee7272 FIR deserializer: support type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6ab38a583 FIR: resolve constructors via type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
aa077b42e9 FIR deserializer: provide type-parameters for constructors 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
1512a6ba9a Support FirAnonymousObject in html fir dump 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6b9c41f3a FIR resolve: use proper argument mapping in FlatSignature for constructor 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
d89913dc8d FIR: use type of last expression as type of branch, not type of block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fd279860f7 FIR resolve: provide unconditional typing for block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
aa5f0fded5 FIR resolve: provide proper type for super reference 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
9dcf8f836a FIR: support varargs in resolve 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fa135bbab0 FIR resolve: properly count used arguments in overload conflict resolver 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
b4019b0cc1 FIR inference: use generic version of error type in type approximator 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
7d793f6750 FIR resolve: add handling of companions as objects 2019-04-30 18:45:43 +03:00
Mikhail Glukhikh
ab258767f8 FIR resolve: add extra test & comments to multiple receiver resolve 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
d1b8ca31c0 FIR resolve: add test for firstOrNull 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
a3806a6e2e Cone (FIR) context: provide proper types instead of todo's 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
dae5822986 FIR: fix nullability loss on substitution 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
572c9e7115 FIR resolve: add test for map and apply 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
206afde9cc FIR inference: add constraint system from receiver 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
fda777ecae FIR: detect extension function types by reference annotation
Later it should be replaced by cone type annotation analysis
2019-04-30 18:45:42 +03:00
Simon Ogorodnik
3d73c28d1e FIR: fix receiver not being substituted 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
77efe8b857 FIR resolve: reorder call resolution sequence 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
d82e790405 Cone (FIR) type context: implement supertype substitution properly 2019-04-30 18:45:42 +03:00
Mikhail Glukhikh
f47258c6b1 FIR: make substitution wrapper for class-based type scope 2019-04-30 18:45:41 +03:00
Mikhail Glukhikh
93496f1dee FIR resolve: add correct receiver tower scopes + check receivers 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
4b5172cda3 FIR (WIP): Initial support for proper lambda analysis 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
8c67ec8c89 FIR resolve: abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0de50307a Raw FIR: generate more trivial tree for lambdas (no explicit return) 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
aaf4645cef FIR: add return type to functional type's arguments 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0176fbde5 Support labels in fir html dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
541e1addf9 FIR modularized test: fix date format in report name 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
82fbe4d83d Support String concatenation and Unit expression in html fir dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
a6b2e119f7 FIR resolve: support trivial when typing 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
55467909da FIR deserializer: optimize KotlinDeserializedJvmSymbolsProvider 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
3a50d2e666 FIR: provide constructors from importing scopes 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
e7ea75fd81 FIR: fix search scope to include kotlin libraries package parts 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
4cb8faf666 FIR: uniquify scopes to avoid ambiguity on diamond inheritance 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
8d4cbd84e3 FIR resolve: support synthetics discrimination 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
49883d1d87 Add root index to fir dump 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
9c04751572 FIR modularized test: use qualified module names 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
3cabf490dd Use fir to html in modularized test 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
61b410e276 Implement fir to html dump 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
32e941cb53 FIR: keep names for error references 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
5bf41594ec FIR resolve: add receiver consistency checking
NB: looks like checker itself may be not needed, but it's important
to check extension receiver presence during candidate collection
2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
2e7d655b20 FIR resolve: support nested class constructors 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
8b718c6822 FIR body resolve: support subject type calculation 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
e05dfb6541 FIR resolve: introduce argument mapper 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
c98b820968 Extract FIR modularized tests to separate module 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
6e3f173567 Implement old FE perf test similar to FIR modularized 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
3c4f5be8fd Implement FIR modularized tests 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
fe3afccfc2 FIR resolve: provide synthetic properties scope
At the moment get* and is* functions are supported
2019-04-30 18:45:37 +03:00
Simon Ogorodnik
5763b82cdd Improve FIR benchmark util, add progress and multi-run info collection 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
45f92c490c FIR: make call resolver stop on first successful candidate 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
95011b1076 Return "FIR resolve: support variable assignments" with full completion 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
c6aff9380b FIR: support resolving to objects 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
b38f3a1272 Replace ConeFunctionType with ConeClassType 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
93cb23a498 Raw FIR: support type placeholders 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
0e0c188e05 Rebuild fir-provider indexes on changes 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
5f0fe4785d Implement FirProvider consistency checker 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
1dae135840 Expand ConeTypeContext, implement FIR type inference & related checkers 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
f1eb66819b Revert "FIR body resolve: support variable assignments"
Performed to make long branch rebasing easier
This reverts commit af8c3788
2019-04-30 18:45:35 +03:00
Simon Ogorodnik
935c21f906 FIR scopes: use use-site member scopes for imports 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
3533541702 Provide class use-site scopes from FirSymbolProviders 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
1cd25da7af FIR scope processors: add function to check is stop on ProcessorAction 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
082e9d1cd7 FIR Java: implement knownClassNamesInPackage optimization 2019-04-30 18:45:34 +03:00
Yanis Batura
a51b7fb8d0 Fix typos 2019-04-30 18:42:07 +03:00
Leonid Startsev
0ecf20bd62 Revert back visibility in deserialization ctor to public so inheritors can access it from other modules.
Fix instantiating of polymorphic serializer with generics.
Move context creation below as asked.
2019-04-30 17:53:40 +03:00
Dmitriy Dolovov
3610c99163 Move IDE-related CIDR modules into 'ide' directory 2019-04-30 21:32:21 +07:00
Svyatoslav Kuzmich
379cb08226 [JS] Reduce usage of 'js' function in stdlib
Function 'kotlin.js.js' is to be redesigned in JS IR backend,
partially because it is a hard feature to support.

Current implementation is unstable and can cause problems around
 inlining and name generator. Luckily most of its use-cases
can be covered by simpler features like dynamic expressions and
external declarations.

Thus we are reducing it's usage in stdlib to make IR backend more
stable in current state. JavaScript features that can't be covered by dynamic expression are
implemented in 'jsOperators.kt' file respectively for each backend:

 - 'internal inline' function which calls 'js' function inside for current
   pre-IR backend

 - 'internal' function with '_hack' parameters for JS IR backend which will be
   later intinsicified in a compiler
2019-04-30 15:27:19 +03:00
Alexander Udalov
e22594acde JVM IR: slightly change field renaming convention implementation
Prefer to rename fields from the class, not from the companion, to be
more in line with the old backend's behavior. This has no effect on the
behavior of current tests but removes differences in metadata (since
metadata has information about every property->field mapping) in some of
them
2019-04-30 13:15:29 +02:00
Alexander Udalov
6cc293a0c5 JVM IR: record FIELD_FOR_PROPERTY for property delegates
Delegated properties now have their $delegate fields recorded in the
metadata (in `ClassCodegen.generateField`). This part of metadata is
used by `KPropertyN.getDelegate` functions, so almost all tests on
getDelegate are now unmuted
2019-04-30 13:15:29 +02:00
Alexander Udalov
5aae832c5f Minor, update doc on -Xsanitize-parentheses
The ASM issue with parentheses was fixed in
02f00c4a82

 #KT-29475
2019-04-30 13:15:29 +02:00
Alexander Udalov
bd6e90f302 FIR: remove dependency of :compiler:fir:resolve on :compiler:cli 2019-04-30 12:01:23 +02:00
pyos
c77e8a8c2d JVM_IR: remove another redundant lowering 2019-04-30 08:20:37 +02:00
Dmitriy Dolovov
c017ef9bc8 Properly detect Kotlin/Native libraries
Issue #KT-30598 fixed
2019-04-30 13:05:22 +07:00
Dmitriy Dolovov
20d77afcce Refactor Kotlin/Native path constants
Use java.io.File instead of java.nio.Path to have more uniform API
2019-04-30 13:05:14 +07:00
Dmitriy Dolovov
2ef7cde34b Add tests for "lite" API for Kotlin/Native libraries 2019-04-30 13:05:06 +07:00
Dmitriy Dolovov
07f6059f44 Refactor "lite" API for Kotlin/Native libraries 2019-04-30 13:04:56 +07:00
Andrey Uskov
6039d86388 Importing projects with granular metadata is partially supported
(except k-lib data format of metadata libraries and multiple target
platforms per source set)
2019-04-29 19:49:18 +03:00
Andrey Uskov
998a24414a Improved parsing of internal compiler arguments with boolean state in
case when the argument is listed twice in the list of command line
arguments. The last value will be used.
#KT-27181 Fixed
2019-04-29 19:48:01 +03:00
Andrey Uskov
affe8baf74 Fix import with jps enabled. kotlin-js-ir and kotlin-test-js-ir were
removed from jps build
2019-04-29 19:45:01 +03:00
Mikhael Bogdanov
0482f7e9c5 Restrict general compare intrinsic optimization to CompareTo intrinsic 2019-04-29 16:27:35 +02:00
Simon Ogorodnik
51f5042315 Fix FIR compilation 2019-04-29 16:51:39 +03:00
Mikhail Glukhikh
b8e6291265 Inference: use generic version of error type in type approximator 2019-04-29 16:51:39 +03:00
Simon Ogorodnik
db8bd8c197 Fix check isCapturedTypeFromSubtyping to support KotlinTypeMarkers 2019-04-29 16:51:38 +03:00
Simon Ogorodnik
aabc9fa10f Abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
58029830f0 Skip star-projection to avoid failures 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
2ea7fb8801 Cleanup ConstraintStorage.buildResultingSubstitutor 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
57a3b1a773 Abstract TypeApproximator from NewCapturedType 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
9306f3840f Abstract buildResultingSubstitutor & ResultTypeResolver from KotlinType 2019-04-29 16:51:35 +03:00
Simon Ogorodnik
fe2e5b7301 Abstract FlatSignature from kotlin types 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
8e595f015e Initial OverloadingConflictResolver abstraction from KotlinTypes 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
9a1678728d Implement inference context and simple components 2019-04-29 16:51:33 +03:00
Simon Ogorodnik
04324b6723 Provide overloads with explicit resolutionFacade for resolutionApi
To ensure stable results of subsequent resolution api method calls,
it is require to provide same resolution facade, as
getResolutionFacade function doesn't guarantee to have same result in
subsequent calls due to soft caching
2019-04-29 16:51:32 +03:00
Roman Elizarov
1e5d973bb1 Fix CoroutineContext documentation with respect to equality
KT-26398 had updated behavior from reference comparison to regular
equality, but the documentation for CoroutineContext was left out.
The whole "by reference" needs to be removed, because it now
follows default behavior of all Kotlin collections and need no
further clarification.
2019-04-29 16:33:22 +03:00
Vyacheslav Gerasimov
389490ad79 Build: resolve :idea project resources lazily in ultimate plugin
to avoid using `evaluationDependsOn`
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
c218385ba8 Build: Collect sources for compiler lazily to avoid evaluationDependsOn 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
8851029baa Build: Use embedded configuration for compiler plugins 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
50e145f239 Build: remove various evaluationDependsOn calls across the build
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
0ec1df89fa Build: use configuration for dependency on android-extensions-runtime
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
b3720a55d2 Build: Make root ideaPlugin task depend on :prepare:idea-plugin
Since it's only one left in the project
2019-04-29 16:23:16 +03:00
Mikhail Glukhikh
3f6be95801 Include FIR modules into compiler #KT-30243 Fixed
(cherry picked from commit 053aa8ca1e)
2019-04-29 16:23:16 +03:00
Nicolay Mitropolsky
bd16c4629a KotlinElementActionsFactory.createChangeModifierActions modernisation
to allow IDEA relatively safely remove `createChangeModifierActions(target: JvmModifiersOwner, request: MemberRequest.Modifier)` in 192
2019-04-29 16:18:14 +03:00
Jiaxiang Chen
4b99d85322 Optimize JVM byte code generation for conditional conjunction
Implement an intrinsic method for boolean.and operation, and replace
ANDAND condition with a call to such intrinsic method.
2019-04-29 13:28:18 +02:00
Vasily Levchenko
53493657ff [kotlin-native-shared][version]bump 2019-04-29 14:08:16 +03:00
Nikolay Krasko
07ea0ffe16 Reformat and clean up idea.actions.internal 2019-04-29 12:13:18 +03:00
Nikolay Krasko
f9012cf637 Add options for disabling Kotlin line markers (KT-27332)
#KT-27332 Fixed
2019-04-29 12:13:14 +03:00
Nikolay Krasko
c72a375063 Better localization for dsl style icon change 2019-04-29 11:56:07 +03:00
Nikolay Krasko
ea8575c5a3 Remove check for Kotlin misconfiguration for the whole project (KT-30644)
Consider an existing project to be previously configured.

There's still "Configure Kotlin" action, check for configuration
triggered by adding a new Kotlin file, and notification in Kotlin files.

 #KT-30644 Fixed
2019-04-29 11:56:07 +03:00
Nikolay Krasko
01c0c3c924 Addition note about intention and quick-fixes execution in UI thread 2019-04-29 11:56:07 +03:00
Alexander Gorshenev
bd78e7e0aa Move property serialization to symbols
Make sure private field's wrapped descriptor is bound
2019-04-29 04:10:00 +03:00
Alexander Gorshenev
2c026114ae Made IrStatementOrigin serialization field optional for all statements 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
85f85fb3e8 IrStatementOrigin support in newly introduced IrDelegatedPropertyReference 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
19bd01cc8a Introduced proper IrStatementOrigin serialization. 2019-04-29 04:04:16 +03:00
Nicolay Mitropolsky
0794ab9432 Uast: cleaunp warnings (but some still remains) 2019-04-28 16:36:43 +03:00
Svyatoslav Kuzmich
13b332e99e Build scripts for JS IR versions of stdlib and kotlin.tests 2019-04-26 20:14:12 +03:00
Svyatoslav Kuzmich
5da83889d9 Stdlib tests: Supporess NoInfer access instead of redeclaration
Stdlib annotation 'kotlin.internal.NoInfer' was redeclared in stdlib tests
so non-fried modules (kotlin-stdlib-jdk7, kotlin-stdlib-jdk8, etc.)
could access it.

IR deserializer does not support declaration duplicates (at least yet
for JS IR backend). Thus this commit removes this redeclaration and
suppresses errors on its usages instead.
2019-04-26 20:14:03 +03:00
Sergey Igushkin
4848911e6d Fix testNativeTests, add missing system-out to expected test outputs 2019-04-26 18:51:25 +03:00
Sergey Igushkin
9d7c5213df Fix testNewKotlinJsPlugin on Windows (slashes) 2019-04-26 18:32:43 +03:00
Dmitry Petrov
865e0cc080 IR: IrConstructorCall: fixes after rebase 2019-04-26 17:43:26 +03:00
Igor Chevdar
7f423bd841 [IR] Fixes in inliner 2019-04-26 17:43:26 +03:00
Mikhael Bogdanov
be0b2e064b Fix JVM IR inliner 2019-04-26 17:43:26 +03:00
Roman Artemev
c545481db9 Fix JS_IR IrConstructorCall support 2019-04-26 17:43:26 +03:00
Roman Artemev
2a3ce8e9f1 Serialize IrConstructorCall 2019-04-26 17:43:26 +03:00
Dmitry Petrov
b78d1bb2b9 IrConstructorCall support in JVM_IR, JS_IR, and FIR2IR 2019-04-26 17:43:25 +03:00
Dmitry Petrov
82128800c5 IR: assertion in IrCallImpl init
NB it uses descriptor to determine if we try to call constructor using
IrCall.
2019-04-26 17:43:24 +03:00
Dmitry Petrov
11eea6e86a psi2ir: generate IrConstructorCall elements in IR builder helpers 2019-04-26 17:43:24 +03:00
Dmitry Petrov
e3fd74a580 IR: annotations are represented as IrConstructorCall elements
Also, they are rendered somewhat nicer
2019-04-26 17:43:24 +03:00
Dmitry Petrov
db7bcb6464 IR proto: IrConstructorCall in protobuf format 2019-04-26 17:43:24 +03:00
Dmitry Petrov
198ccbc114 JVM_IR: support IrConstructorCall in ExpressionCodegen 2019-04-26 17:43:24 +03:00
Dmitry Petrov
37b1c175ce IR: introduce IrConstructorCall / IrConstructorCallImpl 2019-04-26 17:43:24 +03:00
Roman Artemev
023306b1b3 [JS IR BE] Add tests for main function 2019-04-26 17:04:28 +03:00
Roman Artemev
5bd3bcd237 [JS IR BE] Support main function
* Implement IR-based main function detector
2019-04-26 17:04:28 +03:00
Roman Artemev
6729603ac7 [JS IR BE] Fix warnings 2019-04-26 17:04:28 +03:00
Mikhael Bogdanov
867e39f73c Parallelize idea-gradle tests 2019-04-26 14:42:20 +02:00
Leonid Startsev
90bf36ea7a Fix reference to IrField when serializing superclass' properties 2019-04-26 15:06:54 +03:00
Leonid Startsev
6bec6e6905 Add synthetic constructors to class member scope, so they won't fly 'in the air' in the backends
This is required mainly for Native compiler since it wont't work correctly on descriptors that are not present in the class.
2019-04-26 15:04:53 +03:00
Leonid Startsev
406896eaf0 Implement equals/hashcode for IrDeclarationOrigin so deserialized unknown origins would be compared correctly 2019-04-26 14:59:51 +03:00
LepilkinaElena
02331fbd7e Unify compiler and cinterop flags names (#2294) 2019-04-26 13:34:14 +03:00
nikita.movshin
7b017cb76f Add changelog for 1.3.30 and 1.3.31 2019-04-26 13:06:12 +03:00
Mikhael Bogdanov
c53682f397 Fix AS33 compilation
Commented unnecessary code that uses unavailable API
2019-04-26 11:29:42 +02:00
Mikhael Bogdanov
ceec35bf38 Up merge changes from UsefulTestCase into KtUsefulTestCase 2019-04-26 11:29:41 +02:00
Mikhael Bogdanov
1bc03e705a Minor. Remove old parallelize approach 2019-04-26 11:29:41 +02:00
Sergey Rostov
911a5bdd0e Specify missing type arguments to fix compilation 2019-04-26 12:00:43 +03:00
Mikhail Zarechenskiy
5b33e54f77 [NI] Provide diagnostics for candidates in "allCandidates" mode
This helps for completion as it use diagnostics to clip extra
 candidates
2019-04-26 11:40:17 +03:00
Mikhail Zarechenskiy
450bfed375 Specify missing type arguments to fix compilation in FE module 2019-04-26 11:32:19 +03:00
Mikhail Zarechenskiy
57ad0aa8fb Missing fix for project compilation against bootstrap compiler 2019-04-26 06:28:13 +03:00
Anton Yalyshev
657281a60d added tracking of chosen Kotlin framework in Java-based wizards 2019-04-25 19:06:20 +03:00
Anton Yalyshev
1d3f75adfd created FUS Group for New Project Wizards and Frameworks 2019-04-25 19:06:20 +03:00
Anton Yalyshev
01f34a0ba7 switched to new FUS adapter API 2019-04-25 19:06:19 +03:00
Anton Yalyshev
63ffff175b now we send FUS for ModuleBuilders and FrameworkSupportProviders 2019-04-25 19:06:19 +03:00
Svyatoslav Kuzmich
5baa520232 Advance bootstrap to 1.3.40-dev-2251
Required for JS IR CLI and Gradle plugin
2019-04-25 19:04:59 +03:00
Ilya Matveev
774dbcd6c0 Fix IDEA import after including kotlin-native-shared in Gradle plugin 2019-04-25 21:32:03 +07:00
Mikhail Zarechenskiy
f00c946ff7 Fix projection compilation against bootstrap compiler
This is needed after 5d95a1ac
2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
ac0a1d984f [NI] Don't return resulting call if return type has uninferred types 2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
db4ca059bd [NI] Fix IDE-refactorings when there are uninferred parameters 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
ff0993153c [NI] Improvements for "not enough information" diagnostic
#KT-30590 Fixed
2019-04-25 16:19:36 +03:00
Mikhail Zarechenskiy
09cc2ae27f [NI] Initial support of "not enough information" diagnostic
#KT-30590 In Progress
2019-04-25 16:19:36 +03:00
Dmitriy Novozhilov
c1b586f921 [NI] Complex test for "not enough" information diagnostic 2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
d40313a8d7 [NI] Allow capturing type projections with type variables
#KT-25302 Fixed
2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
abd1c3df26 [NI] Fix diagnostic reporting and unveil problem wrt captured types 2019-04-25 16:19:32 +03:00
Dmitry Gridin
6826d2f193 Replace provideByFqNameMulti with provideByFqName 2019-04-25 19:47:39 +07:00
Dmitry Gridin
3e74e875e8 Add a colon check in LanguageSettingsParser 2019-04-25 19:47:39 +07:00
Dmitry Gridin
b78ec32c02 Change CodegenFactory signature from Collection<KtFile?> to Collection<KtFile> 2019-04-25 19:47:39 +07:00
Dmitry Gridin
37c856290f Fix minor compile warnings 2019-04-25 19:47:39 +07:00
Dmitry Gridin
79793a4bda Replace deprecated classes with parent 2019-04-25 19:47:38 +07:00
Dmitry Gridin
2a85bece80 Replace CodeStyleSettingsManager.getSettings with CodeStyle.getSettings 2019-04-25 19:47:38 +07:00
Dmitry Gridin
bdb97ed46a Replace deprecated icons with actual 2019-04-25 19:47:38 +07:00
Dmitry Gridin
c41b98f5b9 Replace SystemInfo.isJavaVersionAtLeast("1.7") with SystemInfo.isJavaVersionAtLeast(1, 7, 0) 2019-04-25 19:47:38 +07:00
Dmitry Gridin
d7d9771b3c Replace UastEmptyExpression with UastEmptyExpression(null) 2019-04-25 19:47:38 +07:00
Alexander Udalov
648ed92ba3 Minor, deduplicate code in CodegenTestCase.doTest 2019-04-25 14:43:56 +02:00
Alexander Udalov
1c1ff3e2b2 Minor, move android-extensions-compiler tests to package org.jetbrains.kotlin
To fix the package name mismatch inspection
2019-04-25 14:43:47 +02:00
Alexander Udalov
74dd99a8da JS: use new DefaultBuiltIns instance instead of anonymous 2019-04-25 14:42:44 +02:00
Alexander Udalov
cb6fb78bc3 JS: do not use "-no-stdlib" in non-relevant tests
Rename some Ant tests: "simple[...]" -> "simpleWithoutStdlib[...]" and
"simpleWithStdlib[...]" -> "simple[...]"
2019-04-25 14:42:43 +02:00
Alexander Udalov
0659d0cba9 JS: do not use getBuiltInsModule to compute module name
The intention of this code was to use the name "kotlin" for the builtins
module, in case we're using builtins loaded from the compiler class
loader (whose module is created in
`KotlinBuiltIns.createBuiltInsModule`). However,
`getBuiltIns().getBuiltInsModule()` may refer not necessarily to the
builtins module, but also to any valid module where the builtins are
visible from, therefore its name would be computed incorrectly. Use the
module name instead to determine if it's a synthetic builtins module
created in `createBuiltInsModule`
2019-04-25 14:42:43 +02:00
Alexander Udalov
d5fd160fd3 JS: minor, do not use '==' on descriptors from built-ins
Use KotlinBuiltIns.isString instead of equality with
KotlinBuiltIns.string, which is more portable across different module
configurations. Also use isSubtypeOf instead of
DescriptorUtils.isSubclass and thus get rid of an extra error on an
unresolved class in nativeAnnotationCheckers.kt
2019-04-25 14:42:42 +02:00
pyos
31670622c0 Remove a redundant JVM-specific lowering 2019-04-25 14:30:41 +02:00
Jake Wharton
373424f430 Add ULong.compareTo and UInt.div/rem/compareTo intrinsics for Java 8 2019-04-25 13:21:25 +02:00
Georgy Bronnikov
e6362661d1 Merge pull request #2298 from pyos/linear-toarray-lowering
JVM_IR: make ToArrayLowering linear in complexity
2019-04-25 13:28:49 +03:00
Mikhail Glukhikh
69ea0a3597 Fir broken FIR2IR test 2019-04-25 12:37:13 +03:00
Ilya Matveev
24588263ed Store kotlin-native-shared version in the jar of the Gradle plugin 2019-04-25 16:19:11 +07:00
Ilya Matveev
c9ed648303 Use kotlin-native-shared in the Gradle plugin
The kotlin-native-shared artifact includes API allowing
us to work with K/N platforms, hosts, distribution etc.
This patch replaces a dependency on kotlin-native-utils
containing copies of such classes with a dependency on
published kotlin-native-shared in the Gradle plugin and
bundles kotlin-native-shared into the Gradle plugin jar.
2019-04-25 16:19:11 +07:00
pyos
4b0b9e1f80 JVM_IR: make ToArrayLowering linear in complexity
by not running DFS from every node visited during another DFS.
2019-04-25 11:07:34 +02:00
Nicolay Mitropolsky
f118b007f0 Uast: more cases for KotlinUSimpleReferenceExpression resolve (KT-30957, KT-27385) 2019-04-25 10:07:09 +03:00
Simon Ogorodnik
9352d52e7e FIR: load default value from meta-data 2019-04-25 09:47:38 +03:00
Simon Ogorodnik
879563233a FIR: optimize caching in JVM deserializer 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f453e7df27 Improve error reporting in fir benchmark function 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
a5ca8ffe69 Refactor FirSelfImportingScope 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f22cca5087 FIR top-level member scope: lookup constructors via classes 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
9cf91738ea Use local callables index in FirClassDeclaredMemberScope 2019-04-25 09:47:37 +03:00
Mikhael Bogdanov
11e0035254 Support test parallelization in uast tests 2019-04-25 08:09:27 +02:00
Mikhael Bogdanov
d1b5c76f09 Reuse KtUsefulTest case temporary files infrastructure 2019-04-25 08:09:26 +02:00
Svyatoslav Kuzmich
e30bdb8dc9 Fix hanling module names that require escaping 2019-04-25 03:54:17 +03:00
Ilya Chernikov
c3a439a829 Fix and refactor scripting subplugin application logic
so warning is not shown when discovery configuration is not populated
fix #KT-31124
refactor code for clarity on the way
also apply scripting subplugin after main plugin to ensure that
configurations are created before scripting is initialized
2019-04-24 17:27:47 +02:00
Ilya Chernikov
917fc56f36 Fix main-kts dependencies after extracting scripting 2019-04-24 17:27:03 +02:00
Ilya Chernikov
4b8d9c8fdd Fix classloaders order on script evaluation
the dependencies one should be a parent for the modules one, to avoid
incompatibility problems. Also fixes main-kts tests
2019-04-24 17:27:03 +02:00
Anton Yalyshev
6ffc3a8679 bunch files update after master switched to 191 2019-04-24 17:23:47 +03:00
Anton Yalyshev
2329954e02 added capability to send a custom event's context 2019-04-24 17:23:22 +03:00
Anton Yalyshev
0255d66144 shortened class and function names and make them closer to actual FUS naming 2019-04-24 17:23:21 +03:00
Dmitry Gridin
9bd32eb3cb Replace GradleBaseInspection with BaseInspection
#KT-31103 Fixed
2019-04-24 20:23:15 +07:00
Dmitry Gridin
0198df4935 PackageDirectoryMismatchInspection should report when a package statement is missing
#KT-13549 Fixed
2019-04-24 20:16:54 +07:00
Dmitry Gridin
2ae30de980 MoveVariableDeclarationIntoWhenInspection shouldn't report a multi-line variable
#KT-30457 Fixed
2019-04-24 20:12:44 +07:00
Sergey Igushkin
d456ae58b6 Remove usages of com.intellij.* utils from kotlin-build-common, KT-31106
As Gradle may under certain conditions reorder the buildscript
classpath artifacts, we need to ensure that the `kotlin-build-common`
module, which duplicates some of the classes that are shaded and packed
into `kotlin-compiler-embeddable`, does not call `com.intellij.*`
classes.

Replace the `com.intellij.*` utils that were called on the execution
path with our own implementations.

Issue #KT-31106 Fixed
2019-04-24 15:51:13 +03:00
Svyatoslav Kuzmich
09d7f4015b Move test.kt stubs to smallRuntime
We already use kotlin.test with fullRuntime klib.
2019-04-24 13:06:59 +03:00
Svyatoslav Kuzmich
b0bd5802bb Remove optionalExpectation hacks
Add common sources to Generate IR Runtime
2019-04-24 13:06:58 +03:00
Svyatoslav Kuzmich
1a6e6588fc Fix: Use Vars instead of plain assignments for declaration imports 2019-04-24 13:06:58 +03:00
Ilmir Usmanov
c2884f3ca8 Optimize variable liveness analysis
During coroutines transformation, we analyse liveness of local variables
in order to decide whether we need to spill them or not.
This analysis contains hot method `useVar`, in which we previously
iterated over all variables in LVT. This is done, since these variables
are seen by debugger and we assume they are alice.
However, this variables can be generated by inliner. In this case, the
LVT's size in huge. I.e. we have loop in hot method.

By hoisting the liveness analysis of the LVT and combining its result
with result of usual liveness analysis, we achieve speed-up from 2m30s
down to 5s.
 #KT-30603 Fixed
2019-04-24 13:04:40 +03:00
Steven Schäfer
f2392a6a28 Remove Concat and StringPlus intrinsics in favor of IrStringConcatenation. 2019-04-24 12:04:12 +02:00
Natalia Selezneva
26c9d69252 Check KotlinOutOfCodeBlockTracker in OutOfBlockModificationTest
General PsiModificationTracker.outOfCodeBlockModificationTracker was removed in IDEA 192
2019-04-24 11:45:03 +03:00
Natalia Selezneva
512a297e0a Process property setter parameter in UAST 2019-04-24 11:39:17 +03:00
Natalia Selezneva
d45644cea4 Fix path to TestNG library in tests for 191 2019-04-24 11:39:17 +03:00
Nicolay Mitropolsky
1db7754298 A workaround for the IDEA-211491 in IDEA 191 to make Kotlin tests pass
for instance `InspectionTestGenerated$Inspections.testOverridingDeprecatedMember_inspectionData_Inspections_test`
2019-04-24 11:21:30 +03:00
Dmitriy Dolovov
d90b63d928 Improve logging in NativeCompilerDownloader
Issue #KT-31158 fixed
2019-04-24 14:17:16 +07:00
Dmitriy Dolovov
63f58b4a4a Add applicability condition to KotlinNativeGradleConfigurator 2019-04-24 14:17:11 +07:00
Dmitriy Dolovov
e188c313e6 Fix: Add Native KLIBs as project-level libraries
Issue #KT-30966 Fixed
2019-04-24 14:17:03 +07:00
Sergey Rostov
cfa635b36a JPS Build: update artifacts for scripting-compiler-impl and js ir backend 2019-04-24 09:45:23 +03:00
Sergey Rostov
aac564872c Scripting, main-kts: temporary workaround to avoid IDE exceptions on Kotlin project
Exclude script definition from resources classpath to avoid IDE exceptions
on kotlin project. This is done by moving MainKtsScript to new `jar-resources`
 folder which is not resource root.

#EA-127827
#KT-31176
2019-04-24 09:14:34 +03:00
Svyatoslav Kuzmich
bb3b9a935f Command line interface 2019-04-23 23:19:12 +03:00
Roman Artemev
89500d776d [IR BE] Don't use symbol table in SuspendFunctionLowering 2019-04-23 22:30:00 +03:00
Alexey Tsvetkov
bec5879e3a Fix ABI plugin
It seems that I forgot to update compiler.pro.191,
so when we switched to IJ 191, ABI plugin has broken
2019-04-23 21:56:05 +03:00
nikita.movshin
deb416484c Update copyright. Fix 2 lines comments after rebase
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:15:03 +03:00
nikita.movshin
a6230c1e2a Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 1 line comment with dates from 2000 till 2017
2019-04-23 20:09:27 +03:00
nikita.movshin
86672df107 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update TestGenerator.kt
2019-04-23 20:09:27 +03:00
nikita.movshin
abb7d3ab46 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 2 lines comment
2019-04-23 20:09:27 +03:00
nikita.movshin
a636e3d57d Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:09:23 +03:00
nikita.movshin
2e59fdc157 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update apache.xml
2019-04-23 20:09:23 +03:00
nikita.movshin
65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Vyacheslav Gerasimov
9f3495138f Build: Use embedded configuration in kapt embeddable project
#KT-31047
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
82f9757138 Build: Fix dependency leak on :kotlin-compiler in kotlin-native-library-reader
Introduce mavenCompileScope to manage compile records in pom.xml
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
57cb59bfc7 Remove 181 related warnings from inspection profile 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
210ee681a4 Cleanup bunch workarounds made for 181 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
2bc11cbd58 Remove as32 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
952d2b6287 Remove 181 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
e261e46e52 Remove 181 & as32 from .bunch 2019-04-23 17:28:40 +03:00
pyos
5b595b58b2 JVM_IR: fold constant string concatenations 2019-04-23 16:20:43 +02:00
Alexey Tsvetkov
1bc4a2eff9 Replace AbstractIncrementalJpsTest->AbstractIncrementalJvmJpsTest
It was accidentally replaced back when switching to IJ 191
2019-04-23 16:14:39 +03:00
Ilmir Usmanov
f94092e952 Add single 192 file for bunch not to fail 2019-04-23 15:57:51 +03:00
Jorge Antonio Díaz-Benito Soriano
3064601e5e Fix a typo
#KT-31138 Fixed
2019-04-23 13:38:19 +02:00
Steven Schäfer
8c06f7daae Fix IR declaration parents.
- Reparent declarations in FileClassLowering, InterfaceLowering,
  StaticDefaultFunctionsLowering, EnumClassLowering, and
  RenameFieldsLowering
- Set correspondingPropertySymbol in MoveCompanionObjectFieldsLowering
- Reparent field initializers in MoveCompanionObjectFieldsLowering and
  EnumClassLowering
- Ensure that parents are unique in PropertiesLowering
- Set declaration parent in SharedVariableManager
- Set field declaration parents in CallableReferenceLowering
- Set declaration parents in FunctionNVarargInvokeLowering
- Set declaration parents for external declaration fields
2019-04-23 12:51:27 +02:00
Yan Zhulanow
f39908b411 Minor: Fix configuration test, lower requirement on Kotlin plugin 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b35ed2602c Pill: Fix test dependencies handling 2019-04-23 12:38:28 +03:00
Yan Zhulanow
038c320594 Pill: Filter duplicating entries for SelfResolvingDependencies 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b8aaf017ea Pill: Update module names in tasks
Pill now uses module names based on Gradle project paths.
Run configurations should be aware of the new names.
2019-04-23 12:38:28 +03:00
Mikhail Glukhikh
4a5b900d28 FIR: get rid of library type parameter symbol 2019-04-23 11:51:36 +03:00
Simon Ogorodnik
649c2f6bcc FIR deserializer: load type-parameters correctly 2019-04-23 11:51:05 +03:00
Simon Ogorodnik
853167a24d FIR deserializer: handle class type parameters properly 2019-04-23 11:41:07 +03:00
Mikhail Glukhikh
2476c0299f FIR Java: fix constructor enhancements
Before this commit,
we generated regular member functions as constructor enhancement.
Now, we generate constructors as constructor enhancement.
2019-04-23 11:41:05 +03:00
Simon Ogorodnik
2e966a7ded FIR deserializer: load type-parameters for kotlin function properly 2019-04-23 11:41:03 +03:00
Simon Ogorodnik
9bbf5bebd2 Raw FIR: support typing for delegated constructor call 2019-04-23 11:41:01 +03:00
Simon Ogorodnik
73b1676a03 Raw FIR: fix unary operators (now convention calls use receivers) 2019-04-23 11:40:32 +03:00
Mikhail Glukhikh
77e83dd8cf Raw FIR: introduce string concatenation call
This removes some 'plus' calls to be resolved
2019-04-23 11:35:41 +03:00
Simon Ogorodnik
8d2acd790d FIR Java: use safer cases in use-site scope to allow constructors 2019-04-23 11:21:46 +03:00
Mikhail Glukhikh
618295f505 FIR: implement trivial typing for break & continue 2019-04-23 11:18:24 +03:00
Mikhail Glukhikh
b9f09afc6f Raw FIR: introduce lambda argument expressions
Without it we cannot distinguish lambda argument from just last argument
2019-04-23 11:15:26 +03:00
Mikhail Glukhikh
cf72b13d84 Add accessor symbols & test for property overriding in Java 2019-04-23 11:15:24 +03:00
Simon Ogorodnik
9abf4062b1 FIR tree: implement trivial expressions typing 2019-04-23 11:14:55 +03:00
Simon Ogorodnik
c3632487d0 FIR Java: improve symbol provider laziness 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
98f4fa1f6c FIR Java: fix too strict cast in use-site scope 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
539fcf82ef Fix deprecation in FIR super type resolver 2019-04-23 09:49:29 +03:00
Mikhail Glukhikh
47f61b2917 Revert "Include FIR modules into compiler #KT-30243 Fixed"
This reverts commit 053aa8ca. It causes
"IllegalArgumentException: org.gradle.*.DefaultClassLoaderScope@13fca663
must be locked before it can be used to compute a classpath!"
in Gradle integration tests
2019-04-23 09:47:18 +03:00
Ilya Kirillov
d2a3d00548 New J2K: fix existing test data 2019-04-22 22:54:48 +03:00
Ilya Kirillov
101ae75b8c New J2K: fix lost JavaMapForEachInspection in post-processing 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c4d07bd7e7 New J2K: reduce boilerplate code in post-processings for registerDiagnosticBasedProcessing's 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c0ec36b3e9 New J2K: fix wrong JKTypeCastExpression children initialisation 2019-04-22 22:54:48 +03:00
Ilya Kirillov
bb81ad7b5f New J2K: do not convert Java string type to a Kotlin one because of wrong constructor calls 2019-04-22 22:54:48 +03:00
Ilya Kirillov
7e7e8f7631 New J2K: add support of lambda expressions in nullabilityAnalysis 2019-04-22 22:54:48 +03:00
Ilya Kirillov
1ffe07bb6c New J2K: fix wrong psi modification in ConvertDataClass 2019-04-22 22:54:47 +03:00
Ilya Kirillov
f11311a20b New J2K: add support of method reference conversion 2019-04-22 22:54:47 +03:00
Ilya Kirillov
8f4f80256a New J2K: do not add extra !! in ImplicitCastsConversion because it would be added later in post-processing 2019-04-22 22:54:47 +03:00
Ilya Kirillov
67770eb86b Fix "New J2K: external annotations support for nullability analysis" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
c39a54d40c Fix "New J2K: pass converter context to postprocessing" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
9e1a858bed New J2K: fix exception in ConvertGettersAndSetters if function is called set 2019-04-22 22:54:47 +03:00
Ilya Kirillov
2ce7dc9d19 New J2K: external annotations support for nullability analysis 2019-04-22 22:54:47 +03:00
Ilya Kirillov
0a88276f68 Make mustNotBeNull function from JavaNullabilityChecker available for J2K 2019-04-22 22:54:47 +03:00
Ilya Kirillov
98651f3484 New J2K: add element info storage, pass info about types & functions via it 2019-04-22 22:54:47 +03:00
Ilya Kirillov
39b09b39ff New J2K: pass converter context to postprocessing 2019-04-22 22:54:46 +03:00
Ilya Kirillov
c4a238cca4 KT-26550: do not show "Convert Java File to Kotlin File" action for external libraries
#KT-26550 fixed
2019-04-22 22:54:46 +03:00
Vyacheslav Gerasimov
8723ad4f46 Switch to 191 platform 2019-04-22 21:52:19 +03:00
Sergey Rostov
21232d202e JPS Build, 191: update artifacts 2019-04-22 21:52:02 +03:00
Vyacheslav Gerasimov
1551f39daa Update asm version to 7.0.1 everywhere 2019-04-22 21:52:01 +03:00
Vyacheslav Gerasimov
aff9da72a8 Update 191 platform to 191.6707.61 2019-04-22 21:52:00 +03:00
Vyacheslav Gerasimov
67a194fa8c Remove broken 192 bunch files 2019-04-22 21:46:57 +03:00
Vyacheslav Gerasimov
6059725c76 Add 192 to .bunch 2019-04-22 21:00:10 +03:00
Svyatoslav Kuzmich
b1d303b027 Reorganize stdlib-js sources specific to the current JS backend
Move kotlin-stdlib-js project and the sources specific to the current backend to 'stdlib/js-v1' directory,
but leave sources that can be shared with the new IR backend in the common 'stdlib/js' location
with exception for 'stdlib/js/src/generated', which is used exclusively for current backend.
This simplifies sourceset configuration when building stdlib with the new backend.
2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
9dd9efd4aa [JS IR BE] Fix isQUnit for JS IR BE 2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
d7be91e8a4 [JS IR BE] Add SIZE_BYTES and SIZE_BITS to Long and Char 2019-04-22 20:30:57 +03:00
Alexander Gorshenev
3ae64061c1 Minimal tweaks in IR Validation code just to be able to turn it on in Native. 2019-04-22 19:42:33 +03:00
Mikhail Glukhikh
053aa8ca1e Include FIR modules into compiler #KT-30243 Fixed 2019-04-22 15:48:46 +03:00
Alexey Tsvetkov
77d74a261d Rename SourceFileToPathConverter->FileToPathConverter 2019-04-22 15:27:58 +03:00
Alexey Tsvetkov
f66d95545d Test JPS Kotlin caches don't change when project root is different 2019-04-22 15:27:57 +03:00
Alexey Tsvetkov
a7df7e2f9f Sort files when performing GC in lookup storage 2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
ea4fc0fb6b Disable scripting plugin in JPS tests
JVM compiler loads scripting plugin by default,
which in turn performs script template discovery
in compile classpath.

Classloading and template discovery takes noticeable
amount of time in JPS tests, because of
relatively big number of short compilations.

Disabling scripting plugin in most JPS+JVM tests
speeds up JPS tests by ~8% compared to the result before all
optimizations.
2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
175dd5679c Keep application environment alive between JPS tests
This speeds up JPS tests by ~16% compared to the result before all
optimizations. The speedup comes mostly from avoiding re-reading jar
files (like kotlin-stdlib.jar).
2019-04-22 15:27:55 +03:00
Alexey Tsvetkov
80c99eceff Rebuild once after each JPS test
After each test we rebuild everything,
then we compare incremental caches and output
with caches and output after rebuild.

For some reason we did rebuild and comparison
twice per test. This seems excessive.

Removing the second rebuild speeds up JPS tests by ~15%
compared to the result before all optimizations
2019-04-22 15:27:54 +03:00
Alexey Tsvetkov
61fbe43a3f Store relative paths in JPS caches if possible
So caches can be relocated from one machine to another
2019-04-22 15:27:53 +03:00
Alexey Tsvetkov
00de7b6c44 Allow customizing source file path conversion in lookup storage 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
79337a6b96 Allow customizing source file path conversion in local IC caches 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
146eebdc7e Print lookup storage as is in tests
This way it is easier to debug when
cache's content is different after rebuild
2019-04-22 15:26:34 +03:00
Nikolay Krasko
de548d6b8b Minor: do not assert psi state in RemoveUselessIsCheckFixForWhen 2019-04-22 15:11:10 +03:00
Nikolay Krasko
b83d07ae9a Assert new quick fixes don't use resolve 2019-04-22 15:11:10 +03:00
Nikolay Krasko
682183a150 Allow resolve in write action for injection for now 2019-04-22 15:11:09 +03:00
Svyatoslav Kuzmich
889b4d721d [JS IR BE] Use constructor parameter to determine underlying type for inline classes
Inline classes from lazy IR may not have files.
2019-04-22 13:18:01 +03:00
Svyatoslav Kuzmich
3fd55673a8 [JS IR BE] Workaround for println
IR backend has a bug in decomposition of dynamic calls.
Workaround: don't use inline function call inside dynamic call argument.
2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
03ba0eae5a [JS IR BE] Minor: better internal error message in Namer 2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
7c2ee41491 [JS IR BE] Fix boolean companion object 2019-04-22 13:18:00 +03:00
Toshiaki Kameyama
864f99782e Use property access syntax: fix problem text and highlight range
#KT-30910 Fixed
2019-04-22 16:19:37 +07:00
Toshiaki Kameyama
bf5b559923 Add function supertype: make abstract function in sealed class
#KT-30769 Fixed
2019-04-22 16:11:59 +07:00
Toshiaki Kameyama
f2c7b6b8c4 Convert to anonymous object: don't remove type arguments
#KT-30208 Fixed
2019-04-22 16:09:53 +07:00
Toshiaki Kameyama
075620daad Invert if condition intention: don't remove line breaks
#KT-30900 Fixed
2019-04-22 15:59:49 +07:00
Nikolay Krasko
a66aebdc2c Consider range marker with bad interval to be invalid (EA-141900, EA-135531) 2019-04-22 11:34:34 +03:00
Dmitry Gridin
3838976083 Fix false positive 'Remove redundant qualifier name' for property
#KT-31112 Fixed
2019-04-22 11:58:43 +07:00
Mikhail Zarechenskiy
673b54554c [NI] Also complete arguments for ambiguity calls
This is needed for IDE-tests and cases when integer literals are used
 in such ambiguity calls
2019-04-22 00:23:15 +03:00
Nikolay Krasko
088da3e807 Postpone no kotlin files in selection to CheckComponentsUsageSearch execution (KT-31092)
#KT-31092 Fixed
2019-04-19 17:12:12 +03:00
Nikolay Krasko
be471b29c4 Use bunch-specific version of gson in kotlin-gradle-plugin
While kotlin-gradle-plugin is not built for different bunches, bad
version still fails Gradle synchronize action in IDE.
2019-04-19 17:12:12 +03:00
Nikolay Krasko
04eeabcd98 Detect platform only for stdlib and use only roots for detection (KT-30442)
#KT-30442 Fixed
2019-04-19 17:12:12 +03:00
Dmitriy Novozhilov
bfb13803d5 [NI] Fix reporting of overload resolution ambiguity 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
f9cc3d9be3 [NI] Fix determining type equality in replacing of extension receiver 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
0739d13038 [NI] Record scope in trace for calls with enabled NI 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
c86b8da982 [NI] Don't report overload ambiguity for error candidates 2019-04-19 14:46:22 +03:00
Kirill Rakhman
00c76593f2 fix typo in test data 2019-04-19 18:31:17 +07:00
Ilya Matveev
c0eba201a5 CocoaPods: Show error if a build is started not from Xcode
Issue #KT-31062 Fixed
2019-04-19 17:55:57 +07:00
Ilya Matveev
a1e20f8d2a Add tests for CocoaPods integration 2019-04-19 17:55:57 +07:00
Alexander Udalov
822b210e85 Minor, update argfile usage description 2019-04-19 12:55:23 +03:00
victor.petukhov
a567aa620b Fix headers in box and parsing spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
f6d67251fb Print info about all failed test cases in spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
86bb5d689d Add various tests for DFA testing 2019-04-19 11:55:30 +03:00
Sergey Rostov
15e3482eec JPS Build: add type-system to kotlin-reflect.jar 2019-04-19 11:51:34 +03:00
Dmitriy Novozhilov
f7b4b553b7 Minor: remove redundant import 2019-04-19 11:08:43 +03:00
Dmitriy Novozhilov
ad50bcaf09 Add extracting original value parameters and original source in IDEA Slicer
#KT-31113 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
94c4a68344 [NI] Fix determination of ArgumentMatchStatus
#KT-31081 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
e70bdb51c5 [NI] Automatically squash equal diagnostics in OI and NI in testdata 2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
642f8ecaf8 [NI] remove redundant replacing receiver in lambda function descriptor
#KT-30927 Fixed
#KT-31057 Fixed
2019-04-19 10:53:19 +03:00
Mikhail Zarechenskiy
2fe900d915 [NI] Resolve lambda against input types from expected type
This is needed to report more precise diagnostics and fix IDE-tests

 #KT-31059 Fixed
2019-04-19 09:08:31 +03:00
Mikhail Zarechenskiy
8f8e33f251 [NI] Strip only Exact-annotation preserving others during inference 2019-04-19 09:08:31 +03:00
Abduqodiri Qurbonzoda
3f08753f87 Move string-related files to text directory 2019-04-19 03:51:20 +03:00
Mikhael Bogdanov
dd005d3c02 Introduce IrLazyField 2019-04-18 19:56:19 +02:00
Sergey Igushkin
13120d23ce Fix Gradle task validation failure due to missing property annotation 2019-04-18 20:41:43 +03:00
Vyacheslav Gerasimov
f9d2601d92 Build: Remove kotlin-scripting-compiler-impl from kotlin-plugin.jar
It already copied to plugin lib as separate library
2019-04-18 20:05:09 +03:00
Ilmir Usmanov
eb5ea62da4 Use anonymous objects instead of lambdas as callbacks in java interop tests 2019-04-18 18:38:16 +03:00
Georgy Bronnikov
328b8f9725 Redirect EnumConstructorCall to IrFunctionAccess in IrElementTransformerVoid 2019-04-18 14:50:55 +03:00
Mikhael Bogdanov
dde28ddc52 Parallelize compiler tests 2019-04-18 13:24:58 +02:00
Mikhael Bogdanov
73836928ef Minor. Update folder suffix
Debug purpose
2019-04-18 13:24:57 +02:00
Ilya Chernikov
9900ac2462 Fix runtime compatibility with the obsolete script jvm eval config options...
also switch mainKtsTest to the mew option
2019-04-18 13:01:50 +02:00
Andrey Uskov
00c3550191 Add method 'addModuleDependencyIfNeeded' in order to keep
compatibility with AndroidStudio
#KT-31090 Fixed
2019-04-18 13:32:48 +03:00
Dmitry Gridin
9d3ebf4562 Minor: refactoring ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:33:48 +07:00
Dmitry Gridin
3bed360c98 Fix "Should be replaced with Kotlin function" warnings 2019-04-18 15:28:52 +07:00
Dmitry Gridin
d738a12b86 Fix false positive ReplaceJavaStaticMethodWithKotlinAnalog for java.io.PrintStream 2019-04-18 15:28:52 +07:00
Dmitry Gridin
fd47dc9b88 Replace popup with several quick-fixes in ReplaceJavaStaticMethodWithKotlinAnalog 2019-04-18 15:28:52 +07:00
Dmitry Gridin
ee304e92b5 Add Java Arrays.asList, Set.of, List.of to ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-27782 #KT-21641
2019-04-18 15:28:52 +07:00
Dmitry Gridin
b5b5723ec3 Rename ReplaceJavaStaticMethodWithTopLevelFunctionInspection to ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:28:52 +07:00
Dmitry Gridin
23003c5d1a Add Java compare to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
7f3c4a21d5 Add Java toString to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
6afc0367c0 Merge ReplaceJavaIntegerToStringWithMemberInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-12721
2019-04-18 15:28:51 +07:00
Dmitry Gridin
6b7f4dda31 Merge ReplaceArraysCopyOfWithCopyOfInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-23023
2019-04-18 15:28:51 +07:00
Dmitry Gridin
50b89dd587 Add more cases for ReplaceJavaStaticMethodWithTopLevelFunction from java.lang.Math 2019-04-18 15:28:51 +07:00
Sergey Rostov
69120c0614 JPS build: note about updating artifacts configuration when updating bootstrap version 2019-04-18 10:36:22 +03:00
Sergey Rostov
30d1cc51bf JPS Build: update artifacts 2019-04-18 10:36:22 +03:00
pyos
b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
Mikhael Bogdanov
14485c0e33 Switch default for parallel execution 2019-04-18 08:33:02 +02:00
Ilmir Usmanov
dc821a720b Fix test data 2019-04-18 01:13:01 +03:00
Ilmir Usmanov
a793055ec2 Check variables, captured by outer object when searching for suspend crossinline parameters 2019-04-18 01:12:58 +03:00
Ilmir Usmanov
7c14f4c6ae Do not duplicate $$forInline counterpart of inline capturing function 2019-04-18 01:12:56 +03:00
Ilmir Usmanov
20b9d8b2f3 Generate state-machine even if the object is going to be transformed
This fixes Java interop of inline functions, which use coroutines.
However, we cannot transform the state-machine. Thus, we generate
a $$forInline counterpart for suspend functions (similar to inline
suspend functions) and invokeSuspend$$forInline for lambdas if these
coroutines are going to transformed (i.e. are declared inside inline
functions).
During transformation we just skip method with state-machine and
transform the $$forInline counterpart. Of course, if inline site is
inline itself, we generate both state-machine version (which will be
dropped during the next transformation) and $$forInline version.
Consequently, the final version of the coroutines will not have
$$forInline counterpart.
Unfortunately, since CompileKotlinAgainstInlineKotlin tests do not allow
java sources, the tests for the interop are usual box tests.

 #KT-30707 Fixed
2019-04-18 01:12:52 +03:00
Mikhail Zarechenskiy
fe8bf98bce Fix project compilation against bootstrap compiler
Follow-up of 705a8a22, there were several usages of SAM conversions
 for Kotlin functions
2019-04-17 23:11:05 +03:00
Ilya Chernikov
ada3edb222 Fix after rebase - adapting to the new idea plugin handling scheme 2019-04-17 22:03:59 +02:00
Ilya Chernikov
4b4186ecb2 Switch to coroutines 1.1.1 2019-04-17 22:03:59 +02:00
Ilya Chernikov
7c4efb2772 Disable ScriptingGradleSubplugin if applied in the gradle prior to 5.0
Allows to avoid limiting scripting infrastructure to languageVersion 1.2,
since kotlin compiler 1.3+ is bundled with gradle only starting from 5.0
2019-04-17 22:03:59 +02:00
Ilya Chernikov
72736d78e4 Drop blocking transitive dependencies following for gradle subplugins
fixes scripting subplugin usage, since it requires some dependencies now
2019-04-17 22:03:59 +02:00
Ilya Chernikov
f688bc5140 Add diagnostics for plugin classpath problems 2019-04-17 22:03:59 +02:00
Ilya Chernikov
8a8de052a3 Fix JSR-223 and scripting samples dependencies 2019-04-17 22:03:59 +02:00
Ilya Chernikov
60b3fa3b07 Fix embeddable host test 2019-04-17 22:03:58 +02:00
Ilya Chernikov
090dadce3e Fix testdata - script extension hint is not generated anymore...
due to changes in the scripting initialization logic
2019-04-17 22:03:58 +02:00
Ilya Chernikov
64c3bcd9ab Drop refactored-out frontend.script module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
a65dafc37d Move scripting support classes to the scripting compiler impl module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
8df829a7cd Move scripting-compiler-impl definition to another package...
to continue merging with the refactoring with further scripting improvements
2019-04-17 22:03:58 +02:00
Ilya Chernikov
f71cc4e480 Drop long deprecated legacy script annotations and resolvers support 2019-04-17 22:03:58 +02:00
Ilya Chernikov
4f135a5fe5 Move REPL implementations to the scripting compiler impl module 2019-04-17 22:03:57 +02:00
Ilya Chernikov
199b32cad7 Merge scripting-impl to scripting-compiler-impl module...
to continue merging with the branch with further scripting refactorings
2019-04-17 22:03:57 +02:00
Ilya Chernikov
a82b386d81 Add a new module for scripting compilation infrastructure...
add embeddable variant as well
2019-04-17 22:03:57 +02:00
Ilya Chernikov
4625468de7 Expose project environment from core env, to allow usages of plugins...
before core env construction. Refactor script evaluation extension to
this scheme.
Plus some refactorings of the logic of script/repl evaluation in K2JVMCompiler
2019-04-17 22:03:57 +02:00
Igor Yakovlev
1178e94f50 Fixed intentions that used not valid PSI
Fixed ConvertToMemberIntention and ObjectLiteralToLambdaIntention that are used PSI after lazy block reparse.
2019-04-17 20:26:23 +03:00
Igor Yakovlev
1f29b42cd3 KtBlockExpression as lazy reparseable node (KT-13841)
Changed KtBlockExpression to support LazyReparseable behaviour
Added LazyKtBlockExpressionTest
Added new BlockWrapper delegations
2019-04-17 20:26:15 +03:00
Kirill Shmakov
e774f3fe77 Update iOS template for XCode 10.2
Info.plist generated by default does not provide required bundle id key.
Added separated Info.plist and its usage is explicitly specified.

See KOTLIN-CR-2913.
2019-04-17 18:54:45 +03:00
Mikhael Bogdanov
b70ff30dc3 Don't generate bridge flag for defaults in JVM IR backend 2019-04-17 14:53:30 +02:00
pyos
115b1c6b6e JVM_IR: force materialization of non-transparent block results 2019-04-17 14:14:21 +02:00
pyos
b1bba70e40 JVM_IR: elide static field initialization to default values 2019-04-17 14:14:21 +02:00
Mikhail Zarechenskiy
bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
Mikhael Bogdanov
5dea14f4ce Reuse already created temp folder from UsefulTestCase 2019-04-17 11:22:19 +02:00
Mikhael Bogdanov
0d3f03a15a Support parallelization in another IDE tests 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
18f76c31ca Get rid of redundant UsefulTestCase 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
854b73b03c Specify test runners for IDE tests 2019-04-17 11:22:17 +02:00
Mikhael Bogdanov
aaf0fbdbd6 Fix debugger tests 2019-04-17 11:22:16 +02:00
Mikhael Bogdanov
51bc979edb Move parallelization utils to separate file, set test root for each process 2019-04-17 11:22:16 +02:00
Anton Bannykh
c6d177b467 JS: don't remove imports only used for fake overrides (KT-31007 fixed) 2019-04-17 11:41:47 +03:00
Anton Yalyshev
6113e66e7a removed forgotten and unnecessary code 2019-04-17 10:56:08 +03:00
Anton Yalyshev
f79517ee5d use new js gradle plugin and correct name of mpp plugin 2019-04-17 10:56:06 +03:00
Mikhael Bogdanov
3f1f335c47 Minor. Fix compilation 2019-04-17 09:50:49 +02:00
Mikhael Bogdanov
01dc66b53a Temporary workaround: use teamcity.build.tempDir instead of java.io.tmpdir
teamcity.build.tempDir is cleaned up between build executions,
 should be fixed soon on Teamcity side
2019-04-17 09:33:58 +02:00
Mikhail Zarechenskiy
e6e0b83184 [NI] Fix IDE-tests where integer types were used in unresolved calls
For example, test like CallExpression#testCallWithJavaClassReceiver

 #KT-31060 Fixed
2019-04-17 01:40:56 +03:00
Mikhail Zarechenskiy
705a8a2234 [NI] Disable SAM-conversions for Kotlin functions by default
#KT-30661 Fixed
2019-04-17 01:40:54 +03:00
Andrey Uskov
c6f29cbf38 Disable GradleInspectionTests in AndroidStudio 2019-04-17 00:17:41 +03:00
Andrey Uskov
364274ef90 Fix setting production-on-test flags in MPP projects
#KT-29854 Fixed
2019-04-17 00:17:21 +03:00
Leonid Startsev
1a0b7902c2 Create separate type arguments for writeSelf function, since it is static now.
Fixes kapt issue https://github.com/Kotlin/kotlinx.serialization/issues/429
2019-04-16 19:37:31 +03:00
Sergey Igushkin
bd1f95da04 Disable automatic JVM target 1.8 detection in Android projects, KT-31027
This is a soft revert of the fix for KT-21030 (commit ffbd0e8a).
The logic introduced for KT-21030 should now only run when a property
flag is provided, kotlin.setJvmTargetFromAndroidCompileOptions.

We can't set the JVM target to 1.8 automatically until an Android Gradle
plugin version appears that can correctly desugar the bytecode produced
by the Kotlin compiler.

So we disable the logic introduced in the fix for KT-26432
with the plan to enable it back and apply it conditionally once there is
an Android Gradle plugin version that processes the calls correctly.

Issue #KT-31027 Fixed
2019-04-16 19:02:44 +03:00
Mikhael Bogdanov
bec80dd27f Use Teamcity tmpdir to cleanUp it between executions 2019-04-16 15:37:07 +02:00
gcx11
164933a31e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
gcx11
b49c5bf74e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
Ilya Chernikov
d98b1dfa7e Fix testdata after adding main function to scripts 2019-04-16 11:55:24 +02:00
Ilya Chernikov
67ad3773de Implement main method generation in scripts and runnable jar saving
refactor necessary parts on the way
2019-04-16 11:55:23 +02:00
Ilya Chernikov
c896b4873b Rearrange scripting host classes, so the runner part is independent from the compiler 2019-04-16 11:55:23 +02:00
Ilya Chernikov
a6f0bd6677 Refactor jvm evaluation to make module operations cleaner and more robust
in addition:
- hide internal configuration keys
- add keys for flags controlling evaluation
- add initial module implementation for using scripts from a classpath
2019-04-16 11:55:22 +02:00
Ilya Chernikov
90444502a6 Extend evaluation API for easier passing of evaluation configuration
refactor helpers accordingly
2019-04-16 11:55:22 +02:00
Ilya Chernikov
fa58b41e43 Implement script evaluation configuration refinement 2019-04-16 11:55:21 +02:00
Ilya Chernikov
c51d4a4405 Implement simple "saving evaluators" to classes and to a jar 2019-04-16 11:55:20 +02:00
Mads Ager
a65f50bb00 JVM_IR: Generate java 8 parameter names when -java-parameters is passed.
The type mapper does not map enum parameters and outer this parameters
to the right parameter signature kinds so around half the tests
are still failing. Since a new type mapper is being worked
on I will not investigate that further right now.
2019-04-16 09:32:57 +02:00
Mikhail Zarechenskiy
e27f71c6f3 [NI] Add test for obsolete issue
#KT-30858 Obsolete
2019-04-16 10:32:12 +03:00
Mark Punzalan
9f4db04839 Change visibility of ForLoopsLowering from internal to public. 2019-04-16 09:31:40 +02:00
Vyacheslav Gerasimov
152d5a98e8 Build: Remove duplicate sam-with-receiver-compiler-plugin in libraries 2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
f052f31c83 Build: Put gradle tooling model in kotlin plugin as separate jars
Those jars are loaded by gradle during import process
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
d6e2b5066b Build: Use sync task for copying idea plugin to the output
It will prevent files from previous builds remain in the target directory
Now we can remove `cleanArtifacts` kostyl from teamcity build
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
478208b070 Build: remove ideaPlugin helper
Plugin distribution building logic is now handled solely by idea-plugin project
2019-04-15 22:04:17 +03:00
Yan Zhulanow
7710942ec5 Kapt: Call next resolver in populateModuleExtraModels() (KT-30995) 2019-04-15 20:11:29 +03:00
Nikolay Krasko
27fd64ed42 Enable registration of CIDR bundle to prevent test failure in AS 3.5 (KT-26337) 2019-04-15 14:46:40 +03:00
Nikolay Krasko
1da51c118e Minor: fix too long strings 2019-04-15 14:46:40 +03:00
Nikolay Krasko
4691f6fed5 Don't read attributes in invalid files (EA-141259) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
a3bd46858a Additional diagnostic added for bad class assert 2019-04-15 14:46:39 +03:00
Nikolay Krasko
28aa404356 Don't create intention for some bad psi (EA-141235) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
bc258fa856 Fix RemoveUselessIsCheckFixForWhen - don't assert psi state in quick fixes (EA-141206) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
55b2a7d051 Fix NPE in surround (EA-141193) 2019-04-15 14:46:39 +03:00
Ryan
916f871fd1 Wrong File name 'KotlinNativeTaretConfigurator.kt' 2019-04-15 17:40:15 +07:00
Nikolay Kasyanov
7d2041ed82 Fix fat dSYM Info.plist copying
Issue #KT-31008 Fixed
2019-04-15 17:34:32 +07:00
Yan Zhulanow
5825da8433 Fix binary compatibility with Android plugin (KT-30978) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
0dfe122a40 Pill: Mark more projects as 'jps-compatible' in FULL variant 2019-04-15 05:17:03 +03:00
Yan Zhulanow
ae747196c2 Pill: Add kotlinVersion to the default JUnit configuration (for Gradle integration tests) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
d5fa4f983e Pill: Resolve dependencies using ResolvedArtifact data 2019-04-15 05:17:03 +03:00
Svyatoslav Kuzmich
977d3ef840 [JS IR BE] New name generator 2019-04-13 14:19:36 +03:00
Svyatoslav Kuzmich
a16ca5e66c [JS IR BE] Static members lowering pass 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
38fc4b0c59 [JS IR BE] Hack irRuntime js function usage to compensate for implementation shortcomings 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
5c5d65bdb9 [JS IR BE] Lower dataClass hashCode and toString 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
e52ae38cf5 [JS IR BE] Minor: Use proper trow in js compiler test runtime 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
ce1ae417c2 [JS IR BE] Minor: don't use descriptors 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
7a6e245dba [JS] Minor: Use file path to V8 runner to show better error messages 2019-04-13 14:17:58 +03:00
Mikhail Zarechenskiy
1bc078769b Regenerate tests 2019-04-12 18:17:48 +03:00
Dmitriy Novozhilov
18f9272f56 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-12 17:36:59 +03:00
Dmitriy Novozhilov
ece3a0fe90 Minor: fix smartcast on var in IrUtils.kt 2019-04-12 17:36:59 +03:00
Roman Artemev
01878fe4b5 [JS IR BE] Remove unused lowering
* its functionality is merged into `FunctionInliner`
2019-04-12 15:23:28 +03:00
Roman Artemev
ece33f00a2 [IR] SuspendFunctionLowering refactoring
* distinguish common part which generates successor of `CoroutineImpl`
   into separate common lowering
 * merge it with K/N
2019-04-12 15:23:28 +03:00
Roman Artemev
bcc8f3e073 [IR] Move Ir utils from Kotlin/Native 2019-04-12 15:23:28 +03:00
Roman Artemev
cf9cce8a9b [JS IR BE] Fix type arguments stuff in Secondary Constructor lowering 2019-04-12 15:23:28 +03:00
Roman Artemev
e3699fbc31 [IR] CommonBackendContext and Symbols refactoring
* add [suspend]functionN factory factions
 * add `getContinuation` property
 * add `internalPackageName` property
 * fix lowerings
2019-04-12 15:23:28 +03:00
Mikhail Zarechenskiy
bdab7a88f6 [NI] Add test for obsolete issue
#KT-28658 Obsolete
2019-04-12 15:22:39 +03:00
Mikhael Bogdanov
d5cd49b2bf Don't delete Idea temporary folder on JVM shutdown
Before parallelization we don't delete Idea folders after test execution.
  Now there is problem with failing test on Teamcity.
  So try to keep folder undeleted (maybe there is some working daemon)
2019-04-12 14:13:53 +02:00
Ivan Gavrilovic
33e7a23208 Fix style in classpath snapshot class
Use filterTo instead of filter followed by forEach.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c28ad116d0 Convert Windows-style path when calculating class internal name 2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
955a27ec77 Use MD5 when caching class ABI structure
This avoids Kotlin Gradle plugin dependency
on Guava, and it is a good hash function for this
use-case.

Also fix some formatting.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
e171199bf5 Do not track defined constants in source files
There is no need to track definitions of constants in sources for now.
References to constants are tracked in order to capture dependencies between types.
This ensures that any change to a type defining a constant (either from the
classpath or sources), will trigger reprocessing of the type that uses the
constant.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
929fca03fd Fixes to KAPT classpath change detection
1) Fix tests to use canonical path for comparison because Mac was failing
2) Update current classpath snapshot only with the missing entries from the previous one
3) Clean-up code and style
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
7c78644eb9 Incremental KAPT - analyze classpath changes
Use artifact transforms to capture structure and
dependencies of classpath entries. In the KAPT task
this information is used to compare previous classpath
structure with the current one. Once changed classes are
detected, all classes that transitively depend on those
are identified, and that set is passed to KAPT invocation.

In order to avoid unrelated classpath changes, we record an
ABI snapshot of the classpath entry. This snapshot ignores
all private members, and @Metadata annotation.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c85e21d43b Incremental KAPT - pass changed classpath entries
Pass computed list of changed classpath names to KAPT instead
of relying on the history files to be computed by stub generation.
Also, stop generating classpath history changes during the stub generation.

This commit does not compute the actual changed classpath entries,
and that will be done in the following commits.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
0c09f56118 Incremental KAPT - track constants usage
This commit adds support for tracking of used constants in
source files. For every constant used in a source file, class
that defines the constant and the constant name are tracked.

Value of the constant can be obtained using
annotation processing APIs, so if the constant value changes, a source file
using it has to be reprocessed.

 #KT-23880
2019-04-12 15:01:47 +03:00
pyos
57dca2ada5 JVM_IR: generate exception specifications 2019-04-12 13:00:54 +02:00
Ilya Matveev
f43579e9fc Update Kotlin/Native: 1.3-dev-9457 2019-04-12 17:53:34 +07:00
pyos
c7d7d903cd Add the IR version of CompileJavaAgainstKotlin tests
Only the WithoutJavac version for now, because the other one ignores
javac errors.
2019-04-12 12:43:37 +02:00
Dmitry Petrov
8a95da4a95 Minor: reformat DeepCopyIrTreeWithDescriptors.kt 2019-04-12 12:13:21 +03:00
Dmitry Petrov
bf2ab99b61 IR: IrSimpleTypeBuilder 2019-04-12 12:13:21 +03:00
Natalia Selezneva
2844d48f9f Refactoring: remove unused class 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0da6d48d5e Minor: fix toString in KotlinSourceFilterScope 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0c2e9f4d9a Scratch: prohobit closing scratch output content (KT-29642)
^KT-29642 Fixed
2019-04-12 11:42:56 +03:00
Natalia Selezneva
3eda40394a Impossible to run applications with long command lines on windows
^KT-29352 Fixed
2019-04-12 11:42:50 +03:00
Natalia Selezneva
dfa5f1f090 Refactoring: extract common parts for create command line for repl and scratch 2019-04-12 11:33:32 +03:00
Ting-Yuan Huang
0dd09ea7de JVM_IR: Lower IrGetEnumValue to this whenever possible.
The reference can be lowered to `this` if it is captured in the lexical
scope of the corresponding enum entry, and not used by the enum entry's
super constructor. Otherwise, it is lowered to
`GETFIELD SomeEnum.SomeEntry`.
2019-04-12 08:58:43 +02:00
Toshiaki Kameyama
faa6eacb25 Add "Replace Java static method with Kotlin top-level function" inspection
#KT-27411 Fixed
2019-04-12 11:35:46 +07:00
Rene Groeschke
6bef27e1e8 Forward stdout and stderr logger of out of process compiler through gradle logging
Issue #KT-30596 Fixed
2019-04-11 20:36:53 +03:00
Dereck Bridie
d86ffd3f34 Add inspection "Map replaceable with EnumMap" #KT-25439 Fixed 2019-04-11 19:01:02 +03:00
Toshiaki Kameyama
607325c6e5 Add "Round using roundToInt/roundToLong" quick fix
#KT-30389 Fixed
2019-04-11 18:58:05 +03:00
Burak Eregar
1455451601 Fix "Replace !! with if-then" inspection in receiver position
#KT-5412 Fixed
2019-04-11 18:58:05 +03:00
Jan Gerling
162de77b71 Add inspection to detect boxes *Range.start & endInclusive
These properties can be replaced with equivalent collections first & last.
#KT-15537 Fixed
2019-04-11 18:58:04 +03:00
Toshiaki Kameyama
401d8c2d70 Add braces: don't move EOL comment when if statement is single statement
#KT-28619 Fixed
2019-04-11 18:58:04 +03:00
Dmitriy Novozhilov
a92cf19641 Revert "[NI] Fix reporting smartcast diagnostics for intersection types"
This reverts commit 033d7262

That commit breaks bootstraping
2019-04-11 18:49:02 +03:00
Toshiaki Kameyama
849d18669b Replace assert boolean with assert equality: do not report when arguments type are not subtype
#KT-30761 Fixed
2019-04-11 18:36:50 +03:00
Toshiaki Kameyama
93d854362b Convert to anonymous function: do not name argument when lambda is Java method
#KT-30613 Fixed
2019-04-11 18:34:24 +03:00
Dmitriy Novozhilov
033d7262a2 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-11 18:10:59 +03:00
Toshiaki Kameyama
47b1ea7fa4 SimplifiableCallChainInspection: replace .sorted().first() with .min()
#KT-30725 Fixed
2019-04-11 18:07:06 +03:00
Toshiaki Kameyama
e4b10a156e SimplifiableCallChainInspection: fix tests 2019-04-11 18:07:06 +03:00
Alexander Gorshenev
ce6cda631d IrDelegatedProperty and IrDelegatedPropertyReference were missing from the serialization 2019-04-11 17:50:53 +03:00
Yan Zhulanow
e07821ca75 Debugger: Assume a class name from the coroutine metadata may be invalid (KT-30934) 2019-04-11 17:46:21 +03:00
Georgios Andrianakis
f11c5a335a KT-30343 Add new Quarkus preset to all-open compiler plugin 2019-04-11 17:46:21 +03:00
Yan Zhulanow
7ecd88aae3 AllOpen: Allow to specify presets in the Gradle plugin 2019-04-11 17:46:20 +03:00
Ting-Yuan Huang
4f64a52d33 Kapt: Fix NPE on JDK 10-11 (KT-26203)
Gradle worker throws NPE when the parameter to the runnable is null.
This patch works that around by passing URL spec as String instead of
File?
2019-04-11 17:46:19 +03:00
Yan Zhulanow
2314ca7a94 Debugger: Fix evaluation of lambda arguments (KT-10636) 2019-04-11 17:46:19 +03:00
Yan Zhulanow
fa5705cc68 Debugger: Fix missing read action in error reporting 2019-04-11 17:46:18 +03:00
Yan Zhulanow
4f6c8d2323 Fix type renderers for Kotlin (KT-18263, KT-18247) 2019-04-11 17:46:18 +03:00
Yan Zhulanow
15db1c8a8f Debugger: Do not validate line breakpoints for irrelevant classes (KT-30714) 2019-04-11 17:46:17 +03:00
Yan Zhulanow
2c5e8dab23 Debugger: Do not require a SourcePosition to exist 2019-04-11 17:46:16 +03:00
Yan Zhulanow
81a7f73db5 Refactoring: Inline getInvokePolicy() 2019-04-11 17:46:16 +03:00
Yan Zhulanow
b26f746514 Minor: Rename KotlinEvaluatorBuilder to match the superclass name 2019-04-11 17:46:15 +03:00
Yan Zhulanow
e31f195716 Minor: Remove unnecessary '!!' 2019-04-11 17:46:15 +03:00
Yan Zhulanow
fb3efd2d78 Debugger: Fix completion for synthetic '_field' extension properties (KT-23586) 2019-04-11 17:46:14 +03:00
Yan Zhulanow
0d04dc6f99 Debugger: Allow to touch experimental stuff from evaluator (KT-30216) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
b7ea4ccc7e Debugger: Hide call-site 'this' in inline functions in Kotlin variables mode (KT-30610) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
6dcaa64793 Pill: Fix platform source file location 2019-04-11 17:46:12 +03:00
Yan Zhulanow
9e99bca322 Pill: Fix artifact generation 2019-04-11 17:46:12 +03:00
Mikhael Bogdanov
5b49043939 Delete KotlinTestUtils.java.as32 and KtParsingTestCase.java.as32 2019-04-11 13:26:06 +02:00
Caleb Brinkman
c84c33cbd6 KT-30816 BasicJvmScriptEvaluator incorrect arg order
https://youtrack.jetbrains.com/issue/KT-30816

Change BasicJvmScriptEvaluator to pass constructor parameters in the
correct order, include tests for scripts w/ provided properties, and
implicit receiver, and both.
2019-04-11 10:17:55 +00:00
Dmitry Gridin
31ce6e1800 Minor: remove redundant qualifier names in QuickFixRegistrar 2019-04-11 15:13:17 +07:00
Dmitry Gridin
86a3daa302 Fix "Remove redundant qualifier name" for KtUserType with type parameter
#KT-30916 Fixed
2019-04-11 15:13:17 +07:00
Dmitry Gridin
f3faae7bb4 Fix 'Redundant qualifier name' warnings & refactoring in idea 2019-04-11 15:13:17 +07:00
Dmitry Gridin
646f325f57 Fix false positive "Redundant qualifier name" for functions with a receiver
#KT-30879 Fixed
2019-04-11 15:13:17 +07:00
Mark Punzalan
1b703448d3 Handle reversed() in ForLoopsLowering.
We get the info for the underlying progression and invert it. For
progressions whose last bound was open (e.g., `until` loop), the
reversed version will have an open first bound and so the induction
variable must be incremented first.

Also unified the way of extracting HeaderInfo out of changed calls
(e.g., `indices.reversed()`), and fixed declaration parents in
ForLoopsLowering.
2019-04-11 08:54:55 +02:00
Mikhael Bogdanov
3d1b6fb83c Minor. Fix AS32 compilation 2019-04-10 21:16:42 +02:00
pyos
b24690b35b Remove a redundant field 2019-04-10 20:51:46 +02:00
pyos
73bd683af1 Store InstructionAdapter, not ExpressionCodegen, in PromisedValue 2019-04-10 20:51:46 +02:00
pyos
96e2eb6fa1 Move PromisedValue to a separate file 2019-04-10 20:51:46 +02:00
pyos
e249c3c594 Return a stripped version of StackValue from ExpressionCodegen 2019-04-10 20:51:46 +02:00
pyos
c5f6be4282 Remove import of StackValue.* to better see use sites 2019-04-10 20:51:46 +02:00
pyos
a9bece9baa Allow intrinsics to be partial
Also, add an overridable invoke() method that skips the Callable step.
2019-04-10 20:51:46 +02:00
pyos
6e44b22340 Remove an unused non-IR IntrinsicMethod.toCallable 2019-04-10 20:51:46 +02:00
pyos
31eb542476 Return an immaterial value from Boolean.not 2019-04-10 20:51:46 +02:00
pyos
31c7183781 Return immaterial values from comparison intrinsics 2019-04-10 20:51:46 +02:00
pyos
9aff1cefb4 Make materialization of StackValues explicit 2019-04-10 20:51:46 +02:00
pyos
2356f72fd4 Make ExpressionCodegen a bit shorter in general 2019-04-10 20:51:46 +02:00
pyos
89cb31c387 Refactor try-catch covering computation 2019-04-10 20:51:46 +02:00
Mads Ager
a8e2893494 JVM_IR: Output EnclosingMethod attribute.
This works in many cases, however, it is incomplete since there
are cases where classes are extracted to top-level and therefore
reparented. Therefore, we lose the information about the function
class are nested inside.
2019-04-10 20:50:03 +02:00
Ilya Kirillov
8a94c66ce7 KT-29568, KT-26550: show "Convert Java File to Kotlin File" only for Java files
#KT-29568 fixed
#KT-26550 fixed
2019-04-10 21:29:18 +03:00
Ilya Kirillov
c7e08f9e5d New J2K: Fix existing test data 2019-04-10 21:29:18 +03:00
Ilya Kirillov
ae3920d535 New J2K: Finish DefaultArgumentsConversion 2019-04-10 21:29:18 +03:00
Ilya Kirillov
008e7a5add New J2K: do not use some keyword removing processings due to incorrect formatting after it 2019-04-10 21:29:18 +03:00
Ilya Kirillov
54d6fc846b New J2K: Add file range support for nullability analysis 2019-04-10 21:29:18 +03:00
Ilya Kirillov
33a42733f5 New J2K: make function parameters which is used as spread value argument to be not null 2019-04-10 21:29:18 +03:00
Ilya Kirillov
4844df2c6a New J2K: calculate for loop variable nullability 2019-04-10 21:29:18 +03:00
Ilya Kirillov
bd53772f5c New J2K: Fix explicit NPE cases in conversions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
4c58016fa4 New J2K: remove SuppressWarnings annotation 2019-04-10 21:29:17 +03:00
Ilya Kirillov
ecf1ab7f04 New J2K: convert internal visibility to public one for annotation class members 2019-04-10 21:29:17 +03:00
Ilya Kirillov
f0b7f1e30b New J2K: Fix type parameters for array creation expressions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
cb1b597b51 New J2K: save comments in data classed conversion 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d4f6558e8a New J2K: Split convert file method in converters 2019-04-10 21:29:17 +03:00
Ilya Kirillov
af17db5f45 New J2K: handle more types of nullability annotations 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d20e4bac1d New J2K: always print fully qualified names in printer to avoid name conflicts 2019-04-10 21:29:16 +03:00
Ilya Kirillov
aa53489e0b New J2K: Handle forced nullability correctly in nullability analysis 2019-04-10 21:29:16 +03:00
Ilya Kirillov
7d5793184f New J2K: Do not throw away incorrect code in switch statements 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a98382a3cb New J2K: Fix wrong fqName for jvm annotations 2019-04-10 21:29:16 +03:00
Ilya Kirillov
e181c7f097 New J2K: save comments for annotation parameters 2019-04-10 21:29:16 +03:00
Ilya Kirillov
b430cfa953 New J2K: fix priority in PolyadicExpressionConversion 2019-04-10 21:29:16 +03:00
Ilya Kirillov
99d4accf2c New J2K: fix IDEA exceptions in post-processings 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a5d64bf0b1 New J2K: Resolve symbols in correctly 2019-04-10 21:29:15 +03:00
Mikhael Bogdanov
d806320383 Rename tmpDirForReusableLibrary -> tmpDirForReusableFolder 2019-04-10 20:03:09 +02:00
Mikhael Bogdanov
8287e448d1 Support parallel execution of IDEA tests 2019-04-10 20:03:08 +02:00
pyos
8ae9e7a106 JVM_IR: unwrap fake overrides when computing property signatures 2019-04-10 19:21:37 +02:00
Vyacheslav Gerasimov
1b68b1d599 Build: embed jps artifact kotlin-plugin.jar into ideaPlugin 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
f71c2bf25e Build: Drop unused fromEmbeddedComponents helper 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
b741d393ed Build: make fatJar in JPS recursively using embedded configuration 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
adb896d74c Build: Introduce embedded configuration used for fatJars 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
a0adc97768 Build: Embed nj2k into kotlin-plugin.jar 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
da7a4a6d58 Build: Exclude trove4j from plugin since Idea already has it 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
c492c0c9f9 Build: Generate JPS artifacts for idea plugin from gradle configurations 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
92248d609f Build: Centralize build logic for kotlin-plugin in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
384f407af6 Minor: rename sideJars -> libraries 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
01aaaae5d0 Build: Pack markdown with dependencies (if any) to the ide plugin
Right now it doesn't have any dependencies
2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
909c6eef57 Build: Remove unnecessary stdlib dependencies in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
b68aee5ff8 Build: Fix missing coroutines-common in ide plugin
We shouldn't omit library dependencies while copying libraries to plugin
2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
f4472fd68a Build: Depend on :prepare:idea-plugin via configuration in ultimate 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
d554b5aafa Build: Embed projects not published to maven into kotlin-plugin.jar 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
4ff1506161 Build: Use project dependency via configuration to build kotlin-plugin
Using configuration allows us to embed fat jars
Removed unnecessary shadowJar task, unnecessary unless relocation is required
2019-04-10 17:54:05 +03:00
victor.petukhov
3ba48f219c Remove debug code in the test for CheckerTestUtil class 2019-04-10 17:10:56 +03:00
Alexander Udalov
121f30d9cc Use IrType instead of KotlinType in SingleAbstractMethodLowering 2019-04-10 14:42:40 +03:00
Alexander Udalov
d257285c86 Load Java enums as final classes
In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
2019-04-10 14:39:16 +03:00
Alexander Udalov
2f003ef545 Generate classes in MultifileClassCodegen exactly the same as in PackageCodegen
Two known issues with generateNonPartClassDeclarations that was here
before were the fact that we didn't sort sealed classes and its
subclasses which led to NoSuchMethodError (KT-27097), and the fact that
we didn't skip expect classes which led to incorrect duplicate JVM class
name diagnostic (KT-30843)

 #KT-27097 Fixed
 #KT-30843 Fixed
2019-04-10 14:39:16 +03:00
Alexey Tsvetkov
c8c630cecb Filter significant elements before creating ListRange
EA-134385
  EA-138187
2019-04-10 14:38:11 +03:00
Mikhail Glukhikh
568e831651 FIR: make rendering of type parameters similar to original Kotlin 2019-04-10 13:31:02 +03:00
Mikhail Glukhikh
0c334163ab FIR: add class type parameters to constructors & change their rendering 2019-04-10 13:31:01 +03:00
Toshiaki Kameyama
55a5ccac5c SimplifyAssertNotNullInspection: change level to INFORMATION
#KT-30876 Fixed
2019-04-10 16:06:37 +07:00
Georgy Bronnikov
43e87a1635 Merge pull request #2256 from pyos/flatten-phases
Flatten phase compositions
2019-04-10 10:43:14 +03:00
Dmitriy Dolovov
7beb49271f Fix: Navigation to inheritor class in non-JVM library source leads to opening stub
Issue #KT-30821 Fixed
2019-04-10 11:17:27 +07:00
Juan Chen
f489a47025 Fix SAM_WITH_RECEIVER_PLUGIN_NAME.
SAM_WITH_RECEIVER_PLUGIN_NAME in PathUtil was accidentally broken by
4c751cdd52 (diff-819dacd07c45ba85ba5459d8a09418daR34)
2019-04-09 15:19:00 +00:00
Ilmir Usmanov
00e952ab15 Introduce CHECK_TAIL_CALL_OPTIMIZATION directive
This directive generates TailCallOptimizationChecker in package helpers.
The check for tail call optimization is based on coroutine stack traces
bug (feature?): when tail call optimization hits, the continuation
object is not generated. Thus, there is no debug metadata for this
suspend function. Consequently, the coroutines stack trace does not
contain stack trace element for that function.
This check is performed by TailCallOptimizationChecker.

Since this is runtime check, unlike bytecode tests, it does not require
test data adjustments on each codegen or inliner change.

Since the check is based on debug metadata, which is JVM specific, there
is not support for other backends yet.
2019-04-09 18:01:21 +03:00
Mikhail Glukhikh
40441a18cc FIR2IR tests: do not try to dump & check external dependencies
(because both wrapped descriptors and FIR-based package descriptors
have no member scopes and aren't able to find class across module deps)
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
485035952a IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS)
Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
61ae365cfd IR text tests: remove some may-be-unnecessary dumps 2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
02bdc826d5 IR text tests: throw an error when test fails to build an external dump 2019-04-09 15:36:16 +03:00
Vyacheslav Gerasimov
2937cb7237 Build: Fix Android Studio 3.5 unpacking, now published as tar.gz 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
83764c113f as35: Upgrade to AS 3.5 C10 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
8c9e1006f2 as35: Derive as35 bunch from 191 2019-04-09 15:06:22 +03:00
Steven Schäfer
26aeddf6d9 Remove broken KotlinType.toIrType function
The KotlinType.toIrType function sometimes produces unbound symbols
and was only used in IrIntrinsicFunction and SharedVariablesManager.

This change removes the broken function and changes SharedVariableManager
to use IrType consistently and IrIntrinsicFunction to use KotlinType
consistently.
2019-04-09 13:46:02 +02:00
pyos
048fd9fa25 Create a single instance of IrIntrinsicMethods per context.
This improves JVM_IR compilation times by 2%.
2019-04-09 11:56:58 +02:00
Dmitry Gridin
fceb5ee245 Fix AutoImport for import with alias
#KT-30663 Fixed
2019-04-09 16:34:26 +07:00
Andrey Uskov
a6ae1f2ba6 Fix import of compiler arguments in IDEA if source set dependencies
could not be resolved (e.g. due to misspelling in artifact name).
Fix works only in case when both new IDEA and gradle plugins are
used
#KT-28627 Fixed
2019-04-09 12:04:59 +03:00
Andrey Uskov
ed0dfaec36 Migrate GradleFacetImportingTest to testdata 2019-04-09 12:04:32 +03:00
Andrey Uskov
0f60daec25 Fix locking multiple threads during KotlinConfiguration check
#KT-29892 Fixed
2019-04-09 12:04:14 +03:00
Andrey Uskov
ff488bb871 Create android source root test added 2019-04-09 12:03:57 +03:00
Simon Ogorodnik
dc84e8fce5 Reformat PluginDeclarationProviderFactory 2019-04-09 11:53:54 +03:00
Simon Ogorodnik
f3268c99df EA-115037: Rebuild PerModulePackageCache on miss 2019-04-09 11:53:52 +03:00
Simon Ogorodnik
dd3dfedf81 KT-30688: Fix memory leak on module in disposer after onTooComplexChange
Remove explicit cache entry removal, use weak map instead

 #KT-30688 fixed
2019-04-09 11:53:22 +03:00
Nikolay Krasko
bfda9cc57b Fix inspection Integer.toString() -> int.toString() reports 2019-04-09 11:47:30 +03:00
Nikolay Krasko
a9beb04cb7 Fix RemoveExpressionTargetFix and don't remove the whole annotation (KT-25574) 2019-04-09 11:47:29 +03:00
Nikolay Krasko
ecda8cd889 Remove resolve in ChangeRetentionToSourceFix and RemoveExpressionTargetFix (KT-25574) 2019-04-09 11:47:29 +03:00
Toshiaki Kameyama
58b6360388 Add quick fixes for RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION (KT-25574) 2019-04-09 11:47:29 +03:00
pyos
f37d171a52 Flatten phase compositions.
This makes stack traces and flame graphs significantly more readable.
2019-04-09 10:15:45 +02:00
pyos
fb0261bfc1 Remove JvmDescriptorWithExtraFlags and fix syntheticness
(of fields and classes, it is already correct for methods).
2019-04-09 08:18:14 +02:00
pyos
3fdcf8376f Add IR equivalent of the WriteFlags test 2019-04-09 08:11:29 +02:00
Dmitriy Dolovov
f2d513a39c Fix: Unstable IDE navigation to expect/actual symbols in stdlib
Issue #KT-30790 Fixed
2019-04-09 10:24:58 +07:00
Anton Bannykh
9b5c8bbac9 JS: switch off inlined local declaration deduplication (KT-30877 fixed)
(cherry picked from commit 681e8dd968)
2019-04-08 21:22:43 +03:00
Ilmir Usmanov
2dee506022 Generate suspend markers for inline and crossinline parameters
if they are not inlined, but directly called.
Previously, all inline and crossinline lambda calls were treated by
codegen as if they are always going to be inlined. However, this is not
always the case.

Note, that we cannot generate these markers during codegen, since we
can inline code with no suspension points, but the whole inlined code
will become one giant suspension point. This, of course, breaks
tail-call optimization and, hence, slows down cold streams.

Because of that, we generate these markers, when we are sure, that they
are not going to be inlined. The only place, in which we know that, is
the inliner. During inlining of the inline function, we check, whether
the parameter is inline or crossinline and whether it is not an inline
lambda. If these checks pass, we generate the markers. Noinline
parameters are already covered by the codegen.
 #KT-30706 Fixed
 #KT-26925 Fixed
 #KT-26418 Fixed
2019-04-08 17:28:37 +03:00
Mikhael Bogdanov
eb1bfac83f Minor. Fix test data 2019-04-08 16:23:00 +02:00
Dereck Bridie
7da52b2df5 Fix KT-13962 with kotlin.collections constructors 2019-04-08 14:53:27 +03:00
Mikhael Bogdanov
10e3dfa980 Support anonymous function as inline parameters 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
2a3a9bb5fc Support properties reificaton 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
944c200a5d Initial support of try as expression in JVM IR 2019-04-08 13:10:24 +02:00
Mikhael Bogdanov
30aeb8dc0a Support finally blocks in non-local returns 2019-04-08 13:10:23 +02:00
Mikhael Bogdanov
4c59d161d4 Support basic reification in IR 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
02cb1d7dcc Change return target in $default function on transformation 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
694a7c329d Initial support of non-local return in IR 2019-04-08 13:10:21 +02:00
Mikhael Bogdanov
3f9154a4a1 Remove declaration that would be inlined 2019-04-08 13:10:20 +02:00
Alexander Udalov
dd2c7aff6e Implement IrType.equals/hashCode via isEqualTo/toHashCode 2019-04-08 13:06:01 +03:00
Alexander Udalov
8cce5dc8de Fix missing return for checkViaDescriptors in FqNameEqualityChecker 2019-04-08 13:06:01 +03:00
Alexander Udalov
bdfe82cfff Fix incorrect condition in CheckIrElementVisitor.ensureTypeIs
Apparently it has no effect on behavior of tests because no backend uses
the checkTypes mode of IR validation
2019-04-08 13:06:01 +03:00
Sergey Rostov
26a9b2b251 JPS Build: fix kotlin-main-kts-test dependency to kotlin-main-kts 2019-04-08 12:47:25 +03:00
Alexander Udalov
5bafd4008f Use correct class loader to load .kotlin_builtins in reflection
#KT-30749 Fixed
2019-04-08 12:43:53 +03:00
Toshiaki Kameyama
3de723b8d0 SimplifiableCallChainInspection: replace .sorted().firstOrNull() with .min()
#KT-30725 Fixed
2019-04-08 11:07:24 +03:00
Sergey Rostov
bdac47369c Gradle, Native: run tests with proper Test task, process test results
#KT-30529 Fixed
2019-04-08 09:38:33 +03:00
Sergey Rostov
d5e434e95b Gradle: move JS and Android platform specific files to targets package: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
9129c08fac Gradle: move JS and Android platform specific files to targets package 2019-04-08 09:38:33 +03:00
Sergey Rostov
09611a612a Gradle, Native: move all Native-related files to targets.native directory: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
1d1a560e32 Gradle, Native: move all Native-related files to targets.native directory 2019-04-08 09:38:33 +03:00
Dmitry Gridin
b45aeda711 Fix caret after "Introduce import alias" if invoke in import directive
#KT-30833 Fixed
2019-04-08 11:25:32 +07:00
Nikolay Krasko
814aca9c8b Single indent for declarations on adding new line (KT-26954)
#KT-26954 Fixed
2019-04-06 20:44:06 +03:00
Nikolay Krasko
e4cc94e0a8 Check bad root presence before checking platform (KT-30442)
Detect platform based on libraries content is a long operation and should
not be called from `isConversionNeeded`. Do other checks before it.
2019-04-06 20:44:05 +03:00
Nikolay Krasko
03c6e23448 Remove platform comparisons based on string dictionary order (KT-30356)
Comparison was changed in 641a9a7153 (diff-0895a6eaf69b9fd4d43f83db9889d103R109)

 #KT-30356 Fixed
2019-04-06 20:44:05 +03:00
Nikolay Krasko
53ab1e7c99 Minor: clean warnings in folding tests 2019-04-06 20:44:05 +03:00
Nikolay Krasko
aea33a3214 Move resolve during import optimizing to background thread (KT-27106, KT-30018)
#KT-27106 Fixed
2019-04-06 20:44:05 +03:00
Vyacheslav Gerasimov
25636c9c39 Build: Compile ultimate with kotlin-stdlib-jdk8 2019-04-05 20:37:19 +03:00
Igor Yakovlev
da4d8a8c90 Parser invalid error advancing for postfix type parameters list #KT-30835 Fixed 2019-04-05 19:50:42 +03:00
Austaon
0e716fd528 KT 13962: Intention to replace Java collection constructor calls with function calls from stdlib (ArrayList() → arrayListOf()) 2019-04-05 18:19:26 +03:00
Dmitry Petrov
bbeb65905e KT-30780 Fix erased inline class context in class context hierarchy
In SourceCompilerForInline we could enter ERASED_INLINE_CLASS context
from containing declaration context. That broke codegen context
hierarchy invariants assumed in accessor generation.
2019-04-05 17:27:04 +03:00
Mikhail Glukhikh
e1915ec99e FIR2IR: add bunch file for 181 to avoid compilation problems 2019-04-05 16:18:59 +03:00
Mikhail Glukhikh
ee28467a47 Raw FIR: add work-around for deeply nested String interpolations
Controversial (but prevents total kotlin test failing)
Related to KT-29222
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
881073b1c9 Add basic FIR -> IR converter with a set of text tests
Tests duplicate IrTextTestCaseGenerated
#KT-24065 Fixed
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
92adfd8946 Add stub implementation of compileTimeInitializer in wrapped descriptors 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
d736a7da6b Raw FIR: get rid of array gets, use array sets only for modifications
(a[b] += c etc. cannot be replaced with get/set calls easily)
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
a0c4e2f05f Raw FIR: convert in to contains and !in to contains.not 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
4482a8f794 Remove FirOperation.RANGE which was effectively unused
Associated KtTokens.RANGE is included into convention call table
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
007edcb4a4 Raw FIR: generate convention / infix binary expressions with receiver 2019-04-05 16:18:57 +03:00
Dmitry Gridin
4f8e29ad23 Fix import quickfix if import has import alias
#KT-30669 Fixed
 #KT-7380 Fixed
 #KT-30663 Fixed
2019-04-05 20:01:11 +07:00
Dmitry Gridin
6caf6858fa Minor: refactoring KotlinAddImportAction 2019-04-05 20:01:11 +07:00
Dmitriy Novozhilov
d8cbeb8d15 Add regression test for SPREAD_OF_NULLABLE diagnostic
#KT-30808 Fixed
2019-04-05 14:17:34 +03:00
Mikhail Zarechenskiy
ff2ce316e1 [NI] Resolve callable reference eagerly at the end of resolution parts
This way we'll resolve less callable references later as we'll have
 more constraints to clip wrong candidates for callable references
2019-04-05 13:16:58 +03:00
Mikhail Zarechenskiy
c3bc6ef2fa [NI] Make callable references more robust to overloads of outer call
#KT-30676 Fixed
2019-04-05 13:16:54 +03:00
Mikhail Zarechenskiy
20a7f387bf [NI] Resolve callable reference eagerly if there is only one candidate
#KT-30737 Fixed
2019-04-05 13:15:57 +03:00
Dmitriy Novozhilov
aa96a05469 [NI] Fix initial data flow info for analyzing lambdas
#KT-30734 Fixed
2019-04-05 12:52:29 +03:00
Anton Bannykh
b7ffdb9fde JS IR: support kotlin.test 2019-04-05 12:30:21 +03:00
Anton Bannykh
b0ed688986 Fix argument passing for smartJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
d04a0246db make smartJavaExec composable with NoDebugJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
8174d6c035 JS IR: eliminate quickIrTest 2019-04-05 12:30:21 +03:00
Anton Bannykh
ad4c2144a7 JS IR: moved klib creation to the serialization_test module 2019-04-05 12:30:20 +03:00
Anton Bannykh
0f183ed662 JS IR: split compilation and deserialization 2019-04-05 12:30:20 +03:00
Anton Bannykh
08785b7cea JS IR: split serialization into a separate module 2019-04-05 12:30:20 +03:00
Anton Bannykh
42f576f033 IR: move serialization to serialization.common 2019-04-05 12:30:20 +03:00
Steven Schäfer
59c5d8bdb8 Add an implicit cast to Unit in returns from a constructor. 2019-04-05 12:05:53 +03:00
Vasily Levchenko
826f55ecb4 Merge pull request #2240 from JetBrains/rr/minamoto/ir-IrFunctionInlineBodyImpl
[IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
2019-04-05 11:49:08 +03:00
Vasily Levchenko
1ebf7faedc [IR][refactoring] g/c IrReturnableBlock[Impl]
- drop calculatable from 'inlineFunctionSymbol' fields: 'sourceFileSymbol' and 'sourceFileName' and
replace then with extension values

- drop unused constructors.
2019-04-05 11:47:45 +03:00
pyos
05e09df683 Throw a clearer error on unexpected IR nodes in expressions 2019-04-04 21:39:49 +02:00
pyos
c3a74ded0e Make isDefaultValueForType shorter 2019-04-04 21:39:47 +02:00
pyos
fb55e34b8f Merge generateBreakOrContinueExpression and doFinallyOnReturn 2019-04-04 21:39:46 +02:00
pyos
c0af91b6d1 Inline markFunctionLineNumber 2019-04-04 21:11:39 +02:00
pyos
9f28b2042a Move common declarations up 2019-04-04 21:11:37 +02:00
pyos
a7dbd08f45 Inline genFinallyBlockOrGoto 2019-04-04 21:11:35 +02:00
pyos
6690e50dd2 Remove direct block stack manipulation 2019-04-04 21:11:33 +02:00
pyos
57450912fb Remove a couple unused classes, inline a short method 2019-04-04 21:11:31 +02:00
Toshiaki Kameyama
bcfab83d1c Add "Constructor has non-null self reference parameter" inspection (KT-29799)
#KT-29799 Fixed
2019-04-04 17:25:37 +03:00
Zalim Bashorov
6634d7ab15 [psi2ir] Minor: dynamicWithImplicitCast.kt -> dynamicWithSmartCast.kt 2019-04-04 17:14:04 +03:00
Zalim Bashorov
57a6b53780 [psi2ir] Add tests for implicit casts "to" and "from" dynamic type 2019-04-04 17:14:03 +03:00
Toshiaki Kameyama
dffcfdc02f Add inspection to replace not-null assertion with elvis return
#KT-30381 Fixed
2019-04-04 20:29:17 +07:00
Vasily Levchenko
6f9feacf6e [IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
This change let backend calculate and bind right function to the code block on generation debug information
e.g. for Kotlin/Native backend this let codegnerator to produce DILocation(..., inlinedAt:..) with correct value
for inlinedAt parameter, thus signifiacntly improve behaviour of debugger.
2019-04-04 16:14:34 +03:00
Dmitry Petrov
1c0c01725b Preserve original for constructors of LazySubstitutingClassDescriptor
We would like DeclarationDescriptor.getOriginal() to always point to a
(preferably unique) unsubstituted descriptors for the given possibly
substituted descriptor. In case of LazySubstitutingClassDescriptor
(which can be observed for nested generic Java classes), this invariant
was broken, because 'getOriginal()' for constructors of substituted
class returned a copy created for this particular substituted class.
2019-04-04 14:42:23 +03:00
Ilya Kirillov
966daf8341 Regenerate NullabilityAnalysisTestGenerated 2019-04-04 14:05:05 +03:00
Alexander Podkhalyuzin
1fbbd71085 Fixed DSL Marker icon
#KT-30470 Fixed
2019-04-04 13:59:49 +03:00
Dmitriy Dolovov
ea3f4ad47f Attach K/N stdlib sources on MPP project import
Issue #KT-30635:fixed
2019-04-04 17:34:42 +07:00
Dmitriy Dolovov
f9d9d7f737 Keep K/N stdlib upper than platform libraries in IDEA UI 2019-04-04 17:34:24 +07:00
Natalia Selezneva
97531c8ec2 Do not include buildSrc module dependencies into script dependencies (KT-30295)
^KT-30295 Fixed
2019-04-04 11:06:14 +03:00
Natalia Selezneva
aa99d8fcbe Rename extension point for additional dependencies of scripts 2019-04-04 11:06:14 +03:00
pyos
4c01614136 Avoid leaking SamConstructorDescriptors from psi2ir 2019-04-04 09:45:00 +02:00
pyos
23d742237f Add tests for merging SAM wrappers and references 2019-04-04 09:45:00 +02:00
pyos
e05c151a73 Remove explicit mention of an internal name from a test 2019-04-04 09:45:00 +02:00
pyos
ee59530f71 Fix casts of the null constant to SAM types 2019-04-04 09:45:00 +02:00
pyos
f47d9d54c0 psi2ir: add test for SAM-conversion of operator arguments 2019-04-04 09:45:00 +02:00
pyos
39c8939241 JVM_IR: optimize SAM conversion of lambda literals
Instead of materializing an invokable object and storing it in an
instance of the implementation, create a specialized class that calls
the lambda directly, resulting in one less nesting layer and one less
class.
2019-04-04 09:45:00 +02:00
pyos
b74586f84e JVM_IR: implement single-abstract-method conversions 2019-04-04 09:45:00 +02:00
Mikhail Glukhikh
141e8d553e FIR body resolve: support variable assignments 2019-04-04 10:31:15 +03:00
Mikhail Glukhikh
c56b471b71 FIR body resolve: handle constant types more precisely 2019-04-04 10:31:13 +03:00
Mikhail Glukhikh
cc2a5cfc06 FIR body resolve: calculate type even for resolved references 2019-04-04 10:31:12 +03:00
Mikhail Glukhikh
d7f0392f90 FIR body resolve: fix value parameter expected type 2019-04-04 10:31:11 +03:00
Mikhail Glukhikh
8a6c9a6aec FIR deserializer: read nullability & add constructors 2019-04-04 10:31:09 +03:00
Mikhail Glukhikh
6e9d78d431 FIR structure: make implicit built-in types resolved 2019-04-04 10:31:08 +03:00
Mikhail Glukhikh
bf0190d96c FIR structure: reuse StandardClassIds in implicit built-in typeRef 2019-04-04 10:31:07 +03:00
Mikhail Glukhikh
b3cf3c6579 FIR structure: include calleeReference into FirDelegatedConstructorCall 2019-04-04 10:31:05 +03:00
Mikhail Glukhikh
63d3100122 FIR structure: FirClassLikeDeclaration is now FirStatement
Done to support (in theory) local type aliases
2019-04-04 10:31:04 +03:00
Mikhail Glukhikh
4213a4c7e2 FIR Java: reuse StandardClassIds 2019-04-04 10:31:02 +03:00
Mikhail Glukhikh
a0fa9e6b48 Raw FIR: make component call a function call, its argument -> receiver 2019-04-04 10:31:01 +03:00
Mikhail Glukhikh
30697787a0 Raw FIR: set "implicit boolean" result type for some operator calls 2019-04-04 10:31:00 +03:00
Mikhail Glukhikh
eb1aaad41b Raw FIR: generate Unit at the end of empty lambda 2019-04-04 10:30:52 +03:00
Mikhail Glukhikh
eb86c9e540 FIR: get rid of ANDAND / OROR by replacing with when 2019-04-04 10:30:49 +03:00
Mikhail Glukhikh
395651a21e Raw FIR: swap branches in when for elvis and bang-bang 2019-04-04 10:30:48 +03:00
Mikhail Glukhikh
f77ba2dd3e Raw FIR: make object/sealed/enum constructor visibility private 2019-04-04 10:30:47 +03:00
Mikhail Glukhikh
057156f323 Raw FIR builder: cleanup code 2019-04-04 10:30:45 +03:00
Mikhail Glukhikh
33729aaf9b Raw FIR: add Any/Enum/Annotation to supertypes iff no supertypes exists 2019-04-04 10:30:44 +03:00
Mikhail Glukhikh
7dd89a48f0 Raw FIR: introduce FirConstructor.isPrimary 2019-04-04 10:30:43 +03:00
Mikhail Glukhikh
61c2e4e590 Raw FIR: handle local visibility for functions & classes 2019-04-04 10:30:41 +03:00
Mikhail Glukhikh
4187ea1f86 Raw FIR: add initializers to primary constructor properties 2019-04-04 10:30:40 +03:00
Ilya Matveev
1f2d31dffb Update Kotlin/Native: 1.3-dev-9301 2019-04-04 14:24:09 +07:00
Mark Punzalan
a0940b1342 Use stricter assertions in for-loop bytecode text tests. 2019-04-04 09:07:19 +02:00
Mark Punzalan
dd65e0876f Simplify loop building by encoding open/closed bound information in the
HeaderInfo object, and modifying the operator in the loop condition.

The "additional emptiness condition" is no longer necessary with this.
The open/closed property was removed from HeaderInfo in an earlier
commit, but bringing it back in to simplify the loop building makes
more sense.

Also expanded tests for evaluation order of range bounds.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7680e7fd56 Use while loop for progressions that cannot overflow (instead of
do-while with enclosing "not empty" check).

Also do not add additional "not empty" condition for `until` loops when
the given bound is a constant != MIN_VALUE.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ba0e016c4e Add bytecode tests for array for-loop iteration. 2019-04-04 09:07:19 +02:00
Mark Punzalan
7afe121238 Eliminated the redundant ForLoopHeader.needsEmptinessCheck property, cast "bound" to progression type if necessary, fixed variable declaration order. 2019-04-04 09:07:19 +02:00
Mark Punzalan
6b83c04472 Cast step expression to the correct Number type, if necessary. 2019-04-04 09:07:19 +02:00
Mark Punzalan
f6e74079bb Cleanup ForLoopsLowering: Add more comments, remove descriptor usages,
make code style consistent.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ea9572ad28 Add DefaultProgressionHandler that handles for-loops over
non-specialized progressions, including "step" progressions.

DefaultProgressionHandler uses the "first/last/step" properties of
the progression when building the loop header.
2019-04-04 09:07:19 +02:00
Mark Punzalan
301ac90770 Remove "bound" and "closed" properties from HeaderInfo and
ForLoopHeader, instead assuming that all ranges are closed and that the
"last" property is already property calculated.

This means the HeaderInfo.last for arrays, "indices" and "until"
progressions are decremented from the bound. This simplifies the loop
construction and moves the work to the handlers. This will also simplify
the handling of "reversed()" in the future since we don't need to
consider the case where the lower bound is open.
2019-04-04 09:07:19 +02:00
Mark Punzalan
93deff5e57 Rename "lowerBound/upperBound" to "first/last" and move loopVariable to
ForLoopHeader base class.

These terms are less loaded and less confusing, especially with "downTo"
progressions, and once we start handling "reversed()".
2019-04-04 09:07:19 +02:00
Mark Punzalan
8e1be5424f Handle for (i in a until Int.MIN_VALUE) corner case by adding
an additional "not empty" condition produced by the UntilHandler.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7b153b2b68 Move building of "not empty" condition (used to check if loop is empty)
from ForLoopsLowering into ForLoopHeader, reducing the building logic in
ForLoopsLowering.
2019-04-04 09:07:19 +02:00
Mark Punzalan
a2e3d3635e Replace HeaderInfo.increasing property with a "direction" enum property,
which is computed based on the value of "step" (if possible).
2019-04-04 09:07:19 +02:00
Mark Punzalan
ed9ede8936 Make HeaderInfo.step not nullable and have handlers explicitly provide
the step expression.

The semantics of "step" are now clearer: It will no longer be negated
based on the "increasing" property; if the progression is decreasing
(i.e., for "downTo" progressions), then it must be negative. The
"increasing" property is still used when building the emptiness
condition.
2019-04-04 09:07:19 +02:00
Mark Punzalan
40dbf8a3fd Move elementType() and getProgressionType() extension methods into
ProgressionType.
2019-04-04 09:07:19 +02:00
Mark Punzalan
409d99a52a Add ForLoopsLowering to JVM phases.
Also deleted StepHandler. Since the HeaderInfo.needLastCalculation is
only set to true for handling step progressions, deleted that property
and all associated logic around it.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7276b7e66a Fix compilation errors after rebasing. 2019-04-04 09:07:19 +02:00
Mark Punzalan
656f6855bb Minimal porting of ForLoopsLowering from kotlin-native.
Diffs resulting from the port:
https://github.com/punzki/kotlin-native/compare/master...punzki:for-loop-diff

When ForLoopsLowering is added to the JVM lowering phases, this causes some of the forLoop bytecode tests to pass, and many still fail due to differences in behavior compared to non-IR backend:
- Generated conditions for lowered loop
- Generated temporary variables
- Supported iterables (e.g., withIndex(), CharSequences)
- Means of incrementing induction variable

The phase will be added once more TODOs are resolved and it is more functionally complete, to prevent breaking for loops.
2019-04-04 09:07:19 +02:00
Toshiaki Kameyama
f861b10798 Add "Add getter/setter" quick fix for uninitialized property
#KT-30078 Fixed
2019-04-04 11:10:39 +07:00
Austaon
efcc6f0967 Add inspection for Integer.toString(i) to i.toString() (KT-12721) 2019-04-03 19:12:54 +03:00
Ilya Gorbunov
dde2b30601 Clarify wording in Random.nextUInt docs: missed extra 'not' 2019-04-03 16:31:03 +03:00
Yan Zhulanow
69353ee9bf Async stack traces: fix compatibility with kotlin-stdlib 1.2.70 (KT-30611) 2019-04-03 15:46:33 +03:00
Yan Zhulanow
ef06009669 191: Fix test running for common modules in MPP/Gradle (KT-29908) 2019-04-03 15:46:32 +03:00
Yan Zhulanow
ee42c1211a 191: Update target IntelliJ SDK version to 191.6183 2019-04-03 15:46:32 +03:00
Ilya Kirillov
b7e6dc4f8b Fix as32 test generation 2019-04-03 14:48:54 +03:00
Sergey Igushkin
e23b74792d Fix Java sources inspected too early in Android variants (KT-30735)
The Android Gradle plugin can set Java sources after a variant is
created, similar to AP options. We need to inspect the Java sources
only from at `afterEvaluate` time.

Issue #KT-30735 Fixed
2019-04-03 14:45:52 +03:00
Ilya Matveev
5ab9723ee1 Configure CocoaPods plugin to be published at the plugin portal 2019-04-03 18:07:49 +07:00
Alexander Podkhalyuzin
a7b43a6bb7 Import only classes when setting add unambiguous on the fly is enabled
#KT-30514 Fixed
2019-04-03 13:51:21 +03:00
Mikhael Bogdanov
4450641321 Merge inlineCodegenUtils2.kt into inlineCodegenUtils.kt 2019-04-03 11:43:46 +02:00
Mikhael Bogdanov
be954c6e62 Rename LabelOwner into ReturnLabelOwner 2019-04-03 11:43:45 +02:00
Mikhael Bogdanov
20adce165f Convert CapturedParamDesc.java into Kotlin 2019-04-03 11:39:59 +02:00
Mikhael Bogdanov
a19cc8efa6 Rename .java to .kt 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
c6fb8ba08e Convert CapturedParamInfo.java into Kotlin 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
79c97ba21d Rename .java to .kt 2019-04-03 11:39:57 +02:00
Mikhael Bogdanov
d8336bd0a1 Convert ParameterInfo.java into Kotlin 2019-04-03 11:39:56 +02:00
Mikhael Bogdanov
53dd1dd76d Rename .java to .kt 2019-04-03 11:39:55 +02:00
Ilya Kirillov
243fd2f4f1 New J2K: Move nullability analysis tests to nullabilityAnalysis dir 2019-04-03 11:24:30 +03:00
Ilya Kirillov
854fc6a7d7 New J2K: Handle correctly modifiers of class members when there is no parent class in the AST 2019-04-03 11:24:29 +03:00
Ilya Kirillov
c05a01e12b New J2K: Fix NPE if no constructor was found in ImplicitInitializerConversion 2019-04-03 11:24:28 +03:00
Ilya Kirillov
6182edadfd New J2K: Move imports into JKImportList 2019-04-03 11:24:27 +03:00
Ilya Kirillov
86fa54fae9 New J2K: Convert Java method to Kotlin function independently of containing class 2019-04-03 11:24:26 +03:00
Ilya Kirillov
f28f340840 New J2K: Wrap ast to a JKTreeRoot 2019-04-03 11:24:26 +03:00
Ilya Kirillov
ddee0deeca New J2K: Move println conversion functionality to BuiltinMembersConversion 2019-04-03 11:24:25 +03:00
Ilya Kirillov
ce666295f7 New J2K: Fix npe when converting java member without parent 2019-04-03 11:24:24 +03:00
Ilya Kirillov
088241313a New J2K: Remove unused JKJavaDefaultNewExpressionImpl 2019-04-03 11:24:23 +03:00
Ilya Kirillov
50a4b9b2b5 New J2K: Remove debug println 2019-04-03 11:24:22 +03:00
Ilya Kirillov
31aea1e5e9 New J2K: Fix converting on copy-past 2019-04-03 11:24:22 +03:00
Ilya Kirillov
5ab9d6bba8 New J2K: Fix collected import inserting in J2K 2019-04-03 11:24:21 +03:00
Ilya Kirillov
1dd0a42298 New J2K: Escape name of declaration in convert data class 2019-04-03 11:24:20 +03:00
Ilya Kirillov
b411e8e18e New J2K: Split old j2k and new j2k tests 2019-04-03 11:24:19 +03:00
Ilya Kirillov
02a206bf7c New J2K: Fix converters spliting 2019-04-03 11:24:18 +03:00
Ilya Kirillov
db2ad96f00 New J2K: Fix ParameterModificationInMethodCallsConversion in a case of varargs parameter 2019-04-03 11:24:18 +03:00
Ilya Kirillov
8cec43fda3 New J2K: Assume KtConstructor as function for symbol provider 2019-04-03 11:24:17 +03:00
Ilya Kirillov
6d621a86d2 New J2K: Convert java.util.Objects.equals call to equals binary operator expression 2019-04-03 11:24:16 +03:00
Ilya Kirillov
a973f9b670 New J2K: Add support of package qualifiers for expressions 2019-04-03 11:24:16 +03:00
Ilya Kirillov
9fb6cfc26e New J2K: Collect imports to ImportStorage, not to JKFle 2019-04-03 11:24:15 +03:00
Ilya Kirillov
9d9c9f40db New J2K: Wrap adding imports to CommandProcessor.executeCommand 2019-04-03 11:24:14 +03:00
Ilya Kirillov
02c8e4cede New J2K: Do not remove semicolon after if expression when then branch is empty in RedundantSemicolonInspection 2019-04-03 11:24:14 +03:00
Ilya Kirillov
b13f7431f2 New J2K: Fix existing test data 2019-04-03 11:24:13 +03:00
Ilya Kirillov
76b73542d9 New J2K: Add type arguments to multi-dimension array initializers 2019-04-03 11:24:12 +03:00
Ilya Kirillov
99f3af9e85 New J2K: Move comments from primary constructor to init section 2019-04-03 11:24:11 +03:00
Ilya Kirillov
481b2feda3 New J2K: Collect annotations for parameters 2019-04-03 11:24:10 +03:00
Ilya Kirillov
b3af05e3ad New J2K: Fix comments order 2019-04-03 11:24:10 +03:00
Ilya Kirillov
1e73748ab4 New J2K: Fix gradle build for nj2k-services 2019-04-03 11:24:09 +03:00
Ilya Kirillov
7f9250c914 New J2K: Fix symbol provider compile error 2019-04-03 11:24:08 +03:00
Ilya Kirillov
32e69629f3 New J2K: Add imports of used kotlin functions 2019-04-03 11:24:08 +03:00
Ilya Kirillov
939b379694 New J2K: Fix old j2k build 2019-04-03 11:24:07 +03:00
Ilya Kirillov
dff4ab2437 New J2K: Fix nullability preserving in AST conversions 2019-04-03 11:24:06 +03:00
Ilya Kirillov
bdd773f806 New J2K: Add nullability analyser tests 2019-04-03 11:24:05 +03:00
Ilya Kirillov
f3b6c880d4 New J2K: Remove unused nj2k test & fix test generation 2019-04-03 11:24:04 +03:00
Ilya Kirillov
e3ee0dac6c New J2K: Add annotations to the import collector 2019-04-03 11:24:03 +03:00
Ilya Kirillov
0610583b80 New J2K: Fix RemoveRedundantExpressionQualifierProcessing 2019-04-03 11:24:02 +03:00
Ilya Kirillov
6f7f516a4f New J2K: Temporary ignore imports & error comments 2019-04-03 11:24:01 +03:00
Ilya Kirillov
bcee73ff01 New J2K: Fix debug tree printer 2019-04-03 11:24:01 +03:00
Ilya Kirillov
b81696947c New J2K: Do not call useless cast on null expression on post processing 2019-04-03 11:24:00 +03:00
Ilya Kirillov
54bd077994 New J2K: Fix type calculating 2019-04-03 11:23:59 +03:00
Ilya Kirillov
658f763887 New J2K: Save unused imports 2019-04-03 11:23:58 +03:00
Ilya Kirillov
a7d2238af4 New J2K: Add IDEA integration of J2k 2019-04-03 11:23:57 +03:00
Ilya Kirillov
a4e3e7abcc New J2K: Add !! when nullability mismatch on post processing 2019-04-03 11:23:56 +03:00
Ilya Kirillov
deb4129a16 New J2K: Add support of diagnostic based inspections on arbitrary PsiElements 2019-04-03 11:23:55 +03:00
Ilya Kirillov
47e722854c New J2K: Remove redundant modifiers in post processing 2019-04-03 11:23:55 +03:00
Ilya Kirillov
7adba40ea2 New J2K: Fix existing test data 2019-04-03 11:23:54 +03:00
Ilya Kirillov
8bd49c147c New J2K: Fix convert getters and setters 2019-04-03 11:23:53 +03:00
Ilya Kirillov
0340c218b9 New J2K: Do not show unknown comment for some kind of type types 2019-04-03 11:23:52 +03:00
Ilya Kirillov
c1ed2e020c New J2K: Fix formatting saving 2019-04-03 11:23:52 +03:00
Ilya Kirillov
13a9a56e85 New J2K: Remove redundant nullability AST conversions due to having them in nullability analyser 2019-04-03 11:23:51 +03:00
Ilya Kirillov
b24ce99097 New J2K: Process fields in modality conversion 2019-04-03 11:23:50 +03:00
Ilya Kirillov
b6625c536d New J2K: Add nullability analysis to post processing 2019-04-03 11:23:50 +03:00
Ilya Kirillov
63d3f90373 New J2K: Fix labeled statement conversion 2019-04-03 11:23:49 +03:00
Ilya Kirillov
0b92b3160f New J2K: Add parenthesis to binary expression in a case of line break before operator 2019-04-03 11:23:48 +03:00
Ilya Kirillov
c20e537b81 New J2K: Preserve comments and line breaks 2019-04-03 11:23:48 +03:00
Ilya Kirillov
b9f8ff9079 New J2K: Rearrange conversions 2019-04-03 11:23:47 +03:00
Ilya Kirillov
4aacb15872 New J2K: Add support of lambda expressions in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:23:46 +03:00
Ilya Kirillov
197fda30e2 New J2K: Implement unimplemented symbol functions 2019-04-03 11:23:46 +03:00
Ilya Kirillov
779dc5c1e2 New J2K: Add RETURN_TYPE_MISMATCH_ON_OVERRIDE to postprocessing 2019-04-03 11:23:45 +03:00
Ilya Kirillov
a1e8d0a6be New J2K: Add Spread operator support 2019-04-03 11:23:44 +03:00
Ilya Kirillov
bf8acc57e3 New J2K: Make all types data classes 2019-04-03 11:23:44 +03:00
Ilya Kirillov
fb6560c1f1 New J2K: Assume parameters when prebuilding symbol provider symbols fro converting declarations 2019-04-03 11:23:43 +03:00
Ilya Kirillov
67a8f445b0 New J2K: Fix provideDirectSymbol in symbol provider fro decompiled declaratiosns 2019-04-03 11:23:42 +03:00
Ilya Kirillov
0456c6a897 New J2K: Make method open only if parent class is open 2019-04-03 11:23:42 +03:00
Ilya Kirillov
269d3f42c6 New J2K: Transfer java method to kotlin function symbol 2019-04-03 11:23:41 +03:00
Ilya Kirillov
cc3564395c New J2K: Promete class to object when init declaration present 2019-04-03 11:23:40 +03:00
Ilya Kirillov
b94ff8af36 New J2K: Clear nullability for methods 2019-04-03 11:23:40 +03:00
Ilya Kirillov
5ae1a819bc New J2K: Add support of Java static init declarations 2019-04-03 11:23:39 +03:00
Ilya Kirillov
ef89a249f2 New J2K: Add FunctionAsAnonymousObjectToLambdaConversion & ReturnStatementInLambdaExpressionConversion conversions 2019-04-03 11:23:38 +03:00
Ilya Kirillov
a659fcd6af New J2K: Move annotations from getters to properties 2019-04-03 11:23:38 +03:00
Ilya Kirillov
1fa0ddcbe8 New J2K: Add qualifiers for static methods, fields & enum consts 2019-04-03 11:23:37 +03:00
Ilya Kirillov
b355572aab New J2K: Add annotation list for JKVariable 2019-04-03 11:23:37 +03:00
Ilya Kirillov
40f5ebb77e New J2K: Fix incorrect imports collecting 2019-04-03 11:23:36 +03:00
Ilya Kirillov
8caf45820c New J2K: Add support of more operations on string conversion 2019-04-03 11:23:35 +03:00
Ilya Kirillov
e39fc53f25 New J2K: Correctly detect varargs argument in annotations & do not throw away named arguments in annotations 2019-04-03 11:23:35 +03:00
Ilya Kirillov
90c12736da New J2K: Convert to data class iff constructor parameter type equals property type 2019-04-03 11:23:34 +03:00
Ilya Kirillov
bcb8742120 New J2K: Add support of named parameters 2019-04-03 11:23:33 +03:00
Ilya Kirillov
ea2081c2f0 New J2K: Fix existing test data 2019-04-03 11:23:33 +03:00
Ilya Kirillov
9c71d5ca25 New J2K: Add repeatable post processing groups 2019-04-03 11:23:32 +03:00
Ilya Kirillov
c827247272 New J2K: Separate new j2k from old j2k 2019-04-03 11:23:31 +03:00
Ilya Kirillov
e6f0a242fd New J2K: Parenthesize qualifier for extension methods in BuiltinMembersConversion 2019-04-03 11:23:31 +03:00
Ilya Kirillov
c111f1c52f New J2K: Cache resolving by fqNames 2019-04-03 11:23:30 +03:00
Ilya Kirillov
ea6cb716e5 New J2K: Move optimize imports invocation out of processings 2019-04-03 11:23:29 +03:00
Ilya Kirillov
f8b8d07621 New J2K: Fix existing test data 2019-04-03 11:23:29 +03:00
Ilya Kirillov
7e30b9e7f5 New J2K: Add support of binary expressions conversion to ImplicitCastsConversion 2019-04-03 11:23:28 +03:00
Ilya Kirillov
208c33a51d New J2K: Add support of prefix expression in ImplicitCastsConversion 2019-04-03 11:23:27 +03:00
Ilya Kirillov
461ef071f4 New J2K: Add AssignmentStatementSplitAlsoConversion 2019-04-03 11:23:26 +03:00
Ilya Kirillov
58fbe7913e New J2K: Use type instead of typeElement to create JKType
because first one can fail on array type
2019-04-03 11:23:25 +03:00
Ilya Kirillov
71780ef442 New J2K: Fix creating expression instead of statement 2019-04-03 11:23:25 +03:00
Ilya Kirillov
4a9ba3c756 New J2K: Do not convert array types to specialized ones in a case of boxed inner type 2019-04-03 11:23:24 +03:00
Ilya Kirillov
7494488edb New J2K: Fix type parameters of JKUnresolvedClassSymbol for new expression 2019-04-03 11:23:23 +03:00
Ilya Kirillov
18e5c1b5f2 New J2K: Fix modality conversion 2019-04-03 11:23:23 +03:00
Ilya Kirillov
936c43d2bc New J2K: Assume specifyLocalVariableTypeByDefault in for loops initializers 2019-04-03 11:23:22 +03:00
Ilya Kirillov
1e7b1f8716 New J2K: Use converter settings values in post processing 2019-04-03 11:23:21 +03:00
Ilya Kirillov
f9a08ad770 New J2K: Add BoxedTypeOperationsConversion 2019-04-03 11:23:21 +03:00
Ilya Kirillov
8b12a9f723 New J2K: Fix support of kotlin method calls 2019-04-03 11:23:20 +03:00
Ilya Kirillov
9a8f8fbfe0 New J2K: Fix KotlinType to JKType conversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
7889756d1a New J2K: Convert type arguments in TypeMappingConversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
d2a4ff172d New J2K: Add Collection.remove conversion 2019-04-03 11:23:18 +03:00
Ilya Kirillov
9fcdb7dde7 New J2K: Fix statement conversion in a case of inner blocks 2019-04-03 11:23:17 +03:00
Ilya Kirillov
d7962afd05 New J2K: Add support of annotation classes 2019-04-03 11:23:17 +03:00
Ilya Kirillov
11f4df8173 New J2K: Add RemoveRedundantCallsOfConversionMethodsIntention post processing 2019-04-03 11:23:16 +03:00
Ilya Kirillov
e4c15c3fb9 New J2K: Fix adding JvmOverloads annotation in DefaultArgumentsConversion 2019-04-03 11:23:15 +03:00
Ilya Kirillov
962b971f07 New J2K: Add conflicts handling in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
e43eb4da03 New J2K: Fix indicesByCollectionSize in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
6c696f6c60 New J2K: Convert tiled prefix operation to inv invocation 2019-04-03 11:23:13 +03:00
Ilya Kirillov
d09e72656a New J2K: Add InterfaceWithFieldConversion 2019-04-03 11:23:12 +03:00
Ilya Kirillov
1d846085de New J2K: Add support of synchronized statement 2019-04-03 11:23:12 +03:00
Ilya Kirillov
0674e6462c New J2K: Fix conversions order 2019-04-03 11:23:11 +03:00
Ilya Kirillov
3c5bb0b259 New J2K: Fix symbols fqNames 2019-04-03 11:23:10 +03:00
Ilya Kirillov
34ca1e1c23 New J2K: Do not print debug trees 2019-04-03 11:23:09 +03:00
Ilya Kirillov
50278058ae New J2K: Fix nullability calculation 2019-04-03 11:23:08 +03:00
Ilya Kirillov
8aa28c0d50 New J2K: Use returnType instead of methodSymbol in operator expressions 2019-04-03 11:23:07 +03:00
Ilya Kirillov
a92c5ebe61 New J2K: Add builtIn operators conversion 2019-04-03 11:23:07 +03:00
Ilya Kirillov
fbcf2e1bcd New J2K: Move equals operator conversion from post processing to AST conversion 2019-04-03 11:23:06 +03:00
Ilya Kirillov
70c700f07a New J2K: Add post processings for removing redundant qualifiers 2019-04-03 11:23:05 +03:00
Ilya Kirillov
d0ba5e7fdf New J2K: Add missing override keyword insertion post processing 2019-04-03 11:23:04 +03:00
Ilya Kirillov
9eaa961a2a New J2K: Add support of deprecated annotation && fix annotations 2019-04-03 11:23:04 +03:00
Ilya Kirillov
3990e1d223 New J2K: Replace conversionContext to symbolProvider in JKExpression.type function 2019-04-03 11:23:03 +03:00
Ilya Kirillov
8df99e54f8 New J2K: Use JKBooleanLiteral for boolean literals 2019-04-03 11:23:02 +03:00
Ilya Kirillov
d3a6b4f12b New J2K: Fix labeled while conversion 2019-04-03 11:23:02 +03:00
Ilya Kirillov
b396ee0cca New J2K: Fix also expression && lambda parameter types 2019-04-03 11:23:01 +03:00
Ilya Kirillov
d56a52fce6 New J2K: Use protected visibility resolution from old j2k 2019-04-03 11:23:00 +03:00
Ilya Kirillov
4c880499fb New J2K: Adapt internal class conversion to old j2k 2019-04-03 11:22:59 +03:00
Ilya Kirillov
d1c1aeed0b New J2K: Fix supertypes constructor calls 2019-04-03 11:22:58 +03:00
Ilya Kirillov
5cdc01621d New J2K: Use parameter initializers as scope for nullability check in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:22:57 +03:00
Ilya Kirillov
53fcf31f23 New J2K: Take parameter in data class iff constructor parameter type is subtype of property type in data class conversion 2019-04-03 11:22:56 +03:00
Ilya Kirillov
fc504c6fdc New J2K: Add ReplacePrimitiveCastWithNumberConversionFix post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
23a42b36b4 New J2K: Add RemoveEmptyPrimaryConstructorIntention post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
d5a3b5644c New J2K: Fix java classes mapped to kotlin ones in post processings 2019-04-03 11:22:54 +03:00
Ilya Kirillov
f603932284 New J2K: Do not merge function definitions whet it is not possible 2019-04-03 11:22:53 +03:00
Ilya Kirillov
46c7cd4b40 New J2K: Fix raw types in new expression 2019-04-03 11:22:52 +03:00
Ilya Kirillov
9b73db4308 New J2K: Add TypeParametersNullabilityConversion 2019-04-03 11:22:52 +03:00
Ilya Kirillov
6dae9da7e2 New J2K: Do not filter default imports 2019-04-03 11:22:51 +03:00
Ilya Kirillov
6e1adf9b6f New J2K: Add JvmOverloads annotation when merging methods 2019-04-03 11:22:50 +03:00
Ilya Kirillov
e232d70b52 New J2K: Add NullableQualifierConversion 2019-04-03 11:22:49 +03:00
Ilya Kirillov
95efc5eecf New J2K: Make annotation's type parameters not null 2019-04-03 11:22:48 +03:00
Ilya Kirillov
211405c034 New J2K: Cleanup code builder 2019-04-03 11:22:47 +03:00
Ilya Kirillov
2d256717ff New J2K: Make JKMethodCallExpression's arguments nullable 2019-04-03 11:22:46 +03:00
Ilya Kirillov
acd8985518 New J2K: Add JetbrainsNullableAnnotationsConverter 2019-04-03 11:22:46 +03:00
Ilya Kirillov
295a160f60 New J2K: Add DefaultNullabilityToNullableConversion 2019-04-03 11:22:45 +03:00
Ilya Kirillov
3d62734cc6 New J2K: Add types to JKExpression.type 2019-04-03 11:22:44 +03:00
Ilya Kirillov
2e353ccf86 New J2K: Use default nullability by default 2019-04-03 11:22:44 +03:00
Ilya Kirillov
f3cb76ff56 New J2K: Fix TypeMappingConversion 2019-04-03 11:22:43 +03:00
Ilya Kirillov
6b889bdf57 New J2K: Add ImplicitCastsConversion 2019-04-03 11:22:42 +03:00
Ilya Kirillov
2d37a2b28e New J2K: Fix type arguments for new expression 2019-04-03 11:22:41 +03:00
Ilya Kirillov
de26e2cfe7 New J2K: Add escaping of class symbol names in code builder 2019-04-03 11:22:40 +03:00
Ilya Kirillov
11da99a1d0 New J2K: Use binaryExpression instead of operatorExpression 2019-04-03 11:22:40 +03:00
Ilya Kirillov
84ad58b50b New J2K: Move literal conversion internals to expression.kt 2019-04-03 11:22:39 +03:00
Ilya Kirillov
60d498cedc New J2K: Add !! postfix expression support 2019-04-03 11:22:38 +03:00
Ilya Kirillov
a529dcce4c New J2K: Add charAt conversion to StringMethodsConversion 2019-04-03 11:22:37 +03:00
Ilya Kirillov
7dbe16d305 New J2K: Make polyadic expression converter to resolve real operator type 2019-04-03 11:22:36 +03:00
Ilya Kirillov
841cd9c749 New J2K: Do not remove redundant nullability in post precessing for variable if initializer is nullable 2019-04-03 11:22:36 +03:00
Ilya Kirillov
bbbadb0431 New J2K: Add support of vararg parameters in method declaration 2019-04-03 11:22:35 +03:00
Ilya Kirillov
6fbc180f92 New J2K: Do not create new line after each local declaration 2019-04-03 11:22:34 +03:00
Ilya Kirillov
51ee64a757 New J2K: Add java void type to JKClassLiteralExpression & make all inner types of JKClassLiteralExpression's classType to be notNull 2019-04-03 11:22:34 +03:00
Ilya Kirillov
5e6e5bcf8c New J2K: Fix modifiers of local class 2019-04-03 11:22:33 +03:00
Ilya Kirillov
ec1bc35df7 New J2K: Use real method symbols in ArrayInitializerConversion 2019-04-03 11:22:32 +03:00
Ilya Kirillov
71b194d0d6 New J2K: Get rid of JKUnresolvedClassType and use JKClassType(JKUnresolvedClassSymbol) instead 2019-04-03 11:22:31 +03:00
Ilya Kirillov
325eec2454 New J2K: Replace java instanceof with kotlin is expression 2019-04-03 11:22:31 +03:00
Ilya Kirillov
eda99a588d New J2K: Fix declarations creation 2019-04-03 11:22:30 +03:00
Ilya Kirillov
0feaad2205 New J2K: Fix enum constant symbol 2019-04-03 11:22:29 +03:00
Ilya Kirillov
1c4e811717 New J2K: Fix symbol's fqName 2019-04-03 11:22:29 +03:00
Ilya Kirillov
7c04590d82 New J2K: Fix method call expression printing 2019-04-03 11:22:28 +03:00
Ilya Kirillov
5fc9ca8fc7 New J2K: Add resolving for kotlin properties and object members calls 2019-04-03 11:22:27 +03:00
Ilya Kirillov
db8beab499 New J2K: Fix NPE in a case of unresolved symbols 2019-04-03 11:22:27 +03:00
Ilya Kirillov
410000f94c New J2K: Fix types for kotlin properties 2019-04-03 11:22:26 +03:00
Ilya Kirillov
667ead10a3 New J2K: Add finalize & clone to JavaStandartMethodsConversion 2019-04-03 11:22:25 +03:00
Ilya Kirillov
12fe096b82 New J2K: Fix class inheritance info 2019-04-03 11:22:25 +03:00
Ilya Kirillov
ad58772453 New J2K: Use IDEA analyzers on kotlin properties & functions 2019-04-03 11:22:24 +03:00
Ilya Kirillov
cc2f27f9cd New J2K: Add string.length conversion 2019-04-03 11:22:23 +03:00
Ilya Kirillov
9704a7aa7f New J2K: Add ReplaceCallWithBinaryOperatorInspection & MayBeConstantInspection to postProcessing 2019-04-03 11:22:22 +03:00
Ilya Kirillov
b7d6a905f3 New J2K: Fix extra spaces in StructuralPsiCompare 2019-04-03 11:22:22 +03:00
Ilya Kirillov
2c8483aef4 New J2K: Rearrange conversions & add new ones 2019-04-03 11:22:21 +03:00
Ilya Kirillov
7dd60a04ec New J2K: Add EnumClassConversion 2019-04-03 11:22:20 +03:00
Ilya Kirillov
17b96b8240 New J2K: Fix printing no semicolon in enum class 2019-04-03 11:22:19 +03:00
Ilya Kirillov
dcf7895314 New J2K: Make JKKtAssignmentStatementImpl field to be a child of JKBranchElement 2019-04-03 11:22:18 +03:00
Ilya Kirillov
56aa6f83af New J2K: Assume enum class in PrimaryConstructorDetectConversion 2019-04-03 11:22:18 +03:00
Ilya Kirillov
d02be5ae94 New J2K: Create init declaration from primary constructor in PrimaryConstructorDetectConversion 2019-04-03 11:22:17 +03:00
Ilya Kirillov
8ceca44b10 New J2K: Remove useless FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:22:16 +03:00
Ilya Kirillov
757675c4ca New J2K: Make JKType.updateNullability return the same type 2019-04-03 11:22:15 +03:00
Ilya Kirillov
104cf2eef5 New J2K: Add NATIVE to EXTERNAL modifiers conversion 2019-04-03 11:22:15 +03:00
Ilya Kirillov
5cb4abf95d New J2K: Add JavaStandardMethodsConversion 2019-04-03 11:22:14 +03:00
Ilya Kirillov
cd6bcb7878 New J2K: Assume that is expression type is always not null 2019-04-03 11:22:13 +03:00
Ilya Kirillov
1615b1c6b3 New J2K: Add support of Anonymous class initializers 2019-04-03 11:22:13 +03:00
Ilya Kirillov
be90db7fca New J2K: Add ParameterModificationInMethodCallsConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
aa173783aa New J2K: Add check that field is not initialized in constructor in ImplicitInitializerConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
730c8ca495 New J2K: Fix java assignment to also conversion 2019-04-03 11:22:11 +03:00
Ilya Kirillov
4194ace762 New J2K: Add super expression qualifier 2019-04-03 11:22:10 +03:00
Ilya Kirillov
d75549f443 New J2K: Fix grouping post processing 2019-04-03 11:22:09 +03:00
Ilya Kirillov
763ea3480d New J2K: Add support of enum consts initializingClass 2019-04-03 11:22:09 +03:00
Ilya Kirillov
49a8a8f116 New J2K: Add support of grouped postProcessings & introduce VarToVal inspection 2019-04-03 11:22:08 +03:00
Ilya Kirillov
c7df104b36 New J2K: Add ConvertDataClass PostProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
5c8035b339 New J2K: Add ConvertGettersAndSetters postProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
daf1f6154e New J2K: Add more types to JKExpression.type 2019-04-03 11:22:06 +03:00
Ilya Kirillov
d47543820a New J2K: Add collection classes mapping to TypeMappingConversion 2019-04-03 11:22:05 +03:00
Ilya Kirillov
df5c2f90c1 New J2K: Add basic import list mapping 2019-04-03 11:22:04 +03:00
Ilya Kirillov
213aa9a86d New J2K: Add annotations for JKField 2019-04-03 11:22:03 +03:00
Ilya Kirillov
2633834741 New J2K: Add conversion of some java modifiers to kotlin annotations 2019-04-03 11:22:03 +03:00
Ilya Kirillov
0e6e0e6df1 New J2K: Stop printing multiline lambdas in a case of single statement inside 2019-04-03 11:22:02 +03:00
Ilya Kirillov
0712db8bd3 New J2K: Add filtering local imports in ImportStatementConversion 2019-04-03 11:22:02 +03:00
Ilya Kirillov
d4077a1622 New J2K: Add boxed types support to PrimitiveTypesInitializersConversion 2019-04-03 11:22:01 +03:00
Ilya Kirillov
f14aa2292f New J2K: Implement primitive type case for ImplicitInitializerConversion 2019-04-03 11:22:00 +03:00
Ilya Kirillov
fb3c7e87a1 New J2K: Fix binaryExpressionMethodSymbol in a case of not JKMultiverseKtClassSymbol 2019-04-03 11:21:59 +03:00
Ilya Kirillov
2c7e44f41e New J2K: Add checking for receiver type in for conversion's indicesByCollectionSize 2019-04-03 11:21:59 +03:00
Ilya Kirillov
ffbdafbe69 New J2K: Add LowerNullabilityInFunctionParametersConversion 2019-04-03 11:21:58 +03:00
Ilya Kirillov
a15f51950b New J2K: Add collection operations conversion 2019-04-03 11:21:57 +03:00
Ilya Kirillov
254d2f8b67 New J2K: Fix JKType.toKtType function 2019-04-03 11:21:57 +03:00
Ilya Kirillov
77eb9b1b37 New J2K: Fix if statement printing with empty then body 2019-04-03 11:21:55 +03:00
Ilya Kirillov
b21c52aecd New J2K: Fix JKClassSymbol's name printing in a case of nested class 2019-04-03 11:21:54 +03:00
Ilya Kirillov
599aa9435f New J2K: Move postProcessingRegistrar to a NewJ2KPostProcessingRegistrarImpl and revert old one 2019-04-03 11:21:54 +03:00
Ilya Kirillov
a80a30e0af New J2K: Fix that RemoveExplicitPropertyType does not work on local variables 2019-04-03 11:21:53 +03:00
Ilya Kirillov
a5b7831773 New J2K: Add array operation conversion 2019-04-03 11:21:52 +03:00
Ilya Kirillov
1faaada01f New J2K: Add import statement conversion 2019-04-03 11:21:51 +03:00
Ilya Kirillov
a19ae4bcc2 New J2K: Fix accessing to non-existing psi in TypeMappingConversion 2019-04-03 11:21:50 +03:00
Ilya Kirillov
17f86d69a7 New J2K: Calculate function return type nullability in JavaMethodToKotlinFunctionConversion 2019-04-03 11:21:49 +03:00
Ilya Kirillov
b076e7e881 New J2K: Fix for conversion due to changing modifier types 2019-04-03 11:21:48 +03:00
Ilya Kirillov
70225ac3d0 New J2K: Fix class access expression fq name when it starts with b "java.lang." 2019-04-03 11:21:47 +03:00
Ilya Kirillov
4a16f4cc9f New J2K: Fix multiple update expressions in psi for statements 2019-04-03 11:21:46 +03:00
Ilya Kirillov
f6f619ea27 New J2K: Add blockStatementWithoutBrackets to for statement conversion 2019-04-03 11:21:46 +03:00
Ilya Kirillov
03131dc138 New J2K: Add JKBlockStatementWithoutBrackets 2019-04-03 11:21:45 +03:00
Ilya Kirillov
4b0840beb1 New J2K: Add multiple updaters to Java for loop 2019-04-03 11:21:43 +03:00
Ilya Kirillov
9532dec452 New J2K: Make JKExpression.type nullable 2019-04-03 11:21:42 +03:00
Ilya Kirillov
28aeaa040e New J2K: Split conversions to Java --> Kotlin conversions and Kotlin --> Kotlin conversions 2019-04-03 11:21:41 +03:00
Ilya Kirillov
67c6192425 New J2K: Remove unused symbolByName 2019-04-03 11:21:40 +03:00
Ilya Kirillov
2c3e8a3909 New J2K: Add print conversion to PrintlnConversion 2019-04-03 11:21:40 +03:00
Ilya Kirillov
71fcbcb60a New J2K: Change type of JKType.classSymbol to JKClassSymbol 2019-04-03 11:21:39 +03:00
Ilya Kirillov
2292e0b792 New J2K: Fix enum constant constructing 2019-04-03 11:21:38 +03:00
Ilya Kirillov
b3dc0d4aff New J2K: Add package & imports declarations to JKFile, simplify JKFile constructing 2019-04-03 11:21:37 +03:00
Ilya Kirillov
3ea4ee9110 New J2K: Add throws list for java method & add JKClassLiteralExpression 2019-04-03 11:21:36 +03:00
Ilya Kirillov
69633e7a0f New J2K: Split ModifiersList to visibilityModifier, modalityModifier, mutabilityModifier and extraModifiers & introduce JKVariable which may have any subset of modifiers 2019-04-03 11:21:35 +03:00
Ilya Kirillov
5c6092c98c New J2K: Add mangling of name identifiers 2019-04-03 11:21:34 +03:00
Ilya Kirillov
0e9abf8ca3 New J2K: Add assert statement conversion 2019-04-03 11:21:33 +03:00
Ilya Kirillov
633c29a2de New J2K: Fix when final fields become vars 2019-04-03 11:21:33 +03:00
Ilya Kirillov
8ba8a2f197 New J2K: Fix binary expression's method symbol search 2019-04-03 11:21:32 +03:00
Ilya Kirillov
bb2c32a402 New J2K: Fix package statement position 2019-04-03 11:21:31 +03:00
Ilya Kirillov
e1108e1764 New J2K: Add anonymous object creation support JKNewExpression 2019-04-03 11:21:30 +03:00
Ilya Kirillov
f58d791a05 New J2K: Introduce type arguments 2019-04-03 11:21:29 +03:00
Ilya Kirillov
40c5b56c10 New J2K: Refactor brackets in new expression printing 2019-04-03 11:21:28 +03:00
Ilya Kirillov
a30311da45 New J2K: Add dummy field to property conversion 2019-04-03 11:21:27 +03:00
Ilya Kirillov
e0ac21c4ad New J2K: Collect and print imports 2019-04-03 11:21:27 +03:00
Ilya Kirillov
c6006927ac New J2K: Add optimize import to post processing 2019-04-03 11:21:26 +03:00
Ilya Kirillov
8f960f2f47 New J2K: Fix do while loop spaces 2019-04-03 11:21:25 +03:00
Ilya Kirillov
b24d683ebe New J2K: Make JKJavaNewArrayImpl a PsiOwner 2019-04-03 11:21:24 +03:00
Ilya Kirillov
a1600bd83a New J2K: Add ForIn statement conversion 2019-04-03 11:21:23 +03:00
Ilya Kirillov
a0ab7492a8 New J2K: Add JavaTokenType.EXCL token to JKJavaOperatorToken.toKtToken() 2019-04-03 11:21:23 +03:00
Ilya Kirillov
bcaea3182e New J2K: Fix JKStatement.isEmpty method by not considering empty block statement as empty statement 2019-04-03 11:21:22 +03:00
Ilya Kirillov
f223a6ebd1 New J2K: Use default psiContext in AssignmentAsExpressionToAlsoConversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
28ef4c5dfa New J2K: Main function conversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
2f1a8831b2 New J2K: Add basic annotations support 2019-04-03 11:21:20 +03:00
Ilya Kirillov
f752796408 New J2K: Fix existing test data 2019-04-03 11:21:19 +03:00
Ilya Kirillov
5236858c20 New J2K: Add JKThrowStatement and JKContinueStatement to SwitchStatementConversion's falls fallsThrough() 2019-04-03 11:21:19 +03:00
Ilya Kirillov
42dc96d9a8 New J2K: Fix switch statement cases printing 2019-04-03 11:21:17 +03:00
Ilya Kirillov
3ea1a937c0 New J2K: Place else case in the end in switch statement conversion 2019-04-03 11:21:16 +03:00
Ilya Kirillov
115fe2cb88 New J2K: Fix statements in lambda expression 2019-04-03 11:21:15 +03:00
Ilya Kirillov
136a254da5 New J2K: Fix showing ":" in type parameter type 2019-04-03 11:21:14 +03:00
Ilya Kirillov
4080804391 New J2K: Add JKPackageDeclaration 2019-04-03 11:21:14 +03:00
Ilya Kirillov
2b6ac84dda New J2K: Add qualified label to JKThisExpression 2019-04-03 11:21:13 +03:00
Ilya Kirillov
71408c0b14 New J2K: Fix class modifiers conversion 2019-04-03 11:21:12 +03:00
Ilya Kirillov
eb0182c5a9 New J2K: Remove extra JKKtModifier.INTERNAL because there is already JKVisibilityModifier.INTERNAL 2019-04-03 11:21:11 +03:00
Ilya Kirillov
4f30283744 New J2K: Add printing of JKClassAccessExpression 2019-04-03 11:21:11 +03:00
Ilya Kirillov
2d9a9613f6 New J2K: Fix conversion of inner classed methods 2019-04-03 11:21:10 +03:00
Ilya Kirillov
f76a3504cc New J2K: Inherit JKBinaryExpression & JKUnaryExpression from JKOperatorExpression 2019-04-03 11:21:09 +03:00
Ilya Kirillov
9374816823 New J2K: Add conversion of prefix and postfix expressions 2019-04-03 11:21:08 +03:00
Ilya Kirillov
3d418d8904 New J2K: Add == to JKJavaOperatorToken.toKtToken 2019-04-03 11:21:07 +03:00
Ilya Kirillov
4310575de9 New J2K: Add ';' in a case of For loop and While loop empty body 2019-04-03 11:21:07 +03:00
Ilya Kirillov
3ddc05fdd9 New J2K: Add forEach statement generation 2019-04-03 11:21:06 +03:00
Ilya Kirillov
7b5ffce7aa New J2K: Separate statements in block 2019-04-03 11:21:05 +03:00
Ilya Kirillov
9a1e5582b6 New J2K: Render list separator as function 2019-04-03 11:21:04 +03:00
Ilya Kirillov
7af03c2859 New J2K: Set exception types as non nullable in try statement conversion 2019-04-03 11:21:04 +03:00
Ilya Kirillov
3771ccedb7 New J2K: Add JKType.updateNullability function 2019-04-03 11:21:03 +03:00
Ilya Kirillov
2e0c7e9128 New J2K: Fix spaces in structural tests 2019-04-03 11:21:02 +03:00
Ilya Kirillov
61d6709cb7 New J2K: Add temporary sorting of class declarations 2019-04-03 11:21:01 +03:00
Ilya Kirillov
03df0f1164 New J2K: Add default mutability to property in FieldToPropertyConversion 2019-04-03 11:21:01 +03:00
Ilya Kirillov
0873045718 New J2K: Print & filter primary constructor modifiers 2019-04-03 11:20:59 +03:00
Ilya Kirillov
7e7d865054 New J2K: Add enum constants 2019-04-03 11:20:59 +03:00
Ilya Kirillov
ff700b5399 New J2K: Add TypeElement.present() function 2019-04-03 11:20:58 +03:00
Ilya Kirillov
77713c1877 New J2K: Add NoType for ktProperty 2019-04-03 11:20:57 +03:00
Ilya Kirillov
a55d2b6597 New J2K: Add missing modifier priorities 2019-04-03 11:20:57 +03:00
Ilya Kirillov
55c304827a New J2K: Do not convert class to object in ClassToObjectPromotionConversion when it has inheritors 2019-04-03 11:20:56 +03:00
Ilya Kirillov
70def791c0 New J2K: Fix ClassToObjectPromotionConversion when empty constructor 2019-04-03 11:20:56 +03:00
Ilya Kirillov
44185c1246 New J2K: Fix adding init section with empty body 2019-04-03 11:20:55 +03:00
Ilya Kirillov
6a8f3a7a84 New J2K: Fix println's in printer 2019-04-03 11:20:55 +03:00
Ilya Kirillov
0bc1e96f0d New J2K: Add type parameter type 2019-04-03 11:20:54 +03:00
Ilya Kirillov
524b07f6ac New J2K: Add variance type parameters 2019-04-03 11:20:53 +03:00
Ilya Kirillov
14f5d866ee New J2K: Add type parameters to methods declaration 2019-04-03 11:20:53 +03:00
Ilya Kirillov
4097ebe583 New J2K: Add typeParameter's upper bounds 2019-04-03 11:20:52 +03:00
Ilya Kirillov
33b66ec17e New J2K: Add typeParameters to JKClass 2019-04-03 11:20:51 +03:00
Ilya Kirillov
1f59f91aeb New J2K: Add typeParameter & typeParameterList 2019-04-03 11:20:50 +03:00
Ilya Kirillov
b9d432bfac New J2K: Call RemoveEmptyClassBodyIntention 2019-04-03 11:20:49 +03:00
Ilya Kirillov
ba08f233b6 New J2K: Try with resource conversion 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d602b9e47 New J2K: Add "use" expression generator 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d45bce06a New J2K: Add try statement 2019-04-03 11:20:47 +03:00
Ilya Kirillov
594d0ba7e9 New J2K: Add throw statement 2019-04-03 11:20:46 +03:00
Ilya Kirillov
66f12d9fea New J2K: Do not print extra mutability modifier in ktProperty 2019-04-03 11:20:45 +03:00
Ilya Kirillov
5ba3d6bc67 New J2K: Fix parameters modifiers 2019-04-03 11:20:45 +03:00
Ilya Kirillov
9e98e36ac7 New J2K: Use RecursiveApplicableConversionBase in FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:20:44 +03:00
Ilya Kirillov
78c5b4acd5 New J2K: Add JKEmptyStatement 2019-04-03 11:20:43 +03:00
Ilya Kirillov
e10a81a942 New J2K: Use JKDeclaration instead of ValIdentifier in ForLoop 2019-04-03 11:20:43 +03:00
Ilya Kirillov
d228d6110c New J2K: Move expression creation functions to separated file 2019-04-03 11:20:42 +03:00
Ilya Kirillov
fad9c52853 New J2K: Add type calculating for equals operator 2019-04-03 11:20:41 +03:00
Ilya Kirillov
a1ac0c2e4b New J2K: Fix for conversion due to using operator tokens 2019-04-03 11:20:41 +03:00
Ilya Kirillov
1851239e7e New J2K: Add JKElement.detached function 2019-04-03 11:20:40 +03:00
Ilya Kirillov
753070b6c7 New J2K: Refactor code 2019-04-03 11:20:39 +03:00
Ilya Kirillov
3030a03584 New J2K: Replace backAnnotator with PsiOwner 2019-04-03 11:20:38 +03:00
Ilya Kirillov
c948e2d086 New J2K: Fix operatorName in JKKtSingleValueOperatorToken 2019-04-03 11:20:37 +03:00
Ilya Kirillov
6051b455bf New J2K: Add type for unresolved symbols 2019-04-03 11:20:36 +03:00
Ilya Kirillov
41640e1a15 New J2K: Add dependency to idea-core in j2k 2019-04-03 11:20:36 +03:00
Ilya Kirillov
29c536579f New J2K: Add converting type functions from kotlin one to j2k one 2019-04-03 11:20:35 +03:00
Ilya Kirillov
dbdd39c6ab New J2K: Add type calculating for more kinds of JKExpressions 2019-04-03 11:20:34 +03:00
Ilya Kirillov
71b3fe33a3 New J2K: Add operator tokens 2019-04-03 11:20:33 +03:00
Ilya Kirillov
cd2a17ae56 New J2K: Add calculating type for binary expressions & building binary expression with correct return type 2019-04-03 11:20:32 +03:00
Ilya Kirillov
5e4b39f10f New J2K: Add calculating type for JKExpression 2019-04-03 11:20:32 +03:00
Ilya Kirillov
27526cf866 New J2K: Add labeled statement 2019-04-03 11:20:31 +03:00
Ilya Kirillov
0a08467b45 New J2K: Add continue statement 2019-04-03 11:20:30 +03:00
Ilya Kirillov
ed61aac4fd New J2K: Add Java for loop to Kotlin while or for in loop conversion 2019-04-03 11:20:29 +03:00
Ilya Kirillov
07f99fe0d2 New J2K: Don't move initilizer to constructor if types are not the same 2019-04-03 11:20:29 +03:00
Ilya Kirillov
baa9b714d1 New J2K: Add init block 2019-04-03 11:20:28 +03:00
Ilya Kirillov
b6239a9130 New J2K: Fix InsertDefaultPrimaryConstructorConversion acceptability determining 2019-04-03 11:20:27 +03:00
Ilya Kirillov
d688b6c6da New J2K: Add filter & sort modifiers conversion 2019-04-03 11:20:26 +03:00
Ilya Kirillov
a7e0f18a57 New J2K: Add primary constructor initializers conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
2aafeda33b New J2K: Add detect primary constructors conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
44d2a6f432 New J2K: Add printing of Java new expression 2019-04-03 11:20:24 +03:00
Ilya Kirillov
6d283b0ac1 New J2K: Add operation's text for some java operators 2019-04-03 11:20:23 +03:00
Ilya Kirillov
451a462b07 New J2K: Add printing of do-while statement 2019-04-03 11:20:22 +03:00
Ilya Kirillov
19c569e8e2 New J2K: Add conversion of Java instanceof expression to Kotlin is expression 2019-04-03 11:20:21 +03:00
Ilya Kirillov
c3ffaa34f8 New J2K: Do not ignore unused vals in CanBeVal inspection in postprocessing 2019-04-03 11:20:20 +03:00
Ilya Kirillov
4d1b2a8d5b New J2K: Add Java switch statement to Kotlin when expression conversion 2019-04-03 11:20:20 +03:00
Ilya Kirillov
6e079e38fe New J2K: Add AST copy tree function 2019-04-03 11:20:19 +03:00
Ilya Kirillov
18164b116b New J2K: Add support of break statements 2019-04-03 11:20:18 +03:00
Simon Ogorodnik
7e2d0695fe New J2K: Use context type for lambda in block to run call conversion 2019-04-03 11:20:18 +03:00
Dimach
2f1c621b5f New J2K: Improve type system and nullability computation in type mapper 2019-04-03 11:20:17 +03:00
Dimach
abc4104ba7 New J2K: Implement Array init conversions 2019-04-03 11:20:17 +03:00
Dimach
f3ffb2acfd New J2K: Implement assignment simplify conversion 2019-04-03 11:20:16 +03:00
Simon Ogorodnik
77819be8f3 New J2K: Add function to lookup symbols by fqName 2019-04-03 11:20:15 +03:00
Dimach
c43bfcb185 New J2K: Introduce context type 2019-04-03 11:20:14 +03:00
Simon Ogorodnik
986b38102e New J2K: Add insert default constructor conversion 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
aef8a7a8f1 New J2K: Clearer return type for recurse 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
6fd2cc73cf New J2K: Remove incorrect ClassKind 2019-04-03 11:20:12 +03:00
Simon Ogorodnik
815070013f New J2K: Split conversions into sequential and batch 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
d793769e92 New J2K: Add block statement to run conversion 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
f496a472f4 New J2K: Even better test diff UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
15981fed17 New J2K: Improve UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
3dbdb2b64d New J2K: Support 'override' modality 2019-04-03 11:20:09 +03:00
Simon Ogorodnik
dcffb60dc9 New J2K: Create UI for tracking test changes 2019-04-03 11:20:08 +03:00
Simon Ogorodnik
e0d3ff7507 New J2K: WIP: Field to property conversion 2019-04-03 11:20:07 +03:00
Simon Ogorodnik
dbf4ba536f New J2K: Implement removing of explicit types in post-processing 2019-04-03 11:20:06 +03:00
Simon Ogorodnik
1c1804f22d New J2K: Fix after merge 2019-04-03 11:20:05 +03:00
Simon Ogorodnik
2844f8d5d9 New J2K: Add conversion to promote classes with only companions into objects 2019-04-03 11:20:04 +03:00
Simon Ogorodnik
fba5ac4c1a New J2K: Post-processing to remove redundant opens in objects 2019-04-03 11:20:03 +03:00
Simon Ogorodnik
ae1f27e327 New J2K: Add conversion that moves statics to companion object 2019-04-03 11:20:02 +03:00
Simon Ogorodnik
38760a8b7c New J2K: Support this qualifier in default arguments converter 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
b868214992 New J2K: Improve debug tree printer, now it capable of printing universe symbols 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
53ebdb4a02 New J2K: Add missing accept for NameIdentifier 2019-04-03 11:20:00 +03:00
Simon Ogorodnik
4eb070a2dc New J2K: Support QuickFixActionBase for inspections in J2K Post-processing 2019-04-03 11:19:59 +03:00
Simon Ogorodnik
bc5ff67aff New J2K: Correctly support variables mutability 2019-04-03 11:19:58 +03:00
Simon Ogorodnik
f147907799 New J2K: Fix incorrect testData (due to nullability bug in old j2k) 2019-04-03 11:19:57 +03:00
Simon Ogorodnik
b530a30882 New J2K: Support different testData for new converter
Sometimes old testData is incorrect
2019-04-03 11:19:56 +03:00
Simon Ogorodnik
800b09b183 New J2K: Add temporary conversion for println calls 2019-04-03 11:19:56 +03:00
Simon Ogorodnik
911f234ba4 New J2K: Implement basic default argument converter 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
34b535c8ab New J2K: Add missing accept for null literal 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
4637903e00 New J2K: Add conversion which will initialize java implicit initialized fields 2019-04-03 11:19:54 +03:00
Simon Ogorodnik
61fd76a89a New J2K: Support relaxed visibility for members of package-local classes 2019-04-03 11:19:53 +03:00
Simon Ogorodnik
1b7c980c83 New J2K: Put braces on same line, if block is empty 2019-04-03 11:19:52 +03:00
Simon Ogorodnik
63fd2439bf New J2K: Hack around type nullability calculation 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
65e0694ba1 New J2K: Primary constructor conversion 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
6793c1d08f New J2K: Constructor conversion 2019-04-03 11:19:50 +03:00
Simon Ogorodnik
e83844e941 New J2K: Inner class conversion 2019-04-03 11:19:49 +03:00
Simon Ogorodnik
c87cd20a9d New J2K: Add rendering for type-parameters 2019-04-03 11:19:48 +03:00
Simon Ogorodnik
b12a91c111 New J2K: Add test with structural compare and cleanup duplicated code in tests 2019-04-03 11:19:47 +03:00
Simon Ogorodnik
ac20e9ba83 New J2K: Render list of implemented correctly 2019-04-03 11:19:46 +03:00
Simon Ogorodnik
b8bbd85bc7 New J2K: Preserve text for unresolved types, and render it in code builder 2019-04-03 11:19:45 +03:00
Simon Ogorodnik
7e2be15fcc New J2K: Clean-up parenthesizing and block rendering in code builder 2019-04-03 11:19:44 +03:00
Simon Ogorodnik
07a33ceebd New J2K: Remove unnecessary modifiers in post-processing 2019-04-03 11:19:43 +03:00
Simon Ogorodnik
13a63e421b New J2K: Print function modifiers and relax method visibility in test 2019-04-03 11:19:43 +03:00
Dimach
fe180138f3 New J2K: Assignment conversion second part. 2019-04-03 11:19:42 +03:00
Dimach
3a2b2d9e97 New J2K: Assignment expression conversion improvements 2019-04-03 11:19:41 +03:00
Simon Ogorodnik
b702e207c0 New J2K: Add inheritance and support while & type-casts in code builder 2019-04-03 11:19:40 +03:00
Simon Ogorodnik
928647462e New J2K: Support general inspections with intention wrapper as quickFix 2019-04-03 11:19:39 +03:00
Simon Ogorodnik
c41be3274e New J2K: Cleanup code generation 2019-04-03 11:19:38 +03:00
Simon Ogorodnik
2e7940149f New J2K: Break line after class def 2019-04-03 11:19:37 +03:00
Simon Ogorodnik
049bb4a8af New J2K: Don't add abstract if not class 2019-04-03 11:19:37 +03:00
Dimach
d73b006b18 New J2K: Lambda expressions. 2019-04-03 11:19:36 +03:00
Dimach
795bfa4b2f New J2K: Fix array assignment. 2019-04-03 11:19:35 +03:00
Dimach
4a0df846de New J2K: Some changes to assignment expression. 2019-04-03 11:19:34 +03:00
Dimach
0078a5a61b New J2K: Symbol provider refactor. 2019-04-03 11:19:33 +03:00
Dimach
e1f47823d4 New J2K: Array access expression. 2019-04-03 11:19:32 +03:00
Dimach
81c0dae139 New J2K: Polyadic expression conversion. 2019-04-03 11:19:31 +03:00
Dimach
15ad2af268 New J2K: More binary expressions support and boolean literals. 2019-04-03 11:19:30 +03:00
Dimach
d183285a75 New J2K: Added unresolved field references. 2019-04-03 11:19:29 +03:00
Simon Ogorodnik
f6a5ac9d97 New J2K: Standardize modality and visibility 2019-04-03 11:19:28 +03:00
Simon Ogorodnik
0ec2fb3d17 New J2K: Introduce JKFile 2019-04-03 11:19:27 +03:00
Simon Ogorodnik
e4fc4b8218 New J2K: Create services for new j2k 2019-04-03 11:19:26 +03:00
Simon Ogorodnik
9d3805defe New J2K: Apply post-processing to nj2k results 2019-04-03 11:19:25 +03:00
Simon Ogorodnik
b216574298 New J2K: Support general inspections in j2k post-processing 2019-04-03 11:19:24 +03:00
Simon Ogorodnik
ccb941ab1c New J2K: Fix type mapper 2019-04-03 11:19:23 +03:00
Simon Ogorodnik
279c835d04 New J2K: Fix nullability for converted primitive types 2019-04-03 11:19:22 +03:00
Dimach
72c88c9003 New J2K: Reference resolve for parameters. 2019-04-03 11:19:22 +03:00
Dimach
6f84750af4 New J2K: Fixed resolve of class reference. 2019-04-03 11:19:21 +03:00
Dimach
97e38615f1 New J2K: Correct resolve of local variables. 2019-04-03 11:19:20 +03:00
Dimach
485f5c7e37 New J2K: Binary expression conversion 2019-04-03 11:19:19 +03:00
Dimach
674b3ce02e New J2K: Fixed modifiers conversion, expression test now can pass. 2019-04-03 11:19:18 +03:00
Dimach
b33f5ec58f New J2K: Fixed wrong whitespace 2019-04-03 11:19:18 +03:00
Dimach
8430ada13b New J2K: Fixed few bugs in conversions and symbols improvements. 2019-04-03 11:19:17 +03:00
Dimach
39cf373286 New J2K: Operators translation. 2019-04-03 11:19:16 +03:00
Dimach
21ae28025c New J2K: Declaration statement and local variables. 2019-04-03 11:19:16 +03:00
Dimach
14dd4fc92f New J2K: Added modifiers conversion and correct resolve of void type. 2019-04-03 11:19:15 +03:00
Dimach
ab723b1d39 New J2K: Added more cases to code builder. 2019-04-03 11:19:14 +03:00
Dimach
b06f0fe848 New J2K: Code builder now VoidVisitor 2019-04-03 11:19:14 +03:00
Dimach
8ce3673aaf New J2K: Fixed array initializer 2019-04-03 11:19:13 +03:00
Dimach
6096b1fd56 New J2K: Java polyadic expression 2019-04-03 11:19:13 +03:00
Dimach
4fe9b6a7c6 New J2K: If expression improvements.
Fixed field resolve.
2019-04-03 11:19:12 +03:00
Simon Ogorodnik
986cb5be27 New J2K: Add more elements to code builder 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
a9ff38f1fa New J2K: Rename parameters to match supertype 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
7fcdcb20d6 New J2K: Some code-builder basic stuff 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
ad0721aae7 New J2K: Extract fqName resolution 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
00c52df519 New J2K: Add missing accept's 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
235dacfd88 New J2K: Copy return type 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
caa4af07c1 New J2K: Fix crash in fqName resolution 2019-04-03 11:19:08 +03:00
Simon Ogorodnik
2c2bd9ab5a New J2K: Support all java operators 2019-04-03 11:19:07 +03:00
Dimach
6dc8933a93 New J2K: While, switch, conditional expression, moved if. 2019-04-03 11:19:07 +03:00
Simon Ogorodnik
d718fae6d9 New J2K: Deal with unresolved class types 2019-04-03 11:19:06 +03:00
Simon Ogorodnik
c53f56629e New J2K: Correctly resolve references to default constructor 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
0e2dac0899 New J2K: Add nullability to all types 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
58de0ae6bc New J2K: Always use text for literals 2019-04-03 11:19:04 +03:00
Dimach
7fbff168dd New J2K: Symbol provider improvements. 2019-04-03 11:19:03 +03:00
Dimach
45eecf2c90 New J2K: Added this and super expressions. 2019-04-03 11:19:02 +03:00
Dimach
a1d37034c4 New J2K: If, for, instanceof, code block statement. 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
607d9820e7 New J2K: Add body stub for abstract methods & set return type to void for <init> 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
cb4474b9a4 New J2K: Add literal conversion 2019-04-03 11:19:00 +03:00
Simon Ogorodnik
c84ecb162e New J2K: Extract common conversions logic to base class 2019-04-03 11:18:59 +03:00
Dimach
003cee8cc1 New J2K: Added assertion statement and more operators. 2019-04-03 11:18:59 +03:00
Dimach
3bbef363e6 New J2K: Added declaration statements, local variables and stub expression. 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
26c011b44a New J2K: Add todo about missing lambda expression element 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
a5f0097dc7 New J2K: Add conversion for assignment as expression to also call 2019-04-03 11:18:57 +03:00
Simon Ogorodnik
fd69efa4c2 New J2K: Add missing literals and cleanup literal handling in tree builder 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
b7fd8e32cb New J2K: Introduce invalidate to mark element for removal, freeing it's children 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
7c5e9cd669 New J2K: Add all primitive types 2019-04-03 11:18:55 +03:00
Simon Ogorodnik
77b6eca76e New J2K: Cleanup element impls to reference nested elements via delegates 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
9f7146d8b9 New J2K: Prohibit to override acceptChildren for BranchElementBase 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
855d713368 New J2K: Use require & check instead of assert in tree consistency check 2019-04-03 11:18:53 +03:00
Simon Ogorodnik
7c278bfbab New J2K: Extract base from concrete implementations 2019-04-03 11:18:52 +03:00
Dimach
bfb0f4a369 New J2K: Type system refactored, parents from types removed, added JKTypeElement 2019-04-03 11:18:52 +03:00
Simon Ogorodnik
bc645a12b5 New J2K: More info in TODO 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
278cf82346 New J2K: Use proper tree structure in kt elements 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
13475cde01 New J2K: Add accept 2019-04-03 11:18:50 +03:00
Simon Ogorodnik
4892784f70 New J2K: Improve debug tree printer for types 2019-04-03 11:18:49 +03:00
Dimach
aea0511486 New J2K: Resolve symbols properly 2019-04-03 11:18:49 +03:00
Dimach
f912639999 New J2K: Done symbols 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
1e4737b4b2 New J2K: Fix reference resolution in type mapper conversion 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
7cccb99982 New J2K: WIP: Type mapper 2019-04-03 11:18:47 +03:00
Dimach
f64c32fd71 New J2K: Changed references to symbols. 2019-04-03 11:18:46 +03:00
Simon Ogorodnik
985e94fbf3 New J2K: Add from argument to detach
Support detach/attach/multilist in applyRecursive

Clarify attach/detach/onElementChanged order
2019-04-03 11:18:46 +03:00
Simon Ogorodnik
9b205c2825 New J2K: Remove multiverse 2019-04-03 11:18:45 +03:00
Dimach
83f9054a7e New J2K: Added list child into JKBranchElement. Added attach and detach method to JKElement 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
f691fb457e New J2K: WIP: Type mapping conversion 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
a55591011a New J2K: WIP: New field to property conversion 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
edd23c7a83 New J2K: WIP: Introduce symbols instead of references 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
4b3fdbcb0b New J2K: Enable effect-system and new inference 2019-04-03 11:18:42 +03:00
Simon Ogorodnik
9ca6829bda New J2K: Cleanup 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
254179321c New J2K: Rename visitable JKElement to JKTreeElement 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
3aeffe25ee New J2K: Try another approach to tree structure 2019-04-03 11:18:40 +03:00
Simon Ogorodnik
4551d3921b New J2K: Fix after merge 2019-04-03 11:18:39 +03:00
Dimach
6806ef8cf6 New J2K: Separated multiverse and universe declarations 2019-04-03 11:18:39 +03:00
Dimach
c398940679 New J2K: Tree refactor.
Added parents, transformers removed.
2019-04-03 11:18:38 +03:00
Dimach
2ee7e3c0e8 New J2K: Fixed errors 2019-04-03 11:18:38 +03:00
Dimach
aeae668f3d New J2K: Addded kt expressions and changed literals logic. 2019-04-03 11:18:37 +03:00
Dimach
fb32783168 New J2K: ArrayType and PrimitiveType 2019-04-03 11:18:36 +03:00
Dimach
09d52d13b8 New J2K: Type system. 2019-04-03 11:18:36 +03:00
Dimach
dfd745d55b New J2K: Fixed errors. 2019-04-03 11:18:35 +03:00
Dimach
10ff8d500b New J2K: References base done. 2019-04-03 11:18:34 +03:00
knize
c8c9c19a91 New J2K: References base 2019-04-03 11:18:34 +03:00
Kirill Knize
70c291f222 New J2K: Add kotlin declarations to IR (#9) 2019-04-03 11:18:33 +03:00
Kirill Knize
c662813b09 New J2K: Implement transformChildren here and there
PR (#6)
2019-04-03 11:18:33 +03:00
Simon Ogorodnik
2f38edb55f New J2K: Display element type when hit visitElement 2019-04-03 11:18:32 +03:00
Simon Ogorodnik
a4630af109 New J2K: Simple code builder 2019-04-03 11:18:31 +03:00
Simon Ogorodnik
dc73d415ad New J2K: Fix declarations to JK conversion 2019-04-03 11:18:31 +03:00
Dimach
dd499d7a13 New J2K: Rebase to latest changes. 2019-04-03 11:18:30 +03:00
Dimach
a94957aa0f New J2K: Added java -> jk converter for new array, type cast, array access and parenthesized expression. 2019-04-03 11:18:30 +03:00
Dimach
4ecbd13e06 New J2K: Added java -> jk converter for new expression. 2019-04-03 11:18:29 +03:00
Dimach
5bf806b85c New J2K: Added java -> jk converter for field access. 2019-04-03 11:18:28 +03:00
Dimach
98d01d600a New J2K: Added java -> jk converter for method call. 2019-04-03 11:18:28 +03:00
Dimach
9bfd8e4453 New J2K: Added basic expression converter. 2019-04-03 11:18:27 +03:00
Knize
d17548ba73 New J2K: Nj2k modifiers hierarchy (#3) 2019-04-03 11:18:26 +03:00
Knize
24803e31fd New J2K: Add class mapper 2019-04-03 11:18:26 +03:00
knize
e3097d8c1f New J2K: class tree mapper 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
e33df530cd New J2K: First conversion 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
8ac5eadadc New J2K: Update transformers to new style 2019-04-03 11:18:24 +03:00
Simon Ogorodnik
517dd9a260 New J2K: Fix debug tree printer after switching to single visitor 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
8ff78611ba New J2K: Make generics in transformers accept least common interface 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
c1f50d3594 New J2K: Drop separated visitors 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
68c03a6236 New J2K: Add transformers 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
4f7c46741e New J2K: Add debug tree visitor and some tree elements 2019-04-03 11:18:21 +03:00
Simon Ogorodnik
3ff0287c9f New J2K: Stub for JavaField initializer 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
e77fe74284 New J2K: Add Block primitive 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
7ce3c57896 New J2K: Add some primitive tests for new converter 2019-04-03 11:18:19 +03:00
Simon Ogorodnik
66d6ac745f New J2K: Implement basic output generation 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
5fd3a78dbe New J2K: Add basic tree structure and visitor generation script 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
9d9dbb4c25 New J2K: Add stub for JKTree builder 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
f50254d555 New J2K: Move TODO to NewJavaToKotlinConverter 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
ff0b09f77b New J2K: Replicate J2K Single File test for New J2K 2019-04-03 11:18:16 +03:00
Simon Ogorodnik
b151e9c48c New J2K: Add New J2K entry-point stub 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
fb49267819 New J2K: Cleanup J2K single file test and make it extensible 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
f2595e58e5 New J2K: Add newSrc source root for J2K 2019-04-03 11:18:14 +03:00
Simon Ogorodnik
1fd5738a60 Add kapt3-idea to J2K classpath to avoid spam in logs 2019-04-03 11:18:14 +03:00
Vyacheslav Gerasimov
394031a183 Build: Fix upload_plugins.gradle broken after migration to gradle 5.0
`<< {` syntax is removed since gradle 5.0
2019-04-02 23:14:23 +03:00
Ilya Gorbunov
04bbf23936 Add explicit imports of kotlin.ranges more specific functions
The extensions 'contains' and 'reversed' from kotlin.ranges can be more
specific for IntRange, LongRange, etc than the same functions from
kotlin.collections, yet they lose in overload resolution to the latter
ones when invoked from kotlin.collections package
because of same package package extensions are preferred (KT-30633).
2019-04-02 21:28:33 +03:00
Ilya Gorbunov
d77f76bdb0 Clarify wording in Random.nextInt/Long/UInt/ULong docs
#KT-30704 Fixed
2019-04-02 21:28:32 +03:00
Andrey Uskov
792fae4afc Optimize memory usage during import of MPP projects
#KT-30767 Fixed
2019-04-02 21:23:07 +03:00
Dmitry Gridin
3ca1c7b55d "Convert property to function" intention should warn about the property overloads at child class constructor
#KT-29764 Fixed
2019-04-02 22:53:56 +07:00
Dmitry Gridin
c8ea62a0d9 Change function signature should change type parameters
#KT-22896 Fixed
2019-04-02 22:53:13 +07:00
Dmitry Gridin
5e613554ee Minor: refactoring ChangeMemberFunctionSignatureFix 2019-04-02 22:53:13 +07:00
Dmitry Gridin
c48c274e59 Minor: refactoring ChangeFunctionSignature quickfix 2019-04-02 22:53:13 +07:00
Ilya Matveev
cb38f13399 Gradle plugin: Enable missing mingw_x86 target for K/N 2019-04-02 20:59:12 +07:00
Alexander Gorshenev
4332ce9884 Grab constructor call type parameters from its class, not from the contructor 2019-04-02 16:55:58 +03:00
Toshiaki Kameyama
e082522cdf Strip trailing spaces on Save: do not strip trailing spaces inside raw String
#KT-13048 Fixed
2019-04-02 15:27:08 +03:00
Ting-Yuan Huang
9fc869397d IrBuiltins: refactoring for equality checks
Previously,
* Equals performs IEEE 754 equality check for floating points and
  byte-to-byte checks for other types, including references.
* Ieee754Equals performs IEEE 754 for primitive types
* TotalOrderEquals performs total order equals to all types, including
  floating points.

Now it is simplified,
* Equals performs total order checks for all types.
* Ieee754Equals performs IEEE 754 for primitive types.
* (TotalOrderEquals is removed.)
2019-04-02 13:16:31 +02:00
Ilya Chernikov
9ddb64288c Avoid warning about scripting subplugin for MPP project
Temporary solution, the subplugin should be adapted to the new MPP
#KT-30742 fixed
2019-04-02 12:28:06 +02:00
Mikhail Zarechenskiy
63bdabcfae [NI] Clean up after merge with 3998e842 2019-04-02 12:21:15 +03:00
Mikhail Zarechenskiy
c458393e2f [NI] Do not avoid trivial constraints if they aren't from upper bounds
Since we skipped trivial constraint with `Any?` from parameter type of
 function `equals`, the compiler thought that there is no proper
 constraints (upper bounds do not matter here) and marked resolved
 call as a failed one, then diagnostic about missing equals was added

 Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like
 constraints

 #KT-30724 Fixed
2019-04-02 12:21:14 +03:00
Mikhail Zarechenskiy
5fa518fd55 Revert "Temporary fix for NI to compile against bootstrap compiler"
This reverts commit 791ab05e08.

 Problem was fixed in 4a1b9dcc & 1ac35420
2019-04-02 12:21:14 +03:00
Nikolay Krasko
5723bfdcaf Add a point about invalidated state between inspection checks and quick-fix run 2019-04-02 11:48:47 +03:00
Burak Eregar
9ab54d0e44 Fix: String templates suggest removing curly braces for backtick escaped identifiers 2019-04-02 11:48:47 +03:00
Toshiaki Kameyama
17a4506575 Keyword completion: complete data class with parentheses
#KT-30511 Fixed
2019-04-02 11:48:47 +03:00
Nikolay Krasko
f1a31652b3 Add action for collection basic information about Kotlin project (KT-11242)
#KT-11242 Fixed
2019-04-02 11:48:47 +03:00
Sergey Rostov
3465a30201 JPS Build: exclude intellij-core that comes from android tools
#KT-30247 Fixed
2019-04-02 09:27:26 +03:00
Toshiaki Kameyama
61f3e776a7 Add 'Covariant equals' inspection
#KT-29798 Fixed
2019-04-02 13:19:05 +07:00
Simon Ogorodnik
3998e842f1 Abstract NewInference & related from KotlinType
Cleanup TypeConstructors & KotlinTypes in VariableFixationFinder
Cleanup TypeConstructors & KotlinTypes in TypeVariableDirectionCalculator
Cleanup KotlinTypes in TypeCheckerContext for ConstraintSystem
Cleanup KotlinTypes in NewCommonSuperTypeCalculator
Cleanup KotlinTypes in TypeApproximator
Cleanup type substitution
Cleanup NewTypeVariable
Cleanup StubType
Cleanup TypeCheckerContext creation, extract common supertype context
Provide TypeSystemInferenceExtensionContext via dependency injection
2019-04-01 22:08:04 +03:00
Leonid Startsev
0ffded5bac Insert correct dispatch receivers and type arguments for expression inside generated by plugin IR functions 2019-04-01 18:54:16 +03:00
Ilya Chernikov
075a902ceb Revert createClassLikeInfo method signature change, depreceate it ...
instead and make alternative method for refactored usages.
Should fix compatibility with the Spek framework plugin.
2019-04-01 17:37:33 +02:00
Ilmir Usmanov
070fb7c250 Fix test data 2019-04-01 18:19:34 +03:00
Ilmir Usmanov
d2a80e7938 Add $result to suspend functions' LVT
#KT-28535
2019-04-01 18:19:32 +03:00
Ilmir Usmanov
05937a28ee Rename result to $result
this way it does not interfere with user-defined variables.
 #KT-28535 Fixed
2019-04-01 18:19:31 +03:00
Alexander Podkhalyuzin
742ffb98ad Use indexes instead of slow directory search for script dependencies
#KT-30018 Comment
2019-04-01 17:54:28 +03:00
Natalia Selezneva
0de0321fa9 Do not call FileEditorManager.getSelectedEditor outside UI thread (KT-30130)
^KT-30130 Fixed
2019-04-01 14:28:17 +03:00
Sergey Rostov
0e0c78317d Gradle, Kotlin/JS: enable source maps by default, get it working on tests.
Publish kotlin-test-nodejs-runner separately from kotlin-gradle-plugin.
2019-04-01 08:42:10 +03:00
Mikhail Zarechenskiy
a4cbec64b7 [NI] Remove failing codegen tests and add similar diagnostic one
These tests were added for suspend-conversions, it worked only
 with new inference, but implementation was incorrect and had other
 bugs, which were fixed in 1ac25259.
 Support of suspend-conversions will be addressed later with a different
 implementation (#KT-30703)
2019-04-01 01:36:15 +03:00
Toshiaki Kameyama
4a3e4f099d KT-30451 Redundant call of selector in maxBy&minBy
Refactor maxBy & minBy: do not call selector when collection has single item
2019-03-31 05:11:05 +03:00
Ilmir Usmanov
8c8ad48152 Enable test 2019-03-30 04:18:55 +03:00
Ilmir Usmanov
ea1e72e7b4 Generate $this$<label> as receiver name instead of $receiver 2019-03-30 04:18:53 +03:00
Ilmir Usmanov
6f14dcfacb Put suspend lambda's parameters to LVT
#KT-26412 Fixed
 #KT-28534 Fixed
2019-03-30 04:18:50 +03:00
LepilkinaElena
21fe5ac415 Fix parser for linkerOpts/compilerOpts (KT-29970) (#2219) 2019-03-29 20:13:23 +03:00
Dmitry Gridin
09b58403b9 Improve "ReplaceWith" for class with generic parameter
#KT-27089 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
88b0db6dd7 ReplaceWith intention could save generic type arguments
#KT-21195 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
b0f7ddd693 Minor: refactoring replaceWith package 2019-03-29 22:35:03 +07:00
Dmitry Gridin
c343876f7c Minor: refactoring codeInliner package 2019-03-29 22:35:03 +07:00
Ilya Chernikov
16ae313b22 Apply scripting subplugin in gradle mpp plugin, so scripts could be added to mpp sources
#KT-30679 fixed
2019-03-29 15:48:45 +01:00
Ilya Chernikov
3a3ba5bd8d Fix scripts discovery in IDEA after adding optional marker extension 2019-03-29 15:47:39 +01:00
romanart
4f1ee649b0 [IR] Fix type mismatch in LocalDeclarationLowering
Note: fix is required to enable @OnlyInputTypes annotation in NI
2019-03-29 17:40:44 +03:00
Dmitriy Novozhilov
f5ca69c324 [NI] Add codegen test for IntegerLiteralType for js backend 2019-03-29 17:38:55 +03:00
Ilmir Usmanov
3e5bc674d6 Update test data 2019-03-29 17:02:44 +03:00
Ilmir Usmanov
3bfee39995 Generate debug metadata for lambdas which capture crossinline lambdas
After cold stream related fixes, we do not generate state machine until
the very last transformation of the lambda. Thus, it is safe to
generate debug metadata for that lambda.
 #KT-30694 Fixed
2019-03-29 17:02:42 +03:00
Ilmir Usmanov
f09457c569 Minor. Remove sourceFile from CoroutineTransformerMethodVisitor's parameters 2019-03-29 17:02:40 +03:00
Dmitry Petrov
2c9ed73ba8 IR: create stubs for constructor type parameters
Java constructors can have type parameters of their own:
  public class J<X extends Number> {
    public <Y extends CharSequence> J() {}
  }

When such constructors are called from Kotlin, type parameters for
constructor follow type parameters for class:
  fun test() = J<Int, String>() // <X=Int, Y=String>

Descriptor-based representation uses the same type parameters ordering.

Also, use 'withScope' in IrLazyFunction type parameters creation.
2019-03-29 16:00:56 +03:00
Dmitry Petrov
8be7f7f1f7 IR: Make sure that symbols refer to original descriptors only
If a descriptor is a WrappedDeclarationDescriptor, it SHOULD NOT be
substituted.
2019-03-29 16:00:56 +03:00
Alexander Udalov
cd6c88fa2c Do not use .kotlin_module files in reflection
Previously, we used a pretty roundabout way to load a MemberScope from a
single file facade represented by KPackageImpl, which involved going
through ModuleDescriptor, PackageFragmentProvider, PackagePartProvider
etc. The only advantage of this approach was that it sort of works
similarly as in the compiler, however mutable state in
RuntimePackagePartProvider and the fact that .kotlin_module files were
required for this to work diminished this advantage.

In this change, we load MemberScope from a KPackageImpl pretty much
directly, by using the existing method
`DeserializedDescriptorResolver.createKotlinPackagePartScope` and
caching the result in the new component PackagePartScopeCache.

 #KT-30344 Fixed
2019-03-29 13:44:23 +01:00
Alexander Udalov
7aa75ab89b Minor, update reflection tests on stdlib
Since functionFromStdlibSingleFileFacade.kt was introduced, lazyOf was
also moved to a multifile class, so we're using another function to test
that reflection on a single file package facade from stdlib works
2019-03-29 13:44:23 +01:00
Dmitriy Novozhilov
719e25c3dd [NI] Fix testdata of codegen test for IntegerLiteralType 2019-03-29 15:20:53 +03:00
Alexander Udalov
36efbc8920 JVM IR: rename JvmBackendContext.getClass and return symbol instead of descriptor 2019-03-29 12:07:11 +01:00
Alexander Udalov
b32241c967 JVM IR: build all needed stdlib symbols in JvmSymbols manually
This removes the mandatory dependency of all JVM IR tests on
kotlin-stdlib (ConfigurationKind.ALL in all IR test cases) and speeds up
tests which don't need kotiln-stdlib by about 20%. Another advantage of
this method is that all required dependencies are listed in one file,
are easy to grasp, and changes to the related code generation can be
done independently of the corresponding changes in the actual library,
which may help in bootstrapping the compiler
2019-03-29 12:07:11 +01:00
Roman Artemev
6b7eba485b [JS] Run all js tests in v8 2019-03-29 13:38:08 +03:00
Igor Chevdar
3838a2f648 [IR] Copied functions from IrGenerator to IrBuilder
With that the number of UNDEFINED_OFFSET should be greater reduced
2019-03-29 12:47:34 +03:00
Mikhail Zarechenskiy
1ac25259e8 [NI] Support callable references to suspend functions
#KT-30658 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
017f9aea35 [NI] Builder-inference: fix unresolved reference for variable calls 2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
d6db1a1b35 [NI] Relax requirement for stub types in builder-inference
For functions with implicit return type annotations will be replaced
 anyway in order to initialize return type, so this restriction in
 `StubType` was too strong

 #KT-30656 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
b10d19dc78 [NI] Align builder inference with the old inference
#KT-29184 Fixed
2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
1eb70ea19e [NI] Update test data related to builder-inference 2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
b033b9180b [NI] Avoid builder-inference algorithm if types specified explicitly
#KT-30620 Fixed
2019-03-29 12:31:59 +03:00
Dmitriy Novozhilov
1ac3542036 [NI] Decrease priority of Integer Literal Types in type checking
#KT-30446
2019-03-29 11:55:30 +03:00
Dmitriy Novozhilov
4a1b9dcc3c [NI] fix approximation of not denotable types in lambda's function descriptors 2019-03-29 11:54:37 +03:00
Alexander Udalov
a9de157fd4 Exclude .kotlin_builtins files when proguarding kotlin-reflect.jar
Even though kotlin-annotations-jvm.jar itself doesn't contain those
files, ProGuard pulls them from the project dependency of
:kotlin-annotations-jvm on :core:builtins. They are already present in
kotlin-stdlib.jar and are thus not needed in kotlin-reflect.jar
2019-03-29 09:45:44 +01:00
Nicolay Mitropolsky
81e84fb62e LightElementsEqualsTest: removing quotes from test name
because of KT-19019
2019-03-29 11:29:22 +03:00
Ilya Gorbunov
91c7233ed8 Make Throwable.addSuppressed extension work without kotlin-stdlib-jdk7*
*given that it runs on JDK7 and higher. The addSuppressed member
is called with reflection when it's available.
kotlin-stdlib-jdk7 extension still overrides that and calls
addSuppressed member statically as before.

#KT-30560 Fixed
2019-03-28 22:42:20 +03:00
Ilya Gorbunov
e6e00483d4 Put kotlin-stdlib-jdk7/8 output in test classpath when running jdk6 tests
These tests ensure how compiled jdk6 binaries work in newer JDK7/8 environment,
and most likely the stdlib-jdk7/8 artifacts will be in that environment.

This reverts test classpath change (accidentally?) made in the commit 99f2cc3d.
2019-03-28 22:42:20 +03:00
Ilmir Usmanov
3724e05b63 Fix test data 2019-03-28 22:21:25 +03:00
Denis Zharkov
66293f4024 FIR: Add @Ignore for FirResolveTestTotalKotlin
Otherwise, it leads to OOM while running on teamcity
Of course, FIR parts might be optimized there but we'll do it later
2019-03-28 17:37:36 +03:00
Mikhael Bogdanov
1a4acb1694 Fix Android test compilation: remove license from generate file 2019-03-28 15:34:46 +01:00
Denis Zharkov
3164197b88 FIR: Fix compilation for bunch file AbstractFirTypeEnhancementTest.kt.181 2019-03-28 17:32:12 +03:00
Alexander Udalov
cb7727d51a Add explicit WITH_RUNTIME to boxAgainstJava tests which need stdlib 2019-03-28 14:26:10 +01:00
Alexander Udalov
15928c5b46 Minor, take String instead of Name in IrFunction.addValueParameter
All call sites of this method construct parameters with the given string
literal name (and more such call sites are coming in subsequent commits)
and it feels like a boilerplate to wrap it into Name each time manually
2019-03-28 14:26:09 +01:00
Alexander Udalov
4cb5a4fb6d Fix misc typos in IR backends 2019-03-28 14:26:09 +01:00
Alexander Udalov
6bd4d72b81 Use more correct KProperty type in PropertyReferenceLowering
Default type is `KProperty<R>` where R is KProperty's type parameter.
This type doesn't make much sense outside the KProperty's own class
declaration. A more correct type here is `KProperty<*>`, which is the
type used in property delegates in Kotlin
2019-03-28 14:26:09 +01:00
Alexander Udalov
73383d0c20 Extract JvmSymbols to separate file, pass lazyWrapper as SymbolTable 2019-03-28 14:26:09 +01:00
Alexander Udalov
1ee4313803 Minor, introduce IrType.classOrNull 2019-03-28 14:26:09 +01:00
Alexander Udalov
dada35d785 Remove obsolete and unused descriptors and utils 2019-03-28 14:26:09 +01:00
Alexander Udalov
72ca05f86a Add kotlin-stdlib explicitly to Gradle integration test data
This is required since ed86757817, otherwise an error "Cannot access
built-in declaration ..." is reported
2019-03-28 14:25:37 +01:00
Alexander Udalov
6223c4481f Minor, disable package mismatch inspection for Groovy
This should be fine because we don't have any production Groovy code in
the project. Otherwise any build.gradle file in
kotlin-gradle-plugin-integration-tests is highlighted as yellow.

Also update inspection profile to the latest version suggested by
IntelliJ
2019-03-28 14:25:37 +01:00
Mikhael Bogdanov
9c21c71c63 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:51:28 +01:00
Sergey Rostov
4df31b2360 JPS Build: support building and running IDEA Ultimate 2019-03-28 15:48:35 +03:00
Sergey Rostov
283ad04f7c JPS Build: fix artifacts after moving dependencies repo 2019-03-28 15:48:35 +03:00
Mikhael Bogdanov
f34a2923b5 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:17:38 +01:00
Mikhael Bogdanov
0c60ff0e80 Revert "Revert "Allow tests to be run in parallel.""
This reverts commit bdad3cac
2019-03-28 13:17:37 +01:00
Nicolay Mitropolsky
944bc31f69 Making Kotlin light elements isEquivalentTo to it's origins (KT-30583) 2019-03-28 13:19:42 +03:00
Ting-Yuan Huang
1bf0354e35 TotalOrderEquals: Handle nulls 2019-03-28 11:36:22 +03:00
Denis Zharkov
b1474b11f2 FIR: Fix FirSupertypeResolverTransformer for case of redeclarations
When transforming a specific class look for the exact match
Otherwise the last redeclaration will be overwritten by the first one
2019-03-28 11:19:52 +03:00
Simon Ogorodnik
a23e4bfdf1 Fix superType resolver 2019-03-28 11:19:52 +03:00
Simon Ogorodnik
49a0b29129 Store containers per symbol, not per callable id 2019-03-28 11:19:52 +03:00
Denis Zharkov
48f0790785 FIR: Fix bunch files for 181 2019-03-28 11:14:55 +03:00
Ilmir Usmanov
59398536d7 Generate inline site's file name in metadata
Otherwise, stacktraces will have invalid file name (declaration site).
 #KT-30508 Fixed
2019-03-28 11:14:17 +03:00
Sergey Rostov
23edafcaaf JPS Build: fix kotlin-main-kts-test 2019-03-28 10:06:36 +03:00
Sergey Rostov
7b89b0abbb JPS Build: exclude :core:builtins, use prebuilt bootstrap version 2019-03-28 10:06:35 +03:00
Sergey Rostov
fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Dmitry Gridin
5802928e52 False positive "unused constructor" for local class
#KT-30637 Fixed
2019-03-28 10:52:23 +07:00
Yan Zhulanow
0b94aa4be2 Pill: Disable a couple of scripting modules
Seems like these modules use the embeddable verson of the scripting host dependency that is not built in the Pill build.
2019-03-27 22:15:26 +03:00
Ilmir Usmanov
95f4115a10 Replace global mutable object with global variable 2019-03-27 21:40:13 +03:00
Ilya Kirillov
9813b748eb Fix android linting tests due to added external annotations support 2019-03-27 20:10:46 +03:00
Ilya Kirillov
f1f6740ec9 Show warnings for Java methods with external annotations when they called from Kotlin code 2019-03-27 20:10:46 +03:00
Mikhail Glukhikh
ba9b3397d0 Make Groovy-based inspections alive again
After commit 9b5b0447, declaration of Groovy-based inspections moved
into gradle-groovy.xml. However, this makes transitive-optional
dependency between plugin.xml, gradle-java.xml & gradle-groovy.xml
which doesn't work (see IDEA-209769) and inspections aren't loaded.

This commit breaks this transitivity by declaring dependency
to gradle-groovy.xml directly in plugin.xml.
This also fixes most tests from GradleInspectionTest group.
2019-03-27 18:06:24 +03:00
Ilmir Usmanov
0fec3470dd Regenerate anonymous object if call site of non-inlineable
functional argument is suspend
Split LambdaInfo into inlineable and non-inlineable
 #KT-26925
2019-03-27 17:44:37 +03:00
Ilmir Usmanov
1c2b8e6fad Fix wrong state-machine generation if inner object is retransformed
during inlining.
 #KT-29492 Fixed
2019-03-27 17:44:35 +03:00
Denis Zharkov
7b97c2a42a FIR: Weaken requirements for all symbols to have correct FIR
Currently, some cases like library type parameters are not supported properly
2019-03-27 17:17:59 +03:00
Denis Zharkov
825218b479 Replace FirSymbolProvider::getCallableSymbols with two methods
Requesting content of classes seems to be reasonable and at the same time
more easy to implement in Composite providers: they should find
just the first class' result instead of flatmapping all of them
2019-03-27 17:17:59 +03:00
Denis Zharkov
1426341e9f FIR: Support loading deserialized declarations from JVM class files 2019-03-27 17:17:59 +03:00
Denis Zharkov
0f9d54c4dc FIR: Support deserialization of nested classes 2019-03-27 17:17:59 +03:00
Denis Zharkov
82c6b51fab Simplify initialization process for JavaClassFinderImpl
After this change, it's not required to call "initialize" with
binding trace and KotlinCodeAnalyzer that is rather useful for FIR
2019-03-27 17:17:59 +03:00
Denis Zharkov
bb1acdbe95 Minor. Extract classes deserialization from BuiltInsPackageFragment 2019-03-27 17:17:59 +03:00
Denis Zharkov
b3e5e059bb Minor. Extract FirDeserializationContext factories 2019-03-27 17:17:59 +03:00
Denis Zharkov
aec5ec89e7 FIR: Support deserialization for built-in classes content 2019-03-27 17:17:59 +03:00
Denis Zharkov
f03c5e0583 FIR: Support loading built-in top-level functions 2019-03-27 17:17:59 +03:00
Denis Zharkov
705f97cbae FIR: Support type parameters in FirTypeDeserializer 2019-03-27 17:17:59 +03:00
Denis Zharkov
1d16008eab Do not request FirProvider for built-in synthesized classes
Because currently they don't have FIR and it might fail with an exception
2019-03-27 17:17:59 +03:00
Denis Zharkov
6daf414098 Add common supertype for FirFunction and FirProperty symbols 2019-03-27 17:17:59 +03:00
Denis Zharkov
466296bca0 Remove FirLibrarySymbolProviderImpl from FirJavaModuleBasedSession
It's anyway already being created within dependencies
2019-03-27 17:17:59 +03:00
Denis Zharkov
7a19e269fd FIR: Support import-references to callables 2019-03-27 17:17:59 +03:00
Leonid Startsev
ccca813792 Allow '@Serializable' on a type usage (for kotlinx.serialization/367) 2019-03-27 12:59:53 +03:00
Leonid Startsev
a2465910a3 Instantiating of Polymorphic in Companion.serializer() for JS and Native 2019-03-27 12:59:52 +03:00
Leonid Startsev
b108dbe568 Auto-applying @Polymorphic for interfaces and serializable abstract
classes
2019-03-27 12:59:51 +03:00
Leonid Startsev
859c95c3c4 Do not enable PolymorphicSerializer without special annotation 2019-03-27 12:59:49 +03:00
Leonid Startsev
9d707cb1d9 New instantiating type for polymorphic serializer 2019-03-27 12:59:48 +03:00
Sergey Rostov
30108d4cb9 CodeConformanceTest: revert formatting committed by mistake 2019-03-27 11:23:54 +03:00
Sergey Rostov
6bf82c1053 Gradle, Kotlin/JS: fix failing tests on Windows 2019-03-27 11:23:53 +03:00
Dmitry Gridin
0237dc3f4b Fix inspections test 'Unused symbol' for enum entry 2019-03-27 12:27:48 +07:00
Dmitry Gridin
d64702d87e Remove check "unused secondary enum class constructor"
#KT-14040 Fixed
2019-03-27 11:46:31 +07:00
Dmitry Gridin
dbe0b4aa71 Unused symbol inspection should detect enum entry
#KT-30612 Fixed
2019-03-27 11:46:30 +07:00
Dmitry Gridin
ce1ec49625 Add case for private nested class/object in KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Dmitry Gridin
4495c653cb Minor: move property from UnusedSymbolInspection to ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
3e0269a95a Minor: refactoring & fix warnings in ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
26575c9389 Minor: refactoring KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Sergey Igushkin
7aed9fd592 Fix Android AP in Kapt (KT-30632), run Android Kapt IT with AGP 3.3.2
Fixes a bug introduced by the commit 6fa610156e, which led to Kapt
options being imported from Android AP options too early (immediately at
creation time for each Android variant, while the Android plugin added
the options only afterwards).

Move Android subplugin options configuration to the time & scope where
it was prior to 6fa610156e.
2019-03-27 01:08:04 +03:00
Natalia Selezneva
ca49e17157 Run indexing for new script dependencies if they are updated from notification 2019-03-27 00:00:11 +03:00
Natalia Selezneva
776a89086f Fix NoSuchElementException editing script file
^KT-30440 Fixed
2019-03-26 23:58:59 +03:00
Natalia Selezneva
224f37ca00 Fix warning in scripts that dependencies are not available
^KT-30441 Fixed
2019-03-26 23:57:20 +03:00
Mikhail Zarechenskiy
791ab05e08 Temporary fix for NI to compile against bootstrap compiler 2019-03-26 22:51:20 +03:00
Mikhail Zarechenskiy
a50cc99b01 [NI] Discriminate integer literal types as they are less specific
Plus simplify code in `ResultTypeResolver` a bit
2019-03-26 22:32:14 +03:00
Mikhael Bogdanov
e01cac4c3d Fix test data 2019-03-26 17:17:54 +01:00
Anton Bannykh
b3f1908026 JS_IR: remove stub generator from IrBuiltins 2019-03-26 17:38:44 +03:00
Anton Bannykh
ed440fc060 JS IR: remove obsolete hack from SymbolTable 2019-03-26 17:38:43 +03:00
Anton Bannykh
530804d072 JS_IR: eager IrBuiltins 2019-03-26 17:38:43 +03:00
Anton Bannykh
45f5342911 JS IR: remove obsolete hacks 2019-03-26 17:38:43 +03:00
Anton Bannykh
bba4399910 JS IR: enable IR validation 2019-03-26 17:38:43 +03:00
pyos
ef5e02da84 JVM_IR: handle Nothing and Unit more consistently.
* In blocks, discard the result of any statement that has a return
   type other than void. This was previously done by wrapping each
   statement into an "implicit Unit conversion" that was actually
   compiled down to a stack pop instead. If an expression happened to
   already have type Unit, however, such a conversion was not inserted,
   resulting in a stray reference on the stack. These conversions are
   now redundant and should probably be removed.

 * In assignments and non-exhaustive conditionals, materialize a Unit
   on the stack to avoid depth mismatches that trip up the bytecode
   validator. Because such expressions are generally used at block level
   (and, indeed, the frontend will reject a non-exhaustive conditional
   used as an expression), combined with the above change this results
   in no additional GETSTATIC opcodes, as they are immediately removed
   by the peephole optimizer.
2019-03-26 13:32:02 +01:00
Zalim Bashorov
bdad3cace9 Revert "Allow tests to be run in parallel."
This reverts commit 21d81f35
2019-03-26 15:22:40 +03:00
Alexander Podkhalyuzin
37de9a0a26 Do not call find editor outside UI thread
#KT-30117 Fixed
2019-03-26 15:18:03 +03:00
Alexander Podkhalyuzin
c9581176d7 git longpaths info for Windows users 2019-03-26 15:17:21 +03:00
Alexander Podkhalyuzin
19f6290686 Fixed selection in case of empty class body
#KT-30597 Fixed
2019-03-26 15:13:54 +03:00
Steven Schäfer
29b7da7c49 Implement support for KClass fields in annotation classes. 2019-03-26 11:54:16 +01:00
Ting-Yuan Huang
4ff2825de0 Fix an assertion for type parameters 2019-03-26 10:44:06 +03:00
Ilya Matveev
acf8a0454f Store Kotlin/Native version in properties
Previously the Kotlin/Native version was hardcoded in sources of the
Gradle plugin. Such an approach is inconvenient when we want to
build Kotlin with a custom K/N version but without changes in sources
(e.g. during CI daily runs).

This patch adds a project property `versions.kotlin-native` which can
be set during build to override Kotlin/Native version. Also this
patch gets rid of hardcoding this version in sources and stores it in
a properties file packed with the Gradle plugin in a jar.
2019-03-26 12:50:53 +07:00
Andrey Uskov
a0b8140278 Fix creation of Android source roots
#KT-30464 Fixed
2019-03-26 08:28:23 +03:00
Andrey Uskov
01a100e2ef Fix KNE in intentions
EA-124846 Fixed
2019-03-26 08:27:24 +03:00
Dmitriy Dolovov
e33ea24dc7 Fix: Native libraries are not automatically unloaded from an IDE project
Issue #KT-30490 fixed
2019-03-26 09:43:06 +07:00
Toshiaki Kameyama
3b569737ad Redundant getter/setter: reduce hightlight range to header
#KT-30559 Fixed
2019-03-25 23:27:44 +03:00
Toshiaki Kameyama
0cf641398c Suspicious 'var' property: do not report when property has default getter
#KT-30565 Fixed
2019-03-25 23:26:24 +03:00
Dmitriy Novozhilov
a26df4b4c6 [NI] Update test data for spec tests 2019-03-25 23:04:50 +03:00
Victor Petukhov
568506e5c1 Exclude warning "Remove final upper bound" for functions with override modifier
^KT-25105 Fixed
2019-03-25 22:14:26 +03:00
Steven Schäfer
9cd005fbae Create temporary library directories for J2V8.
Workaround for https://github.com/eclipsesource/J2V8/issues/39
2019-03-25 19:50:37 +01:00
Steven Schäfer
21d81f353c Allow tests to be run in parallel. 2019-03-25 19:50:37 +01:00
Dmitriy Novozhilov
ca0e66bafc [NI] Refactor compiler representation of integer literals types
Add `IntegerLiteralTypeConstructor` that holds types, that can take
  integer literal with given value. It has two supertypes
  (`Number` and `Comparable<IntegerLiteralType>`) and have
  special rules for subtyping, `intersect` and `commonSuperType`
  functions with primitive number:

Example (assuming that ILT holds Int type):
* ILT <: Int
* Int :> ILT
* ILT intersect Int = Int
* commonSuperType(ILT, Int) = Int

#KT-30293 Fixed
#KT-30446 Fixed
2019-03-25 18:55:36 +03:00
Anton Bannykh
9c3e452396 IR: (update test data) NOT(Boolean) -> Boolean.not 2019-03-25 17:49:15 +03:00
Alexander Udalov
fff22d9372 Remove hack from JvmBuiltinOptimizationLowering related to booleanNotSymbol 2019-03-25 17:49:15 +03:00
Anton Bannykh
a382956c19 IR: use the correct descriptor for the booleanNotSymbol creation
NOTE corresponding function now has a dispatch receiver instead of a
single argument
2019-03-25 17:49:15 +03:00
Mikhail Glukhikh
0546548ff3 Raw FIR: add kotlin.Any super class if no super classes are visible 2019-03-25 17:17:14 +03:00
Alexey Tsvetkov
db6a7779b8 Check friend jars paths for exact match
Fixes CompileKotlinAgainstCustomBinariesTest.testInternalFromForeignModule
after unifying non-build-file mode and build-file mode.

Previously when the compiler was run without -Xbuild-file argument,
it was not using modules internally, so we were not checking if internal
descriptors were contained in destination dir of current module
(without -Xbuild-file we were returning false at `if (modules.isEmpty())
return false` in `ModuleVisibilityHelperImpl#isInFriendModule`).

After switching to using modules for CLI compilation,
any jar file contained in destination dir was considered friend,
because only a prefix was checked.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
0687b8eac3 Add argument to allow running compiler without sources
`-Xbuild-file` argument allows the compiler to run without
passing any Kotlin source file in arguments.
We have been using this property in
Kotlin Gradle plugin for a few important cases:
1. incremental compilation (to update caches when there are only removed files);
2. for KAPT (Kotlin sources don't make sense in context
of running APs).

We want to stop using `-Xbuild-file` in Kotlin Gradle plugin,
and avoid breaking the Gradle plugin or IC in other build-systems.

This change adds an argument to explicitly run
the compiler without specifying any Kotlin source file.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
97d3d38374 Always run codegen when IC is enabled
We may need to run code generation when no source files are specified
for incremental compilation (to update caches & metadata)
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5b7cee6221 Unify JVM compilation with and without -Xbuild-file 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
4154e97aa3 Fixes after code review 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
ada880fbad Fix non-incremental compilation 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
337ca7021d Add test for IC of non-kts scripts in Gradle 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5f54f67f70 Stop using -Xbuild-file in Gradle Plugin
#KT-27640 fixed
    #KT-27778 fixed
    #KT-27638 fixed
2019-03-25 16:39:47 +03:00
Nikita Skvortsov
9b5b0447fa only load inspections when groovy plugin is present KT-30579
otherwise, a user who disables Groovy support gets NoClassDefFound errors
2019-03-25 16:06:55 +03:00
Svyatoslav Kuzmich
0504635254 Remove -ProperIeee754Comparisons test directive duplicate 2019-03-25 15:55:06 +03:00
Svyatoslav Kuzmich
70ef0e9431 Add '-ProperIeee754Comparisons' to some tests and disable them in JS_IR 2019-03-25 12:57:26 +03:00
Dmitriy Novozhilov
d3e98bc434 [NI] Update test data for diagnostic tests 2019-03-25 12:38:37 +03:00
Dmitry Gridin
74cd53963d Fix false positive "Unused symbol" for type alias & private nested class/object
#KT-21526 Fixed
 #KT-30527 Fixed
2019-03-25 16:32:28 +07:00
Dmitry Gridin
4441b1579f Minor: refactoring UnusedSymbolInspection 2019-03-25 16:32:28 +07:00
Mikhail Zarechenskiy
3eda7c462b [NI] Add Nothing constraint if it was inferred from a call 2019-03-25 12:17:28 +03:00
Mikhail Zarechenskiy
ca894a6a71 [NI] Don't complete nested call if there's no constraints at all 2019-03-25 12:17:28 +03:00
Dmitriy Novozhilov
9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Dmitry N. Petrov
c2a0e73a79 Merge pull request #2207 from ting-yuan/ieee754improper
Label improper IEEE 754 tests.
2019-03-25 12:10:59 +03:00
Mikhail Glukhikh
73ed52a511 Get rid of binding context in FirBodyResolveTransformer 2019-03-25 12:04:28 +03:00
Dmitry Petrov
8664fc3b28 psi2ir: add test for implicit cast on values of intersection type 2019-03-25 11:50:14 +03:00
Dmitry Petrov
d4525e19dd IR: get rid of descriptors in local delegated properties rendering 2019-03-25 11:50:14 +03:00
Dmitry Petrov
12e9943f8f IR: IrCallableReference now implements IrDeclarationReference 2019-03-25 11:50:14 +03:00
Dmitry Petrov
6ca61cf347 IR: symbol for IrLocalDelegatedProperty 2019-03-25 11:50:14 +03:00
Mikhail Glukhikh
aa6ba1cd4a Introduce typeRef for FirExpression
This helps both body resolve & conversion to IR
2019-03-25 10:38:45 +03:00
Ilya Gorbunov
adeeeeee48 Fix embedded version of kotlin-stdlib in buildSrc
To avoid bringing stdlib:1.2.30, which is a transitive dependency of
com.jakewharton.dex:dex-method-list:3.0.0, into compile classpath of
the project build scripts.
2019-03-25 03:28:06 +03:00
Georgy Bronnikov
7f8cbf5434 JVM_IR: handle new JVM targets in AdditionalClassAnnotationsLowering 2019-03-25 02:18:57 +03:00
Georgy Bronnikov
0a2450bcd5 Remove duplicate definitions 2019-03-23 19:04:36 +03:00
Georgy Bronnikov
451cda79de Rewrite AnnotationCodegen for IR, removing descriptors 2019-03-23 19:04:36 +03:00
Nikolay Krasko
8bd6e1b8e4 Rename action for throwing exception from Kotlin plugin
Make the name similar to other internal actions for throwing exceptions.
2019-03-23 11:54:57 +03:00
Nikolay Krasko
0c2bdc68f1 Additional checks for listed and approve in fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
27397f4131 Use xmlId for fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fb2e5f970d Add intention/inspections/quickfix contribution quick notes 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fdf2482600 Clean up findUsages package 2019-03-23 11:53:29 +03:00
Nikolay Krasko
046a35bcda Hide concrete classes for Kotlin nodes to avoid more compatibility problems 2019-03-23 11:53:28 +03:00
Nikolay Krasko
8ab10ebda3 Minor: remove warnings in CommonIntentionActionsTest.kt 2019-03-23 11:53:28 +03:00
Ilya Chernikov
99a5885aa7 Fix ScriptingCompilerPluginTest after creating a separate jar with shared plugin code 2019-03-23 09:52:02 +01:00
Abduqodiri Qurbonzoda
636ed025da Replace "binary representation of" with "bits of" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
960797b926 Replace mistaken "bit sign" with "sign bit" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
f36a8db8eb More detailed Primitive.toChar conversion documentation 2019-03-22 21:18:27 +03:00
Ting-Yuan Huang
caccb79324 Label improper IEEE 754 tests.
Those tests don't expect ProperIeee754Comparisons.
See KT-22723 for details.
2019-03-22 11:07:35 -07:00
Alexander Udalov
87c6b723f0 Add JvmBuiltIns.Kind instead of boolean flags in constructor 2019-03-22 14:59:03 +01:00
Alexander Udalov
c32d7ef116 Do not create additional module for built-ins in reflection 2019-03-22 14:59:03 +01:00
Alexander Udalov
ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Alexander Udalov
8ce7742e7c Inject DeserializationConfiguration into JvmBuiltInsPackageFragmentProvider 2019-03-22 14:59:03 +01:00
Alexander Udalov
05700b8c43 Use JvmResolveUtil.createContainer in AbstractDescriptorRendererTest 2019-03-22 14:59:03 +01:00
Alexander Gorshenev
a3b1d3ff62 Allow forward declarations bring additional IR dependencies
for modules present in metadata.
2019-03-22 16:47:08 +03:00
Alexander Gorshenev
674580fdef File annotation deserialization is triggered by the first file use 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
215da10687 A little refactoring of deserializer in preparation for the next commit. 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
3bc4616a17 Eliminated global state in IR deserializer. 2019-03-22 16:47:08 +03:00
Ilya Matveev
8f9189d61e Update Kotlin/Native: 1.2-eap-8879 2019-03-22 20:27:18 +07:00
Simon Ogorodnik
b617c40051 FIR: Update testData for fir multi-module test (rendering+body resolve) 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
85a096029c FIR: Do not fail on not calculated type 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
70e324277e FIR: Stub for super references 2019-03-22 16:25:23 +03:00
Mikhail Glukhikh
9b4fe2f991 FIR: Fix part of problems with smoke tests 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
3e7e9269ab FIR: Fix 2^n transform complexity in blocks/whens 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
6799eeb084 FIR: Add CallKind 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
a562f3db3c FIR: Re-implement call resolver with proper architecture 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
33b44870d6 FIR: Add test for constructor 2019-03-22 16:25:20 +03:00
Simon Ogorodnik
5aa783a961 FIR: Fix visitors/transformers and testData 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
2341692296 FIR: Change transform order in calls/variables to more appropriate 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
071f324738 FIR: Prevent failing on implicit typed local declarations 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
46e432df54 FIR: Prevent failing on constructor substitution 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
cd7a96e91b FIR: Proper self-type for constructor return type 2019-03-22 16:25:17 +03:00
Simon Ogorodnik
6c7be3c547 FIR: Improve diagnostic in fir unsafe 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
fedde668b3 FIR: Support captureFromArguments for ConeTypes 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
6efb22cd45 FIR: Support typing of type operators 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
79018abee2 FIR: Optimize name gathering in call resolver 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
b574693916 FIR: Introduce function to render fir element with it's type 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
24041828a9 FIR: Improve rendering for type operators 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
27687602f8 FIR: Add functions to change nullability/arguments of ConeTypes 2019-03-22 16:25:13 +03:00
Simon Ogorodnik
2118f6008a Extract TypeArgumentListMarker.all 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
d9c40c24ed FIR: Allow rendering ConeTypes 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
818701b8df FIR: Implement cycle avoidance in implicit type resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
334c42e8ab FIR: Implement deep implicit types resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
70be1c1024 FIR: Update testData, now it resolves due to call resolver 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
498fb94c37 FIR: Make FIR rendering more kotlin-styled 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
9cc6e44158 FIR: Fix value-parameters redeclare in destructuring 2019-03-22 16:25:09 +03:00
Simon Ogorodnik
9a642ef2e5 FIR: Add test for three receivers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
43315fd61d FIR: Preparation for resolve to classifiers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
307b8a1d4c FIR: Support top-level constructors 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
d817f719a4 FIR: Cleanup failures in body resolve 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
3867b255f2 FIR: Support this resolve 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
9dc6d93070 FIR: Resolve local callables 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
61eb19fbbf FIR: Make possible to return variable symbols from scope 2019-03-22 16:25:05 +03:00
Simon Ogorodnik
02079bbeb5 FIR: Update fir hierarchy, decouple member declaration from callable 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
7b6f4d8ba4 FIR: Implement implicit invoke desugaring in call resolver 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
3be1d0f946 FIR: Add tests for invoke 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
c58c1a6c4e FIR: Add operator test 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
3ac495a45d FIR: Implement basic function call resolve 2019-03-22 16:25:02 +03:00
Simon Ogorodnik
099f98f817 FIR: Expression typing and simple call resolver 2019-03-22 16:25:02 +03:00
Alexey Tsvetkov
28873e61d4 Remove unused IncrementalCompilationServicesFacade 2019-03-22 16:13:45 +03:00
Ivan Gavrilovic
493a2006f1 Remove unused SimpleDirtyData from incremental compilation
This is not used any more and all information about
the changed symbols and fqNames is passed alongside artifacts.
2019-03-22 16:13:45 +03:00
Yan Zhulanow
49d94f72d2 Revert "Kapt: Generate constant value initializers for mutable properties (KT-30164)"
This reverts commit cce2b472
2019-03-22 15:17:12 +03:00
Yan Zhulanow
9aa6a10aff Revert "Kapt: Move out the 'final' fallback for initial field values"
This reverts commit 10e53a2e
2019-03-22 15:17:12 +03:00
Yan Zhulanow
4c794b1302 Revert "Kapt: Support default constant values for constructor parameters"
This reverts commit e4d758b6
2019-03-22 15:17:12 +03:00
Ilya Chernikov
215d24e12c Fix jps build after adding new scripting jar 2019-03-22 12:26:02 +01:00
Svyatoslav Kuzmich
8429734a67 [JS IR BE] Disable -ProperIeee754Comparisons tests 2019-03-22 13:49:37 +03:00
Sergey Rostov
d210255623 Gradle: Kotlin NodeJS tests runner for single target
#KT-30528
2019-03-22 09:57:21 +03:00
Sergey Rostov
04d8568fdc Build: fix DistModelBuilder for copy tasks without destination dir 2019-03-22 09:49:34 +03:00
Sergey Rostov
d467e4209a Gradle: Basic Kotlin NodeJS tests runner
#KT-30531 Fixed
#KT-30528 Fixed
2019-03-22 09:49:32 +03:00
Sergey Rostov
b6e675f934 Gradle: move buildCompilationProcessor from target preset to target configurator 2019-03-22 09:34:11 +03:00
Sergey Rostov
46c32f2aa6 Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-22 09:34:11 +03:00
Georgy Bronnikov
e627f08614 Make wrong phase name an error 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
fae003866b Use CLI compiler arguments directly in PhaseConfig creation 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
40079f7cae Use default argument values in PhaseConfig constructor 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
469fd20902 Warn about mistyped phase names in CLI 2019-03-21 23:32:25 +03:00
Alexander Udalov
0fb444a5d1 Move createPhaseConfig to module cli
To use things like MessageCollector to report errors/warnings related to
incorrect phase configuration flags
2019-03-21 23:32:25 +03:00
Alexander Udalov
2995be8bd2 Move usages of createPhaseConfig up to cli & test modules 2019-03-21 23:32:25 +03:00
Alexander Udalov
ddad3034da Extract createPhaseConfig from PhaseConfig
To remove dependency of PhaseConfig on CLI-dependent concepts such as
CompilerConfiguration
2019-03-21 23:32:25 +03:00
Nicolay Mitropolsky
ce40bfb259 191: Uast: making KotlinUObjectLiteralExpression provide a proper referenceNameElement (KT-30534) 2019-03-21 19:56:47 +03:00
Vyacheslav Gerasimov
e3a012cd19 Fix CodeConformanceTest after merging android-dx to prepare-deps 2019-03-21 18:15:55 +03:00
Nikolay Krasko
a5f96d6470 Minor: cleanup and remove outdated TODOs 2019-03-21 18:03:15 +03:00
Nikolay Krasko
04ecc913ef Show expression type for argument names (KT-30057)
#KT-30057 Fixed
2019-03-21 18:03:15 +03:00
Nikolay Krasko
ce2f738d9f Minor: fix Nullness deprecation warnings 2019-03-21 18:03:15 +03:00
Nikolay Krasko
77f1167773 Minor: remove bunch for KotlinSliceProvider.kt 2019-03-21 18:03:15 +03:00
Nikolay Krasko
026fc998c1 Allow resolve write action check for all plugins when enabled in registry 2019-03-21 18:03:15 +03:00
Ilya Matveev
7f08ecee39 CocoaPods: Use FQ name for the sync task during an Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
0a27699591 CocoaPods: Generate wrapper if the corresponding property enabled 2019-03-21 21:09:47 +07:00
Ilya Matveev
07c3ed5bd1 Fat frameworks: Use absolute path to lipo 2019-03-21 21:09:47 +07:00
Ilya Matveev
1f94224b52 Fat frameworks: Don't fail if plist has no device capabilities
The PlistBuddy fails when deleting an entry from a file which
has no such entry. This patch workarounds this by ignoring
PlistBuddy's exit code.
2019-03-21 21:09:47 +07:00
Ilya Matveev
300acafc63 CocoaPods: Don't generate a fat framework for a single device target 2019-03-21 21:09:47 +07:00
Ilya Matveev
c079543e7d Fat frameworks: Improve header merging
1. If header contents are identical, don't write all of them
   in the resulting header. Just write content of one of the
   headers without #ifdef-s.
2. Use #elif to separate declarations for different platforms.
2019-03-21 21:09:47 +07:00
Ilya Matveev
8b8028e10d Fat frameworks: Run PlistBuddy only once for all commands
Previously we executed the PlistBuddy utility for each command
separately. This patch gathers all commands and run PlistBuddy
for all of them at once.
2019-03-21 21:09:47 +07:00
Ilya Matveev
3f04bf119e Fat frameworks: Improve error messaging 2019-03-21 21:09:47 +07:00
Ilya Matveev
1c7866e81f CocoaPods: Require Gradle wrapper for Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
2e60b18570 CocoaPods: Rename: simple framework -> regular framework 2019-03-21 21:09:47 +07:00
Ilya Matveev
fd825e0601 CocoaPods: Detect the real path to Gradle wrapper.
Previously the CocoaPods plugin assumed that Gradle wrapper
is located in the project directory. But the project may be
a part of multiproject build and wrapper may be located in
the root directory of such a build. Also the build may not
have the wrapper at all.

This patch looks for the wrapper in the root directory of the
build and runs the local Gradle if there is no wrapper.
2019-03-21 21:09:47 +07:00
Ilya Matveev
4985b24b07 CocoaPods: Don't use realpath utility in script phase
The realpath utility may not be found on the user's machine
so we get rid of using it.
2019-03-21 21:09:47 +07:00
Ilya Matveev
5b4d83e770 CocoaPods: Build fat arm32/arm64 frameworks
Building for old iOS devices requires us to provide fat
arm32/arm64 frameworks. This patch uses the fat framework
task to build such a framework and provides it to Xcode
if a build for a device is executed. In other cases
(building for iOS simulator or macOS) simple frameworks
are still used.
2019-03-21 21:09:47 +07:00
Ilya Matveev
6621414d72 Provide a task for building a fat framework
This patch adds a task taking several iOS frameworks and
building one fat framework on their basis.

Issue #KT-24184 Fixed
2019-03-21 21:09:47 +07:00
Roman Artemev
538512fa2a [JS IR BE] Fix unbound symbols after deserialization
* restore broken psi2ir invariant
2019-03-21 16:26:51 +03:00
Dmitriy Novozhilov
58189c79ca Add regression test for PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic
#KT-20507
2019-03-21 16:09:46 +03:00
Alexey Tsvetkov
42aa708f16 Minor: remove JVM-specific assertion from common test code 2019-03-21 15:23:48 +03:00
Ilya Chernikov
c56382a62b Move common idea and compiler parts of the scripting plugin to the new jar 2019-03-21 12:02:29 +01:00
Nicolay Mitropolsky
af63fcb3be KotlinElementActionsFactory: adding empty annotations without parenthesises 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
1669b6aa9f 192: KotlinElementActionsFactory: changing parameters could add annotations 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
6b91b7cce5 192: KotlinElementActionsFactory: support for keeping existing parameters on signature change 2019-03-21 12:47:26 +03:00
Nicolay Mitropolsky
713f73e414 Uast: getMaybeLightElement returns class for annotation primary constructor 2019-03-21 12:46:28 +03:00
Nicolay Mitropolsky
7b590055f8 Uast: resolveCallToDeclaration cleanup 2019-03-21 12:46:27 +03:00
Nicolay Mitropolsky
90894176f9 Uast: stop resolve parts of fqn to the full-name target 2019-03-21 12:46:27 +03:00
Dmitry Gridin
403801b0b3 Fix exception when add import
#KT-30524 Fixed
2019-03-21 16:35:43 +07:00
Dmitry Gridin
3ce002dd6e Improve: optimize ConvertMemberToExtension 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e8eb9c3d58 Minor: refactoring ConvertMemberToExtensionIntention 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e11072b8c2 Improve: add more cases for MoveVariableDeclarationIntoWhen
#KT-30499 Fixed
2019-03-21 16:32:41 +07:00
Dmitry Gridin
c84ff1d8b1 Inspection "MoveVariableDeclarationIntoWhen" should inline variable declaration 2019-03-21 16:31:29 +07:00
Dmitry Petrov
f9119c001e JVM_IR: generate file class without members if it has metadata 2019-03-21 11:23:51 +03:00
Dmitry Petrov
a5c95275f0 IR: get rid of descriptors in DumpIrTree 2019-03-21 11:23:51 +03:00
Dmitry Petrov
9a82f926a1 IR: descriptor-less rendering of IR elements (work in progress) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
cd138bc022 IR: IrSymbolVisitor 2019-03-21 11:23:51 +03:00
Dmitry Petrov
110a15d395 IR: drop IrFile.fileAnnotations (it already has annotations anyway) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
b42aa39033 IR: drop IrTypeAlias 2019-03-21 11:23:51 +03:00
Dmitry Petrov
e49eae528c IR: don't use descriptors in rendering (work in progress)
There's some descriptor-based code remaining. Need some more work on IR.
2019-03-21 11:23:51 +03:00
Toshiaki Kameyama
bd3d5a9dbb Use withIndex intention: fix false positive for destructuring declaration
#KT-30341 Fixed
2019-03-21 10:59:01 +03:00
Toshiaki Kameyama
cbdc79fcda Add when branches: remove unnecessary blank line
#KT-30426 Fixed
2019-03-21 10:58:11 +03:00
Mikhail Glukhikh
c1984d92ff Introduce FirFile.fileSession, get rid of most FirElement.session usages 2019-03-21 10:29:58 +03:00
Roman Artemev
698594b14d [IR] Fix classifier equality for Local classes 2019-03-20 23:45:03 +03:00
Vyacheslav Gerasimov
4cd95256b6 Build: Add tasks to clean repo directory and legacy repo directories 2019-03-20 23:38:36 +03:00
Ilya Chernikov
43e4dbb0b1 Fix tests after unblocking exceptions on loading script definitions
should be temporary, proper solution needed in the future
2019-03-20 21:19:25 +01:00
Ilya Chernikov
ffd1633e3e Write tests for dynamic versions with ivy and maven resolvers
and refactor tests
#KT-27051 fixed
this commit is just a confirmation of the fix: either it worked
from the beginning, or was fixed by some unrelated change
2019-03-20 21:19:24 +01:00
Ilya Chernikov
f2bddce4fd Refactor script definition loading error handling
reenable logging of failures
suppress loading from failed contributors
2019-03-20 21:19:24 +01:00
Ilya Chernikov
dd3ac74bd2 Refactor ivy resolver
add support for artifacts with type an classifier
use ibiblio resolver by default - it is designed for working with maven central
add test, but disable it - see comments for the reason and todos
2019-03-20 21:19:24 +01:00
Ilya Chernikov
fc9a6dec7e Add optional suffix to the script template markers
add suffix to the markers in the repo
#KT-28593 fixed
2019-03-20 21:19:24 +01:00
Ting-Yuan Huang
79fcaae991 Implement constant folding in the IR backend for JVM
The newly added pass folds the set of constant functions of the
current backend, plus IrBuiltIns.
2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
7e4d33be24 ConstantExpressionEvaluator: make evaluate*naryAndCheck public 2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
f352a4dcd4 IrBuiltIns: factoring out operator names
so that they can be used in other contexts.
2019-03-20 21:02:55 +01:00
Ilya Gorbunov
8021f9c4af Clarify toSortedMap and sortedMapOf docs (KT-30100)
Remove the note about iteration order so that toSortedMap is not misused
for sorting map entires with the comparator inconsistent with key equality.
2019-03-20 22:08:03 +03:00
Vyacheslav Gerasimov
c650206f54 Build: Fix hardcoded paths in artifacts for JPS build 2019-03-20 21:29:25 +03:00
Vyacheslav Gerasimov
d9b149fd2f Build: Rename kotlinBuildRepo -> kotlinBuildLocalRepo 2019-03-20 21:29:24 +03:00
Vyacheslav Gerasimov
a1a30ad041 Build: Rename nodeJS -> nodeJSPlugin 2019-03-20 21:29:22 +03:00
Vyacheslav Gerasimov
128b70e2c4 Build: Add property to enable dependency task output verification
Enabled on teamcity by default, disabled locally by default,
kotlin.build.dependency.output.verification may be used to specify explicitly
2019-03-20 21:29:21 +03:00
Vyacheslav Gerasimov
a543dee39a Build: Get jps-build-test directly from maven 2019-03-20 21:29:19 +03:00
Vyacheslav Gerasimov
d9d6e9b10a Build: Merge AndroidSdkDependencies.kt & intellijDependencies.kt 2019-03-20 21:29:18 +03:00
Vyacheslav Gerasimov
98a7c5264c Build: Move intellij-sdk contents to prepare-deps 2019-03-20 21:29:16 +03:00
Vyacheslav Gerasimov
139286bf44 Build: Merge prepare-deps/android-dx to intellij-sdk 2019-03-20 21:29:14 +03:00
Vyacheslav Gerasimov
fc8be48fa8 Build: Improve intellij-sdk repo up-to-date check time & layout
Up-to-date check is very heavy for intellij repo due to artifact size.
If module directory in repo is written only by one task we can assume
that task if up-to-date if target directory exists.
2019-03-20 21:29:13 +03:00
Vyacheslav Gerasimov
f890cab145 Build: Rename custom-dependencies -> dependencies 2019-03-20 21:29:11 +03:00
Vyacheslav Gerasimov
07b0129a6a Build: Build android-dx and intellij-sdk repo to dependencies/repo
From KOTLIN-CR-2801 reasons to move:
 - I've changed repo layout and build process in incompatible way and decided to change location
 - It was difficult to find and annoying to locate, it was very deep and long path
 - I think dependencies/repo path is very easy to remember and find
 - It was called dependencies some time ago
2019-03-20 21:29:09 +03:00
Vyacheslav Gerasimov
ef159a4fc9 Minor: Fix typo in build error message 2019-03-20 21:17:27 +03:00
Vyacheslav Gerasimov
9f64e0fa69 Build: Remove intellijEnforceCommunitySdk flag, use currentIde instead
Setup ultimate repositories only when currentIde is Intellij
2019-03-20 21:17:27 +03:00
Yan Zhulanow
683c2b0434 Don't use experimental features of Android Extensions in 'testAndroidDaggerIC()'
AndroidDaggerProject uses the @Parcelize functionality that was experimental until 1.3.30. Now it is not.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
44f752d1c5 Always attach kotlin-android-extensions-runtime library
@Parcelize is now enabled by default, and it requires the runtime library.
Enabling it for all clients is a temporary solution.
In future, the runtime library will be split to two separate artifacts.
2019-03-20 20:52:23 +03:00
Jake Wharton
8e23555660 Make parcelize a non-experimental feature
It was already being added to the feature list by default, but was only enabled when isExperimental was true.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
c40cc76ad3 Minor: Fix error message, add missing article 2019-03-20 20:52:23 +03:00
Yan Zhulanow
c7678a27e5 Kapt: Fix star indentation in stub Javadoc (KT-30163) 2019-03-20 20:52:23 +03:00
Yan Zhulanow
e4d758b614 Kapt: Support default constant values for constructor parameters 2019-03-20 20:52:23 +03:00
Yan Zhulanow
10e53a2e73 Kapt: Move out the 'final' fallback for initial field values 2019-03-20 20:52:22 +03:00
Yan Zhulanow
cce2b472bf Kapt: Generate constant value initializers for mutable properties (KT-30164) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
ce13982cfc Kapt: Use constant value references where possible in property initializers 2019-03-20 20:52:22 +03:00
Yan Zhulanow
66754e62da Kapt: Always use raw types for annotation parameter types (KT-30346) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
90e84aa15d Remove isAtBreakpoint checks as it's not valid in all cases
For example, when we stopped at a breakpoint and then did a 'step over' action, we aren't at that breakpoint any more.
However, we still can evaluate things.
2019-03-20 20:52:22 +03:00
Yan Zhulanow
bbdeb3efac Avoid using 'loadClass()' as it doesn't cache the results 2019-03-20 20:52:22 +03:00
Yan Zhulanow
e79ee1ba8e Use caching 'findClass()' instead of raw 'Class.forName()' call in async stack trace provider (KT-30268) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
b2a47027fb Move eval4j to idea 2019-03-20 20:52:22 +03:00
Yan Zhulanow
65da7ba971 Add the whole content of the Apache 2.0 license to the Kotlin repo 2019-03-20 20:52:21 +03:00
Yan Zhulanow
6d90e850ff Refactoring: Incapsulate method calls into ExecutionContext 2019-03-20 20:52:21 +03:00
Yan Zhulanow
5d156c2edb Debugger: Fix indentation in code fragments 2019-03-20 20:52:21 +03:00
Yan Zhulanow
a1e5ce2c8b Don't activate Kotlin async stack trace provider in Java sources (KT-30318) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
754a7bc554 Code fragment analysis: analyze parents if there's no sensible scope for the default element (KT-29179) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
97f94700b9 Don't file an exception if we failed to calculate the anonymous class name 2019-03-20 20:52:21 +03:00
Yan Zhulanow
fd3fab5bcc Minor: Fix formatting in DebuggerClassNameProvider 2019-03-20 20:52:21 +03:00
Yan Zhulanow
d0a61fa7e2 Fix breakpoint handling in Kotlin scripts (KT-29234) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
4870b2e6ba Fix asmTypeForAnonymousClassOrNull(): it should not throw an exception if a class name isn't found 2019-03-20 20:52:20 +03:00
Yan Zhulanow
3f92451fde Explicitly check for the callable class availability
'@NotNull' annotation generates a not-null assertion that caused exceptions to throw from 'asmTypeForAnonymousClassOrNull()'.
2019-03-20 20:52:20 +03:00
Yan Zhulanow
77c2a5c87c Debugger: Fix missing NOP in empty 'when' header (KT-29189) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
ba0989801a Debugger: Show captured outer this in lambdas (Variables view) (KT-30220) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
723f8df23e Hide '$delegate' variables in Kotlin variables mode 2019-03-20 20:52:20 +03:00
Yan Zhulanow
570421b831 Fix lambda evaluation on JDK 9-11 (KT-29423) 2019-03-20 20:52:20 +03:00
Sergey Igushkin
af7c35b5c7 Revert profile_settings.xml accidentally deleted in ffdd43b8 2019-03-20 19:56:50 +03:00
Jake Wharton
6ee987fa2e Add intrinsics for compile-time computing trimMargin/trimIndent
These only apply when the receiver can be resolved to a constant and the margin prefix, if specified, is also a constant.
2019-03-20 17:25:29 +01:00
Alexey Tsvetkov
2ec6ab92b5 Clear outputs before compiling with in-process/out-of-process execution mode
Issue #KT-30492 Fixed
2019-03-20 17:11:37 +03:00
Ivan Gavrilovic
b2ad82b7d2 Incremental KAPT - invalidate obsolete types
Once set of dirty symbols is computed, filter these types
when they are requested from the JavaFileManager. This is accomplished
by tracking all declared types in the sources and generated sources.
It is not necessary track types in generated class files, as these will
be removed before the APs are incrementally run.

Motivation: APs (e.g. Dagger) may use Elements.getTypeElement(String)
to determine if type is already present, and if it is, they will not
generate it. Therefore, whenever generated sources is invalidated, types
it defines need to be filtered in the JavaFileManager.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:13 +03:00
Ivan Gavrilovic
2f3d234516 Incremental KAPT - handle inherited annotations
Handle annotations with @Inherited. This is important for
the aggregating APs, as the current implementation passes all sources
annotated with claimed aggregating annotations.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:10 +03:00
Ivan Gavrilovic
9f14daa682 Incremental annotation processing with KAPT
Add support for incremental annotation processors in KAPT. These
processors conform to https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing
specification.

Support is provided by using javac compiler APIs and
recording the source file structure. At runtime, processors
are instrumented with custom Filer that is used to keep track of generated
files. In order to support classpath changes, stub generation task is
used to generated a list of changed FQCNs, and this is simply used by KAPT.
Both worker and non-worker mode are supported.

 #KT-23880
2019-03-20 16:43:02 +03:00
Dmitry Gridin
600a955a51 Fix false positive "Unused import" for type alias
#KT-29977 Fixed
2019-03-20 20:28:22 +07:00
Dmitry Gridin
7e4b3ceede Minor: refactoring KotlinUnusedImportInspection 2019-03-20 20:28:22 +07:00
Toshiaki Kameyama
4e3d13fcee Change to star projection: do not suggest in arguments or receiver
#KT-23259 Fixed
2019-03-20 20:12:06 +07:00
Nikolay Krasko
73396b5018 Log connection problems during fetching release date 2019-03-20 14:23:43 +03:00
Nikolay Krasko
9a5b902766 Use special request for fetching plugin release date in exception reporter 2019-03-20 14:23:43 +03:00
Nikolay Krasko
a0d015dd4d Minor: document shortening and smart enter use resolve in write action 2019-03-20 14:23:42 +03:00
Nikolay Krasko
1060a24221 Don't allow to resolve anything within write action 2019-03-20 14:23:42 +03:00
Dmitry Petrov
7e4688da93 psi2ir: add test for reference to var with non-accessible setter 2019-03-20 11:57:57 +03:00
Dmitry Petrov
21dbe2e7e7 IR: symbolName mangling for IrTypeParameter
(original author: Alexander Gorshenev)
2019-03-20 11:57:57 +03:00
Roman Artemev
206e5d30d9 Regenerate protobuf 2019-03-20 11:57:57 +03:00
Dmitry Petrov
c86ef5da53 psi2ir: update testData for property references 2019-03-20 11:57:57 +03:00
romanart
5b5f3a7468 [IR] Fix classes TypeParameter [de]serialization 2019-03-20 11:57:57 +03:00
Dmitry Petrov
9f48695dde psi2ir: no unbound field symbols in delegated property references
#KT-30323 Fixed
2019-03-20 11:57:57 +03:00
Dmitry Petrov
15918fc475 IR: deprecations 2019-03-20 11:57:57 +03:00
Dmitry Petrov
bd9c5645cd IR: fix property reference symbol binding for generic properties 2019-03-20 11:57:57 +03:00
Dmitry Petrov
8b4dab7c25 JS_IR: fix property name generation 2019-03-20 11:57:57 +03:00
Dmitry Petrov
04fad012a0 IR: IrPropertySymbol introduced, some code cleaned up
#KT-30304
2019-03-20 11:57:57 +03:00
Anton Yalyshev
1bc35b1b0c updated TipsOfTheDay pics, as New Project Wizards got new names 2019-03-20 11:23:18 +03:00
Ting-Yuan Huang
f6cf434650 when: emit switch for String if possible
Effectively, the following when structure:

  when (s) {
    s1, s2 -> e1,
    s3 -> e2,
    s4 -> e3,
    ...
    else -> e
  }

is implemented as:

  when (s.hashCode()) {
    h1 -> {
      if (s == s1)
        e1
      else if (s == s2)
        e1
      else if (s == s3)
        e2
      else
        e
    }
    h2 -> if (s == s3) e2 else e,
    ...
    else -> e
  }

where s1.hashCode() == s2.hashCode() == s3.hashCode() == h1,
      s4.hashCode() == h2.

A tableswitch or lookupswitch is used for the hash code lookup.

Change-Id: I087bf623dbb4a41d3cc64399a1b42342a50757a6
2019-03-20 09:13:51 +01:00
Dmitriy Dolovov
1a9ed88be4 Don't publish CLion/AppCode plugins to IDEA channel at plugins.jetbrains.com 2019-03-20 12:19:30 +07:00
Sergey Igushkin
914f7c8719 KT-27675: Following the Gradle Java plugin, enable Kapt cache by default
As the Gradle Java plugin considers Java annotation processing cacheable
with any annotation processors, we can enable build cache by default
for Kapt tasks, leaving the opt-out flag just in case.

Issue #KT-27675 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
ffbd0e8af1 Automatically detect Android Java 1.8 source+target (KT-21030)
When Android Java 8 desugaring is set as follows (or above):

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

set the Kotlin JVM target to 1.8

Issue #KT-21030 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
70db646576 Fix wrong commits picked for master: restore changes from KOTLIN-CR-2817 2019-03-19 21:22:35 +03:00
Sergey Igushkin
ec3e5c6959 Revert "Use KotlinTarget.disambiguationClassifier for task & configuration names" 2019-03-19 21:10:26 +03:00
Roman Artemev
2ed29d8869 [IR BE] Use pure IrType instead of KotlinType
* clean up code
2019-03-19 20:09:07 +03:00
Ilya Chernikov
1823ba1c48 Fix deserialization of the compiled script
#KT-29741 fixed
2019-03-19 17:11:52 +01:00
Ilya Chernikov
b395cb120a Implement import test witch caching
reproduced KT-29741
plus some tests refactoring
2019-03-19 17:11:52 +01:00
Ilya Chernikov
931b1c66d8 Fix equality and serializability of scripting data, fix relevant caching behaviour 2019-03-19 17:11:52 +01:00
Ilya Chernikov
7a4d369c9f Extend script cache tests, revealing that cache doesn't work in fact 2019-03-19 17:11:52 +01:00
Ilya Chernikov
6e55116519 Relocate packages that could be possibly used in the scripts themselves
#KT-30210 fixed
2019-03-19 17:11:52 +01:00
Sergey Igushkin
91ce7ef5ca Introduce new Gradle plugin org.jetbrains.kotlin.js
This is the Gradle plugin that does not rely on the
Java model and uses the same Kotlin model
(target – compilation – source set) as MPP does.

Also add JS DCE support for this plugin.

Issue #KT-5756 Fixed
Issue #KT-13256 Fixed
Issue #KT-16355 Fixed
Issue #KT-20156 Fixed
Issue #KT-29284 Fixed
2019-03-19 16:32:11 +03:00
Sergey Igushkin
03b74343c8 Refactor & minor fix in software component logic of AbstractKotlinTarget
* Create the sources JAR for both Gradle 4.7+ and versions below 4.7
* Set `componentName` in all branches of `createKotlinVariant`
2019-03-19 16:24:37 +03:00
Sergey Igushkin
5b5316214f Apply user-defined attributes in single-platform plugins
The attributes applied by the user to the target and its compilations
were ignored in single-platform plugins while the target was not a part
of the API.

Since the user will be able to access and configure the target, we need
to apply the attributes to the relevant configurations in the same way
as in MPP.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
8fa1630695 Add the single-platform target's 'components' to 'project.components' 2019-03-19 16:24:37 +03:00
Sergey Igushkin
a19e8fe03e Use KotlinTarget.disambiguationClassifier for task & configuration names
In MPP, the disambiguation classifier is always the same as the target
name. In single-platform projects, the task name suffix should be empty
for the JVM targets. Using the `disambiguationClassifier` for this
purpose is more consistent with other usages of
`disambiguationClassifier`.

The target name for all existing single-platform plugins will be just
'kotlin'.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
4e711f9a0c Introduce single-project extensions with static types for Kotlin target 2019-03-19 16:24:37 +03:00
Sergey Igushkin
b3eef05e6e Fix user-specified attributes in Android targets (KT-27714)
Ensure that custom target and compilation attributes are copied to
relevant configurations of Android targets as well, which did not happen
because of Android variants (and missing simple apiElements,
runtimeElements) and Android compilations being created late in the
project configuration.

Issue #KT-27714 Fixed
2019-03-19 16:24:36 +03:00
Sergey Igushkin
6fa610156e Create and configure Android compilations earlier (KT-29964)
As Android variants are created after the project is evaluated,
the build script and plugins might have added some item handlers to the
domain object containers which are yet to be filled.

To ensure that those handlers see properly configured compilations and
their tasks, we need to add a compilations to the container only after
it has been properly configured.

Also, the `forEachVariant` handler is already executed in
`afterEvaluate`, and there seems to be no need to wrap our
code working with variants in `afterEvaluate`.

Issue #KT-29964 Fixed
2019-03-19 16:24:36 +03:00
Toshiaki Kameyama
e06514c945 Smart completing anonymous object: follow code style settings (KT-29572)
#KT-29572 Fixed
2019-03-19 16:09:07 +03:00
kenji tomita
e1f26ffc74 Remove spaces between accessor and its parameter list in formatter (KT-30393)
#KT-30393 Fixed
2019-03-19 16:09:07 +03:00
Toshiaki Kameyama
0acecb4936 Minor: fix caret behaviour in arg template test
#KT-29398 Fixed
2019-03-19 16:09:07 +03:00
Alexander Udalov
29d32b213e Cleanup modules descriptors.jvm, descriptors.runtime
Fix warnings and inspections
2019-03-19 13:01:03 +01:00
Alexander Udalov
b89d7029b2 Reformat modules descriptors.jvm, descriptors.runtime
Also remove several unused files (BuiltinOverridabilityCondition.kt,
PackageMappingProvider.kt)
2019-03-19 13:01:02 +01:00
pyos
39adfcced1 Add more comments to PropertyReferenceLowering 2019-03-19 12:00:29 +01:00
pyos
ed298c48b7 Unmute a test fixed by a combination of PR #2151 and #2184 2019-03-19 12:00:29 +01:00
pyos
6c68474489 JVM_IR: use correct signatures for local delegated property references
Which is `<v#N>` where N is the index of that property in the containing
class.
2019-03-19 12:00:29 +01:00
pyos
8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
pyos
330c4648cb Implement property references in JVM_IR 2019-03-19 12:00:29 +01:00
Dmitry Gridin
43be01bbc8 Fix false positive 'Introduce import alias' on this/super 2019-03-19 16:42:41 +07:00
Dmitry Gridin
1626bc4751 Optimize "Introduce import alias"
Relates to #KT-30462
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ccb1ae13ea Fix local conflicts in 'Introduce import alias' 2019-03-19 16:42:41 +07:00
Dmitry Gridin
9659453351 Improve: intention "Introduce Import Alias" should suggest new names for the new alias
#KT-30456 Fixed
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ff34788eb3 Minor: refactoring KotlinNameSuggester 2019-03-19 16:42:41 +07:00
Nicolay Mitropolsky
0d2426b081 191: Uast: isJvmElement check added to the newly added conversion methods (EA-125791) 2019-03-19 12:24:44 +03:00
Mikhail Glukhikh
a07502374e Rename (style): russian "С" to english "C" 2019-03-19 12:23:47 +03:00
pyos
82ccf81da8 Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
2019-03-19 09:20:41 +01:00
pyos
7e8db4cc4a Refactor InnerClassesLowering 2019-03-19 09:20:41 +01:00
Toshiaki Kameyama
a2adfd0cc0 Nested lambda has shadowed implicit parameter: do not report when lambda is in scope function
#KT-30173 Fixed
2019-03-19 10:37:47 +03:00
Dmitry Gridin
daf8df9e4b Fix flaky test AddReturnToUnusedLastExpressionInFunction/Nothing 2019-03-19 11:29:53 +07:00
Ilya Matveev
fd9ac54d81 Improve deprecation warning about usage of old binary DSL
Previously we showed list of all deprecated APIs even if a user uses
only one of them. This patch changes the behaviour and shows only
APIs really used by the user. An approach similar to the one used by
SingleWarningPerBuild in applied here.

Issue #KT-29998 Fixed
2019-03-19 11:19:49 +07:00
Ilya Matveev
bfb0d738b1 Disable C2 compiler for HotSpot VM when running K/N tools 2019-03-19 11:19:48 +07:00
Ilya Gorbunov
b74fe7c1c3 Clarify floor and ceil docs (KT-30418) 2019-03-19 03:12:12 +03:00
Ilya Gorbunov
b0a234ec74 Minor: collection docs formatting 2019-03-19 03:12:09 +03:00
Ilya Gorbunov
bc444df20c Clarify behavior of MutableSet.add (KT-29373) 2019-03-19 03:12:04 +03:00
Alexander Gorshenev
e9ad9273b1 Proper KotlinIr protobuf location. 2019-03-18 23:29:44 +03:00
Dmitriy Novozhilov
d01b6ef900 Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
Ilya Gorbunov
25b3f62767 Clarify yield/yieldAll function suspending the caller behavior 2019-03-18 18:01:39 +03:00
Mikhail Glukhikh
16f9eecb29 Fix "/ by zero" in FirResolveBench & switch progress OFF in smoke tests 2019-03-18 17:12:02 +03:00
Mikhail Glukhikh
741bdccca5 Enhance progress logging in FIR total resolve tests 2019-03-18 14:49:11 +03:00
Mikhail Glukhikh
a334ca6224 Move FIR total kotlin resolve in IDE test into performance group 2019-03-18 14:48:50 +03:00
Anton Yalyshev
71eb540eaf improved english in wizard's descriptions. also now user knows about project's build system from its name 2019-03-18 14:15:35 +03:00
Svyatoslav Kuzmich
1d6cd90043 [JS IR BE] Clean up compiler driver api
This is a preparation step for JS-IR CLI:
- CompiledModule was overused. Split it into KlibModuleRef and TranslationResult
- Deserialize klib dependencies from klibs itself
2019-03-18 14:13:28 +03:00
Svyatoslav Kuzmich
e302f63d9a [JS IR BE] Remove generateModuleInGlobalScope for code generator
This method used to be a workaround for test speedup.
Now we use proper close world module with runtime+stdlib module
as pre-serialized klib.
2019-03-18 14:13:28 +03:00
Ilmir Usmanov
d154cf9a59 Fix test data 2019-03-18 14:04:04 +03:00
Ilmir Usmanov
c68413b953 Do not generate StateMachineChecker if CHECK_STATE_MACHINE directive is
not present.
Otherwise, since it uses suspend functions, it breaks IR tests.
2019-03-18 14:04:03 +03:00
Ilmir Usmanov
7956ef18b2 Generate RETURN instead of ARETURN if (cross)inline suspend lambda returns Unit
#KT-30073 Fixed
2019-03-18 14:04:02 +03:00
Ilmir Usmanov
cc9a0041e0 Check number of suspensions in crossinline tests 2019-03-18 14:04:01 +03:00
Ilmir Usmanov
df52c5217d Add facility to check number of suspensions in coroutine tests 2019-03-18 14:04:01 +03:00
Maxim Shafirov
ca35c9e2ff Update copyright dates 2019-03-18 12:52:27 +03:00
Nikolay Krasko
b0156bc5db Minor: cleanup KotlinTypeCheckerTest.java 2019-03-18 11:56:20 +03:00
Burak Eregar
db4144426a Fix SimplifiableCallChain inspection quick fix removes comments for intermediate operations 2019-03-18 11:35:32 +03:00
Toshiaki Kameyama
8728bc0820 Convert to scope function: also convert binary expression
#KT-30228 Fixed
2019-03-18 11:18:23 +03:00
Toshiaki Kameyama
e340af51df Add "Rename class to containing file name" intention
#KT-25262 Fixed
2019-03-18 11:09:09 +03:00
Toshiaki Kameyama
39016594b1 Replace return with 'if'/'when': don't drop return label
#KT-30414 Fixed
2019-03-18 09:46:10 +03:00
victor.petukhov
9a2178d96b Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines) 2019-03-16 21:39:44 +03:00
victor.petukhov
29493a4977 Fix 'nothingTypedSuspendFunction' test after 70c35f4186 2019-03-16 14:15:08 +03:00
Alexander Gorshenev
51e862e793 Fix file descriptor unlimited growth. 2019-03-16 13:45:45 +03:00
victor.petukhov
5fc0d85b3c Regenerate FIR tests (include tests for implicit nothing as type parameter) 2019-03-16 00:41:58 +03:00
Alexander Udalov
2539873492 Remove CommonBackendContext.getClass
This function is unused in backend.common (and actually throws exception
in Native), therefore it makes sense to move it down to subtypes
2019-03-15 19:27:48 +01:00
Alexander Udalov
e13b8eb039 Remove CommonBackendContext.getInternalFunctions
Similarly to getInternalClass, move to subclasses
2019-03-15 19:27:48 +01:00
Alexander Udalov
bd694105e9 Remove CommonBackendContext.getInternalClass
Move to subclasses: getJvmInternalClass, getJsInternalClass and
getKonanInternalClass (in Kotlin/Native). The advantage of this is that
this API need not be shared between backends any longer, which makes
sense because implementation details differ across platforms
2019-03-15 19:27:48 +01:00
Alexander Udalov
4ab1916ebf Cleanup Symbols and JvmIr.JvmSymbols 2019-03-15 19:27:47 +01:00
Alexander Udalov
e9c2bc81aa Remove lateinitIsInitializedPropertyGetter, introduce static check function
This will be helpful in JVM IR tests without stdlib where it's not
necessary to have 'isInitialized' in dependencies
2019-03-15 19:27:47 +01:00
Alexander Udalov
c730de13df Minor, add missing copyright to compiler modules 2019-03-15 19:27:46 +01:00
Alexander Udalov
9ca7719d1f Minor, inline obsolete and deprecated createFunctionSymbol
Also undeprecate 'createSymbolForScopeOwner' and make it private
2019-03-15 19:07:16 +01:00
Alexander Udalov
0c8e58936c Remove DeepCopyIrTree and most "Creates unbound symbol" deprecated members 2019-03-15 19:05:19 +01:00
victor.petukhov
70c35f4186 Introduce warning about implicitly inferred Nothing as a type parameter
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Roman Artemev
1f98eaa27b [JS IR BE] Fix Callable reference with vararg
* Update tests
2019-03-15 19:21:38 +03:00
Roman Artemev
a2d65e8a60 [IR] Code clean up 2019-03-15 19:21:38 +03:00
Roman Artemev
95821313e3 [IR BE] Get rid of usages of descriptor-based IrType utils 2019-03-15 19:21:38 +03:00
Roman Artemev
238f1b2b06 [IR] * Implement isSubtypeOfClass and commonSuperclass based on pure Ir
* Implement type strict equality check
     * Move type checkers into Ir
     * Implement strict Fqn-based classifier equality checker
2019-03-15 19:21:38 +03:00
Simon Ogorodnik
e056882aa6 Add DiagnosticsTest testData based smoke test for FIR #KT-29962 Fixed
Yet seven of these tests fail with an exception in RawFirBuilder
2019-03-15 18:31:55 +03:00
Mikhail Glukhikh
0d976a4870 FIR: forbid supertype resolve in local classes 2019-03-15 18:31:49 +03:00
Abduqodiri Qurbonzoda
35c6f09886 Implement coerce extension functions for unsigned types 2019-03-15 17:46:48 +03:00
Abduqodiri Qurbonzoda
a369496aca Throw IOOB on invalid index in JS StringBuilder.get to adhere contract 2019-03-15 17:40:31 +03:00
Abduqodiri Qurbonzoda
814d6cf39c Document Array and String get() function behavior (KT-30141) 2019-03-15 17:40:19 +03:00
Anton Bannykh
a4c693ec29 [JS IR BE] updated inliner to the most recent version
FunctionInlining.kt commit 364b7ae72a :
364b7ae72a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt
2019-03-15 14:56:33 +03:00
Anton Bannykh
0249e33f3e IR: add skipExternalProperties flag to PropertiesLowering
Same problem as in deafult argument lowering: JVM and JS semantics differ.
Same solution: skip in common lowerings, process if needed in platform ones.
2019-03-15 14:56:31 +03:00
Anton Bannykh
9a56b0e6d6 [JS IR BE] Reorder phases in order to extract a common prefix 2019-03-15 14:56:31 +03:00
Anton Bannykh
017cd3a0f6 IR: more verbose unsatisfied phase requirement reporting 2019-03-15 14:55:10 +03:00
Anton Bannykh
9dd9ef1cf0 IR: Make Phaser complain about duplicate phase names
(instead of silently throwing away all but the last phase
with the same name)
2019-03-15 14:55:10 +03:00
Anton Bannykh
bb1660c688 JS: better error reporting for V8 runner
In case of stack overflow both the code and the memory release
caused an exception. Only the latter was shown, and it did
not contain much useful information.
2019-03-15 14:55:10 +03:00
Anton Bannykh
b61a520da9 [JS IR BE] unmute tests 2019-03-15 14:07:53 +03:00
Svyatoslav Kuzmich
41a45d98e7 [JS IR BE] Regenerate & unmute tests 2019-03-15 13:53:23 +03:00
Svyatoslav Kuzmich
0f07209490 [JS IR BE] Remove unnecesary println from tests 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
d203e062bb [JS IR BE] Remove package from operators.kt 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
7b3416c99f [JS IR BE] Disable @library test for JS IR
@library is an internal annotation used in legacy stdlib to expose
declarations written in JS.

IR BE based stdlib will not include JS code thus annotation will not
be supported.
2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
41bbd4d2d6 [JS IR BE] Support property accessors with @JsName 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
c7f1238a07 [JS IR BE] Add @JsName to inheritanceInNativeClass.kt test to avoid relying on mangling 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
9230b70294 [JS IR BE] Minor dynamic refactoring 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
94dc6ff24a [JS IR BE] Disable legacy test 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
4005b5ce10 [JS IR BE] Fix fqNames in moveBodilessDeclarationsToSeparatePlace 2019-03-15 13:53:20 +03:00
Dmitry Gridin
d333a0ad4e Allow "Create class" action in return statement
#KT-22137 Fixed
2019-03-15 17:33:14 +07:00
Dmitry Gridin
41cfb4e2ed Minor: refactoring createClassUtils.kt 2019-03-15 17:33:14 +07:00
Dmitry Gridin
220cb95b85 Move caret to class name after creating it from "CreateFromUsage" action
Relates to #KT-24631
2019-03-15 17:27:06 +07:00
Alexander Gorshenev
0c8f0a433d Copying kotlin-native fix
* commit 575cbf48c3
    | Author: SvyatoslavScherbina <Svyatoslav.Scherbina@jetbrains.com>
    | Date:   Thu Mar 14 14:25:10 2019 +0300
    |
    |     Optimize DescriptorReferenceDeserializer again (#2755)

to common ir deserializer.
2019-03-15 12:48:48 +03:00
Anton Bannykh
826b9d935d JS/JS IR: split testing tasks for the two backends
Run jsTest for current backend, and jsIrTest for the JS-IR backend tests
2019-03-15 12:19:33 +03:00
Dmitriy Novozhilov
b07aed7a00 [NI] Fix determination of completion mode. #KT-30406 Fixed 2019-03-15 10:39:50 +03:00
Dmitriy Novozhilov
1c92c22dee [NI] Add support ExpectedTypeFromCast to new inference. #KT-30405 Fixed 2019-03-15 10:39:29 +03:00
Dmitriy Novozhilov
9062811231 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
Dmitriy Novozhilov
0ba163d70b [NI] Fix testdata of inference lambdas with SAM conversions
Tetdata was broken in 3e147af3c0
#KT-27565 related
2019-03-15 10:39:11 +03:00
Mark Punzalan
3585792b3b Break out bytecodeText/conditions tests into smaller tests for if/while/do-while. 2019-03-15 08:32:22 +01:00
Mark Punzalan
9eb11ff3e9 Generate conditional jumps with optimizations for loops, if possible. 2019-03-15 08:32:22 +01:00
Mikhail Glukhikh
2aaf13e734 FIR: fix test compilation for 181 patchset 2019-03-15 10:24:15 +03:00
Ilya Gorbunov
7a038f1330 Refactor sanitizeStackTrace function to spare allocations
Use Arrays.copyOfRange instead of List.subList.toArray.
2019-03-15 06:26:59 +03:00
Alexander Gorshenev
ee7660065b Changes after code review 2019-03-15 03:03:08 +03:00
Alexander Gorshenev
f8be378a65 Port of native fix to common deserializer
* commit 347e2dadc6
    | Author: Igor Chevdar <igor.chevdar@jetbrains.com>
    | Date:   Wed Mar 6 12:51:40 2019 +0300
    |
    |     [Serializer] More graceful fix of parents
2019-03-15 03:03:08 +03:00
Alexander Gorshenev
cc93239397 Commonized native and js IR serialization infrastructure 2019-03-15 03:03:08 +03:00
Mikhail Glukhikh
909a5fd32d FIR: implement named arguments #KT-24081 Fixed 2019-03-14 18:30:13 +03:00
Mikhail Glukhikh
d65b30dd82 Fix corner-cases in ConeTypeContext / FIR builder / FIR enhancements
This fixes a pack of FIR smoke diagnostic tests, now all of them pass
Related to KT-29962
2019-03-14 18:30:12 +03:00
Mikhail Glukhikh
8ea347653b Remove some FirElement.session usages in FIR resolve 2019-03-14 18:23:25 +03:00
Mikhail Glukhikh
63cb8bb1a7 Remove FirElement.session usages from RawFirBuilder & around
Related to KT-30187
2019-03-14 18:23:11 +03:00
Mikhail Glukhikh
e6bb920a1d FIR Java: support Kotlin extension overriding: at last, #KT-29937 Fixed 2019-03-14 18:18:40 +03:00
Mikhail Glukhikh
d00d078b4f FIR Java: implement "appendErasedType" thus adding predefined signatures
Related to KT-29937
2019-03-14 18:18:20 +03:00
Mikhail Glukhikh
43d06f85e3 Add raw type comparison for Java (J2K mapping is taken into account)
NB: Java enhancement scope does not perform substitution, so we could
have some duplicates inside "type enhancement" testData

Related to KT-29937
2019-03-14 18:17:58 +03:00
Mikhail Glukhikh
f5e2cd2ac4 No override check in FirClassUseSiteScope, fix nasty substitution bug
This fixes MPP override test
(see mppFakeOverride in FirMultiModuleResolveTestGenerated)
2019-03-14 18:17:44 +03:00
Mikhail Glukhikh
de14dd1b9f FIR type enhancements: more accurate * handling 2019-03-14 18:17:31 +03:00
Mikhail Glukhikh
c708171add FIR type enhancements: support annotations for default parameter values
Related to KT-29937
2019-03-14 18:17:17 +03:00
Mikhail Glukhikh
5f3a01c25a Get rid of FirElement.session usages inside fir:java 2019-03-14 18:16:58 +03:00
Mikhail Glukhikh
6c12fabf74 FIR: make JavaClassEnhancementScope use-site, get rid of scope providers
Related to KT-29937
2019-03-14 18:09:41 +03:00
Mikhail Glukhikh
e0348b56a1 FIR type enhancement: extract indexed Java type qualifiers 2019-03-14 18:08:16 +03:00
Mikhail Glukhikh
be412baf9f FIR type enhancement: fold flexible types when it's possible
Related to KT-29937
2019-03-14 18:08:01 +03:00
Mikhail Glukhikh
3d29b31177 FIR type enhancements: handle class qualifiers, add new JSR 305 tests
Related to KT-29937
2019-03-14 18:07:46 +03:00
Mikhail Glukhikh
6c8aba8039 FIR: support callable symbols in dependencies provider
This breaks mppFakeOverrides test because of bug in FIR fake overrides
2019-03-14 18:07:32 +03:00
Mikhail Glukhikh
33fb3d154b FIR Java model: support static members & enum entries
Related to KT-29218
2019-03-14 18:07:17 +03:00
Mikhail Glukhikh
0434a55ea2 FIR: add initial JSR 305 tests for Java type enhancements 2019-03-14 17:57:28 +03:00
Mikhail Glukhikh
14fb495ab6 Support Java constructors in FIR (related to KT-29218) 2019-03-14 17:57:13 +03:00
Mikhail Glukhikh
484e67727f JavaClassifierTypeImpl: convert to Kotlin & cleanup 2019-03-14 17:56:57 +03:00
Mikhail Glukhikh
21d19f4144 JavaClassifierTypeImpl.java -> kt 2019-03-14 17:56:41 +03:00
Mikhail Glukhikh
fb788dc4c0 Fix null Java type argument problem & add relevant test 2019-03-14 17:56:23 +03:00
Mikhail Glukhikh
7563a98999 FIR type enhancement: make J2K mapping and changed handling more exact
Related to KT-29937
2019-03-14 17:56:05 +03:00
Mikhail Glukhikh
9bb2278fd4 Simplify JavaClassEnhancementScope: callback -> TypeInSignature 2019-03-14 17:55:47 +03:00
Mikhail Glukhikh
226cf8e42c FIR Java types: handle wildcard types correctly
Related to KT-29937, KT-29218
2019-03-14 17:55:25 +03:00
Mikhail Glukhikh
6c79b184c0 FIR Java types: add Kotlin/Java mapping & mutability enhancements
Related to KT-29937
2019-03-14 17:55:10 +03:00
Mikhail Glukhikh
e7ac88d326 FIR: implement Java fields (in provider, type enhancement, scopes)
Related to KT-29218
2019-03-14 17:54:53 +03:00
Mikhail Glukhikh
4255c9f774 Add FIR enhancement tests, fix some exceptions / problems around them
Test data and tests themselves are based on
compiler/testData/loadJava/compiledJava
2019-03-14 17:52:33 +03:00
Mikhail Glukhikh
f31faafd72 Introduce initial version of FIR Java type enhancement
Java type enhancement is performed by a special scope kind
Java FIR dump was added for multiplatform tests to look at enhancements
Overrides, J2K mapping, special cases does not work yet

Related to KT-29937
2019-03-14 17:51:00 +03:00
Mikhail Glukhikh
060bd1b464 Add separate FirJava elements (class, method, parameter, type reference)
Related to KT-29218
2019-03-14 17:40:04 +03:00
Mikhail Glukhikh
109f1938f6 FIR: make simplification around class substitution scope 2019-03-14 17:39:49 +03:00
Mikhail Glukhikh
8ac34e1a0f Reformat: context (Java resolve) 2019-03-14 17:39:25 +03:00
Denis Zharkov
6740cdabac Get rid of ConeAbbreviatedType::directExpansion
It becomes necessary after extracting supertypes resolution into a
separate phase.
But also it looks reasonable because direct expansion actually depends
on the module we are looking from.
2019-03-14 17:06:45 +03:00
Denis Zharkov
92defc2ae3 Extract supertypes resolution into a separate FIR phase 2019-03-14 17:06:45 +03:00
Steven Schäfer
3f4c5c8d53 Resolve type aliases when looking for default arguments to actual methods.
Change-Id: I059093c1af32fcd7a2de36c25160c352d6f03a3c
2019-03-14 14:59:34 +01:00
Toshiaki Kameyama
dfd3947856 Keyword completion: add 'fun' after 'suspend' (KT-29038)
#KT-29038 Fixed
2019-03-14 15:35:45 +03:00
Toshiaki Kameyama
fd262bcd8d Smart completion: fix anonymous object code style (KT-29572)
#KT-29572 Fixed
2019-03-14 15:35:44 +03:00
Toshiaki Kameyama
6acf3ad629 Add "arg" postfix template (KT-29398)
#KT-29398 Fixed
2019-03-14 15:35:44 +03:00
Ilmir Usmanov
0c0f035241 Set default value of releaseCoroutines in TypeSignatureMapping to true 2019-03-14 15:06:07 +03:00
Dmitriy Dolovov
5af2cbeacd Fix MPP wizard tests
Issue #KT-30003 fixed
2019-03-14 18:11:25 +07:00
Nicolay Mitropolsky
69ea0175a2 KotlinElementActionsFactory.createAddAnnotationActions: adding @field annotation target for targetless annotations (KT-18459) 2019-03-14 10:59:00 +03:00
Dmitry Gridin
3bf0fb8957 Intention “Introduce import alias” shouldn't modify other files
#KT-30412 Fixed
2019-03-14 12:09:41 +07:00
Dmitry Gridin
179dfce3a8 Fix false positive for type error in intentions AddReturnTo...
Relates to #KT-25272
2019-03-14 10:52:59 +07:00
Georgy Bronnikov
d7ce24410d Remove descriptors from SharedVariablesManager 2019-03-13 23:13:41 +03:00
Ilya Gorbunov
edc766af56 Document exception thrown for negative n in take/takeLast/drop/dropLast
#KT-29151
2019-03-13 17:58:19 +03:00
Ilya Gorbunov
6bc7c06038 Add samples for is(|Not|NullOr)Empty and is(|Not|NullOr)Blank functions 2019-03-13 17:58:05 +03:00
Ilya Gorbunov
ed878be1f7 Docs: reword summaries for a couple of experimental annotations 2019-03-13 17:53:37 +03:00
Ilya Gorbunov
ffe8b4419c Docs: use consistent kotlinlang.org url in references 2019-03-13 17:53:37 +03:00
Dmitry Gridin
479e812bbc Fix false positive "Redundant lambda arrow" inspection
#KT-29590 Fixed
 #KT-19462 Fixed
 #KT-29124 Fixed
2019-03-13 20:57:30 +07:00
Sergey Igushkin
49ee197578 Ignore deprecated configurations in a test with Gradle 5.3+ (KT-30378) 2019-03-13 16:39:56 +03:00
Sergey Igushkin
0830977d16 Exclude the configurations of source sets from dependency resolution
The `*Api`, `*Implementation`, `*CompileOnly`, and `*RuntimeOnly`
configurations of a `KotlinSourceSet` must not be resolved directly, as
they lack attributes needed to choose a Kotlin MPP variant, and they
must not be candidates in variant-aware resolution of a project
dependency either.

With Gradle 5.3, these configurations failed to resolve anyway, as they
had no proper `org.gradle.usage` attribute, and the disambiguation
rules of the 'java-base' plugin conflicted with the Kotlin rules.
2019-03-13 16:39:55 +03:00
Sergey Igushkin
7c139e059a Fix publishing with Gradle 5.3 (KT-30379)
In Gradle 5.3, there was a change to the internal logic of publishing
`SoftwareComponent`s with the 'maven-publish' plugin, and,
simultaneously, a new public API was introduced for user-defined
software components, see https://github.com/gradle/gradle/pull/8399

Earlier, the 'maven-publish' plugin used the Gradle `Usage` attribute
values to arrange the dependencies of a software component's
`UsageContext`s into the Maven scopes. Now that mechanism doesn't work
and a `SoftwareComponent` must provide an explicit mapping of the
variants to POMs by using the `SoftwareComponentFactory.adhoc` API.

However, the new API lacks some features we need to properly publish an
MPP, such as adding a component to another one as a variant, so we still
create old-style software components under the hood and
then wrap them into the new API (and then wrap the adhoc components once
again).

We also continue to use the old-style components for Kotlin-specific
logic like finding a target in another project that a dependency
resolved to, as the components produced by the new API lack crucial
information that is used in the logic, like references to
`KotlinCompilation`s.

Issue #KT-30379 Fixed
2019-03-13 16:39:55 +03:00
Sergey Igushkin
eedb8b0ae1 Run tests against Gradle 5.3 RC2 2019-03-13 16:39:55 +03:00
Sergey Igushkin
17df1ce096 Support a Gradle Usage value 'java-api-jars'
The support on our side involves:

* using the new value for Maven publishing, as the 'maven-publish'
plugin now expects 'java-api-jars' for dependency scopes ordering where
it used to expect 'java-api'

* accepting the new value in KotlinUsages compatibility and
disambiguation rules
2019-03-13 16:39:55 +03:00
Nikolay Krasko
491fb40dd3 Fix INRE from find usages activated with Ctrl + Click (EA-137655)
Only Ctrl + Click is affected as find usages from Alt + F7 is a different
action (`GotoDeclarationAction` is `DumbAware`, but `ShowUsagesAction` is not).
2019-03-13 15:30:06 +03:00
Dmitriy Dolovov
40474bee3f Update Kotlin/Native project templates
Use modern "binaries" DSL
2019-03-13 18:53:47 +07:00
Dereck Bridie
a02ad76b16 KT-25272: Unused expression as last expression of normal function should have quickfix to add "return" Fixed 2019-03-13 17:53:48 +07:00
Burak Eregar
e02877d1dc Disable WhenWithOnlyElse by default. 2019-03-13 13:25:00 +03:00
Abduqodiri Qurbonzoda
a0e2ca669b Write docs for primitive types conversions 2019-03-13 13:14:37 +03:00
Nikolay Krasko
76d4a2fd17 Minor: cleanup org.jetbrains.kotlin.idea package 2019-03-13 12:55:02 +03:00
Nikolay Krasko
08b93b0ba0 Make internal mode controlled from execution arguments 2019-03-13 12:55:00 +03:00
Nikolay Krasko
8e7145d6ff Allow to pass addition system properties to runIde task 2019-03-13 12:54:58 +03:00
Toshiaki Kameyama
bee7736baf Find Java usage of @JvmField declared in primary constructor (KT-18322)
#KT-18322 Fixed
2019-03-13 12:54:55 +03:00
Mads Ager
8b566fda76 JVM_IR: Perform asm type conversion for string concat arguments.
This ensures that the Unit instance is loaded when string
concatenation contains a sub part that is a call of a Unit
return-type method.
2019-03-13 10:01:21 +01:00
Ting-Yuan Huang
013ad4b8e4 JVM_IR: defer some branch optimizations to codegen.
Specifically, defer the removal of hand-written "if (true|false)" from
JvmBuiltinOptimizationLowering into codegen so that appropriate debug
info (and a NOP) can be inserted.

Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
2019-03-13 08:48:20 +01:00
Ting-Yuan Huang
6bbb0269b1 IR: Set when.origin for IrIfElseImpl
Change-Id: I38510b59e3dc936baadbfe3ef2702990493815e5
2019-03-13 08:48:20 +01:00
Ilya Chernikov
18198987a3 Restore jvmTarget 1.6 for scripting libraries that could be used externally
#KT-29319 fixed
2019-03-13 08:47:17 +01:00
Mikhael Bogdanov
1e3277d0e6 Set proper origin for cascaded if expression 2019-03-13 08:27:07 +01:00
Max Medvedev
1040665471 add missing && 2019-03-13 09:09:19 +03:00
Dmitry Gridin
8f9c536a82 Change priority of the quick fixes
#KT-30233 Fixed
2019-03-13 11:07:05 +07:00
Dmitry Gridin
3d66147685 Minor: fix warnings & refactoring 2019-03-13 11:07:05 +07:00
Abduqodiri Qurbonzoda
ba61695a45 Check for index-out-of-bound in elementAt function (KT-30051) 2019-03-12 21:39:09 +03:00
Alexander Udalov
584137121b Do not write version requirements in metadata for lambdas
#KT-29790 Fixed
2019-03-12 18:53:08 +01:00
Alexander Udalov
e942bff4a2 Reformat module 'serialization', fix inspections 2019-03-12 18:53:08 +01:00
Alexander Udalov
a269e9bc00 JVM IR: fix typo in condition in KCallableNamePropertyLowering
This however makes testLocalFunctionName fail because currently
isSubclassOf (incorrectly) returns false and therefore an anonymous
class is generated and the name is taken from there. The name there is
"box$OK" which is incorrect. The isSubclassOf issue is KT-28198 and will
be fixed separately; the incorrect name issue will be investigated later
2019-03-12 18:49:41 +01:00
Mikhael Bogdanov
dd59deb977 Mute failed test 2019-03-12 13:33:35 +01:00
Mikhail Zarechenskiy
f95fdb3cf1 Advance bootstrap to include fix in NI about Nothing-expressions
See 1594c1fc for details. Also, remove fix from f07fed9a.
2019-03-12 15:27:12 +03:00
Alexey Tsvetkov
efe93176ab Fix inter-project IC for kaptGenerateStubs task with AGP
In Android projects we need to detect modules by inspecting jar files
in order to find build history files.
However `useModuleDetection` property was not set up correctly for
KaptGenerateStubsTask.

    #KT-29761 Fixed
2019-03-12 15:10:49 +03:00
Nikolay Krasko
1bfd6705cc Minor: fix junit.framework.Assert deprecation warnings 2019-03-12 14:28:31 +03:00
Nikolay Krasko
213b98fefe Review changes: revert compiler behaviour, add test, remove inner classes 2019-03-12 14:28:31 +03:00
Harry Billinis
6ba134b1be Better names suggestion for constant like reference expressions (KT-28485)
Code was simplified after @igorwojda suggestions

 #KT-28485 Fixed
2019-03-12 14:28:31 +03:00
Nikolay Krasko
7886095327 Prevent constant reporting from released plugin versions in EA (KT-30388)
Apply a compromise strategy between "no report" and "always report".
Report only for several days after release and don't bother users afterwards.

 #KT-30388 Fixed

All exceptions still can be found in Idea Log.
2019-03-12 12:13:24 +03:00
Nikolay Krasko
7f07782095 Allow to throw plugin exception when plugin version is patched 2019-03-12 12:05:21 +03:00
Nikolay Krasko
ddc9d0eba1 Allow to override plugin version with system property
Need this during testing and development.
2019-03-12 12:05:21 +03:00
Steven Schäfer
9ea39d2b7c Fix return types for while loops. 2019-03-12 09:33:00 +01:00
Steven Schäfer
4c8425caeb Run ExpectDeclarationsRemoving in the JVM_IR backend. 2019-03-12 09:29:00 +01:00
Abduqodiri Qurbonzoda
82002e5e73 Remove implementations of conversions from UByte/UShort to Float/Double 2019-03-12 02:56:44 +03:00
Alexander Udalov
d12e5ddafc Generate bytecode for array intrinsics manually
#KT-28285 Fixed
2019-03-11 18:36:10 +01:00
Alexander Udalov
dd0b087b92 Add StackValue.put(InstructionAdapter) for convenience 2019-03-11 18:36:09 +01:00
Alexander Udalov
f9be21c935 Report warning on @Synchronized on inline methods
Until KT-27310 is supported, we warn users that this has no effect.

 #KT-29884 Fixed
2019-03-11 18:32:44 +01:00
Alexander Udalov
76aff56b04 Remove unneded parameter of ResolverForProjectImpl 2019-03-11 18:31:59 +01:00
Alexander Udalov
0ccf7345e3 Move JsAnalyzerFacade from ide-common to js.frontend
To be used in diagnostic tests now, and as a replacement for
TopDownAnalyzerFacadeForJS in the future
2019-03-11 18:31:59 +01:00
Dmitry Gridin
6b8547f57b Fix "Specify type explicitly" intention with generic type
#KT-27641 Fixed
 #KT-30252 Fixed
2019-03-11 23:38:19 +07:00
Dmitry Gridin
57040f6f9d Minor: refactoring & fix warnings 2019-03-11 23:38:19 +07:00
Toshiaki Kameyama
f1e66d0654 Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection
#KT-26269 Fixed
2019-03-11 19:33:17 +03:00
Ilya Gorbunov
42120b93b8 KT-29151 Provide specialized string samples for all drop/take functions
These include:
- take, takeLast, takeWhile, takeLastWhile,
- drop, dropLast, dropWhile, dropLastWhile
2019-03-11 19:30:59 +03:00
Burak Eregar
991e739693 KT-29151 Fix the problematic pages - CharSequence.take() & String.take() 2019-03-11 19:30:58 +03:00
Toshiaki Kameyama
0f45e3d238 Fix false positive for HasPlatformType with member extension on 'dynamic'
#KT-29812 Fixed
2019-03-11 19:28:08 +03:00
Mikhail Zarechenskiy
1594c1fc6b [NI] Don't consider Nothing-constraint as proper to complete call
Follow-up of 9b3e17f0. There we decided to complete call if a type
 variable from a return type has proper lower constraints, now we refine
 this rule wrt `Nothing`-like constraints to avoid inferring type variables
 to Nothing, which is quite useless

 #KT-30370 Fixed
2019-03-11 19:14:29 +03:00
Dmitriy Dolovov
77ab15ec65 Add a hint to the message about not found Kotlin Gradle plugin version
Issue #KT-19788
2019-03-11 18:15:05 +07:00
Dmitry Gridin
6ba0a182bb Fix false positive "Insert explicit type arguments" intention
#KT-16139 Fixed
2019-03-09 14:01:04 +07:00
Dmitry Gridin
212e573c26 Minor: refactoring InsertExplicitTypeArgumentIntention 2019-03-09 14:01:04 +07:00
Ilya Gorbunov
6ae5e91930 Move UArraysKt into kotlin.collections.unsigned package
Provide UArraysKt class in kotlin.collections for binary compatibility
instead of removed multipart facade class. It contains only non-inline
functions of the latter.
2019-03-08 23:35:40 +03:00
Ilya Gorbunov
db4c4132f6 Make JvmPackageName a common internal annotation 2019-03-08 23:35:37 +03:00
Ilya Gorbunov
f07fed9afa Temporary fix to avoid runtime exception due to incorrect inferred type
Caused by: java.lang.ClassCastException:
kotlin.collections.EmptySet cannot be cast to java.lang.Void
  at org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitorKt.findSafelyReachableReturns(CoroutineTransformerMethodVisitor.kt:984)

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2019-03-08 23:35:32 +03:00
Ilya Gorbunov
1f83a48839 Advance bootstrap to 1.3.40-dev-310 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
be6c2d8c7d Implement min max minOf maxOf functions for unsigned types (KT-30035) 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
bf83f0e070 Implement contains extension functions for URanges (KT-26378) 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
cb587893c0 Implement sorting extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
c42dbb34ca Implement drop, take & filter extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
abb275775e Implement map, flatMap, zip & groupBy extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
503264b996 Implement folding extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
7695b5e575 Implement sum extension function for UArrays (KT-28779) 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
690e35f11a Implement reduce, forEach, min & max extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
114736c09b Implement reversing extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
92cd84682c Implement first, last & single extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
299fac8e2d Implement conversion from typed array and collection to UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
bbaabb90e4 Implement any, all, none, count & sumBy functions for UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
512d986006 Implement index-requesting extension functions for UArrays
Contains implementations of `indexOf`, `lastIndexOf`, `indexOfFirst`,
`indexOfLast`, `lastIndex` and `indices` extension functions.
2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
876dff6d22 Implement fill extension function for UArrays (KT-28339) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6b92190726 Implement component(N) functions for destructuring UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
550c74bb6b Implement binarySearch method for UArrays (KT-27262) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6cd9858147 Specialize plus operator for UArrays (KT-28397) 2019-03-08 23:34:32 +03:00
Nikolay Krasko
8977d0e26d Setup Missing API inspection 2019-03-08 19:13:07 +03:00
Alexander Udalov
d8b364ea40 Mark KAnnotatedElement.hasAnnotation as experimental
#KT-29041 Fixed
2019-03-08 14:57:01 +01:00
Kerooker
a342f844b8 Implements KAnnotatedElement.hasAnnotation()
This commit fixes KT-29041, by adding a convenience method to verify if a certain `KAnnotatedElement` has an annotation or not
2019-03-08 14:53:51 +01:00
Ilya Matveev
3a33f68fc9 Fix compilation after refactoring MPP extension access 2019-03-07 20:04:59 +03:00
Kirill Shmakov
fe9236f91e Add key 'module' into interop definitions file 2019-03-07 19:42:32 +03:00
Ilya Matveev
607288b089 Update Kotlin/Native: 1.2-eap-8365 2019-03-07 18:36:56 +03:00
Ilya Matveev
45c2489a53 CocoaPods: Replace '-' with '_' in podspec name 2019-03-07 18:08:50 +03:00
Ilya Matveev
230f11df42 CocoaPods: Refactor framework name mangling 2019-03-07 18:08:50 +03:00
Ilya Matveev
226da18e3a CocoaPods: Rename user-visible: Cocoapods -> CocoaPods 2019-03-07 18:08:50 +03:00
Ilya Matveev
7ac7ea58f8 CocoaPods: Rename podspec task: generatePodspec -> podspec 2019-03-07 18:08:50 +03:00
Ilya Matveev
2f45206268 CocoaPods: Replace dynamic dummy framework with a static one 2019-03-07 18:08:50 +03:00
Ilya Matveev
1f2f0244a1 Refactor kotlin multiplatform extension access 2019-03-07 18:08:50 +03:00
Ilya Matveev
52c9c74f52 CocoaPods: Use regex to split quoted compiler args 2019-03-07 18:08:50 +03:00
Ilya Matveev
3b80ffe1d6 CocoaPods: Add 'native' in the plugin ID
kotlin-cocoapods -> kotlin-native-cocoapods
org.jetbrains.kotlin.cocoapods ->
org.jetbrains.kotlin.native.cocoapods
2019-03-07 18:08:50 +03:00
Ilya Matveev
3cd20fab75 Support -Xstatic-framework in DSL
In Kotlin/Native 1.3.30 EAP1 an ability to build
a static ObjC framework has been added. This patch
adds support for this feature in the kotlin-multiplatform
plugin.
2019-03-07 18:08:50 +03:00
Ilya Matveev
60026c8aa1 Update Kotlin/Native: 1.3.30-eap-8089 2019-03-07 18:08:50 +03:00
Ilya Matveev
21a69b0e5b CocoaPods: Basic support
This patch adds a separate Gradle plugin allowing
a user to import Kotlin/Native modules in Cocoapods
projects and use Cocoapods dependencies in Kotlin
code via cinterop.

The plugin when applied does the following things:

1. Add a framework binary for each supported (iOS
   or macOS) platform in the project.

2. Add a Cocoapods extension allowing one to configure
   Cocoapods dependencies of the project.

3. Create cinterop tasks for each dependency from the
   previous point. The tasks are added for main
   compilations of each supported platform.

4. Add a task to generate a podspec-file which includes
   the framework from the point 1, script to
   build it and dependencies from the point 2.

So the Cocoapods import procedure is the following:

1. A user runs `./gradlew generatePodspec`. The plugin
   creates a podspec-file with all dependencies.

2. The user adds a dependency on this podspec in his Podfile
   and runs `pod install`. Cocoapods downloads dependencies
   and configures user's XCode project.

3. The user runs XCode build. XCode builds dependencies and then
   runs Gradle build. Gradle performs interop processing and
   builds the Kotlin framework. Compiler options and header
   search paths are passed in the Gradle from XCode environment
   variables. After that the final application is built by XCode.

Issue #KT-30269 Fixed
2019-03-07 18:08:50 +03:00
Ilya Matveev
2999cdd3e0 Avoid resolution ambiguity for cinterop DSL
Earlier we used to have two methods: cinterops(Container.() -> Unit) and
cinterops(Action<Container>). It's OK for Groovy DSL but causes resolution
ambiguity in Kotlin DSL. This patch removes the first overload to avoid
this situation. The second overload still can be called in Kotlin DSL
as `cinterops { ... }`.
2019-03-07 18:05:54 +03:00
Ilya Matveev
8a012c83e5 Deprecate old DSL method for binary configuration
In 1.3.20 a new binaries DSL was introduced. This
patch deprecates old DSL methods used for binary
configuration in 1.3.0 and 1.3.1x.

Issue #KT-29998 Fixed
2019-03-07 18:05:54 +03:00
Ilya Matveev
b971a91a8c Add main interop libraries in test interop dependencies
Earlier we added interop libraries built for a main compilation
in dependencies of a corresponding test compilation. But we didn't
add them in dependencies of interop libraries built for the test
compilation. It caused cinterop failures when the test compilation
has interop libraries. This patch fixes it by adding main interop
libraries in dependencies of test ones.

Also earlier interop libraries of test compilations were
unintentionally added in apiElements and publication. This patch
fixes this issue too.

Issue #KT-30290 Fixed
2019-03-07 18:05:54 +03:00
Dmitriy Novozhilov
b681e4bda3 NI. Fix call commonSuperType for 0 types (bug introduced in cbf1d773) 2019-03-07 17:50:30 +03:00
Roman Elizarov
4f532a7c05 Invoke probeCoroutineResumed on each unroll of the frame from heap
Fixes KT-29997
2019-03-07 17:04:11 +03:00
Dmitriy Novozhilov
9b50d31169 NI. Fix StackOverFlow in type approximation. #KT-30021 Fixed 2019-03-07 16:24:53 +03:00
Dmitriy Novozhilov
cbf1d773f7 NI. Coerce return type of lambda function descriptor to Unit. #KT-30242 Fixed 2019-03-07 14:36:09 +03:00
Dmitriy Novozhilov
77c98bef4d Fix recursion in contract declaration analysis. KT-26386 Fixed
Issue fixed only in old inference
2019-03-07 14:35:18 +03:00
Dmitriy Novozhilov
d0462859bf Minor. Fix reporting diagnostic in contract with callable reference 2019-03-07 14:35:13 +03:00
Alexander Udalov
518b03125c Support JVM target versions up to 12
#KT-26240 Fixed
2019-03-07 11:42:31 +01:00
Alexander Udalov
9f75fd0d62 Minor, remove confusing logic from GenericReplChecker 2019-03-07 11:42:31 +01:00
Alexander Udalov
c7c377e1b1 Use JvmTarget.DEFAULT instead of JVM_1_6 where applicable 2019-03-07 11:42:31 +01:00
Pavel Nikitin
a6b7aa3257 KT-30322 Memory leak in CompilationSourceSetUtil (#2158)
Issue #KT-30322 Fixed
2019-03-07 12:57:48 +03:00
Anton Yalyshev
b3cbd7d5bd update names for Kotlin Gradle DSL wizards as well 2019-03-07 10:44:58 +03:00
Dmitriy Dolovov
dbc66bd0ae Native: Support 2- and 3-digit Kotlin/Native versions 2019-03-07 12:59:27 +07:00
Nikolay Krasko
ec0084ef61 Minor: remove outdated ant mentioning 2019-03-06 18:16:30 +03:00
Nikolay Krasko
878e56f2ab Minor: clean deprecated warnings in KotlinTestFinder.kt 2019-03-06 18:16:29 +03:00
Nikolay Krasko
606a7766af Make colours for lambda return hints similar to other hints (KT-30203)
Works for IntlliJ and Darcula themes but doesn't work with High Contrast
2019-03-06 18:16:29 +03:00
Nikolay Krasko
0e990ae01b Update inserting algorithm to preserve order for tags with the same offset 2019-03-06 18:16:29 +03:00
Nikolay Krasko
06dbe1ec09 Avoid adding DYNAMIC_PROPERTY_CALL highlighting twice
Tested in idea/testData/highlighter/Dynamic.kt
2019-03-06 18:16:29 +03:00
Nikolay Krasko
1cc59f4b18 Mute false positive duplicate warnings in highlighting in 191 2019-03-06 18:16:28 +03:00
Mikhael Bogdanov
6a893ba196 Regenerate test data 2019-03-06 16:12:43 +01:00
Steven Schäfer
eec25dbea2 Avoid true condition generation for do while loop, since it confuses the Java verifier.
Change-Id: I96eca6623a91a8365090768f42c6e865b612e1cc
2019-03-06 16:04:23 +01:00
Alexander Udalov
59fda8d7ce Support JvmPackageName with JvmMultifileClass
This is an internal feature of our standard library needed to compile
new API for unsigned types
2019-03-06 15:34:23 +01:00
Alexander Udalov
ea21cda4df Reformat MultifileClassCodegen, fix inspections 2019-03-06 15:33:45 +01:00
Alexander Udalov
670b06ae97 Minor, ignore tests on typeOf without reflection on Android
Currently all Android tests are run with kotlin-reflect in the
classpath, so these tests can't succeed
2019-03-06 15:25:21 +01:00
Sergey Igushkin
7d9405a9cb Warning for Kotlin plugins loaded multiple times (KT-30276)
Print a warning with an instruction on how to fix this. Don't warn about
different versions and duplicate plugins in composite build.

Issue #KT-30276 Fixed
2019-03-06 16:05:02 +03:00
Sergey Igushkin
42a7c87e2e Setup conf2ScopeMappings for 'api' configuration with 'maven' plugin
The 'java' plugin doesn't expect the 'api' configuration to exist (it
is only introduced by the 'java-library' plugin) and doesn't map it
to the compile scope when publishing with the legacy 'maven' plugin.

This commit adds the missing conf2ScopeMapping for 'api' -> 'compile'
2019-03-06 16:04:08 +03:00
Sergey Igushkin
803af3e040 Fix ConcurrentModificationException iterating over tasks (KT-29971)
Issue #KT-29971 Fixed
2019-03-06 16:04:08 +03:00
Sergey Igushkin
4aaa1a8067 Rewrite MPP dependencies in POMs of single-platform projects (KT-27059)
This is needed to ensure that POMs of single-platform Kotlin projects
depending on MPP libraries contain dependencies (Maven coordinates)
of the platform-specific modules of the libraries.

The mechanism and rationale are the same as in KT-28482

Issue #KT-27059 Fixed
2019-03-06 16:04:07 +03:00
Sergey Igushkin
51279a8195 Add a switch that disables dependencies rewriting in POMs
This covers the cases when a user knows what they do and doesn't want
anything to do any changes to the POMs, e.g. they want to manually
replace all of the dependencies, so they need the original dependencies.
2019-03-06 16:04:07 +03:00
Sergey Igushkin
2f8baf6715 Refactor: move all tools for MPP dependencies rewriting to a utils file 2019-03-06 16:04:07 +03:00
Natalia Selezneva
f98429c509 Preprocess script dependencies before running UnusedSymbolInspection
^KT-29474
2019-03-06 15:42:50 +03:00
Natalia Selezneva
47a4500eaa Show notification that script dependencies are not ready yet 2019-03-06 15:42:49 +03:00
Natalia Selezneva
1d56f44093 Show progress for loading script dependencies even show notification is true when there are more than 3 scripts in queue
We are trying to update script dependencies silently when 'Reload script dependencies on file change' is off,
but in case when the queue for update is too long we need to make process visible to user and make it cancelable.
2019-03-06 15:42:49 +03:00
Natalia Selezneva
8331d9789e Fire one 'roots changed' event after all scripts dependencies loaded
^KT-29474
2019-03-06 15:42:49 +03:00
Natalia Selezneva
6bc6dea916 Check project.isDisposed before attaching script reports 2019-03-06 15:42:48 +03:00
Natalia Selezneva
c2dd365158 Do not search for text occurrences if this option is switched off 2019-03-06 15:40:59 +03:00
Natalia Selezneva
4a0574dc5f Scratch can be modified during execution (KT-30200)
^KT-30200 Fixed
2019-03-06 15:40:46 +03:00
Natalia Selezneva
0dbbd8e08c Introduce ScratchPanelListener to set module in the created panel (KT-30049)
^KT-30049 Fixed
2019-03-06 15:40:30 +03:00
Ting-Yuan Huang
c1d721a15f when: emit lookupswitch/tableswitch if possible
A lookupswitch or tableswitch can be used if all conditions are equality
checks to constants. To be more specific, it can be done if:
  1. All conditions are CALL 'EQEQ(Any?, Any?)': Boolean
  2. All types of variables involved in comparison are in the same group
     of Char/Byte/Short/Int, String or enum.
  3. All arg0 refer to the same value.
  4. All arg1 are IrConst<*>.

Change-Id: Ifd7cb618395f6c5cc64601018b446f0bb7f5891c
2019-03-06 13:33:55 +01:00
Sergey Rostov
f5d0a38629 JPS Build: update artifacts 2019-03-06 14:42:49 +03:00
Simon Ogorodnik
3950dec4db Implement TypeSystemContext for FIR #KT-29968 Fixed
Use this context in FirClassUseSiteScope for type comparison
2019-03-06 13:36:00 +03:00
Simon Ogorodnik
85cd4f3cdf Extract common code (TypeSystemContext) 2019-03-06 13:33:29 +03:00
Igor Chevdar
2c7b05a67b Wrapped descriptors: supported complex annotations 2019-03-06 13:25:06 +03:00
Toshiaki Kameyama
6b35c06d50 Add intention to replace '!isNotEmpty()' to 'isEmpty()'
#KT-30123 Fixed
2019-03-06 11:06:40 +03:00
Mikhail Zarechenskiy
88ee0bf6af Swap arguments for diagnostic message about incompatible enums
This commit is restoring previous behavior changed in c4b69b65 and
 fixing `DiagnosticMessageTestGenerated.testIncompatibleEnums` test
2019-03-06 10:44:45 +03:00
Yan Zhulanow
3315c1c35b Debugger: Call invokeMethod() safely, through the execution context (KT-30268, EA-131589) 2019-03-06 03:30:56 +03:00
Yan Zhulanow
9d176917e6 Fix EA-138393: Calculate async stack traces only on breakpoints 2019-03-06 03:30:55 +03:00
Yan Zhulanow
eb1543c71a Minor: Fix a few compilation warnings in compiler and compiler tests, fix formatting 2019-03-06 03:30:55 +03:00
Yan Zhulanow
5564760ebf Pill: Recognize non-default test source roots 2019-03-06 03:30:55 +03:00
Yan Zhulanow
bab1c63126 Fix EA-135863: Access allLineLocations() safely 2019-03-06 03:30:54 +03:00
Yan Zhulanow
b54f9a0c05 Fix EA-105847, use 'location()' safely 2019-03-06 03:30:54 +03:00
Roman Artemev
e3e3fcded1 Fix windows j2v8 artifact 2019-03-05 22:56:48 +03:00
Alexander Udalov
2bec72d46a Additional cleanup of KotlinTypeMapper after J2K 2019-03-05 20:34:32 +01:00
Mikhael Bogdanov
20da778046 Add default values to KotlinTypeMapper constructor, remove them from call sites
~
2019-03-05 20:34:25 +01:00
Mikhael Bogdanov
cc0c3b1592 Specify default value for irBackend 2019-03-05 20:33:35 +01:00
Mikhael Bogdanov
a3c3282362 Minor. Clean up code after convertion 2019-03-05 20:33:34 +01:00
Mikhael Bogdanov
315df81397 Convert KotlinTypeMapper to Kotlin 2019-03-05 20:33:33 +01:00
Mikhael Bogdanov
61a95b440f Rename .java to .kt 2019-03-05 20:33:32 +01:00
Mikhael Bogdanov
b43622b87f Minor. Code clean 2019-03-05 20:33:31 +01:00
Alexander Udalov
d1e33534db Implement typeOf intrinsic on JVM
#KT-29915 Fixed
2019-03-05 18:16:31 +01:00
Alexander Udalov
5d297c40fd Minor, move ReifiedTypeParameterSubstitutionChecker to PlatformConfiguratorBase 2019-03-05 17:58:10 +01:00
Alexander Udalov
c61fe16202 Minor, fix inspections, remove unused in codegenUtil.kt 2019-03-05 17:58:10 +01:00
Alexander Udalov
e3779b1883 Minor, relax parameter type of AsmUtil.putJavaLangClassInstance 2019-03-05 17:58:10 +01:00
Alexander Udalov
afe3bed7e1 Minor, remove unused functions from inlineCodegenUtils.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
214ef0c3c2 Move generation of inline intrinsics to inlineIntrinsics.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
69eae035f6 JVM IR: do not add kotlin-reflect in tests unconditionally 2019-03-05 17:58:09 +01:00
Alexander Udalov
4d817aa6cf Minor, simplify/optimize FunctionTypeConstructor.computeSupertypes 2019-03-05 16:28:53 +01:00
Alexander Udalov
b73a927133 Remove KotlinTestUtils.replaceHash
Both package parts and SAM wrappers have no hashes in their names for a
long time already
2019-03-05 16:28:53 +01:00
Alexander Udalov
74b14f14bd Minor, refactor parseLanguageVersionSettings
Get rid of code duplication, use a more type-safe approach to
enumerating analysis flags
2019-03-05 16:28:53 +01:00
Alexander Udalov
4136fd1dbb Minor, remove unused parameter of LazyImportResolver.collectFromImports 2019-03-05 16:28:53 +01:00
Alexander Udalov
c069371591 Inline LazyImportScope.selectSingleFromImports 2019-03-05 16:28:52 +01:00
Alexander Udalov
b6e745fe52 Minor, rename InlineExposed -> PublishedApi in readme 2019-03-05 16:28:52 +01:00
Alexander Udalov
9d94a54f03 Simplify ExternalDependenciesGenerator
Remove unused parameters, inline inner class
2019-03-05 16:28:34 +01:00
Alexander Udalov
4b712bd14b Remove dependency of backend-common on descriptors.jvm 2019-03-05 16:28:34 +01:00
Alexander Udalov
d7fd4987ae Remove dependency of ir.tree on frontend.java 2019-03-05 16:28:34 +01:00
Alexander Udalov
45e8d2e1df Do not use JVM-specific code for SAM conversions in psi2ir
Extract all JVM-specific code into GeneratorExtensions.SamConversion.
This is needed in order to remove dependency of ir.tree on frontend.java
2019-03-05 16:28:33 +01:00
Alexander Udalov
aaa2bad719 Do not use IR_EXTERNAL_JAVA_DECLARATION_STUB in DeclarationStubGenerator
This code is common across backends and it should not depend on
JVM-specific behavior. Introduce GeneratorExtensions to reverse the
dependency here
2019-03-05 16:28:33 +01:00
Alexander Udalov
f29012a78f Remove unreachable code in psi2ir tests, delete unused tests 2019-03-05 16:28:33 +01:00
Mikhail Glukhikh
8e29ee53a4 Deprecate session in FirElement (related to KT-30275) 2019-03-05 18:23:17 +03:00
Denis Zharkov
2dbe96c853 Extract ConeClassifierLookupTag (aka SearchSymbol)
So, for classifiers there are both Symbols and LookupTags
The difference between them is that the former are assumed to have
a reference to the actual FirDeclaration while LookupTags
effectively contain only classId and
something informative may only be obtained by FirSession

#KT-24075 Fixed
2019-03-05 18:23:17 +03:00
Toshiaki Kameyama
6b5ba272a0 Import members from: suggest on type reference
#KT-29927 Fixed
2019-03-05 18:19:33 +03:00
Abduqodiri Qurbonzoda
3af6b36401 Write docs for unsigned types conversions 2019-03-05 17:34:15 +03:00
Nicolay Mitropolsky
f664499708 Uast: getMaybeLightElement cleanup 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
ec1badf60d Uast: testing resolve for method called on variables of parametrized types 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
5268cd4663 Uast: type-parameter references resolves to type-parameters 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
ec26ea4e36 Uast: TypeReferences log test added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
adb13b2f9e Uast: ResolveEverythingTest tests for generics added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
337f16194a Uast: resolving references to local function declarations 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
72860fb695 Uast: making KotlinUSimpleReferenceExpression able to resolve to types 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
e1e1e53e4a Uast: setup for KotlinUastResolveEverythingTest 2019-03-05 14:30:07 +03:00
Mikhail Zarechenskiy
c4b69b65bc Gradually prohibit comparison of incompatible enums
#KT-22043 Fixed
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
82c8289666 Refactoring: move getRepresentativeUpperBound method to core
Plus prettify it a bit
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
7c357c0ec0 [NI] Complete calls during one inference session only once
The problem is that delegated properties resolve two calls together:
 `getValue`/`setValue` with a common receiver, which can contain
 callable references. For each completion new anonymous descriptor
 was created and caused "rewrite at slice" exceptions later.
 Now there is a little hack to check that during one inference session
 we don't complete one call more than one time.

 More correct fix would be to explicitly specify common receiver for
 inference session but it requires quite big refactoring, which will
 be done later with a whole refactoring of the common solver

 #KT-30250 Fixed
2019-03-05 13:33:22 +03:00
Stanislav Erokhin
14c93c7c0e Remove obsolete ant build file: build-docs.xml 2019-03-05 12:54:02 +03:00
Anton Yalyshev
52f297c644 renewed pictures of our wizards in TipOfTheDay #KT-28941 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
8a3659008e unified naming of Kotlin projects #KT-17829 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
415793be1c better look for wizards names and descriptions: removed word dups and specified build system #KT-27183 Fixed 2019-03-05 11:40:19 +03:00
Simon Ogorodnik
dc56fd873a Add missing type-system dependency to ultimate 2019-03-05 01:52:03 +03:00
Roman Artemev
88d365328a [JS IR BE] Run JS IR tests in V8 engine 2019-03-04 23:24:18 +03:00
Roman Artemev
2ccd093099 Update test data 2019-03-04 23:24:18 +03:00
Roman Artemev
80a2be50c3 Regenerate tests 2019-03-04 23:24:18 +03:00
romanart
8e02964112 Make test be language version agnostic 2019-03-04 23:24:17 +03:00
romanart
2d6b291998 Rename test 2019-03-04 23:24:17 +03:00
romanart
5d6f42e4e6 Fix rebase 2019-03-04 23:24:17 +03:00
Roman Artemev
3770d310f1 Deserialization code clean up 2019-03-04 23:24:17 +03:00
Roman Artemev
d085e66aa3 [JS IR BE] Optimize test performance
* temporary disable verification
 * restore default/full runtime source set scheme
2019-03-04 23:24:16 +03:00
Roman Artemev
5033d99380 [JS IR BE] Update test data 2019-03-04 23:24:16 +03:00
Roman Artemev
a19bdd0c18 [JS IR BE] Refactored klibs proto files 2019-03-04 23:24:16 +03:00
Roman Artemev
52baf90518 Drop DebugJsAstProtoBuf 2019-03-04 23:24:15 +03:00
Roman Artemev
cae800b24e [JS IR BE] Fix deserialization performance 2019-03-04 23:24:15 +03:00
Roman Artemev
079f2534c7 [JS IR BE] Support compilation and tests against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
b99377fd69 [JS IR BE] Fix backend to be able compile test against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
0ec75f1534 [JS IR BE] Temporary fix K/JS stdlib 2019-03-04 23:24:14 +03:00
Roman Artemev
b0b6b359b1 [JS IR BE] Do not produce KotlinType creating IrType 2019-03-04 23:24:14 +03:00
Roman Artemev
6863f9e4f3 [JS IR BE] Make backend be able work with unbound symbols
* Fix array type deserialization
 * Prepare to compilation against klibs
2019-03-04 23:24:14 +03:00
Roman Artemev
2334ea2742 [JS IR BE] Support IrDynamicExpression in proto and deserializer 2019-03-04 23:24:13 +03:00
Roman Artemev
44010cc6ef [JS IR BE] Refactored compiler interface 2019-03-04 23:24:13 +03:00
Roman Artemev
67f0d49ea1 [JS IR BE] Fix rebase 2019-03-04 23:24:13 +03:00
Roman Artemev
4ede02f5b2 [JS IR BE] Update test data 2019-03-04 23:24:12 +03:00
Roman Artemev
b2cfef4902 [JS IR BE] Lazy initialize lowering properties 2019-03-04 23:24:12 +03:00
Roman Artemev
c95d99dbe0 [JS IR BE] Use symbol instead of declaration 2019-03-04 23:24:12 +03:00
Roman Artemev
862ccd05df [JS IR BE] Merge native fixes into Ir Serializer 2019-03-04 23:24:12 +03:00
Roman Artemev
813fef6f26 [JS IR BE] Get rid of usages of KotlinType 2019-03-04 23:24:11 +03:00
Roman Artemev
d034ce106e [JS IR BE] Implement isPrimitiveArray with pure Ir 2019-03-04 23:24:11 +03:00
Roman Artemev
3a444cd0f3 [JS IR BE] Move IrSerializer from native to JS
* Fix issues
2019-03-04 23:24:10 +03:00
Roman Artemev
5384f23f30 [JS IR BE] Extract metadata deserializer to keep binary compatibility
* add UniqId extension to metadata protobuf
2019-03-04 23:24:10 +03:00
Roman Artemev
3718edb6bc [JS IR BE] Some preparation for IrSerialization 2019-03-04 23:24:09 +03:00
Ilya Gorbunov
d4b97d33ef Introduce kotlin.ExperimentalStdlibApi annotation for prerelease API
#KT-30174
2019-03-04 20:47:49 +03:00
Kirill Shmakov
05be09c839 Explicitly order projects for cidr plugin build
With additional module included, evaluation of :prepare:idea-plugin
is requested prior to :prepare evaluation. See KOTLIN-CR-2775.
2019-03-04 20:21:52 +03:00
Mikhail Glukhikh
14a6f684dc Reformat "make constructor parameter a property" quick-fix 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
9e2ee6183c Fix "make constructor parameter a property" for vararg case
Same should work for annotated parameters
#KT-29312 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
c714e599ea Don't report "Unsafe call with ? extension receiver" with smart-cast
#KT-29499 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
4d19120d84 Don't report "main parameter not necessary" in objects #KT-29414 Fixed 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
022c625d2d MPP web builder: upgrade Ktor version to 1.1.3 #KT-29918 Fixed 2019-03-04 17:57:52 +03:00
Simon Ogorodnik
4882627712 Make type-system KotlinType-independent
- Port NewKotlinTypeChecker.equalTypes
- Decouple new-type transform from isSubtypeOf
- Port isSubtypeForSameConstructor
- Port checkSubtypeForSpecialCases
- Port isSubTypeOf without internals
- Port anySupertype
- Port isSubtypeForSameConstructor, findCorrespondingSupertypes
- Port isSubtypeOfForSingleClassifierType
- Port NullabilityChecker
- Reorder checks for performance
2019-03-04 17:27:45 +03:00
Simon Ogorodnik
d210e8bad0 Introduce optional optimization parameters for type system context 2019-03-04 17:10:47 +03:00
Simon Ogorodnik
8992537180 Place instance markers in KotlinType hierarchy 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
be79aeafa7 Create first draft of AbstractStrictEqualityTypeChecker 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
f7702d3e43 Create new core module: type-system 2019-03-04 17:10:45 +03:00
Natalia Selezneva
fe278ea0a0 Add test for build.gradle.kts highlighting 2019-03-04 16:13:23 +03:00
Mikhael Bogdanov
6d9c49e55e Add IrCompileKotlinAgainstKotlinTest tests 2019-03-04 13:59:58 +01:00
Toshiaki Kameyama
1b7627e039 Surround with null check: suggested for an assignment
#KT-30215 Fixed
2019-03-04 15:11:57 +03:00
Toshiaki Kameyama
2314a38342 Reformat SurroundWithNullCheckFix 2019-03-04 15:11:57 +03:00
Sergey Rostov
f467d892ca Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-04 13:12:34 +03:00
Sergey Rostov
88c04f75f1 Gradle: Move files from org.jetbrains.kotlin.gradle.plugin.mpp to org.jetbrains.kotlin.gradle.targets 2019-03-04 13:12:22 +03:00
Sergey Igushkin
51234d10b9 Actual change for splitting files preserving Git history
Remove resulting redeclarations and finish the split in files below:

  - from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:12:10 +03:00
Sergey Igushkin
b096057bdc (step 8/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the temporary files back to their original paths.
2019-03-04 13:11:42 +03:00
Sergey Igushkin
0473bd2c4c Merge commit 'ffdd43b8083c4fd7795799e351f23d997534a43e'; commit 'af3bf257ba1584fd2f3d690fe76c48778699e29b'; commit '83d22a3744df1b79545070fbb9ea13ee1182a614'; commit 'b7cf915e884caea8cabc2db5f611fa5d5a7536e8'; commit '522a5b8c3ffd84c11cb70efead9c152e8d62cd37'; commit '37a117574f314263360350964e80ce182c093e31' into move-packages-on-master 2019-03-04 13:11:35 +03:00
Sergey Igushkin
bb90cf7831 (step 7/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the original files to
temporary files suffixed with '.git_split_tmp'
2019-03-04 13:11:35 +03:00
Sergey Igushkin
37a117574f (step 6/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinMetadataTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinWithJavaCompilation.kt
2019-03-04 13:11:32 +03:00
Sergey Igushkin
522a5b8c3f (step 5/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmWithJavaTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinNativeCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinWithJavaCompilationFactory.kt
2019-03-04 13:11:31 +03:00
Sergey Igushkin
b7cf915e88 (step 4/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJsCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinNativeCompilationFactory.kt
2019-03-04 13:11:28 +03:00
Sergey Igushkin
83d22a3744 (step 3/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinWithJavaTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinJsTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmAndroidCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmAndroidCompilationFactory.kt
2019-03-04 13:11:26 +03:00
Sergey Igushkin
af3bf257ba (step 2/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinNativeTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinNativeTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmCompilationFactory.kt
2019-03-04 13:11:24 +03:00
Sergey Igushkin
ffdd43b808 (step 1/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  KotlinTargetConfigurator.kt -> KotlinNativeTaretConfigurator.kt
  mpp\kotlinTargets.kt -> mpp\KotlinAndroidTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinAndroidTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinCommonCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJsCompilationFactory.kt
  mpp\kotlinCompilationOutputs.kt -> mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:11:22 +03:00
Dmitry Gridin
dce2139eb0 Fix KNPE from "Create" quick fix
#KT-27289 Fixed
2019-03-04 13:01:18 +03:00
Dmitry Gridin
78bee70946 Refactoring 2019-03-04 13:01:18 +03:00
Nikolay Krasko
b458e187af Extract ITNReporter.submit() compatibility problem to separate file 2019-03-04 12:14:23 +03:00
Nikolay Krasko
a5434d7d9e Add internal action for reporting exceptions from Kotlin plugin 2019-03-04 12:14:23 +03:00
Nikolay Krasko
6504cb285b Add internal action for continuous enabling and disable dumb mode 2019-03-04 12:14:22 +03:00
Nikolay Krasko
27ba9b5481 Fix Goto tests by invoking action directly instead of using handler
Problem introduced in
1f7f3d9fdc

Implementation CodeInsightActionHandler was returned for GotoDeclarationAction later.
2019-03-04 12:14:22 +03:00
Mikhail Zarechenskiy
93e79afab4 [NI] Preserve nullability of resulting type from CST if it's possible
Consider common supertype of `S` and `Nothing`, where `S` has nullable
 upper bound or it's flexible. Before the fix, result was `S?`, which
 is correct but too conservative. Now, we'll preserve nullability of
 resulting type if it's already nullable.

 This happened because we were failing to find path of not-nullable
 types from `Nothing` to `S`, which should obviously exists by
 semantics of Nothing
2019-03-04 11:29:39 +03:00
Mikhail Zarechenskiy
9b3e17f0d7 [NI] Avoid building controversial systems by clipping extra constraints
#KT-23854 Fixed
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
92b40ea9d5 [NI] Refactor adding expected type constraint
Add comments, make computation needed for expected type more clear
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
43cf6623f9 [NI] Added test for controversial common system
See KT-23854
2019-03-04 11:29:38 +03:00
Dmitry Gridin
5927032143 Fix "Introduce import alias" on extensions
#KT-30214 Fixed
2019-03-04 10:15:52 +03:00
Pavel V. Talanov
853e9a2aa0 Prevent calls to onFirstRun default implementation for gradle rc
This is temporary until we get compatible API from IDEA
    to support gradle run configurations for MPP projects in IDEA 191+
2019-03-04 02:52:41 +01:00
Andrey Uskov
25dc81c2bd Fix memory leak in gradle import
#KT-30076 Fixed
2019-03-03 20:28:04 +03:00
Andrey Uskov
3919898d19 Minor. Reformat code in multiplatform project importer 2019-03-03 20:27:12 +03:00
Ilya Chernikov
db3eb5707b Drop redundant usages of the ScriptDefinitionProvider 2019-03-02 08:10:17 +01:00
Ilya Chernikov
e99715cf82 Extract extra imports provision into an extension, implement one ...
for script in the plugin, drop direct dependency on scripts from
FileScopeFactory
2019-03-02 08:10:17 +01:00
Ilya Chernikov
57ac149f5b Extract script cli evaluation to the plugin 2019-03-02 08:10:17 +01:00
Ilya Chernikov
7c3bdde102 Fix sequence of the script definitions search - explicit ones should be tried first 2019-03-02 08:10:16 +01:00
Ilya Chernikov
196e274929 Move calculating dependencies from script sources to plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
336f43dbf2 Reorganize files and folders in the scripting plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
adb4d264ec Move script definition extraction functions to the plugin
plus finish refactoring of these functions
2019-03-02 08:10:16 +01:00
Nicolay Mitropolsky
815fcd062d Uast: caching isJvmElement if all modules are Jvm (KT-28564) 2019-03-01 20:14:57 +03:00
Alexander Udalov
8ef7f73164 Fix incorrect enum comparison in kotlinx-metadata
Previously, we compared instances of different enums and thus the
conditions were always true. This did not affect visible behavior of the
program except the fact that we've been writing default field values
(kind and level) for version requirements to protobuf where they
could've been omitted
2019-03-01 17:09:03 +01:00
Shagen Ogandzhanian
ed4e93cc98 Fix for npm publishing configuration
This reverts commit 0188cd5330.
Turns out it's not a url after all
2019-03-01 15:46:28 +01:00
Dmitry Gridin
2a940f5b0a Fix KT-26965 2019-03-01 17:43:56 +03:00
Shagen Ogandzhanian
7162dd9807 Prepare JsTestChecker (but not introduce so far) for J2V8 adoption 2019-03-01 15:29:35 +01:00
Wil
d3ac50f694 Minor: typo fix in Writer.buffered docs 2019-03-01 17:09:27 +03:00
Dereck Bridie
4156a76129 #KT-26965 Add inspection + quickfix for replacing Collection<T>.count() with .size 2019-03-01 16:58:36 +03:00
Toshiaki Kameyama
240ff08069 Specify type: escape with backticks if need
#KT-29677 Fixed
2019-03-01 16:43:02 +03:00
Toshiaki Kameyama
1a818970c3 Add inspection to replace Java Map.forEach with Kotlin's forEach
#KT-17278 Fixed
2019-03-01 16:15:23 +03:00
Nicolay Mitropolsky
9c674cb7c3 Uast: support for KtDelegatedSuperTypeEntry (KT-30033) 2019-03-01 15:00:31 +03:00
Dmitriy Novozhilov
2f5843f764 Move detecting of illegal call of contract function into call checker
(#KT-26153, #KT-26191) fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
54e5cce9be Prohibit declaring multiple callsInPlace contract on same lambda.
#KT-26150 fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
4a7420d77d Allow declaring contracts on suspend functions. KT-27468 Fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
84da8b6279 Report CONTRACT_NOT_ALLOWED diagnostic on extension property getter/setter
KT-27090
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
b484e03fa8 Allow use contract function by FQN. #KT-29772 fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
7072b9d179 Fix order of fixing type variables for callable references. KT-25433 Fixed 2019-03-01 14:50:33 +03:00
Andrey Uskov
735f86a50e Fix creation of KotlinSDK. GradleFacetImportTest fixed 2019-03-01 13:12:43 +03:00
Andrey Uskov
325ed8eb32 Change class hierarchy of KotlinSourceRootType. Deadlock during concurrent classloading fixed
#KT-30137 Fixed
2019-03-01 13:12:16 +03:00
Toshiaki Kameyama
87dc1a035b Convert property initializer to getter: suggest on property name
#KT-29344 Fixed
2019-03-01 11:37:42 +03:00
Toshiaki Kameyama
20aa8ebdb0 Add "Throwable not thrown" Inspection
#KT-11629 Fixed
2019-03-01 11:35:12 +03:00
Toshiaki Kameyama
e0aeb8f7ec Remove redundant let: rename invoke call
#KT-29556 Fixed
2019-03-01 11:31:07 +03:00
Toshiaki Kameyama
df3953f03a Redundant Unit: fix false positive when return type is nullable Unit
#KT-30038 Fixed
2019-03-01 11:12:25 +03:00
Toshiaki Kameyama
d67c793a9b map.get() with not-null assertion: add quick-fixes
#KT-30010 Fixed
2019-03-01 11:11:05 +03:00
Mikhail Glukhikh
84a3239cdf FIR: extract "toTypeProjection" 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
f8497bc339 FIR: extract "constructType" from type resolver 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
1cefcc1438 Add "firCompilerTest" configuration & include it into compiler tests 2019-03-01 10:36:19 +03:00
Natalia Selezneva
bc1e836f01 Fix saving Kotlin Scripting Setting to xml
^KT-30146 Fixed
2019-03-01 09:42:43 +03:00
Ilya Gorbunov
640699e076 Do not expose internal copyOfUninitializedElements and copyOfNulls 2019-02-28 23:44:00 +03:00
Ilya Gorbunov
2e9497f8f8 Rewrite copyOfUninitializedElements with templates without using copyRangeTo 2019-02-28 22:57:45 +03:00
Ilya Gorbunov
c1a51d44a4 Rewrite copyInto without using copyRangeTo
Rename array copying implementation to arrayCopy
2019-02-28 22:57:45 +03:00
Ilya Gorbunov
b8d9e896c2 Move sorting implementations for Native to kotlin.collections
- Move Array.sortWith to generated code
2019-02-28 22:57:45 +03:00
Svyatoslav Kuzmich
e11fda1c49 [JS IR BE] Skip external methods in js default arguments stub generators 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
8da076c1ed [JS IR BE] Fix basic reflection for primitive types 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
a01407eec9 [JS IR BE] Don't mangle Any::equals method 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
27005d7c2e [JS IR BE] Basic support for external varargs 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
0d9218b017 [JS IR BE] Refactor namer 2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
e9cdad1143 [JS IR BE] Remove support for dynamic symbols and descriptors
Dynamic expressions in IR are now represented as IrDynamicOperatorExpression

We don't have dynamic functions, dynamic dispatch receivers anymore
2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
d323dce2b6 [JS IR BE] Fix codegen for nested external objects 2019-02-28 20:13:55 +03:00
Dmitry Gridin
41f3316981 Fix caret position in "Convert function to property" intention
#KT-19944 Fixed
2019-02-28 15:59:50 +03:00
Dmitry Gridin
29a63ae58c Refactoring & fix warnings 2019-02-28 15:59:50 +03:00
Vadim Brilyantov
bd2e51ded5 Fix for bug introduced in moveConflictUtils (never show warnings when moving to the same scope) 2019-02-28 15:52:28 +03:00
victor.petukhov
bd03ecf4a0 Rename helper file with typealias samples for spec tests 2019-02-28 14:55:41 +03:00
victor.petukhov
b7a5d73bf0 Add type inference tests by specification to remote run tests 2019-02-28 11:55:16 +03:00
Georgy Bronnikov
c618ef9304 Correct phase argument names and cli test outputs 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
5ff1337ec8 Add some phase checkers 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
da13d3288e Check pre- and postconditions on phases 2019-02-28 11:53:02 +03:00
Natalia Selezneva
48433110a4 Do not threat modifications inside lambdas in KtScriptInitializer block as out of code block 2019-02-28 10:59:15 +03:00
Natalia Selezneva
49277bb5e4 Optimize MemberVisibilityCanBePrivateInspection: check that descriptor is in class before resolving it 2019-02-28 10:59:14 +03:00
Natalia Selezneva
560acd631c KtScriptInitializer doesn't has a descriptor 2019-02-28 10:59:13 +03:00
Natalia Selezneva
3b4d1dd7bf Optimize ChangeVisibilityModifierIntention: do not analyze element if declaration isn't local 2019-02-28 10:59:12 +03:00
Natalia Selezneva
869fb46c0b Optimize KotlinUFunctionCallExpression.isAnnotationArgumentArrayExpression 2019-02-28 10:59:12 +03:00
Toshiaki Kameyama
6ca22fbf34 Remove redundant let: do not report for function stored in variable call
#KT-30082 Fixed
2019-02-28 10:44:05 +03:00
Dmitry Gridin
304007f602 Fix false positive "Redundant companion reference"
#KT-30166 Fixed
2019-02-28 10:42:22 +03:00
Sergey Rostov
50263ed7cd JPS Build: update artifacts configuration (bootstrap) 2019-02-28 09:16:10 +03:00
Yan Zhulanow
7c0233dfeb 191: 191: Fix test compilation, remove deleted test 2019-02-27 21:41:09 +03:00
Kirill Shmakov
262b3fde3d Fix Gradle MPP integration tests
#KT-30056 Fixed
2019-02-27 20:51:04 +03:00
Dmitry Gridin
3756b6f54d Add inspection to remove redundant qualifier name
#KT-12134 Fixed
2019-02-27 20:43:35 +03:00
Dmitry Gridin
d0c3a28996 Move canBePossibleToDropReceiver to Companion object & fix warnings 2019-02-27 20:43:35 +03:00
Ilya Gorbunov
19bd326810 Swap mismatched docs for Result.onSuccess/onFailure KT-30109 2019-02-27 17:53:11 +03:00
Ilya Gorbunov
908009bf42 Improve double-to-ulong conversion tests
#KT-27108
2019-02-27 17:49:41 +03:00
Mikhail Zarechenskiy
892fb9f39e Increment metadata version and improve message for error type
Follow-up of 617bed1b
2019-02-27 14:03:22 +03:00
Vyacheslav Gerasimov
f7428e7161 Build: Add diagnostic for publish() helper 2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
a42f607ecf Build: Fix artifacts signing for maven central
With gradle > 5.0 `publish()` helper call should be done before
`noDefaultJar()` or any other artifact hacks, otherwise singing plugin doesn't sign any jars
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
df3aa48c9b Build: Apply java plugin in kotlin-annotation-processing-embeddable
Otherwise artifact signature works incorrectly for this project
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
f4c157a9bc Build: properly remove artifact from archives in runtimeJar helper 2019-02-27 13:21:17 +03:00
Alexander Podkhalyuzin
6098e97ae5 Do not go to the same type twice during contains search
This fixes exponent in algorithm for scala.FunctionN.curried, where N can be up to 22.

#KT-29435 Fixed
2019-02-27 12:36:43 +03:00
Nicolay Mitropolsky
c151be5547 Uast multiresolve key description fix 2019-02-27 12:15:32 +03:00
Mark Punzalan
fc5eac26cd Extracted complex string concatenation bytecode test case into separate test data file. 2019-02-27 08:36:35 +01:00
Mark Punzalan
d4d5a6011c Flatten nested string concatenation expressions into a single IrStringConcatenation, in a separate lowering phase.
Consolidating these into IrStringConcatenations allows the backend to produce efficient code for string concatenations (e.g., using StringBuilder for JVM).
2019-02-27 08:36:35 +01:00
Natalia Selezneva
ae22bdee15 Add scripting resolver extension to plugin-kotlin-extensions.xml 2019-02-27 09:37:07 +03:00
Sergey Rostov
63dca7b3b5 Build: exclude annotations.jar from Intellij 2019-02-27 09:11:42 +03:00
Sergey Rostov
17c0422d8f Build: got rid of @TestOnly annotations on fields and classes 2019-02-27 09:08:34 +03:00
Dmitry Gridin
c89d1af9fa Improve Create property from Usage
Place generated property next to other properties
 #KT-14886 Fixed
2019-02-27 00:07:55 +03:00
Dmitry Gridin
5d599ee2ff Refactoring 2019-02-27 00:07:55 +03:00
Alexander Udalov
76e133014b Minor, explain why we don't store array type arguments in ::class in proto 2019-02-26 19:09:42 +01:00
Alexander Udalov
736ac12374 Prohibit type parameters in class literals in annotation arguments
#KT-27799 Fixed
2019-02-26 19:09:42 +01:00
Vadim Brilyantov
c633f7568f #KT-25674: Fix unexpected reference renames in literals when moving referenced files. 2019-02-26 15:37:48 +03:00
Vadim Brilyantov
c7acd89fad #KT-19799: Add initialDirectory to KotlinAwareMoveFilesOrDirectoriesDialog 2019-02-26 15:37:47 +03:00
Vadim Brilyantov
0c1e7e1d63 #KT-23099: Fix name clashes when moving top-level objects with same signature 2019-02-26 15:37:45 +03:00
Vadim Brilyantov
f7c4760cb9 #KT-17825: Filter PackageLookupObjects as available for completion 2019-02-26 15:37:42 +03:00
Vadim Brilyantov
c5d1190d15 #KT-26611: Change mnemonic for "search references" checkbox to Alt+R 2019-02-26 15:37:40 +03:00
Vadim Brilyantov
01200252f5 #KT-22721: Fix move refactoring to make it check previous PsiElement before a whitespace 2019-02-26 15:37:39 +03:00
Vadim Brilyantov
e413395cbf #KT-19661: Create missing directories when moving to a user-defined path 2019-02-26 15:37:34 +03:00
Vadim Brilyantov
dc2c8140a9 Add optimize imports with timeout for move refactoring 2019-02-26 15:35:17 +03:00
Vadim Brilyantov
0ec3d15218 #KT-19924: Fix usability issue with extract declaration from file intention
Fix ExtractDeclaration intention name in tests

Fix ExtractDeclaration intention folder and description to avoid "not found Dir URL" exception
2019-02-26 15:35:15 +03:00
Alexander Gorshenev
888641e7f1 Use file symbol instead of a file name string in IrReturnableBlockImpl 2019-02-26 13:54:04 +03:00
Alexander Udalov
e2106d4d08 Do not assert that function is inline in MemberDescriptor.isInlineOnly
This is a more accurate fix of the problem described in 946acd2416
2019-02-26 11:16:01 +01:00
Alexander Udalov
b8bc79e17c Support non-trivial default argument values in expected functions on JVM
#KT-22818 Fixed
2019-02-26 11:02:30 +01:00
Ting-Yuan Huang
b2cc661783 Set target backend of BytecodeTextTestGenerated to JVM
as BytecodeTextTestGenerated is only available to JVM.

Change-Id: I0bb15b35ab3b8418434875971a572f3e49a516a5
2019-02-26 09:22:43 +01:00
Alexander Udalov
cfcd0d7b4a Minor, fix localClassLiteral.kt on JDK 9 2019-02-25 23:37:43 +01:00
Abduqodiri Qurbonzoda
ae47130c8e Implement UArray.contains(element) workaround for JS 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
c1b523ddef Fix UArray.containsAll(Collection<Any?>) 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
60e83383ad Add containsAll(Any?) check to CollectionBehaviors 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
1b6b44c805 Implement conversion between floating point numbers and unsigned integers
KT-27108
2019-02-25 21:58:03 +03:00
Yan Zhulanow
a970de51ab Debugger: Fix 182 bunch, add missing scratch extensions 2019-02-25 21:35:00 +03:00
Yan Zhulanow
55db2abd89 Debugger: Fix 191 bunch file, add new debugger extensions 2019-02-25 21:35:00 +03:00
Alexander Udalov
3f1533c35b Restore support for local class literals in annotation arguments
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead

 #KT-29891 Fixed
2019-02-25 19:22:09 +01:00
Alexander Udalov
f733bda912 Fix compilation error introduced in d374723e3c 2019-02-25 19:22:09 +01:00
Pavel Punegov
86ac5e97e4 Update Kotlin/Native to 1.2-rc2-7869 2019-02-25 20:42:02 +03:00
Ilya Chernikov
d374723e3c Restore default jvmTarget for scripts that was lost after refactoring 2019-02-25 18:22:27 +01:00
Nicolay Mitropolsky
e0e5009f3f 191: Uast: StringTemplateComplexForUInjectionHost testdata fix 2019-02-25 19:24:51 +03:00
Leonid Startsev
472d91e0de Do not return whole list of generated property descriptors for type
arguments' serializers when only one name is needed.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/383
2019-02-25 19:21:29 +03:00
Nicolay Mitropolsky
f9813af3ff 191: Uast: KotlinUSimpleReferenceExpression bunch fix 2019-02-25 18:13:18 +03:00
Nikolay Krasko
6813402abf Fix INRE from KotlinQuickDocumentationProvider (KT-30058, EA-137533)
Show a warning like CtrlMouseHandler does.

Fixed in 191 branch in CtrlMouseHandler.updateOnPsiChanges().
b116dcaf99

 #KT-30058 Fixed
2019-02-25 17:43:57 +03:00
Alexey Tsvetkov
f38ad0fe8a Fix inter-project IC with new MPP for JS/JVM targets
#KT-26275 Fixed
   #KT-29966 Fixed
2019-02-25 17:12:14 +03:00
Nicolay Mitropolsky
5786ab5140 Uast: making KotlinClassViaConstructorUSimpleReferenceExpression also handle deserialized descriptors 2019-02-25 16:35:46 +03:00
Nicolay Mitropolsky
25e00c9079 Uast: making KotlinClassViaConstructorUSimpleReferenceExpression resolve to class in case of SAM (KT-28272) 2019-02-25 16:35:46 +03:00
Nicolay Mitropolsky
d7584df01b Uast: making ULambdaExpression.functionalInterfaceType return non-null values for explicitly typed SAM-s with Java interfaces (KT-28272) 2019-02-25 16:35:46 +03:00
Anton Yalyshev
a326ba60a3 metadata contains Common target, so we need to track it as well 2019-02-25 16:26:12 +03:00
Max Medvedev
526e49d68a fix test icons for methods
#KT-25956
2019-02-25 16:02:42 +03:00
Sergey Igushkin
03e36334cf Push Gradle version for kotlin-gradle-plugin-integration-tests to 5.2 2019-02-25 15:43:40 +03:00
Sergey Igushkin
43de81e4c8 Fix MPP publishing with metadata on Gradle 5.2 (KT-29758)
In publishing, use attribute containers of detached configuration
instead of HierarchyAttributeContainer, which is rejected by Gradle for
not being an AttributeContainerInternal.

Using attributes of a detached configuration is a small and
conservative fix; we may need to either not filter the attributes,
which will lead to [ProjectLocalConfigurations.ATTRIBUTE] being
published in the Gradle module metadata, which will potentially
complicate our attributes schema migration, or create proper,
non-detached configurations for publishing that are separated from the
configurations used for project-to-project dependencies.

Issue #KT-29758 Fixed
2019-02-25 15:43:40 +03:00
Svyatoslav Kuzmich
beb5f73a2b Remove duplicate tests from JS compiler test set. Merge chages to common compiler tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich
a736756ceb [JS IR BE] Fix and refactor interop tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich
569187a751 [JS IR BE] Use Char boxing rules of current backend 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
de020ed58a [JS IR BE] Generate and export JS properties 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
fc5636b7c1 [JS IR BE] Fix: Don't generate built-in "Function" interface 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
326cbcc218 [JS IR BE] Unmute tests 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
1184c158e4 [JS IR BE] Support @JsName in bridges 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
e09a6f0007 [JS IR BE] Fix codegen for external companion objects 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
c4ffe36a21 [JS IR BE] Add CharSequence type check 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
3be4248791 [JS IR BE] Disable deprecated jsName tests 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
74c8f54fc8 [JS IR BE] Support cast to native interface 2019-02-25 15:09:25 +03:00
Kirill.Shmakov
4a3476a87c Merge rr/kishmakov/KT-30056 into master 2019-02-25 11:45:55 +00:00
Yan Zhulanow
e43fd713ef Fix new compiler tests (new receiver name mangling – $this$label) 2019-02-25 14:44:00 +03:00
Yan Zhulanow
133f021b26 Async stack traces: Fix compilation on IDEA 182 and older AS versions 2019-02-25 14:44:00 +03:00
Yan Zhulanow
cadb70f64a Evaluator: Allow to evaluate expression on synthetic lines in .kt files 2019-02-25 14:44:00 +03:00
Yan Zhulanow
16266259f5 Evaluator: Handle function context gracefully. Use file scope as a fallback instead of error scope 2019-02-25 14:44:00 +03:00
Yan Zhulanow
5035de24ac Code fragments: Use file scope as a fallback when a more specific one is not available 2019-02-25 14:44:00 +03:00
Yan Zhulanow
316dcccc30 Minor: Capitalize word "Kotlin" in error messages 2019-02-25 14:43:59 +03:00
Yan Zhulanow
28e4356e6e Restore original variable name mangling for captured/receiver $this
Design for the new one is still not finished.
2019-02-25 14:43:59 +03:00
Yan Zhulanow
1edacbbb5e Evaluator: Don't rely on moduleDescriptor presence in DebugLabel descriptor generation
The containing moduleDescriptor may not exist for the Java context.
2019-02-25 14:43:59 +03:00
Yan Zhulanow
a21802ee51 Pill: Fix new annotations-13.0 configuration 2019-02-25 14:43:59 +03:00
Yan Zhulanow
632b9ac38c Evaluator: Support 'field' variable evaluation for top-level properties 2019-02-25 14:43:59 +03:00
Yan Zhulanow
81f4e2fb3b Evaluator: Support delegated local variables 2019-02-25 14:43:59 +03:00
Yan Zhulanow
77bec27c99 Evaluate parameter value instead of backing field in primary constructor 2019-02-25 14:43:59 +03:00
Yan Zhulanow
592083bc5b Debugger: Support DebugLabel descriptors in completion 2019-02-25 14:43:58 +03:00
Yan Zhulanow
bff3f28a72 Pill: Fix IdeaPlugin artifact configuration 2019-02-25 14:43:58 +03:00
Yan Zhulanow
b9f76683dd Simplify 'suppressDiagnosticsInDebugMode'
In the new evaluator, suppressDiagnosticsInDebugMode is never set, and effectively the only check is that if a particular file is a KtCodeFragment.
2019-02-25 14:43:58 +03:00
Yan Zhulanow
6cb2146d31 Remove 'allowSpecialClassNames' extraction option 2019-02-25 14:43:58 +03:00
Yan Zhulanow
11dfbd5d3d Allow '$this$label$<somethingElse>' for extension receivers
Our mangling works poorly with nested inline function calls (saying, `apply()` inside an another `apply()`). In that case, the generated local variable name for both cases will be `$this$apply`. As the debugger sees only the last (the closest) variable with the same name, we loose the ability to get the first one.
This means we might want to add some additional information to the mangling (e.g. add the trailing indices `$this$apply$1`). This commit supports this case.
2019-02-25 14:43:58 +03:00
Yan Zhulanow
34b03c45d7 Add a test for escaped names supported in the new evaluator (KT-29661) 2019-02-25 14:43:58 +03:00
Yan Zhulanow
51b26325c6 Coroutine stack trace provider: check thread state before invokeMethod() 2019-02-25 14:43:58 +03:00
Yan Zhulanow
24cdd3f857 Remove 'debugTypeInfo' key
The key became obsolete as the new evaluator doesn't use it anymore.
2019-02-25 14:43:57 +03:00
Yan Zhulanow
6a81c2e1e4 Minor: Extract 'this' local variable name in DefaultImpls 2019-02-25 14:43:57 +03:00
Yan Zhulanow
65b6098242 Further refinements in variable displaying (Kotlin mode)
- Remove synthetic outer this for lambdas
- Recognize captured this for interface default methods
2019-02-25 14:43:57 +03:00
Yan Zhulanow
300c102c3f Remove BeforeExtractFunctionInsertionTest, the new evaluator doesn't depend on the 'extract function' refactoring 2019-02-25 14:43:57 +03:00
Yan Zhulanow
0657a3d399 New evaluator that doesn't depend on the 'extract function' refactoring (KT-28192, KT-25220, KT-25222, KT-21650) 2019-02-25 14:43:57 +03:00
Yan Zhulanow
3e849294f0 Extract the common part from bunched KtCodeFragment 2019-02-25 14:43:57 +03:00
Yan Zhulanow
b4002accfb Extract label name calculation from 'recordCallLabelForLambdaArgument()' 2019-02-25 14:43:56 +03:00
Yan Zhulanow
34c5954d75 Minor: Reformat evaluator code 2019-02-25 14:43:56 +03:00
Yan Zhulanow
eaed6855ac Minor: Add proper nullability check in generateExtensionReceiver() 2019-02-25 14:43:56 +03:00
Yan Zhulanow
d039e3b1c0 Hide synthetic variables for local functions and destructured lambda parameters (Kotlin variables) 2019-02-25 14:43:56 +03:00
Yan Zhulanow
ed88020a84 Minor: Reformat extraction engine files 2019-02-25 14:43:56 +03:00
Yan Zhulanow
488418d960 Change mangling for local functions 2019-02-25 14:43:56 +03:00
Yan Zhulanow
aca3be12e9 Change illegal local variable mangling rules 2019-02-25 14:43:56 +03:00
Yan Zhulanow
47f0b68a8c Change mangling for destructured lambda parameters 2019-02-25 14:43:56 +03:00
Yan Zhulanow
d2c2a6c99f Debugger: Support inline functions in Variables view 2019-02-25 14:43:55 +03:00
Yan Zhulanow
7fb8357b28 Allow '// PRINT_FRAME' option for multi-breakpoint stepping tests 2019-02-25 14:43:55 +03:00
Yan Zhulanow
16b94feea6 Minor: Remove an obsolete TODO comment 2019-02-25 14:43:55 +03:00
Yan Zhulanow
6cd980765c Do not issue exceptions for non-captured local variables
This partly fixes KT-28192.
2019-02-25 14:43:55 +03:00
Yan Zhulanow
4ae01badff Extract function: avoid same parameter names 2019-02-25 14:43:55 +03:00
Yan Zhulanow
7de5ddaac9 Fix receiver evaluation for primitive receiver types 2019-02-25 14:43:55 +03:00
Yan Zhulanow
f6cc686095 Minor: Extract a const for continuation variable name 2019-02-25 14:43:55 +03:00
Yan Zhulanow
cf9461847b Hide unrelated this entries in Kotlin Watches mode 2019-02-25 14:43:54 +03:00
Yan Zhulanow
e5b0d2e34f Refactoring: Extract list field search 2019-02-25 14:43:54 +03:00
Yan Zhulanow
c5061e7997 Replace 'visibleVariablesByName()' calls with a safe implementation 2019-02-25 14:43:54 +03:00
Yan Zhulanow
757fc421f7 Refactoring: Extract wrapping 'try' expressions 2019-02-25 14:43:54 +03:00
Yan Zhulanow
f5a3a46e76 Watches: Hide 'this' if it's a continuation 2019-02-25 14:43:54 +03:00
Yan Zhulanow
227a7e5609 Provide access to 'coroutineContext' inside suspend functions/lambdas (KT-24829) 2019-02-25 14:43:54 +03:00
Yan Zhulanow
cf925fc2ad Activate Kotlin stack frame even if there is no Kotlin strata 2019-02-25 14:43:54 +03:00
Yan Zhulanow
f6b2e673f7 Debugger: Display async stack trace elements for suspend callers (KT-28728) 2019-02-25 14:43:53 +03:00
Yan Zhulanow
e8c066605b Do not drop analysis results for the code fragment context, allow to re-use it
Otherwise labels declared in the expression context become unresolved.
This is needed for the `this@label` expression evaluation support (KT-28134).
2019-02-25 14:43:53 +03:00
Yan Zhulanow
4c681c787d Watches: Add Kotlin/JVM views to watches window (KT-28134, KT-28087, KT-22250)
Kotlin mode: show only Kotlin variables and captured values. The variable names are Kotlin-friendly.
JVM mode: show all variables available in the current stack position, including synthetic ones.
2019-02-25 14:43:53 +03:00
Yan Zhulanow
5c419fc629 Evaluator: New implementation for variable finder
Support both old and new receiver variable conventions in variable finder.
2019-02-25 14:43:53 +03:00
Yan Zhulanow
df7bbf707b Refactoring: Rename a function to 'getArgumentsForEvaluation()' 2019-02-25 14:43:53 +03:00
Yan Zhulanow
ea462091c4 Support new convention for local variables name mangling: '$receiver' -> '$this$<label>' (KT-26913) 2019-02-25 14:43:53 +03:00
Yan Zhulanow
b5f9149702 Minor: Get rid of some magic constants 2019-02-25 14:43:53 +03:00
Kirill Shmakov
2a3473f275 Better string builder. 2019-02-25 14:43:32 +03:00
Kirill Shmakov
c43024a9c7 Version is backed. 2019-02-25 14:34:47 +03:00
Kirill Shmakov
02c9afcb6f Last test 2019-02-25 14:15:30 +03:00
Ilya Chernikov
b1ab2ead61 Restore find script definition behaviour (mostly) and relevant comments broken with refactoring 2019-02-25 11:57:13 +01:00
Kirill Shmakov
fb14128cbd All but one 2019-02-25 13:46:34 +03:00
Nicolay Mitropolsky
6b792c36f0 KotlinUastApiTest: using kfail alias 2019-02-25 12:26:22 +03:00
Nicolay Mitropolsky
712c897472 Uast: fix for UVariables missing typeReferences 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
98740138f3 Uast: yet another check for invalid context before resolve (EA-137191, EA-137193) 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
bd0c6736ce Uast: implementing specific javaPsi for UVariables 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
7dc818d42b 191: KotlinUastApiTest.kt missed bunch aligning fix 2019-02-25 12:26:21 +03:00
Andrey Uskov
63a1bba6d9 Fix importing compiler arguments if worker api is used #KT-29564 Fixed 2019-02-25 12:20:27 +03:00
Natalia Selezneva
8453c1ff4d Scratch: hide 'make module' checkbox when no module is selected
^KT-23985
2019-02-25 11:20:49 +03:00
Natalia Selezneva
e2b5134048 Allow to run scratch without module selected
^KT-23985 Fixed
2019-02-25 11:20:49 +03:00
Natalia Selezneva
8d4ca4d1c5 Scratch: Fix "Read access is allowed from event dispatch thread or inside read-action only"
^KT-28958 Fixed
2019-02-25 11:19:36 +03:00
Dmitry Savvinov
ba36fafb84 Create JsAnalyzerFacade with allowSliceRewrite=true
Other facades (JVM, Common, Native) are already created with such flag.
This should stop some known 'rewrite at slice'-exceptions from being
thrown (KT-21405, KT-29705).

For a more thorough investivation and details, refer to KT-30031.

Also, see KT-30030: even though it was fixed by the different commit,
the same scenario probably can be used to investigate other rewrites
(even though they will reproduce much less frequently than original
issue)

^KT-21405 Fixed
^KT-29705 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
50d1c013fc Force-resolve body in contract computation under lock
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).

This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.

^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
705ec503cf Minor optimization: don't put 'null' for ContractProvider in user data 2019-02-25 11:10:16 +03:00
Dmitry Savvinov
2359944fa7 Minor: add debugName to JS-slices 2019-02-25 11:10:16 +03:00
Mikhail Glukhikh
c084eefb65 Fix a bunch of IDE quick-fix tests (related to "convert to run/...")
These actions became available more often some days ago
2019-02-25 10:37:46 +03:00
Dmitriy Dolovov
4ef12b1ed7 CIDR: New way of building CLion and AppCode plugins v2 2019-02-25 14:06:51 +07:00
Mikhail Glukhikh
de93aad8aa FIR total resolve in IDE test: fix accidentally wrong project path :( 2019-02-25 09:53:21 +03:00
Mikhail Zarechenskiy
617bed1bf1 Fix nested typealiases expansion and as a result fix serialization
Consider the following situation:
 ```
 class Inv<T>
 typealias A<K> = Inv<K>
 typealias B<V> = Inv<A<K>>

 fun <U> materialize(): B<U> = TODO()
 ```

 Type `B<U>` is expanding to `Inv<Inv<U>>` and for this type `B<U>` and
 `Inv<A<U>>` are abbreviated types, but due to a bug we forgot to make
 substitution for `Inv<A<U>>` and were getting abbreviated type
 `Inv<A<K>>` where `K` is a type parameter from the typealias declaration.

 This bug didn't affect subtyping anyhow but the incorrect type was
 serialized and caused problems during deserialization as there wasn't
 `K` in deserialization context.

 #KT-24964 Fixed
 #KT-20780 Fixed
 #KT-20065 Fixed
 #KT-28236 Fixed
 #KT-21775 Fixed
2019-02-25 00:28:45 +03:00
Stanislav Erokhin
f1d5912f05 Update Kotlin/Native: 1.2-rc1-7773 2019-02-23 11:39:10 +03:00
Georgy Bronnikov
67656a447a Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
3531f47bfb Remove descriptors from ToArrayLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
c3652a47c6 Remove descriptors from JvmStaticAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
28bab6510e Remove descriptors from JvmOverloadsAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
f61072873f remove descriptors from createInnerClassConstructorWithOuterThisParameter 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
72ea4cc3d7 Remove descriptors from BridgeLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
c9b8f58a10 Restore overriddenSymbols consistency in InterfaceDelegationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
68f9f4b3b5 Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
cb757f1cbc Remove descriptors from SyntheticAccessorLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
9078cb87e8 Remove descriptors from InitializersLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
5d7a736cb1 Remove desriptors from ObjectClassLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
5f4b8dd0aa Remove descriptors from EnumClassLowering 2019-02-23 00:42:16 +03:00
Ilya Gorbunov
8f6d73fd32 Use JS stdlib merger from bootstrap compiler 2019-02-22 21:22:19 +03:00
Ilya Gorbunov
0a0f81486f Advance bootstrap to 1.3.30-dev-1945 2019-02-22 21:22:07 +03:00
Dmitry Petrov
b792f3f12f KT-30020 expressions without resolved calls in augmented assignment LHS
Augmented assignment operator (e.g., '+=') can be resolved to simple
function call ('plusAssign'). In that case, augmented assignment LHS
can be an arbitrary expression, and may have no associated ResolvedCall.

For example:
    (a as MutableList<Int>) += 42

Note that it can happen only in case of augmented assignment operator
convention resolution, because all other forms of assignment-like
operator desugaring require some kind of 'store' operation
(property setter, 'set' operator for array element expression, etc),
and should resolve to some combination of calls.

In that case we simply generate LHS on 'load', and throw assertion on
'store'.
2019-02-22 17:45:27 +03:00
Ilmir Usmanov
1777849ff3 Generate correct linenumber for the debugger to see the return value
of suspend function.

 #KT-20322 Fixed
2019-02-22 17:37:32 +03:00
Nicolay Mitropolsky
9bf55d81ca Making kts-compiler able to dig out the ClassPath from the intellij PluginClassLoader 2019-02-22 13:51:47 +03:00
Ilmir Usmanov
ec7315e6da Add $completion entry to suspend functions' LVT
#KT-28810 Fixed
2019-02-22 13:50:35 +03:00
Dmitriy Novozhilov
677987c85f Add diagnostics on annotations on super types. KT-23992 fixed 2019-02-22 10:28:21 +03:00
Dmitriy Novozhilov
1fc6f30c50 Add test for KT-23992 2019-02-22 10:22:19 +03:00
Dmitriy Novozhilov
92bd907983 Fix checking repeatablilty of use-site target annotations. KT-26638 fixed 2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
cfda468f13 Add test for KT-26638 2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
3e147af3c0 KT-27565 fix 2019-02-22 10:15:16 +03:00
Dmitriy Novozhilov
cd2b8839b4 Add test for KT-27565 2019-02-22 10:15:16 +03:00
Ilya Gorbunov
eca1af4091 Temporary restore kotlin-stdlib-js-merger for bootstrapping 2019-02-22 02:37:31 +03:00
Ilya Gorbunov
98c6c925fc Move JS stdlib merger into cli compiler module
Refactor: use stdlib function to relativize paths.
2019-02-22 02:37:24 +03:00
Dmitry Gridin
b58bfff843 Fix paramTypeLambdaMismatch test 2019-02-21 19:08:02 +03:00
Kirill Shmakov
b695f20526 Candidate 2019-02-21 19:00:37 +03:00
Nikolay Krasko
e495bfc570 Stop failing when there's no CIDR classes during running tests 2019-02-21 18:01:57 +03:00
Ilya Chernikov
d1a1594f26 Remove redundant direct usages of the ScriptDefinition in compiler
plus some refactoring around definition extraction
2019-02-21 15:59:48 +01:00
Ilya Chernikov
5bc262fcb4 Add scripting resolver extension to the IDEA plugin as well 2019-02-21 15:59:48 +01:00
Ilya Chernikov
cc4aedb807 Move the rest of script descriptor implementation details to plugin, cleanup 2019-02-21 15:59:48 +01:00
Ilya Chernikov
29fa0f5dff Replace unnecessary direct usages of the LazyScriptDescriptor with ScriptDescriptor interface
lift result property to the interface to implement it
2019-02-21 15:59:48 +01:00
Ilya Chernikov
e28017039d Split scripts and class/object declarations in DeclarationsProvider
simplifies code in most places, avoids filtering in places where they
should be processed independently
2019-02-21 15:59:48 +01:00
Ilya Chernikov
a218455193 Extract script descriptor creation to scripting plugin 2019-02-21 15:59:48 +01:00
Ilya Chernikov
4359919e10 Add package-level class descriptors generation to the SyntheticResolveExtension
required for extracting script descriptors generation to an extension
2019-02-21 15:59:48 +01:00
Ilya Chernikov
0839b44ebb Replace explicit ScriptDescriptor in resolver with appropriate superclass 2019-02-21 15:59:47 +01:00
Ilmir Usmanov
6e120b2173 Do not generate state-machines for suspend lambdas, which capture any
crossinline lambda, not only suspend.
 #KT-29912 Fixed
2019-02-21 17:44:41 +03:00
Alexander Podkhalyuzin
931e1aa213 Removed 2x svg files from Android Studio 3.3 as it renders it anyway
#KT-29533 Fixed
2019-02-21 16:52:45 +03:00
Dmitry Petrov
c248dd29c2 IR: declaration builders, initial iteration, use in some JVM lowerings 2019-02-21 16:03:11 +03:00
Kirill Shmakov
1846ec83e1 Return app name of the main folder
Better fix for KT-29804 aligned with KT-30003

KT-29804
KT-30003
2019-02-21 14:43:34 +03:00
Dmitry Gridin
147521d6cb Add intention to introduce import alias
#KT-16118 Fixed
 #KT-30007 Fixed
2019-02-21 12:25:09 +03:00
Dmitry Gridin
6bf119b262 Refactoring 2019-02-21 12:25:08 +03:00
Dmitriy Novozhilov
d58ee133a2 Fix type constraints of empty lambda (KT-28654 fix) 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
2ba33c3b8a Fix testdata broken in 46bd5ba 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
10b7baf69a Add test for KT-28654 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
f186c83b15 KT-25383 fix 2019-02-21 12:04:23 +03:00
Ilya Gorbunov
7b55e72583 Remove dead teardown code for builtins uninvalidation in tests
VirtualFile.isStdLibFile always returns false, therefore unInvalidateFile is never executed

See also commit 358e64fdb
2019-02-20 19:14:31 +03:00
Natalia Selezneva
254374c619 Use ModuleInfo in VirtualFileFinder to add script dependencies in search scope
Otherwise it prevent to inline functions from those dependencies during scratch compilation
2019-02-20 18:36:38 +03:00
Natalia Selezneva
f3c828a17d Get platform for scripts from script definition
Introduce 'platform' property in KotlinScripDefinition (should have a value which exists in TargetPlatform.ALL_KINDS)

^KT-27684 Fixed
2019-02-20 15:59:44 +03:00
Shagen Ogandzhanian
0188cd5330 Publish npm artifacts over encrypted connection
https://youtrack.jetbrains.com/issue/KT-29988
2019-02-20 13:22:25 +01:00
LepilkinaElena
39bdc1cc2c Change short form of flag name to full one for cinterop tool (#2117) 2019-02-20 15:14:08 +03:00
Alexander Udalov
946acd2416 Minor, ignore test for JVM_IR
It started to fail with AssertionError in inlineOnly.kt after
d267f1e875 because "$annotations" methods have annotations from the
corresponding property (which can include InlineOnly), but are never
inline. The test will be unmuted as soon as we stop using wrapped
descriptors in the IR backend to determine access flags which should be
generated on a declaration in the bytecode
2019-02-20 10:56:14 +01:00
Ilya Matveev
588236391e Build: Fix Kotlin/Native composite build 2019-02-20 12:14:17 +03:00
Igor Chevdar
1d0fdd7976 [IR] Some fixes to wrapped descriptors 2019-02-20 10:39:30 +05:00
Yaroslav Russkih
9ac52fad17 Use https everywhere - documentation and samples 2019-02-19 21:35:36 +01:00
Yaroslav Russkih
028a311949 Use https everywhere - tests and test data 2019-02-19 21:35:36 +01:00
Yaroslav Russkih
7135f1972a Use https everywhere - production code 2019-02-19 21:35:36 +01:00
Vyacheslav Gerasimov
7d5158c439 Build: Fix internal api usage in DistModelBuilder
MapFileTree interface changed in gradle 5.1
2019-02-19 20:06:24 +03:00
Vyacheslav Gerasimov
f8266a5109 Build: Update gradle version to 5.1 2019-02-19 20:06:24 +03:00
Alexander Udalov
d267f1e875 JVM IR: generate synthetic $annotations methods for properties 2019-02-19 17:25:47 +01:00
Alexander Udalov
c92c50aa98 JVM IR: generate JVM signatures of companion object properties 2019-02-19 16:37:47 +01:00
Alexander Udalov
c357967c2c JVM IR: generate Kotlin metadata
Introduce MetadataSource as a way to store the original descriptor for
any element (before any lowerings) and maintain it until the end of the
codegen where it's used in generating the metadata. Note that JVM
signatures written to the metadata are formed from the _resulting_
generated elements, not by mapping the original descriptors.

Some corner cases are not supported yet, namely properties declared in
companion objects, synthetic methods for property annotations,
JvmPackageName, etc.

 #KT-29119 Fixed
2019-02-19 16:37:47 +01:00
Alexander Udalov
3d1858a8c5 Refactor and rename CodegenUtil.getDeclarationsToGenerate
Move logic regarding expect classes to the only relevant call site at
PackageCodegenImpl, and return the list of members to remove code
duplication at remaining call sites
2019-02-19 16:37:46 +01:00
Alexander Udalov
4487c7a988 JVM IR: rename private fields for properties with same name
This is needed to get rid of the code that appends "$companion" to
properties moved from companion, because it caused inconsistencies in
the ABI and in JVM signatures stored in the metadata
2019-02-19 16:37:46 +01:00
Nikolay Krasko
b4571fd548 Minor: cleanup tests in org.jetbrains.kotlin.idea.navigation 2019-02-19 18:27:50 +03:00
Toshiaki Kameyama
80e1fc2ace Navigation to implementation / overriding method: do not show method of inline class twice
#KT-28661 Fixed
#KT-26924 Fixed
2019-02-19 18:27:50 +03:00
Ilmir Usmanov
aa9ce7b2e9 Minor. Update test data 2019-02-19 18:09:23 +03:00
Mads Ager
057bdb3954 Generate better code for branches based on comparisons.
For comparison intrinsics and for instanceof checks, make
it possible to get the the stack value produced and branch
on that directly instead of materializing a boolean to
branch on from it.

That reduces code such as

```
    IF_CMPEQ L1
    CONST_0
    GOTO L2
L1: CONST_1
L2: IFEQ L3
```

to just one IF_CMP instruction.
2019-02-19 15:46:52 +01:00
Leonid Startsev
7d2c59fb70 Fix missing optionality of property when generating descriptor in Native 2019-02-19 15:52:04 +03:00
Leonid Startsev
8b16801f0d Insert correct offsets in a lot of places in IR
Use correct type arguments when invoking a generic functions
Fix missing parent in initializer
2019-02-19 15:52:04 +03:00
Leonid Startsev
66272bfa74 Fix impossibility to make @Optional field in a class hierarchy on JS 2019-02-19 15:52:04 +03:00
Leonid Startsev
18667a5a34 Add validator for unique serial names 2019-02-19 15:52:04 +03:00
Leonid Startsev
36e1d6668b Make write$Self a static function 2019-02-19 15:52:04 +03:00
Leonid Startsev
7c942af13d Add synthetic companion with .serializer() getter even if default serializer is overridden. (kotlinx.serialization/228) 2019-02-19 15:52:04 +03:00
Leonid Startsev
1e440efc01 Ban primitive arrays in JVM codegen too (fixes kotlinx.serialization/260) 2019-02-19 15:52:04 +03:00
Leonid Startsev
5231ef9966 Don't generate writeSelf/internal constructor if corresponding serialize/deserialize aren't auto-generated 2019-02-19 15:52:04 +03:00
Leonid Startsev
a6651fd6f9 Call superclass deserialization constructor if superclass is also internal serializable or no-arg ctor of non-serializable class on Native and JS 2019-02-19 15:52:04 +03:00
Leonid Startsev
e02cfcb8ea Replace @Optional with @Required 2019-02-19 15:52:04 +03:00
Leonid Startsev
04706f4473 Support classes with more than 32 serializable properties
Via increasing count of int bit masks in synthetic constructor
2019-02-19 15:52:04 +03:00
Leonid Startsev
08f983ef52 Semantic change:
Now properties with default values are @Optional by default, and properties without backing fields are @Transient by default.
2019-02-19 15:52:04 +03:00
Leonid Startsev
cca03e9586 Make enums and interfaces not serializable internally. However, they
still can be serialized using custom companion object.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/138 and https://github.com/Kotlin/kotlinx.serialization/issues/304
2019-02-19 15:52:04 +03:00
Nikolay Krasko
c41d6c427d Fix flaky navigation tests by refreshing file system before find 2019-02-19 15:42:32 +03:00
Mads Ager
e9ec8e2cee JVM_IR: Do not generate annotations on $default methods. 2019-02-19 13:23:42 +01:00
Mikhael Bogdanov
19d2bac2f8 Temporary disable test in IR 2019-02-19 13:05:05 +01:00
Toshiaki Kameyama
8cdf901538 Keyword completion: do not suggest const except inside top level or object
#KT-23026 Fixed
#KT-29840 Fixed
2019-02-19 14:57:44 +03:00
Mikhail Glukhikh
7d809bc1d5 Fix 181 compilation (AbstractFirResolveWithSessionTestCase)
We could fix it better, but anyway FIR & its tests aren't important
for this branch
2019-02-19 14:33:47 +03:00
Mikhail Glukhikh
7952249cd9 FIR: prevent SDK leak error in total kotlin IDE test
Related to KT-24077
2019-02-19 14:12:43 +03:00
Mikhail Glukhikh
2bc22fc2a6 FIR: fix Gradle configurator exception in total IDE test 2019-02-19 14:12:26 +03:00
Simon Ogorodnik
a6297f5f2f Refactor FIR total resolve in IDE test fixing various problems
Related to KT-24077
2019-02-19 14:11:43 +03:00
Simon Ogorodnik
5cef869d36 FIR: add symbol provider for IDE #KT-24097 Fixed
Functions & properties aren't yet supported
2019-02-19 14:11:11 +03:00
Mikhail Glukhikh
12ee81358c FIR: Add total resolve test in IDE mode (related to KT-24077) 2019-02-19 14:02:01 +03:00
Toshiaki Kameyama
779d536605 Redundant getter: fix false positive for 'external' getter
#KT-29416 Fixed
2019-02-19 13:03:11 +03:00
Mikhael Bogdanov
3b57ceeafe Don't generate annotations on $default methods
#KT-29965 Fixed
2019-02-19 10:51:37 +01:00
Mikhael Bogdanov
a020170a92 Report missed INLINE_FROM_HIGHER_PLATFORM diagnostic for derived class
Inline function descriptor in derived class represented as FAKE_OVERRIDE.
 So we should find it in base class declaration
 (not interface cause inline function can't be virtual, but always final)
 and then check class version.

 #KT-29402 Fixed
2019-02-19 10:51:36 +01:00
Mikhael Bogdanov
b03065b2ba Minor. Reformat 2019-02-19 10:51:35 +01:00
Kirill Shmakov
b844e587ed Fix KT-29804: rename app -> main
#KT-29804 Fixed
Reviewed at KOTLIN-CR-2735
2019-02-19 12:14:34 +03:00
Sergey Rostov
db8f423880 JPS Build, update artifacts: fix js stdlib, remove stdlib-jdk7 and 8 2019-02-19 11:39:53 +03:00
hisaaki.sioiri
f1cc7cecce Escaping quotes in live-templates (KT-2387)
#KT-2387 Fixed
2019-02-19 11:18:13 +03:00
Toshiaki Kameyama
7149d4cd1c Group by file structure: show groups on text search (KT-28838)
#KT-28838 Fixed
2019-02-19 11:18:13 +03:00
Stanislav Erokhin
76f2430e7c Code of Conduct for Kotlin project 2019-02-19 11:04:37 +03:00
Toshiaki Kameyama
5f7dee4194 Convert to scope function: enable on single function call
#KT-29099 Fixed
2019-02-19 10:41:20 +03:00
Dmitry Petrov
e1fdf0aa43 KT-29959 fix IR generation for 'd.m = e' 2019-02-19 09:59:42 +03:00
Mikhail Glukhikh
7f9b3a98b4 Fix corner cases (no expression, not resolved label) in raw FIR builder 2019-02-19 09:54:39 +03:00
Mikhail Glukhikh
552b137852 FIR: get rid of fictitious function symbols 2019-02-19 09:54:37 +03:00
Mikhail Glukhikh
74d89b1be2 JavaSymbolProvider: support different kinds of literals in annotations
Constants, enum entries, class references, arrays are covered here
Related to KT-29218
2019-02-19 09:54:34 +03:00
Mikhail Glukhikh
f8e165dbe4 Integrate nullability into cone types, add & use FIR flexible type
FIR fake overrides are rendered now more precisely to test this process
2019-02-19 09:54:32 +03:00
Mikhail Glukhikh
3d77f3d129 Fix rendering of ConeClassErrorType
This commit fixes total kotlin resolve test
2019-02-19 09:54:30 +03:00
Simon Ogorodnik
9ebefa3ba6 FIR: make FunctionType class-like, refactor built-ins resolution
This breaks total kotlin resolve test because of incorrect rendering
of ConeClassErrorType (we are trying to read its symbol)
2019-02-19 09:54:28 +03:00
Simon Ogorodnik
3edd82b602 FIR: make JavaSymbolProvider return error-type on not found symbols 2019-02-19 09:54:26 +03:00
Simon Ogorodnik
5afb0a6f4a FIR rename: FirType -> FirTypeRef and related 2019-02-19 09:54:24 +03:00
Mikhail Glukhikh
1c76a612f9 FIR rename: isNullable -> isMarkedNullable 2019-02-19 09:54:21 +03:00
Simon Ogorodnik
3a237416c9 Implement FIR loading for Java (classes, supertypes, parameters, funs)
Properties aren't implemented yet
FIR symbol provider functions return more specialized types now
Related to KT-28918, KT-29636, KT-29218

#KT-28788 Fixed
2019-02-19 09:54:20 +03:00
Mikhail Glukhikh
4ea3df53cc Implement FIR loading for libraries (classes, supertypes, parameters)
Members aren't implemented yet
Related to KT-28788, KT-28918
2019-02-19 09:54:18 +03:00
Mikhail Glukhikh
0bef9f2afe Rename in FIR provider: getSymbolByFqName -> getClassLikeSymbolByFqName 2019-02-19 09:54:17 +03:00
Simon Ogorodnik
bd769f8fd7 Add multiplatform test with substitution, fix deep supertypes
This commit fixes ambiguity problems introduced before
in MPP tests with deep supertypes

#KT-29636 Fixed
2019-02-19 09:54:16 +03:00
Simon Ogorodnik
0e3fecf614 Implement fake override mapping for functions
Related to KT-29636
2019-02-19 09:53:33 +03:00
Mikhail Glukhikh
1f5e89cd32 Disable JavaElementFinder in FIR tests to avoid old FE 2019-02-19 09:52:20 +03:00
Simon Ogorodnik
840750ee40 Implement basic use-site scopes and override mapping
This commit also introduces separate scope processors:
processFunctionsByName and processPropertiesByName, in addition to
existing processClassifiersByName

Ad-hock call resolver starts to discover ambiguities, which leads
to some ambiguity problems in MPP tests with deep supertype hierarchy

Related to KT-29636
2019-02-19 09:52:20 +03:00
Mikhail Glukhikh
6ea2abfc46 FIR override resolve: lookup also interfaces 2019-02-19 09:52:20 +03:00
Mikhail Glukhikh
b3c8e83c58 FIR: make override resolve in use-site session (and module)
Related to KT-24078
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
84b3a17e2b Type resolve transformer: reorder tower scope
This commit prioritizes inner scopes above outer scopes
(before this commit, inner scopes had lowest priority).
NB: really it's not precise enough too,
because explicit importing scope should have higher priority
than inner scopes.
Also fixes problem with total Kotlin resolve test introduced
in previous commit.
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
bec62acf5b FIR: introduce callable member symbols & initial member scopes
Initial member scopes cover top-level, class-level, and  supers

Ad-hock version of call resolve was introduced to test them
NB: after this commit, total Kotlin resolve test cannot finish
because of scope problems in type resolve transformer

Related to KT-24078
#KT-24083 Fixed
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
95678a4d64 Extract FirAbstractTreeTransformer and *WithSuperTypes 2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
0e179f6b44 Extract FirAbstractProviderBasedScope & fix potential KNPE 2019-02-19 09:52:19 +03:00
Dmitriy Dolovov
83cb2cb99e CIDR: Patch LLDB pretty printers for K/N < 1.1.1
Issue #KT-29625 Fixed
2019-02-19 10:49:08 +07:00
Ilya Gorbunov
ce577ac06b Minor: remove redundant imports in sample 2019-02-18 21:09:18 +03:00
Kevin Peek
565727e302 KT-20357 - Add sample for Regex.findAll() 2019-02-18 21:05:46 +03:00
Kirill Shmakov
a8777a8bb3 Add forgoten file 2019-02-18 20:57:28 +03:00
Kirill Shmakov
478c18f194 Move data of handmade test from auto-generated tests data dir
KT-29187
2019-02-18 20:36:26 +03:00
Vyacheslav Gerasimov
2bec617446 Build: Fix npmInstall task inputs validation problem
NpmInstall task adds $nodeModulesDir/package.json to input and fails validation with:
 "File '.../package.json' specified for property '$1' does not exist."
2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
333eb9701c Build: Fix JPS importer (DistModelBuilder) for Gradle 5.0 2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
3d0cd57e31 Build: Drop testDistProjects, root :dist task was already in list 2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
a4cfd37203 Minor: Reformat dependencies.kt 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
294ba51d0b Build: Drop obsolete dependency handlers 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
25128f07f2 Build: Reformat artifacts.kt & fix some warnings, drop some dead code 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
14d9ec9fb2 Build: Use javadocJar helper to specify artifact explicitly
Creating javadocJar task for every project produces lots of unnecessary
tasks, some project don't even have code. Jar task without outDir
property set fails idea import with gradle 5.0+
2019-02-18 19:59:36 +03:00
Vyacheslav Gerasimov
e09802289d Build: Workaround SOE in kotlin-stdlib-common-sources
Probably gradle bug
2019-02-18 19:58:57 +03:00
Sergey Igushkin
2a14301c75 Fix Gradle plugin build with Gradle 5.0
* Due to 'improved POM support' introduced in 5.0, runtime dependencies
of the `compileOnly 'com.android.tools.build:gradle:...'` dependency
were no more transitively available. Add them manually;

* Add `!!` to usages of `resourcesDir`, which became nullable;

* Replace the dropped `classesDir` method usages with reflection;
2019-02-18 19:58:57 +03:00
Vyacheslav Gerasimov
e8f1e2d022 Build: Use latest version of build-scan plugin 2019-02-18 19:58:57 +03:00
Vyacheslav Gerasimov
7e1f64b712 Build: Fix generateVisitors task outputs 2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
d32f6fb382 Build: Fix compatibility with shadow plugin
Apply java-base plugin since shadow task requires sourcesets
2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
df9ca1b6d9 Build: Update shadow plugin version to 4.0.3 2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
f2bf33fe2a Build: Update gradle version to 5.0 2019-02-18 19:58:56 +03:00
Ilya Gorbunov
5cc2215338 Extend compileOnly configuration from builtins
to avoid adding builtins configuration to classpath manually
2019-02-18 19:30:24 +03:00
Ilya Gorbunov
441e7cc15d Always use singleFile when passing a configuration as a zipTree parameter 2019-02-18 19:30:24 +03:00
Ilya Gorbunov
6bcd112062 Drop obsolete artifact kotlin-runtime
Remove suppresses used to compile some parts of stdlib
as a non-multiplatform project.
2019-02-18 19:20:30 +03:00
Ilya Gorbunov
8ed2facc8c Remove integration test involving kotlin-stdlib-jre7/8 2019-02-18 18:45:20 +03:00
Ilya Gorbunov
811566bbe0 Drop obsolete artifacts kotlin-stdlib-jre7/8 2019-02-18 18:44:35 +03:00
Dmitry N. Petrov
4e05c2305e Merge pull request #2121 from jimgoog/mutable-origin
Make IrDeclaration.origin mutable
2019-02-18 16:48:50 +03:00
Toshiaki Kameyama
8e61a13809 Move lambda argument out of parentheses: fix false negative when function type is type parameter
#KT-26979 Fixed
2019-02-18 16:48:11 +03:00
Toshiaki Kameyama
b4789b95ef Rename: fix renaming of label by label reference in loop
#KT-29796 Fixed
2019-02-18 15:12:39 +03:00
Nicolay Mitropolsky
76bdfddfea Making KotlinAnnotatedElementsSearcher able to search for parameters (KT-27794) 2019-02-18 14:08:09 +03:00
Simon Ogorodnik
2b9cf06c3f Enable debug log for PerModulePackageService only in J2K 2019-02-18 13:42:12 +03:00
Nikolay Krasko
9a99f832e5 Fix blinking parameter info popup for nested places (KT-29574)
#KT-29574 Fixed
2019-02-18 13:25:45 +03:00
Nikolay Krasko
5f7815bd54 Attempt to fix invalid element exception at suppress intention (EA-135693) 2019-02-18 13:25:44 +03:00
Nikolay Krasko
8a97cd3a15 Fix PIEAE on getting current editor (EA-135969) 2019-02-18 13:25:44 +03:00
Nikolay Krasko
16ff522cd3 Check element disposed before getting component in migration (EA-134713)
Check if it can reduce the exceptions rate and check for deeper exceptions.
2019-02-18 13:25:44 +03:00
Dmitriy Novozhilov
d1b7c0f683 Fix testdata for try/catch inference and DFA 2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
8fc7b4436b Revert "Temporary fix to compile project with the snapshot compiler"
This reverts commit acb83f1a
2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
5d0074bda5 Fix bug in try/catch resolution in NI
Bug was presented in a236ad5
2019-02-18 12:43:42 +03:00
Ilmir Usmanov
1e4b7e1ef1 Put $assertionDisabled field into inline-site's class
The generated code is more inline with java, and we avoid the error of
accessing package-private field outside of the package.
However, this changes semantics a bit. Now, a user should set assertion
status of inline-site's package, instead of inline function's one.
 #KT-28317: Fixed
2019-02-18 12:39:03 +03:00
Mikhail Zarechenskiy
acb83f1af1 Temporary fix to compile project with the snapshot compiler
The problem is in NI and can relate to a236ad5686
2019-02-18 11:45:02 +03:00
Dmitriy Dolovov
45f028d353 CIDR: Avoid Java errors during KTS analysis in CIDR
There is no Java support in CIDR. Therefore:
- analyze KTS in CIDR using Common platform
- disable error highlighting for KTS in CIDR

Issue #KT-29953 Fixed
2019-02-18 11:27:31 +07:00
Dmitriy Novozhilov
a4d6f72ad1 Split testdata of #KT-25432 and #KT-29767 2019-02-17 13:03:01 +03:00
Dmitriy Novozhilov
49a42f9434 Fix #KT-28999. Prohibit type parameters on anonymous objects 2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
11e5ddf9ae Add test for #KT-28999 2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
4a298d1413 NI: introduce new data flow analysis for try/catch (#KT-28370) 2019-02-17 12:51:25 +03:00
Dmitriy Novozhilov
a236ad5686 NI: resolve try catch as synthetic function call (#KT-25435 fixed) 2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
4e64b07727 Add some tests for inference and DFA of try/catch/finally 2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
8d3271cc68 Refactor if expressions resolving
Context without expected type became redundant after synthetic
  call resolving was added for inference of `if` expression type

`isStatement` flag removed, because it was effectively unused
2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
1a1375240b Minor: reformat PSICallResolver according to codestyle 2019-02-17 12:46:11 +03:00
Andrey Uskov
a106085e67 Update kotlin gradle plugin used in import tests 2019-02-17 12:42:31 +03:00
Andrey Uskov
b5e6752656 Migrate import tests of composite MPP build to new version of MPP 2019-02-17 12:42:15 +03:00
Andrey Uskov
ed87a4a00d Add memory leak detection in import tests 2019-02-17 12:41:21 +03:00
Andrey Uskov
3a27192241 Remove dependency on dev version of gradle plugin in import tests 2019-02-17 12:41:04 +03:00
Andrey Uskov
ec9ee8ce40 Remove platform 173 in build script bunch 2019-02-17 12:40:50 +03:00
Andrey Uskov
6dee81f653 Cleanup Kotlin SDK in MavenImportingTestCase 2019-02-17 12:39:23 +03:00
Andrey Uskov
7890037d90 Move KotlinSdkCreationChecker to idea-test-framework module 2019-02-17 12:38:59 +03:00
Andrey Uskov
ec08d0bc27 Minor. Get rid of KotlinMavenImporter bunch 2019-02-17 12:30:29 +03:00
Andrey Uskov
b3593e87c0 Create Kotlin SDK for non-MPP JS projects
#KT-29467 Fixed
2019-02-17 12:30:06 +03:00
Andrey Uskov
8063c6511c Create Kotlin SDK on reopen project for native platform
#KT-29464 Fixed
2019-02-17 12:29:42 +03:00
Andrey Uskov
9a5fe43468 Create Kotlin SDK action moved to pooled thread
#KT-29551 Fixed
2019-02-17 12:29:24 +03:00
Andrey Uskov
59bcd608a1 Minor. Remove useless code related to IJ 173 and AS 3.1 in build scripts 2019-02-17 12:29:01 +03:00
Andrey Uskov
52be952fb7 Refactor gradle importing tests. Add possibility to test various
versions of gradle kotlin plugin
2019-02-17 12:28:19 +03:00
Andrey Uskov
5c82daf7a1 Improve bunches of GradleImportingTestCase 2019-02-17 12:27:33 +03:00
Jim S
47d63fc9be Make IrDeclaration.origin mutable 2019-02-16 09:55:03 -08:00
Yan Zhulanow
a7ea252973 Refactoring: Split KotlinCoreEnvironment setup functions for Android Lint 2019-02-15 21:23:27 +03:00
Yan Zhulanow
1fbf51ea13 Kapt: Ignore imports for enum entries on import conversion (KT-28220) 2019-02-15 21:23:27 +03:00
Yan Zhulanow
87cad2af02 Kapt: Fix "no interface expected here" in class implementing interface with secondary constructor (KT-27506) 2019-02-15 21:23:27 +03:00
Yan Zhulanow
a9eaf1c345 Pill: Rename Pill configurations, make its name not capital 2019-02-15 21:23:27 +03:00
Yan Zhulanow
770a2e3f2d Attach expect sources to all source set tasks (KT-26977)
If kapt is enabled, there are several Kotlin compilation tasks for one source set (stub generator + compile). We should attach the expect sources to all of them.
2019-02-15 21:23:26 +03:00
Yan Zhulanow
1c824655d4 Kapt: Fix supertype conversion for DefaultImpls (KT-28306) 2019-02-15 21:23:26 +03:00
Ting-Yuan Huang
3a768060ca Skip annotation processing when there's no AP specified
This also fixes KT-29302 where stub generation is skipped while the
subsequent annotation processing phase anticipates the generated stubs.

This patch addresses cases where kapt.use.worker.api=true. The cases
where kapt.use.worker.api=false are handled in the same place of stub
generation.
2019-02-15 21:23:25 +03:00
Yan Zhulanow
53fa647d41 Revert "Kapt: Do not treat initially empty configurations specially (KT-27404)" (KT-29481)
This partially reverts commit 2cb2141e07.
2019-02-15 21:23:25 +03:00
Yan Zhulanow
0444203b9b Ignore non-jar files in ServiceLoaderLite (KT-29513) 2019-02-15 21:23:25 +03:00
Yan Zhulanow
15a316ff90 Fix keyword completion for code fragments (KT-28680) 2019-02-15 21:23:25 +03:00
Yan Zhulanow
088b89b534 Pill: Add a dependency to backend.ir, fix JPS build 2019-02-15 21:23:25 +03:00
Alexander Udalov
f2bf81e799 Fix UOE when using Java annotation with infinity/NaN as default value
The root problem is the fact that ConstantExpressionEvaluator returns
null for values such as infinity and NaN loaded from cls psi (see
IDEA-207252). This commit simply reverts a part of 8ab9226805 where we
started to compute default values more often than needed. In
LazyJavaClassMemberScope, we only need to check whether or not there
_is_ a default value, not compute its value.

 #KT-29792 Fixed
2019-02-15 19:13:53 +01:00
Alexander Udalov
b2cdf2dc74 Simplify AnnotationSplitter creation and target set computation 2019-02-15 17:53:27 +01:00
Alexander Udalov
4692247897 Do not check backing field presence in AnnotationSplitter
This code can be invoked early, during body resolution and before the
fact that a property has backing field (which is only known for certain
after body resolution, because an implicit 'field' identifier may be
used). Since split annotations are cached until the end of the program,
they may end up on incorrect elements in the bytecode (or disappear
completely) as in KT-29507 or KT-28182.

Because the FIELD target has the lowest priority among implicit
annotation targets (see TARGET_PRIORITIES), it's safe to always assume
that FIELD is a valid target when splitting annotations. This only
changes the way annotations are split in case of incorrect code, as
changes in test data show.

 #KT-28182 Fixed
 #KT-29507 Fixed
2019-02-15 17:53:27 +01:00
Kirill Shmakov
5595a2dd1b Add highlighting for exceptions stacktrace on Mac
KT-29817
Review: KOTLIN-CR-2722
2019-02-15 18:33:14 +03:00
Dmitry Petrov
08de82db85 Added tests for KT-29833 2019-02-15 16:25:16 +03:00
Dmitry Petrov
4c3d0cd9d7 KT-29861 startOffset/endOffset for 'valueOf' function of enum class 2019-02-15 16:25:16 +03:00
Dmitry Petrov
1b0d410a6f KT-29862 startOffset of class declaration
NB startOffset of primary class constructor declaration should still
point to the 'class' keyword (because of debugger requirements).
2019-02-15 16:25:16 +03:00
Natalia Selezneva
92a160e6c3 Fix navigation to buildSrc from scripts
buildSrc folder should be placed under project dir (root or included project)
^KT-29707 Fixed
2019-02-15 16:06:55 +03:00
Natalia Selezneva
830973a93c Fix "Multiple Script Definitions" notification for settings.gradle.kts
^KT-29832 Fixed
2019-02-15 16:06:55 +03:00
Natalia Selezneva
d8080f205c Always scan root for script templates in background
^KT-29893 Fixed

Provide AsyncScriptDefinitionsContributor.
Show a notification if the highlighting for script is requested when not all script templates are loaded
2019-02-15 16:06:54 +03:00
Natalia Selezneva
00cd6a698d Do not run multiple script dependencies updates if dependencies weren't saved yet
^KT-29770 Fixed
2019-02-15 16:06:54 +03:00
Natalia Selezneva
8918a83fb4 Unify cache size for script dependencies 2019-02-15 16:06:54 +03:00
Natalia Selezneva
abc2dbba39 Minor: fix typo in package name 2019-02-15 16:06:54 +03:00
Natalia Selezneva
889396ec27 Cache 10 + 5 scripts in KotlinCacheService
This may be useful for find usages (and inspections that uses it) of declaration from buildSrc which may be used in several scripts
2019-02-15 16:06:54 +03:00
Natalia Selezneva
74909c4d09 Do not run unused symbol inspection if declaration in used in more than 3 scripts 2019-02-15 16:06:53 +03:00
Ilya Chernikov
c29332e290 Regenerate tests 2019-02-15 13:15:47 +01:00
Toshiaki Kameyama
cd13648906 Object literal can be converted to lambda: report if "return" is only one and is in the last statement
#KT-29763 Fixed
2019-02-15 13:52:19 +03:00
Ilya Matveev
7c3c21790b Fix subplugin options for K/N 2019-02-15 13:37:16 +03:00
Nicolay Mitropolsky
2678ada5ae 191: AbstractModelBuilderTest: addExtraProjectModelClasses was removed in platform 2019-02-15 11:39:54 +03:00
Dmitriy Dolovov
375697c413 User friendly presentation of KLIBs in IDEA
Missed fixes in 181 bunch
2019-02-15 15:32:22 +07:00
Dmitriy Dolovov
05323f8a30 CIDR: Avoid exception in JavaDocumentationProvider
as there is no Java support in CIDR
2019-02-15 11:12:28 +07:00
Nicolay Mitropolsky
a29bf61d05 191: fix for KotlinUastReferencesTest reference target assertion added in 191 2019-02-14 20:44:17 +03:00
Ilmir Usmanov
d269ff8ac8 Update test data 2019-02-14 18:33:20 +03:00
Ilmir Usmanov
19d2262cf1 Generate call of throwOnFailure instead of manual check
whether coroutine is resumed with exception.
 #KT-28015 Fixed
2019-02-14 18:33:17 +03:00
Nikolay Krasko
7c83d5df93 Move queue back to class instance after bad refactoring in search package
Relevant commit: 7f1e7cc461
2019-02-14 18:26:55 +03:00
Dmitry Gridin
33954c7632 Add inspection to move the variable declaration into when
#KT-29001 Fixed
2019-02-14 17:45:53 +03:00
Nikolay Krasko
7abe9333c8 Minor: remove deprecated usages of PsiSearchHelper.SERVICE 2019-02-14 17:23:49 +03:00
Nikolay Krasko
7f1e7cc461 Minor: reformat and cleanup org.jetbrains.kotlin.idea.search package 2019-02-14 17:23:49 +03:00
Nikolay Krasko
16c79b562e Minor: cleanup warnings in KotlinFunctionParameterInfoHandler.kt 2019-02-14 17:23:49 +03:00
Nicolay Mitropolsky
a3bd70a76e KotlinDeclarationSearcher: return backing fields for parameters (KT-29034) 2019-02-14 17:12:17 +03:00
Dmitry Petrov
6aff53204f psi2ir: support dynamic infix calls ('foo bar 42' is 'foo.bar(42)') 2019-02-14 16:03:11 +03:00
Dmitry Petrov
740d5ec468 Mute some tests in JS_IR after adding basic dynamic expressions support 2019-02-14 16:03:11 +03:00
Dmitry Petrov
77cbd10f9c psi2ir: don't generate temporaries in dynamic array augmented assignment
In constructs such as 'd[i] += x', where both indexed get and indexed
set are dynamic calls, it's safe to generate augmented assignment body
directly, without temporary variables for array ('d') and index ('i').
Note that corresponding IntermediateValue's are OnceExpressionValue's,
which would throw an exception if this assumption is violated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov
580eb6fcac JS_IR: support dynamic expressions in block decomposition 2019-02-14 16:03:11 +03:00
Dmitry Petrov
03c35a4f44 JS_IR: support dynamic expressions in JS tree generation 2019-02-14 16:03:11 +03:00
Dmitry Petrov
4cee8c6f00 Minor: fix IrDynamicOperatorExpressionImpl double dispatch methods 2019-02-14 16:03:11 +03:00
Dmitry Petrov
5b4b22a8b6 psi2ir: additional tests for dynamic expressions: '?:', '!!' 2019-02-14 16:03:11 +03:00
Dmitry Petrov
83b2fed5be psi2ir: minor: drop unused import 2019-02-14 16:03:11 +03:00
Dmitry Petrov
6889e470d1 psi2ir: minor: move array access generation code 2019-02-14 16:03:11 +03:00
Dmitry Petrov
50269d3a5c psi2ir: minor: simplify code for dynamic array element assignment 2019-02-14 16:03:11 +03:00
Dmitry Petrov
cf29dce4c2 pri2ir: dynamic unary & binary expressions
NB1 Not every dynamic unary or binary expression is translated to
dynamic operator expressions literally. For example, assignments and
increments can have safe calls in LHS, which require some extra logic.

NB2 There are some open design questions left regarding how dynamic
expressions should actually be translated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov
82701de87b psi2ir: minor: drop some unused params/imports 2019-02-14 16:03:11 +03:00
Dmitry Petrov
fbbe4f6e92 psi2ir: dynamic array element get/set 2019-02-14 16:03:11 +03:00
Dmitry Petrov
9a2bd5f4e6 psi2ir: dynamic member simple assignment/augmented assignment/++/-- 2019-02-14 16:03:11 +03:00
Dmitry Petrov
fc76d0970b psi2ir: Implicit casts with 'dynamic' 2019-02-14 16:03:11 +03:00
Dmitry Petrov
3c8f52b436 psi2ir: simple dynamic member calls 2019-02-14 16:03:11 +03:00
Dmitry Petrov
ddb1ea2047 psi2ir: dynamic member access ('d.x', 'd?.x') 2019-02-14 16:03:11 +03:00
Dmitry Petrov
6e7ccfbfff Introduce IrDynamicExpression and children
Dynamic expressions are represented as either operator expressions -
e.g., `d1 + d2`, `d[e]`, `d(e1, e2, e3)`, `d += e` -
where "operator" is a one of the known operators,
or as member reference expressions - e.g., `d.memberName` - where
member name is some arbitrary name (unresolved at compile-time and
represented as String).
2019-02-14 16:03:11 +03:00
Anton Bannykh
f8dc6763bd JS: minor review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
4e298ae5cb JS: Inlined local declarations should be positioned after imports 2019-02-14 15:14:28 +03:00
Anton Bannykh
0bfd332580 JS: improve a test (review fix) 2019-02-14 15:14:28 +03:00
Anton Bannykh
9ad1d8d054 JS: improve inline suspend function declaration splitter 2019-02-14 15:14:28 +03:00
Anton Bannykh
4b39e2df12 JS: (review fix) Header -> InlineData 2019-02-14 15:14:28 +03:00
Anton Bannykh
0fa87e3baa JS: advance IC version 2019-02-14 15:14:28 +03:00
Anton Bannykh
5c1664ebf8 JS: collect label definitions, not some of their usages 2019-02-14 15:14:28 +03:00
Anton Bannykh
b7bea3242e JS: fix fragment info loading
The very first fragment didn't got processed, thus inline cycle
reporter was not failing tests
2019-02-14 15:14:28 +03:00
Anton Bannykh
370194796e JS: fix synthethic name bindings for the inlined local declarations
TODO add synthetic order-based namebindings for inlined local
declarations AFTER all post-processings. This would be a more robust
approach imho
2019-02-14 15:14:28 +03:00
Anton Bannykh
32de99fe32 JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
8f68c47225 JS: support inline function definitions without wrappers
Apparently function literals are translated without hiding the local declarations
in the wrapFunction call.

Which makes sense. Apart from the fact that it would also make
sense to do the same for private inline functions and function
literals inside other inline functions.
2019-02-14 15:14:28 +03:00
Anton Bannykh
6e74c4ce71 JS: switch off the validator until class translation is fixed 2019-02-14 15:14:28 +03:00
Anton Bannykh
0daa6675bd JS: comments, review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
1c67e4cf21 JS: simplify and fix the AST visitor code. 2019-02-14 15:14:28 +03:00
Anton Bannykh
11265f1424 JS: review fixes (renamings, etc.) 2019-02-14 15:14:28 +03:00
Anton Bannykh
990ee849e2 JS: test local declaration deduplication with name clash; fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh
60aa6e4971 JS: a cross-module local declaration fake override test;
Also describe an alternative, more robust approach in a TODO comment
2019-02-14 15:14:28 +03:00
Anton Bannykh
b4b406af99 JS: explain what validateJsAst does; enable validation in non-incremental tests 2019-02-14 15:14:28 +03:00
Anton Bannykh
a35fc4fa3c JS: use string table for module names and inline function tags 2019-02-14 15:14:28 +03:00
Anton Bannykh
d7499363bc JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
44dedf3a64 JS: minor refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh
396ec20788 JS: add constructor binding and inlining test 2019-02-14 15:14:28 +03:00
Anton Bannykh
92401f0561 JS: fix primary constructor name tag generation 2019-02-14 15:14:28 +03:00
Anton Bannykh
36fd4d24fb JS: move label renaming to new fragment post-processing
Also remove metadata renaming from the global passes
2019-02-14 15:14:28 +03:00
Anton Bannykh
6921d4d128 JS: minor 2019-02-14 15:14:28 +03:00
Anton Bannykh
2022a9c887 JS: fix inheriting fake overrides in inlined object literals 2019-02-14 15:14:28 +03:00
Anton Bannykh
9716abcc12 JS: inline private properties 2019-02-14 15:14:28 +03:00
Anton Bannykh
50aeeee462 JS: fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh
21cbc7b018 JS: add incremental test for local declarations change 2019-02-14 15:14:28 +03:00
Anton Bannykh
299a45ccbf JS: validate AST when serializing to IC cache 2019-02-14 15:14:28 +03:00
Anton Bannykh
e4b081e1bf JS: fix inline cycle reporting 2019-02-14 15:14:28 +03:00
Anton Bannykh
b5b770c804 JS: line number fix 2019-02-14 15:14:28 +03:00
Anton Bannykh
47a219eeff JS: refactorings & cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh
e76f80cbc6 JS: prevent duplicate imports inside inline function definition 2019-02-14 15:14:28 +03:00
Anton Bannykh
13844bd08e JS: FunctionReader cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh
6d5ef2d324 JS: fix long constants importing 2019-02-14 15:14:28 +03:00
Anton Bannykh
cd0fd569b4 JS: visit tests and main in import remover; update line numbers 2019-02-14 15:14:28 +03:00
Anton Bannykh
52b705e7ae JS: Fix local aliases
Local aliases can be copied as-is to a different fragment now. Before this change we would have had to extract the local alias tag (if any) from the source fragment and add to the destination fragment name bindings.
2019-02-14 15:14:28 +03:00
Anton Bannykh
3a258ad08a JS: fix module references in case of @JsModule annotation 2019-02-14 15:14:28 +03:00
Anton Bannykh
a1649e9e4d JS: fix import cleaner
The tag generated during the source file translation could differ from
the tag generated based on the import statement (e.g. "intrinsic:..."
during generation becomes "'Kotlin'...." later on).

This means that the same function imported from the start and imported
during inlining has different tags. Which makes duplicate import removal
trickier. The best solution would be to make sure the tag generation
algorithms are consistent.

Current solution: rewrite the tags in terms of the Inliner tag
generation algorithm right after the source file translation.

Also it seems that some `var` statements we treated as imports, even
though they were not. Supported this behavior for now.

TODO: Get rid of these workaround
2019-02-14 15:14:28 +03:00
Anton Bannykh
c1fbeeb7d9 JS: fix bugs 2019-02-14 15:14:28 +03:00
Anton Bannykh
a30c7fbee1 JS: Support imported wrapper serialization 2019-02-14 15:14:28 +03:00
Anton Bannykh
75668826d3 JS: simplification in process 2019-02-14 15:14:28 +03:00
Anton Bannykh
2cbdc7ecb0 JS: store whole JsImportedModule's in the module local alias
Module references were stored as plain JsName's. When inlining a function
from one fragment to another, those references should be re-interpreted
in terms of the destination fragment. Storing the whole module information
makes that much easier.
2019-02-14 15:14:28 +03:00
Anton Bannykh
a0ff581a2f JS: refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh
6d26bf9622 JS: don't load binary AST unless required by the inliner 2019-02-14 15:14:28 +03:00
Anton Bannykh
c83b6d46cc JS: split JsInliner 2019-02-14 15:14:28 +03:00
Anton Bannykh
c65383fa3f JS: postpone JS AST merging 2019-02-14 15:14:28 +03:00
Anton Bannykh
ec276dbea4 JS: convert JsInliner to Kotlin 2019-02-14 15:14:28 +03:00
Anton Bannykh
039625bb7e JS: convert K2JSTranslator to Kotlin 2019-02-14 15:14:28 +03:00
Anton Bannykh
1052ec898c JS: review fixes (mostly tests) 2019-02-14 15:14:28 +03:00
Anton Bannykh
3529114913 JS: incremental translation of tests and main fun invocation 2019-02-14 15:14:28 +03:00
Anton Bannykh
0397af79b4 JS: convert from java to kotlin JsProgramFragment 2019-02-14 15:14:28 +03:00
Toshiaki Kameyama
d583c1be58 Can be replaced with binary operator: do not suggest when receiver or argument is floating point type
#KT-28596 Fixed
2019-02-14 15:10:26 +03:00
Nicolay Mitropolsky
48619a49ed RenameKotlinPropertyProcessor made not update the property before all references are updated (KT-27602)
because otherwise language independent bean property references couldn't properly handle rename in some cases.

Groovy references were also affected by this bug because they weren't able to resolve to original property
2019-02-14 13:27:06 +03:00
victor.petukhov
2bcdadf17f Add positive diagnostic tests for smartcasts from nullability condition using if expression 2019-02-14 13:11:14 +03:00
Dmitriy Dolovov
75250cf1a0 User friendly presentation of KLIBs in IDEA
Adds friendly names for KLIBs imported as file dependencies from Gradle project.

Issue #KT-29613 Fixed
Issue #KT-29783 Fixed
2019-02-14 16:55:45 +07:00
victor.petukhov
06b5a42d0d Improve test exceptions fixation:
- exceptions is analyzed if it's specified explicitly only,
- compute test case number for diagnostic tests in which an exception is thrown.
2019-02-14 12:31:43 +03:00
victor.petukhov
317da3d481 Add NOTE and UNSPECIFIED BEHAVIOUR fields to spec tests 2019-02-14 12:31:43 +03:00
victor.petukhov
ec8a6cbe9c Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:43 +03:00
victor.petukhov
acd6d354dc Support several spec places to which tests are linked and require specify spec version for each test 2019-02-14 12:31:43 +03:00
victor.petukhov
cb5f497cbe Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:42 +03:00
victor.petukhov
30762a450a Wrap diagnostic parameters to double quotes and split by comma instead of semicolon 2019-02-14 12:31:42 +03:00
victor.petukhov
46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
victor.petukhov
fad59e200c Code stylistic improvements in BaseDiagnosticTest 2019-02-14 12:31:42 +03:00
victor.petukhov
b354518a41 Add lazy debug diagnostic DEBUG_INFO_EXPRESSION_TYPE 2019-02-14 12:31:42 +03:00
victor.petukhov
f92232f015 Decompose and rewrite CheckerTestUtil to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov
9e06e1eec0 Move and rename into .kt files around CheckerTestUtil for rewrite to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov
8a9c7a69f3 Move checkType directives for tests to separate folder 2019-02-14 12:31:42 +03:00
Ilmir Usmanov
440cccae73 Loosen tail call check
Check that any source of ARETURN is inside a suspension point, not all
of them.
 #KT-27190 Fixed
2019-02-14 12:21:44 +03:00
Sergey Rostov
cc62c971e7 JPS Build: update artifacts for IDEA 2019.1 module names 2019-02-14 10:32:28 +03:00
Dmitriy Dolovov
3df5123d0d CIDR: New way of building CLion and AppCode plugins
- Move `prepare/cidr-plugin`, `prepare/clion-plugin` and `prepare/appcode-plugin` modules from `kotlin` to `kotlin-ultimate` project
- Move `versions.clion.*` and `versions.appcode.*` properties from `kotlin` to `kotlin-ultimate` project
- Drop `cidr183` bunch in `kotlin` project
- Drop useless `cidrPluginDir`, `clionPluginDir`, `clionSandboxDir`, `appcodePluginDir`, `appcodeSandboxDir` Gradle properties in `kotlin` project
- Drop `cidrPlugin` Gradle task in `kotlin` project
- Total: Add ability to build `kotlin-ultimate` both as part of multi-project build with `kotlin` project, and as a standalone build
2019-02-14 12:28:57 +07:00
Alexey Tsvetkov
d5507734e8 Fix maven plugin after IC build reports were introduced to Gradle 2019-02-13 22:04:07 +03:00
Anton Yalyshev
b8d9b563a9 inlined field for better look 2019-02-13 21:48:18 +03:00
Anton Yalyshev
2ccc79b536 Adapted statistics logging to new FUS API. Removed Context usage. 2019-02-13 21:48:18 +03:00
Anton Yalyshev
77d7b8fa1d Plugin util seems better for getting plugin version 2019-02-13 21:47:04 +03:00
Anton Yalyshev
586d2a548b attr. name was changed in FUS API 2019-02-13 21:47:04 +03:00
sashache
7e9f8df43a Allow IDE plugin for 2019.1 platform to run with IDEA 2019.2. 2019-02-13 21:30:57 +03:00
Yan Zhulanow
9729932fe4 191: Update Android plugin changes to AS33 (KT-29847) 2019-02-13 16:35:46 +03:00
Alexander Podkhalyuzin
a2d702c2a7 Fixed 182 patchsets 2019-02-13 16:31:25 +03:00
Denis Zharkov
abad408d7b Do not implicitly propagate deprecations originated in Java
^KT-29604 Fixed
2019-02-13 16:21:05 +03:00
Alexander Podkhalyuzin
2f546d1003 Test for multline todo comments support to Kotlin 2019-02-13 15:59:14 +03:00
Alexander Podkhalyuzin
6c2af0741a Added multline todo comments support to Kotlin
#KT-26950 Fixed
2019-02-13 15:34:00 +03:00
Nikolay Krasko
0d1460ac04 Add "Hard wrap at" and "Wrap on typing" to UI (KT-28905)
#KT-28905 Fixed
2019-02-13 13:56:34 +03:00
Nikolay Krasko
9c47fc6d4d Don't auto close simple long template entry if it's already finished (KT-11143)
#KT-11143 Fixed
2019-02-13 13:56:34 +03:00
Nikolay Krasko
9fe82524e5 Rename in wrapping settings: method -> function (KT-29304) 2019-02-13 13:56:34 +03:00
Ilya Gorbunov
f50820045a Allow setting seed only once, as it is set from superclass constructor
Add tests for Java<->Kotlin Random wrappers.

#KT-29520 Fixed
2019-02-13 00:21:22 +03:00
Ilya Chernikov
4d0261fc45 Fix parsing tests 2019-02-12 21:02:56 +01:00
Alexey Tsvetkov
37e74e0949 Add debugKotlinDaemon shortcut to Gradle tests 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
560a9d6ae6 Add smoke test 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
690f6fdd32 Print build overview 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
7084fd8966 Do not print tasks info when no Kotlin task was run 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
dbdc7a5b07 Add verbose mode to build reports
#KT-12700

Verbose mode can be enabled by adding `kotlin.build.report.verbose=true`
to `gradle.properties` file.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
01c23510c7 Print recompilation reasons in build report 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
47bb938b94 Adjust build report verbosity 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
98ef00b957 Add build reports for diagnosing build problems in Gradle
#KT-12700 Fixed

To turn build reports, add 'kotlin.build.report.enable=true' to
gradle.properties file
(or pass it in CLI via`-Pkotlin.build.report.enable=true`).
By default build reports are created in
`rootProject/build/reports/kotlin-build`.
Build report dir can be customized via `kotlin.build.report.dir`
property.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
8fc8b95d83 Move TaskLoggers to org.jetbrains.kotlin.gradle.plugin.internal.state 2019-02-12 22:10:11 +03:00
Svyatoslav Kuzmich
d0e7fb7af3 [JS IR BE] Copy Runtime IR after inline preparation passes 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
74ee64fcf1 [JS IR] Workaround: don't try to use generated js files for secondary modules 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
cfde97a7a0 [JS IR BE] Support nested external classes 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
0ff23544fc [JS IR BE] Initial support for mudule wrapper generation 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
d8b1d09566 [JS IR BE] Support codegen for external objects and properties 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
53d15ea27c [JS IR BE] Fix arrays type checks 2019-02-12 18:45:34 +03:00
Vyacheslav Karpukhin
9d4e161324 Updated AppCode dependency 2019-02-12 16:27:07 +01:00
Pavel Punegov
52055ecc94 Add classifier for the artifact to be resolved correctly 2019-02-12 16:01:45 +03:00
Dmitry Gridin
5089df2441 Fix convert unary operator to function call
#KT-25501 Fixed
2019-02-12 11:57:40 +03:00
Kirill Shmakov
e341286fb1 Bump gradle version in template projects
#KT-28522 supposed to be fixed with this
2019-02-11 15:53:24 +03:00
Sergey Rostov
70ffb14d0a JPS Build: update artifacts 2019-02-11 15:18:43 +03:00
Toshiaki Kameyama
4113d06767 Add "Change type to mutable collection" quick fix for NO_SET_METHOD
#KT-29193 Fixed
2019-02-11 10:17:51 +03:00
Toshiaki Kameyama
52c2547d95 Create extension function '.set' quick fix: do not suggest for read-only collestions
# KT-29193 Fixed
2019-02-11 10:17:51 +03:00
Toshiaki Kameyama
d6e21b1c21 Convert to secondary constructor: do not suggest when property has val/var and no name
#KT-29056 Fixed
2019-02-11 10:04:33 +03:00
Ilya Chernikov
dab97ac936 Use KotlinPaths to access jars 2019-02-10 13:35:59 +01:00
Ilya Chernikov
66107d430e Fix maven plugin after moving scripting to the compiler plugin 2019-02-10 13:35:58 +01:00
Ilya Chernikov
d0e78b95c3 Introduce classpath for compiler with scripting in KotlinPaths, fix JSR-223 for Idea 2019-02-10 13:35:58 +01:00
Ilya Chernikov
4c751cdd52 Refactor KotlinPaths - make it easier to extend and keep track of supported entities 2019-02-10 13:34:28 +01:00
Ilya Chernikov
b0c86647ed Convert KotlinPaths to kotlin 2019-02-10 13:33:22 +01:00
Ilya Chernikov
d1da1dd410 Rename .java to .kt 2019-02-10 13:33:22 +01:00
Ilya Chernikov
c6a24c03e4 Move CliScriptDefinition provider to the plugin too, fix tests 2019-02-10 13:33:22 +01:00
Ilya Chernikov
731df8d3cc Proper handling of the scripting compiler plugin in JSR-223 with daemon 2019-02-10 13:33:21 +01:00
Ilya Chernikov
df0b648cea Add scripting configuration to daemon repl, fix and add tests 2019-02-10 13:33:21 +01:00
Ilya Chernikov
be95acd897 Load scripting plugin explicitly in repl tests and JSR-223 2019-02-10 13:33:21 +01:00
Ilya Chernikov
2f52df0640 Initialize scripting plugin in other tests 2019-02-10 13:31:57 +01:00
Ilya Chernikov
5ef6ad916f Apply scripting compiler plugin to the jvm scripting host compiler 2019-02-10 13:31:57 +01:00
Ilya Chernikov
2c02ee3d29 Rename test files to scripts to trigger proper scripting initialization
fix generation config accordingly
2019-02-10 13:31:57 +01:00
Ilya Chernikov
2b67dbe8dd Initialize scripting in tests if script is passed as a source 2019-02-10 13:31:56 +01:00
Ilya Chernikov
89fc7eba95 Make script infrastructure providers optional 2019-02-10 13:31:56 +01:00
Ilya Chernikov
0732b48701 Move script related configuration to the plugin 2019-02-10 13:31:55 +01:00
Ilya Chernikov
dafb2a7519 Drop unused classes and references 2019-02-10 13:31:55 +01:00
Toshiaki Kameyama
6f7830a4b2 Make public: reformat after removing primary constructor visibility modifier
#KT-29444 Fixed
2019-02-09 02:56:14 +03:00
Alexander Udalov
c2968b6a68 Minor, use kotlin.Pair in JvmSerializationBindings.FIELD_FOR_PROPERTY 2019-02-07 23:33:29 +01:00
Alexander Udalov
23298af5a4 Implement fillInStackTrace and others in TestsError
This fixes exception stack traces in some compiler tests. Also provide
explicit return types to get rid of platform type inspections
2019-02-07 23:33:29 +01:00
Alexander Udalov
ce7d8a6874 JVM IR: replace unnecessary property accessor calls with field access
Split the ConstAndJvmFieldPropertiesLowering into two: ConstLowering
which replaces const vals with their values, and
PropertiesToFieldsLowering which removes unnecessary property accessors
(such as for JvmField or private properties with default accessors) and
replaces calls to those accessors with field access
2019-02-07 23:32:32 +01:00
Alexander Udalov
1c143310ac JVM IR: coerce call result to expected expression type
The boundWithSerializableReceiver.kt test is muted since property
references are not yet supported in the JVM IR backend. Previously it
passed by accident
2019-02-07 21:26:00 +01:00
Alexander Udalov
8b395589be JVM IR: fix incorrect IR types in inner and enum class lowerings
In InnerClassesLowering, the type of the "outer$0" expression should be
the outer class, not the inner class. In EnumClassLowering, the type of
the enum entry is the type of its class or the type of the enum class,
but not the type of initialierExpression which is always Unit
2019-02-07 21:25:59 +01:00
Alexander Udalov
4bfa98144b JVM IR: fix compound access to JvmField properties 2019-02-07 21:23:02 +01:00
Alexander Udalov
5c807266f6 JVM IR: fix origin of file class in FileClassLowering
IrDeclarationOrigin.FILE_CLASS is used in CallableReferenceLowering to
generate correct declaration owner.

Many reflection tests start to fail with this commit because they are
now treating callable references to top level declarations as Kotlin
symbols and fail because there's no JVM signature for them; this is
fixed in subsequent commits (previously, they worked because without
Kotlin metadata, these files were treated as Java classes)
2019-02-07 21:23:02 +01:00
Alexander Udalov
8ae03b54d9 JVM IR: generate correct .kotlin_module files 2019-02-07 21:23:02 +01:00
Alexander Udalov
aa0882a74f Refactor .kotlin_module-writing code, simplify PackagePartRegistry 2019-02-07 21:23:01 +01:00
Alexander Udalov
be74f36acc Add module backend.jvm to kotlin-compiler.jar JPS artifact 2019-02-07 21:23:00 +01:00
Alexander Udalov
246346367c Minor, don't use experimental coroutines in kotlinp test 2019-02-07 21:23:00 +01:00
Mikhael Bogdanov
4dc304b24e Move IrBytecodeText tests to ir package 2019-02-07 16:14:20 +01:00
Mads Ager
b902da55d5 JVM_IR: Block with nothing type do not generate values on the stack. 2019-02-07 16:05:16 +01:00
Denis Zharkov
b37aeb8f14 Remove accidentally committed test data bunch for as33 2019-02-07 16:24:23 +03:00
Vyacheslav Karpukhin
ec2dacf9a2 AppCode: minor refactoring in the build script 2019-02-07 13:21:26 +01:00
Mikhael Bogdanov
267925ef14 Update bootstrap to 1.3.30-dev-1419 2019-02-07 11:55:02 +01:00
Mikhael Bogdanov
6aaa601239 Add tests for obsolete issues
#KT-21085 Obsolete
 #KT-13846 Obsolete
2019-02-07 11:39:48 +01:00
Mikhael Bogdanov
6d24d50df6 Remove obsolete test 2019-02-07 11:39:48 +01:00
Dmitriy Novozhilov
c5c43d89d3 Fix testdata of #KT-28598 2019-02-07 13:27:05 +03:00
Dmitriy Novozhilov
3f4df6160c Minor: reformat NewCapturedType.kt according to code style 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
9129210cfe Move changes from dfb379d under new language feature (#KT-28672)
Changes from that commit are breaking, and should be pass throw LC
2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
cf25cab773 Add test for #KT-28598 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
6878abe8b4 Add test for #KT-25432 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
93de13d931 Fix behaviour of NI in testData
After one of previous commits (my or Mikhail Zarechenskiy) that test
  was broken and it's behaviour was not fixed. That test's behaviour
  is strange (why at one case we have `UNREACHABLE_CODE` and haven't
  at other) and needs further investigation
2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
b9c5b63d69 Fix #KT-28993 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
c60bce88c2 Add test for #KT-28993 2019-02-07 12:12:34 +03:00
kirill.shmakov
4b1e5e8005 Resolve #KT-26865 and related issues
CLITool.exec is used in konanc to perform compilation of native project.
Due to some internal limitation, this function runs in separate process.

After this change, there will be a possibility to choose MessageRenderer
used in CLITool.exec via system property
org.jetbrains.kotlin.cliMessageRenderer.

Reviewed at KOTLIN-CR-2698.
2019-02-07 11:29:16 +03:00
Denis Zharkov
2518ddd87d Fix test data for 181/as33 2019-02-07 11:25:25 +03:00
Ilya Matveev
25bc88f33d Fix K/N framework naming in test 2019-02-06 18:21:42 +03:00
Ilya Matveev
ecbadcdf6f Use project.container instead of WrapUtil
In Gradle 5.2 the 'WrapUtil.toNamedDomainObjectSet' method
was removed. This patches replaces usage of this method
with call of the 'Project.container' method.

Issue #KT-29725 Fixed
2019-02-06 18:21:42 +03:00
Denis Zharkov
1a630773cf Fix parent and containingFile for throws-reference list
Otherwise, exception is thrown during type inference
because default implementations effectively return null

^KT-29287 Fixed
2019-02-06 16:26:28 +03:00
Mikhail Glukhikh
f040eaff27 FIR expressions: perform some names refactoring
FirAccess -> FirQualifiedAccess
FirAccessExpression -> FirQualifiedExpression
FirPropertyAssignment -> FirVariableAssignment
Introduce lValue & rValue in FirAssignment
Introduce separate indexes in FirArraySetCall
2019-02-06 11:59:06 +03:00
Mikhail Glukhikh
8ea4500ab4 Add test for PSI consistency #KT-24080 Fixed
This test checks that we handled all PSI elements properly
2019-02-06 11:59:03 +03:00
Mikhail Glukhikh
5e6ccb4b10 FIR total kotlin test: calculate also KtExpression/Declaration number 2019-02-06 11:59:02 +03:00
Mikhail Glukhikh
8dce8c1549 Make correct traverse in both FIR consistency tests 2019-02-06 11:59:01 +03:00
Mikhail Glukhikh
db2fb86c8e Raw FIR: implement expression trees & conversions from PSI
Testing: total kotlin test controls no stubs in FIR in non-stub-mode
#KT-29002 Fixed
2019-02-06 11:58:59 +03:00
Mikhail Glukhikh
aa97175d40 FIR generator: support type parameters with bounds for interfaces
This commits also reorders bridge visit functions
2019-02-06 11:58:58 +03:00
Toshiaki Kameyama
fa1f3871c0 Add "Redundant 'requireNotNull' or 'checkNotNull' call" inspection
#KT-29113 Fixed
2019-02-06 11:10:27 +03:00
Mikhail Glukhikh
c234683770 Fix changelog for 1.3.21 2019-02-06 11:03:13 +03:00
Mikhail Glukhikh
df0e2dd50a Fix for canBeResolvedViaImport: check isExtension earlier
This commit fixes mistake in d202e96e and fixes broken tests
Related to KT-29713
2019-02-06 10:59:53 +03:00
Georgy Bronnikov
ab1e334847 Reorganize phaser 2019-02-06 07:26:18 +03:00
Nikolay Krasko
89c5549b0a Refactoring: extract urls to separate class and remove long strings 2019-02-06 03:17:25 +03:00
shiraji
d3895c519c Display Quick Documentation for reserved words
#KT-9934 Fixed
2019-02-06 03:17:24 +03:00
Mikhail Glukhikh
53607ba8d4 Add changelog for 1.3.21 2019-02-05 20:02:58 +03:00
Mikhael Bogdanov
0ce4c9bf00 Upgrade proguard to 6.0.3 to avoid corrupted stack maps 2019-02-05 16:14:51 +01:00
Mikhael Bogdanov
b2606735c5 Properly capture local delegated properties in object constructor
#KT-23117 Fixed
2019-02-05 16:14:51 +01:00
Mikhael Bogdanov
9ab6062295 Properly capture extension receiver for array convention expressions in object constructor
#KT-19389 Fixed
2019-02-05 16:14:50 +01:00
Ilya Chernikov
3943bd1b15 Make toString for repl return function types nicer, drop obsolete isFunctionType 2019-02-05 16:13:06 +01:00
Ilya Chernikov
b7e1dd96b2 Supply proper classloader to the evaluator, add another test for function type
and some minor refactoring
2019-02-05 16:13:06 +01:00
Nikolay Krasko
aac9a3e953 Update since to 183.3283.2 as we already use API from it
Thanks to "Usage of Intellij API not available in older IDEs" inspection.
2019-02-05 16:54:34 +03:00
Nikolay Krasko
22a46d96c1 Update copyright in test module 2019-02-05 16:54:34 +03:00
Timo Obereder
ff4279762e Fix comment placement on if/else in if or when condition #KT-28224 Fixed 2019-02-05 14:07:28 +03:00
Mikhael Bogdanov
520679a2b4 Regenerate JS tests 2019-02-05 11:55:42 +01:00
Mikhail Glukhikh
d202e96ea1 Extract and use for inline KtSimpleNameExpression.canBeResolvedViaImport
Related to KT-29486
#KT-29713 Fixed
2019-02-05 13:32:33 +03:00
Mikhail Glukhikh
cccc6bf315 Redundant enum constructor invocation inspection: minor rename 2019-02-05 12:57:14 +03:00
Toshiaki Kameyama
7cba11ff28 Can be private: don't report if it's used in inline property
#KT-29085 Fixed
2019-02-05 11:34:08 +03:00
Toshiaki Kameyama
2a7eb2fb0e Redundant lambda arrow: do not report on nested lambda
#KT-29093 Fixed
2019-02-05 11:27:41 +03:00
Toshiaki Kameyama
bf7f7c81b1 Redundant explict type: do not report for aliased types
#KT-29128 Fixed
2019-02-05 11:24:32 +03:00
Toshiaki Kameyama
25952036af Reformat RedundantExplicitTypeInspection 2019-02-05 11:24:32 +03:00
Toshiaki Kameyama
b9d8466fc0 Replace rangeTo with until: fix false negative with parenthesized expression
#KT-29153 Fixed
2019-02-05 11:22:59 +03:00
Toshiaki Kameyama
c183f0285d Reformat ReplaceRangeToWithUntilInspection 2019-02-05 11:22:59 +03:00
Toshiaki Kameyama
9c468ef2aa Convert member to extension: preserve visibility
#KT-29248 Fixed
2019-02-05 11:22:02 +03:00
Toshiaki Kameyama
e8a8bc89c9 Add "Redundant enum constructor invocation" inspection
#KT-29321 Fixed
2019-02-05 11:16:01 +03:00
Mads Ager
542d3c3532 JVM_IR: Fix stack underflow for unit coercion of when expressions.
Code such as

```
val b = getBoolean()
if (b) 4
else if (b) 5
```

didn't generate a value on the stack always and therefore would
have control-flow paths leading to a pop instruction with nothing
on the stack.

Change-Id: I09d059f361e56a41880006e3f4e51e9acdbd167d
2019-02-05 08:52:18 +01:00
Mark Punzalan
e91a16556c JVM_IR: Do not add redundant field initializers.
Initializers are "set field" expressions and are considered redundant
when they are:
1. In the primary constructor; and
2. Set the field to `0`, `false`, or `null`; and
3. Have a `null` origin. I.e., not in an initializer block or
constructor body, and therefore the field could not have been set by a
prior expression.
2019-02-05 08:44:33 +01:00
kirill.shmakov
9e8972f1f9 Correct typo in comments 2019-02-04 14:30:37 +03:00
Mikhael Bogdanov
53aca0069c Update bootstrap version to 1.3.30-dev-1297 2019-02-04 09:04:44 +01:00
Kirill Shmakov
aafb8473e9 Correct typo 2019-02-04 10:00:43 +03:00
kirill.shmakov
566dac8599 Correct suppress directive 2019-02-04 09:48:03 +03:00
Nikolay Krasko
a75da632a6 Revert extension function in IndexUtils and better testing 2019-02-03 17:32:05 +03:00
Nikolay Krasko
c89bee624a Minor: remove DocumentAdapter usage 2019-02-03 17:32:05 +03:00
Nikolay Krasko
b8bbe10086 Support global inspections in tests (KT-29549)
#KT-29549 Fixed
2019-02-03 17:32:05 +03:00
Nikolay Krasko
56d56ab842 Make package name inspection global (KT-29549)
Report same package only once.

 #KT-29549 Fixed
2019-02-03 17:32:04 +03:00
Nikolay Krasko
6ee78fb629 Refactoring: extract name verifier code to settings class 2019-02-03 17:32:04 +03:00
Ilmir Usmanov
39de3c2ab1 Fix test data on JVM_IR BE 2019-02-01 21:45:44 +03:00
Ilmir Usmanov
20e4efaeab Fix test data 2019-02-01 17:33:49 +03:00
Vadim Brilyantov
4d68e08ab7 Change 191 idea version to 191.4738.6 2019-02-01 16:47:04 +03:00
Vadim Brilyantov
6a657714ec Move usage statistics to idea source root 2019-02-01 16:47:03 +03:00
Vadim Brilyantov
032a784d0b Implement statistics for the new API for intellij 191 2019-02-01 16:47:02 +03:00
Alexander Podkhalyuzin
495030ad9b Back to png icons in Android Studio
It's not support 16px @2x.svg icons yet, we need to wait for AS 3.4

#KT-29533 Fixed
2019-02-01 16:41:21 +03:00
kirill.shmakov
6c8b3d03fd Add syntax highlighting for *.def files 2019-02-01 16:34:00 +03:00
Alexander Udalov
8b286faa6a Workaround issue with unsupported report-cdata-event in XMLInputFactory on IBM JDK
#KT-29596 Fixed
2019-02-01 14:27:43 +01:00
Mikhail Glukhikh
bef0249347 UAST: do not analyze KtPsiFactory-created files #KT-29486 Fixed 2019-02-01 13:26:17 +03:00
Toshiaki Kameyama
bd467f39d6 Convert to scope function: Also convert call expression
#KT-28698 Fixed
2019-02-01 12:13:05 +03:00
Toshiaki Kameyama
f15c8f78fa Convert to scope function: refactor 2019-02-01 12:13:05 +03:00
Dmitriy Novozhilov
0501a108c0 Fix tests in DiagnosticsTestWithStdLibGenerated with NI 2019-02-01 11:40:20 +03:00
Toshiaki Kameyama
98810ba750 Add intention to replace snake-case test function name with a space-separated
#KT-27143 Fixed
2019-02-01 11:07:00 +03:00
Pavel V. Talanov
5226ea5cda Add missing bunch files
#KT-27769 Fixed
2019-01-31 17:38:05 +01:00
Ilya Gorbunov
bd2e00ae99 Exclude kotlin.native internal package from modular kotlin-stdlib
Otherwise jlink fails to consume this library due to Java keyword in
package name.

#KT-29612
2019-01-31 19:18:55 +03:00
Ilya Gorbunov
9c7a785d78 Add an integration test of using modular artifacts with jlink in JDK9
Setup maven plugin integration test execution with JDK9 as java home.
2019-01-31 19:18:55 +03:00
Toshiaki Kameyama
804e03379d Remove unused function parameter: do not propose for property setter parameter
#KT-29606 Fixed
2019-01-31 18:56:59 +03:00
Igor Chevdar
5b0d1bb6e4 Unmuted passing tests 2019-01-31 18:19:41 +03:00
Igor Chevdar
c257af31f4 Added test 2019-01-31 18:19:41 +03:00
Igor Chevdar
0ca28914a5 Minor changes in default arguments lowering
Calls to a function with default args can be not only
from function bodies, but for example from initializers
2019-01-31 18:19:40 +03:00
Igor Chevdar
9d84576021 Hack to help lowerings communisation in K/N
The hack breaks dependency LocalDeclarationsLowering —> CallableReferenceLowering
2019-01-31 18:19:40 +03:00
Igor Chevdar
07a576ec79 Supported enums in LocalDeclarationsLowering 2019-01-31 18:19:40 +03:00
Igor Chevdar
414899b482 Fixed copy/paste 2019-01-31 18:19:40 +03:00
Igor Chevdar
c765bd74d7 Made LateInitLowering the same in K/N as in other BEs 2019-01-31 18:19:39 +03:00
Alexander Udalov
db487a622a Add -Xsanitize-parentheses to workaround ASM 6.1 issue in frame computation
#KT-29475 Fixed
2019-01-31 15:47:43 +01:00
Dmitriy Novozhilov
dfb379d999 Expand Effect System with receiver values (#KT-28672)
Add some classes to hierarchy of `ESValue`:
- `ESReceiver` -- representation of receiver
  of lambda function
- `ESDataFlow` and `ESDataFlowReceiver` -- little refactoring of entities
  that holds information for DFA (description in comments in code).

Also add kdoc to classes of `ESValue` hierarchy
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
932e0234e7 Add testdata for issue #KT-28672 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
ba71bbde6a Extract InvocationKind class into separate file 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
44ae7a19e6 Reformat ContractSerializer.kt according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
b86ea7621c Cleanup code in PseudocodeTraverser 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
0e8c43f8c0 Generify key type parameter of ControlFlowInfo
Previously only `VariableDescriptor` was key of `ControlFlowInfo`.
Now it's generic parameter `K: Any`, so there is a possibility of using
  different object's inside CFA
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
efe891bb47 Remove duplicate of typealiases for javaslang collections 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
68d2cbf91f Extract classes used in control flow analysis of variable into variable package 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
1dd7365e9f Reformat some classes in org.jetbrains.kotlin.cfg according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
fa79f7bf30 Reformat ControlFlowProcessor according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
80835fe6ea Add ability to configure environment in AbstractLoadJavaTest
There is two methods added into `AbstractLoadJavaTest`:
- `configureEnvironment(KotlinCoreEnvironment environment)` allow to
  configure environment that will be used two compilation of source test
  data and loading generated `.class` files (e.g. you can register extensions)
- `getExtraClasspath()` allow to add custom libraries to classpath of
  compiler

Similar methods exists in `AbstractDiagnosticsTest`
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
68d7e51d32 Support test directive for rendering full diagnostic messages
New `RENDER_DIAGNOSTICS_MESSAGES` directive forces test system render
full messages for all diagnostics that found in test file
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
2866bd84a1 Reformat BaseDiagnosticTest according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
047f9abaf7 Make order of rendered diagnostics more stable
There was a bug that sometimes diagnostics on the same element with
same names but with different parameters had been reshuffled.
2019-01-31 17:25:13 +03:00
Tor Norbye
a42406f2aa KT-29586: Add android.annotation annotations
KT-29586 Fixed
2019-01-31 17:12:56 +03:00
Pavel V. Talanov
f1f2d5b4d3 Change dsl marker gutter icon to use different colors
#KT-27769 Fixed
2019-01-31 14:06:10 +01:00
Ilya Matveev
6b14271931 Declare K/N platform libraries as files instead of modules
Earlier the K/N platform libraries were looked for in a local ivy
repository created on basis of a K/N compiler distribution. Such
an approach allowed correctly showing such dependencies in
IDEA using the "group:name:version" format (e.g.
"Kotlin/Native:Accounts:ios_arm64:1.1.1"). But it caused looking
for there libraries in all other declared repositories too
making IDE import slower (see KT-28128).

This patch declares these dependencies as files and gets rid of
the local repo to avoid this problem. The downside of this change
is less informative output in the IDE:
"Kotlin/Native:Accounts:ios_arm64:1.1.1" -> "Accounts".

Issue #KT-28128 Fixed
2019-01-31 19:32:26 +07:00
Ilya Matveev
88d35cb798 Don't embed bitcode for ios simulator 2019-01-31 19:32:26 +07:00
Sergey Igushkin
c5ce32653d Fix POM not rewritten correctly with custom artifact IDs (KT-29485)
When the plugin rewrites a POM, it establishes the mapping of the
original Maven coordinates to the modified ones. As one of the steps,
this requires finding the original Maven coordinates to rewrite – these
should be exactly the coordinates that Gradle writes to the POM.

In MPP, these are the coordinates of the 'root' (Gradle module metadata)
publication. If those are modified in the publication, the plugin relies
on delegating to the publication in the root module's SotwareComponent
(the only reasonable fallback is the project's name, and in this case
it obviously doesn't match the Maven artifact ID that was modified).

In 1.3.20, the publication delegate was never assigned. To fix the
issue, it is enough to correctly assign the publication delegate for the
root module's SoftwareComponent.

Issue #KT-29485 Fixed
2019-01-31 15:18:15 +03:00
Sergey Igushkin
55cc5e84fc Fix publishing dependencies of Android libraries (KT-29476)
* Add the extendsFrom relation between the Kotlin MPP compilation's
  configurations (`*Api`, `*Implementation`, `*RuntimeOnly`) and
  the Android variant's `*Elements` configurations, as those
  dependencies currently are not added to the Android source sets and
  are thus missing from the published dependencies.

* Fix a `this is KotlinCompilationToRunnableFiles` check that
  mistakenly referenced the Project receiver of `whenEvaluated { ... }`

Issue #KT-29476 Fixed
2019-01-31 15:16:06 +03:00
Nikolay Krasko
64b2527e31 Revert allowing upper case letters in packages (KT-27900) 2019-01-31 13:40:37 +03:00
Nikolay Krasko
726e18333d Fix infinite recursion during indexing types (EA-86494) 2019-01-31 12:39:08 +03:00
Nikolay Krasko
d95189281d Regenerate AddImportTestGenerated 2019-01-31 12:39:08 +03:00
Dmitry Savvinov
4694a7963b Allow actuals with more permissive visibility
Allow non-virtual expects to have actuals with more permissive
visibility.

^KT-19664 Fixed
2019-01-31 12:29:27 +03:00
Dmitry Savvinov
0338753c11 Add test on actual with more permissive visibility
Currently the behaviour is undesired, see KT-19664. The next commit
fixes it.
2019-01-31 12:26:58 +03:00
Mikhael Bogdanov
a122cba862 Switch Kotlin project to jvm-target 1.8
#KT-29405
2019-01-31 07:43:05 +01:00
Georgy Bronnikov
3e9c290a3a Remove references to invisible fakes from IR backend 2019-01-31 07:55:39 +03:00
Georgy Bronnikov
ee43b5f1e9 IR. Do not generate invisible fakes 2019-01-31 07:55:39 +03:00
Leonid Startsev
8eeb9d4faa [kx.serialization] Fix serializer resolving for file-level annotations:
Instantiating ContextSerializer for primitives with boxing (fixes https://github.com/Kotlin/kotlinx.serialization/issues/349)
Unwrap nullable type when looking for general-defined serializer (fixes https://github.com/Kotlin/kotlinx.serialization/issues/351)

Add lost java collection types and fix annotation name (fixes https://github.com/Kotlin/kotlinx.serialization/issues/343)
2019-01-30 19:42:08 +03:00
Mikhail Zarechenskiy
738271aba6 Refactoring: rename CheckArguments -> CheckArgumentsInParenthesis 2019-01-30 14:56:33 +03:00
Mikhail Zarechenskiy
6705803d83 [NI] Fix coercion to Unit for lambdas with empty labeled return 2019-01-30 14:56:31 +03:00
Mikhail Zarechenskiy
147d7844bc [NI] Dont' add trivial constraints with Nothing from incorporation
#KT-24490 Fixed
 #KT-26816 Fixed
2019-01-30 13:48:33 +03:00
Mikhail Zarechenskiy
662e2287cc [NI] Discriminate resulting type Nothing(?) at fixation stage 2019-01-30 13:48:28 +03:00
Mikhail Zarechenskiy
0b0e335cdd [NI] Discriminate constraints with Nothing(?) lower bounds 2019-01-30 13:44:48 +03:00
Nicolay Mitropolsky
dcbd441814 Uast: aligning bunches after moving all convert* methods to KotlinConverter in 191 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
b45172a7f8 191: Uast: support convertToAlternatives for KtFile 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
4df72b4f79 191: Uast: refactoring: all convert* methods were moved to KotlinConverter 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
28e19ed8c7 191: Uast: AlternativesRenderLogTest introduced 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
8ad06314f0 191: Uast: support convertToAlternatives for KtClassOrObject 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
9e2358e8ff 191: Uast: support convertToAlternatives for KtParameter 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
f4c51dc6d0 191: Uast: support convertToAlternatives for KtProperty 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
114c3be632 191: Uast: KtParameter can be converted to field 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
529d0b8326 191: Uast: initial support for multiple required types 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
731956db71 191: Uast: UInjectionHost moved under flag kotlin.uast.force.uinjectionhost (KT-27283) 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
9ecd69760b 191: Revert KotlinStringTemplateUPolyadicExpression implement UInjectionHost testdata changes 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
56dfde0428 191: Uast: making KotlinStringTemplateUPolyadicExpression implement UInjectionHost (KT-27283) 2019-01-30 12:35:17 +03:00
victor.petukhov
6f04deff0e Remove old grammar files
The new grammar is located in the Kotlin spec repo: https://github.com/JetBrains/kotlin-spec/tree/spec-rework/src/grammar
2019-01-30 11:48:01 +03:00
kenji tomita
cbf6aa4ac3 Fix #KT-29567 "Remove empty class body" is a poor name for inspection text 2019-01-30 09:53:16 +03:00
Nikolay Krasko
52c46811ff Enable JPS test runner for new JPS build (KT-29368)
#KT-29368 Fixed
2019-01-30 01:13:23 +03:00
Svyatoslav Kuzmich
c9e2ed4e1f Undo unnecessary changes to stdlib
Partially revert "[stdlib] Reduce usage of extension functions"
2019-01-29 19:06:32 +03:00
Svyatoslav Kuzmich
0ef4194770 [JS IR BE] Support String companion object 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
24ab36616e [JS] Fix runtime file order in runIrTestInNode.js 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
b239c80531 [JS IR BE] Add a few kotlin.test stubs to IR runtime 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
b49ec3edb8 Disable generation of 1.2 coroutine tests for JS_IR
Add directive DONT_TARGET_EXACT_BACKEND.
This directive is needed to exclude JS_IR backned but keep "compatible"
JS backend.
2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
ab3eb06a62 [JS IR BE] Fix lowering Long comprising operators 2019-01-29 19:06:31 +03:00
Mikhail Zarechenskiy
5bcd974944 Temporary remove failing test for new inference about SAM conversions
Currently, it's easier to remove test completely rather than mute it
 somehow as it throws exception at compile-time

 #KT-29561 Open
2019-01-29 17:24:49 +03:00
Ilya Chernikov
f125600af1 Restore returning of functional types from repl eval
add tests for the broken case as well for the return value representation
#KT-29490 fixed
2019-01-29 15:05:37 +01:00
Mads Ager
52464fd103 JVM_IR: do not generate line number info for temporary loads.
Loads from compiler-introduces temporary variables to do not
correspond to loads in user code.
2019-01-29 14:25:17 +01:00
Anton Bannykh
b1f6a05aa0 JS: fix incremental suspend inline test (KT-29360 fixed) 2019-01-29 13:16:39 +03:00
Anton Bannykh
5c7072ec44 JS: add incremental suspend inline test 2019-01-29 13:16:39 +03:00
Nicolay Mitropolsky
aa88e579a6 Uast: checking that element is valid before running into resolve
probably will fix EA-134193
2019-01-29 11:05:27 +03:00
Dmitriy Dolovov
e59a5de314 CLion: New version 2018.3.3 (183.5153.40) 2019-01-29 09:23:50 +07:00
Alexey Tsvetkov
1103ca3a38 Fix logging in workers
Setting `forkMode` to `ForkMode.NEVER` switches
`isolationMode` to `IsolationMode.CLASSLOADER`.
Classloader isolation mode prevented passing task's
logger to the unit of work.
Also it might resulted in multiple daemon instances starting
in parallel.

This change removes setting `forMode` (it was unnecessary).
Also a logger is used for the fallback message instead of printing it
to stderr. An assertion is added to tests, ensuring that
the fallback does not happen.

    #KT-29394 Fixed
2019-01-28 21:33:22 +03:00
Mads Ager
bb0cd92da0 JVM_IR: Fix codegeneration for missing branches.
This used to generate an ACONST_NULL instruction leading to incorrect
stack height for code such as:

```
if (condition) else 32
```
2019-01-28 15:41:48 +01:00
Alexander Udalov
37a149b218 Allow to specify builtInsModule for DefaultBuiltIns
Similarly to JvmBuiltIns, this will be needed to load built-ins from
compilation dependencies rather than the compiler class loader
2019-01-28 15:18:53 +01:00
Alexander Udalov
f2bf0dc236 Drop unneeded synthetic package fragment construction from KotlinBuiltIns
Instead use package views of builtInsModule
2019-01-28 15:18:52 +01:00
Alexander Udalov
e19c6ce23c Use KotlinBuiltIns.getBuiltInsPackageScope instead of getBuiltInsPackageFragment
In general case, the module where built-ins are looked up
(builtInsModule) can have multiple package fragments corresponding to
the package "kotlin". Remove the misleading method
getBuiltInsPackageFragment along with its implementation details and use
the package view's scope instead (by changing
KotlinBuiltIns.getBuiltInsPackageScope), since it'll iterate over all
fragments accessible in the module and its dependencies.

The only difference between scopes of package fragment and package view
is that the latter also contains package views for subpackages, which is
why the change in BuiltInsReferenceResolverTest is necessary
2019-01-28 15:18:52 +01:00
Alexander Udalov
a419112c25 Refactor class lookup methods in KotlinBuiltIns
Remove external usages of get*Nullable methods, inline/remove other
methods to simplify the API facade
2019-01-28 15:18:52 +01:00
Alexander Udalov
aa8938cc1b Minor, cleanup KotlinBuiltIns
Remove unused code, fix inspections
2019-01-28 15:18:52 +01:00
Alexander Udalov
4a7bd9467c Remove obsolete BuiltInsInitializer
JvmBuiltIns do not use it for a long time already and work fine. It
seems that other implementations do not need it either
2019-01-28 15:18:52 +01:00
Alexander Udalov
6cd3d9f19a Do not use DefaultBuiltIns.Instance in ESConstant
Add ESComponents and ESConstants to encapsulate usages of built-ins in
different functors and operators
2019-01-28 15:18:52 +01:00
Alexander Udalov
9516d6e89b Do not use DefaultBuiltIns in contracts
Default built-ins represent built-ins loaded from the compiler jar via
class loader, and they may not be equivalent to the built-ins present in
the standard library that is used in compilation dependencies, in case
the compiler and stdlib versions do not match. Use built-ins from the
given module instead.

This commit deals with more-or-less obvious usages of DefaultBuiltIns;
next commits refactor the ESConstant values and related code to support
injected built-ins
2019-01-28 15:18:52 +01:00
Alexander Udalov
7561502956 Refactor AndFunctor/OrFunction: do not use strictPartition
Instead use a filter with a simple check. This seems to be slightly
better both for readability (`strictPartition` gave an impression that
two its parameters were related in some way, but they were totally
independent) and for performance (do not create unnecessary objects,
instead decompose the existing objects and check their structure)
2019-01-28 15:18:52 +01:00
Alexander Udalov
07931451b1 Add utilities to check if ESValue is boolean/wildcard constant 2019-01-28 15:18:51 +01:00
Alexander Udalov
cf19fa832c Add utility to check if effect is ESReturns
Somewhat simplify related code in AbstractBinaryFunctor and
AbstractUnaryFunctor
2019-01-28 15:18:51 +01:00
Vadim Brilyantov
de22c133c7 Fix redundant statistics extensions in plugin-common.xml 2019-01-28 17:17:46 +03:00
Mikhail Glukhikh
04bd5139d5 Don't suggest "return type is..." inspections for anonymous functions
#KT-29290 Fixed
2019-01-28 16:03:55 +03:00
Ilya Chernikov
4f9e844735 Improve standard libs search logic for script compilation:
- refactor appropriate functions to accept optional classloader (not used yet)
- try to load from thread context classloader first
- fallback to marker class classloader in the appropriate function
2019-01-28 13:15:36 +01:00
Ilya Chernikov
95d782b6ca Implement diagnostics for ignored compiler arguments on script compilation 2019-01-28 13:15:36 +01:00
Ilya Chernikov
7ee9801c5f Implement additional compiler arguments support in scripts 2019-01-28 13:15:36 +01:00
Ilya Chernikov
04b04ea0ee Refactor compiler arguments to configuration conversion:
extract into independent functions, rearrange logic
2019-01-28 13:15:36 +01:00
Ilya Chernikov
298aaf999e [minor] fix function name typo 2019-01-28 13:15:36 +01:00
Ilya Chernikov
d5d60cbc6b Convert CliCompiler class to Kotlin 2019-01-28 13:15:35 +01:00
Ilya Chernikov
025d2d1b66 Rename .java to .kt 2019-01-28 13:15:35 +01:00
Sergey Rostov
f5b7b5990f Build: fix PILL for JPS build. 2019-01-28 13:43:09 +03:00
Sergey Rostov
30cc70d4c3 JPS build: move idea configuration to separate script 2019-01-28 13:43:09 +03:00
Sergey Rostov
46d616641f JPS build workarounds for gradle import 2019-01-28 13:43:08 +03:00
Sergey Rostov
ca47247e5d Build: got rid of useBootstrapStdlib flag (replaced with jpsBuild flag) 2019-01-28 13:43:08 +03:00
Sergey Rostov
82e56f9cdd Build: fail on attempt to include anntations.jar from intellij 2019-01-28 13:43:08 +03:00
Sergey Rostov
f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Sergey Rostov
78630fec41 Build: add annotations-13.0.jar to compilerManifestClassPath
This is required since intellijCore/annotations.jar was removed from
koltin-compiler.jar
2019-01-28 13:43:08 +03:00
Sergey Rostov
0f2fb4ff82 Build: remove intellijCore/annotations.jar usages 2019-01-28 13:43:08 +03:00
Sergey Rostov
c716ef112e Got rid of @TestOnly usages on fields 2019-01-28 13:43:08 +03:00
Sergey Rostov
efa3201a68 JPS build: add dependencies to stdlib 2019-01-28 13:43:08 +03:00
Sergey Rostov
e8e2a5b047 Build: update pill comments in build scripts to distinguish from JPS 2019-01-28 13:43:07 +03:00
Sergey Rostov
2dad03f817 JPS Build: Temporary solution for creating IDEA artifacts settings
This script traverses all Gradle copy task, build virtual files model
and generates IDEA artifacts configuration based on this. Unfortunately
this is not fully working and needs manual fixing, so the actual artifacts
configurations are commited by hand for now. By the way, this script also
visits copy task's internals which leads that Gradle generates
manifests in `build` folders during IDEA import. This files are referenced
in artifacts configurations. So, despite the fact that artifacts
configurations created by this script is not used, we need to run them
to generate required manifests.

This solution will be replaced with DSL that produces both Gradle
copy tasks and IDEA artifacts configuration which is coming soon.
2019-01-28 13:43:07 +03:00
Sergey Rostov
d81f9dc24d JPS build: artifacts 2019-01-28 13:43:07 +03:00
Sergey Rostov
9fa8a80c6c JPS build: add JUnit run configuration and defaults
#KT-29335 Fixed
#KT-29211 Fixed
2019-01-28 13:43:07 +03:00
Sergey Rostov
f2fd28e84f JPS build: add idea settings to build.gradle.kts
#KT-29323 Fixed
2019-01-28 13:43:07 +03:00
Sergey Rostov
21ae6e272d Build utils: Kotlin DSL for idea-ext plugin 2019-01-28 13:43:07 +03:00
Sergey Rostov
12cfd6396d JPS build flag: exclude java9 when jps build enabled 2019-01-28 13:43:07 +03:00
Sergey Rostov
1031edc933 JPS build flag: exclude modules that we are currently cannot compile with jps 2019-01-28 13:43:07 +03:00
Nikolay Krasko
4b3ff05af4 Fix several problems with bunch file synchronize in plugin-common
Drop plugin-common bunches.
2019-01-28 13:30:29 +03:00
Vyacheslav Gerasimov
b78627f572 Build: Merge sources to single jar (idea can't handle multiple) 2019-01-28 01:27:53 +03:00
Svyatoslav Kuzmich
75328f26ea [JS IR BE] Add missing KJS_WITH_FULL_RUNTIME to some tests
+ ranges test generator
2019-01-27 01:14:51 +03:00
Mikhael Bogdanov
ac7517dd76 Minor. Reformat 2019-01-26 08:26:50 +01:00
Mikhael Bogdanov
f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Burak Eregar
91980c5293 KT-27869: Make Java to Kotlin dialog show yes/no button according to it's question
* Change `showOkCancelDialog` to `showYesNoDialog`
 #KT-27869 Fixed
2019-01-25 18:53:35 +03:00
Nicolay Mitropolsky
ef48373109 191: Update intellijSdk=191.4212.41 2019-01-25 18:34:49 +03:00
Mikhail Glukhikh
10b6ab949e Explanation for BaseTransformedType 2019-01-25 18:05:09 +03:00
Mikhail Glukhikh
dbdc57769b Explanation for VisitedSupertype 2019-01-25 18:05:09 +03:00
Simon Ogorodnik
dcd41bd26f FIR: Add test for total kotlin resolve #KT-24077 Fixed 2019-01-25 18:05:08 +03:00
Mikhail Glukhikh
619bddfdbc FIR: handle recursion in super-types correctly
Related to KT-24077
2019-01-25 18:05:08 +03:00
Alexander Udalov
a2f4efbc2a Report error on state in multi-file class with -Xmultifile-parts-inherit
Simplify MultifileClassPartCodegen, remove related tests and change some
tests to use const val instead of val because backing fields for const
properties are stored in the facade, not parts

 #KT-23701 Fixed
2019-01-25 15:57:13 +01:00
Alexander Udalov
6b5a16884c Refactor inheritMultifileParts to be a JVM analysis flag
Instead of a JVMConfigurationKeys key. This will allow to use it in a
checker in 'frontend.java'
2019-01-25 15:57:13 +01:00
Roman Artemev
f3758771c9 Update tests 2019-01-25 17:17:16 +03:00
Roman Artemev
fd9a72b627 [JS IR BE] Fix traits super calls 2019-01-25 17:17:16 +03:00
Dmitriy Novozhilov
af964d56c7 Fix testdata with new inference after fix in 65e6e21 2019-01-25 15:59:57 +03:00
Alexander Podkhalyuzin
4f4099796d Use 16px logo instead of 13px for run configurations 2019-01-25 14:33:13 +03:00
Alexander Podkhalyuzin
63cec94dbc Cleanup after review 2019-01-25 14:33:13 +03:00
Alexander Podkhalyuzin
4c674ae27a Updated icons to svg version. 2019-01-25 14:33:13 +03:00
Toshiaki Kameyama
fe006cf342 Boolean literal arguments: do not report in batch (offline) mode with INFORMATION severity
#KT-29494 Fixed
2019-01-25 14:25:38 +03:00
Max Medvedev
6f95030fe4 Don't perform potentially long operation in FindImplicitNothingAction#update
#KT-29457 fixed
2019-01-25 12:49:17 +03:00
Alexander Udalov
38fd2b9ed6 Fix reflection-related codegen tests on JDK 9+
In JDK 9, Class.simpleName changed behavior for local/anonymous Kotlin
classes (see KT-23072), this is why we now check for both variants of
the name in tests. Also, the format of annotation arguments changed a
little, where float parameters no longer have the trailing "f", and
class literals are rendered with ".class" at the end
2019-01-25 10:14:25 +01:00
Nicolay Mitropolsky
795f9d83e1 191: Uast: implementation of UReferenceExpression.referenceNameElement (KT-29025) 2019-01-25 11:13:43 +03:00
Nicolay Mitropolsky
a3ea7bcd3b Uast: property resolve arrayOf in nested annotations (KT-29434) 2019-01-25 11:10:59 +03:00
Toshiaki Kameyama
4ffeff5e6c Redundant lambda arrow: do not report on type parameter
#KT-28131 Fixed
2019-01-25 10:53:04 +03:00
Svyatoslav Kuzmich
8fbf1ed683 [JS IR BE] Unmute tests 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
2818d3767e [JS IR BE] Covert Char into inline class 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
a5f537adc5 [JS IR BE] Implement *Array.plus(Collection<>) in typed Kotlin without dynamic helper 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
8c89ffbe2d [JS IR BE] Load builtins from code to runtime
Bypass builtins deserialization mechanism in legacy JS backend and load
bultins direcly as kotlin code.

This way we won't have separated IR declarations for Enum, Char, Long

Some "native" builtins are implemented in libraries/stdlib/js/irRuntime/builtins/
Other builtins are moved by MoveExternalDeclarationsToSeparatePlace and
used only in compile-time
2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
7e263fd68e Allow primitive types to be vararg elements disregarding their inline class status 2019-01-24 18:58:51 +03:00
Nikolay Krasko
80f1efaddc Dispose range markers in UI thread to prevent race condition at getting range (KT-28870)
#KT-28870 Fixed
2019-01-24 17:05:56 +03:00
Nikolay Krasko
f19f38a4db Rework "lambda return expression" hint (KT-28870)
Move the hint to the end of the line, to avoid breaking indentation.

Also use `EditorLinePainter` API for painting to prevent problems with
typing at the line end, when caret is placed after the hint
(See IDEA-204702 for implementing such hints in platform).

 #KT-28870 Fixed
2019-01-24 17:05:55 +03:00
Nikolay Krasko
547357baa1 Don't check intentions without categories for description presence 2019-01-24 17:05:55 +03:00
Nikolay Krasko
a41dcd2af2 Fix NPE in coverage (EA-134461) 2019-01-24 17:05:55 +03:00
Svyatoslav Kuzmich
29eb3c745c [JS IR BE] Support two versions of test runtime: full and reduced 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
a40448aebc [JS IR BE] Use unsigned types lowering lazily 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
eea7e85d3a [stdlib] Reduce usage of extension functions 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Felix Guo
185d0c6165 Remove unnecessary constructor keyword intention (KT-29143)
#KT-29143 Fixed
2019-01-24 14:32:21 +03:00
Roman Artemev
c10eadfa77 Add 1.3.20 Changelog 2019-01-24 14:12:09 +03:00
Alexander Podkhalyuzin
5aa7216c13 Rewritten resolving conflicting imports on adding new import with star action (KT-18503)
#KT-18503 Fixed
2019-01-24 11:40:25 +03:00
Nikolay Krasko
ed5051a5e3 Fix exception in imports folding when there're two imports lists (KT-29455)
Probably caused by modifications of the recovery for import lists
65e6e21d0f

 #KT-29455 Fixed
2019-01-24 11:23:47 +03:00
Nikolay Krasko
92a50b2880 Minor: explicitly use FULL mode for resolve, tests are falling otherwise 2019-01-24 11:23:46 +03:00
Nikolay Krasko
a0b8980d77 Show lambda exist points when cursor is at the correspondent call (KT-29381)
#KT-29381 Fixed
2019-01-24 11:23:46 +03:00
Mikhail Glukhikh
5ec7643b5a Fix two QF tests (new add underscores action, KT-28953) 2019-01-24 11:00:59 +03:00
Toshiaki Kameyama
7cad0052d9 "Add parameter to constructor": fix for enum entry
#KT-28995 Fixed
#KT-29051 Fixed
#KT-29052 Fixed
2019-01-24 11:00:59 +03:00
Dmitriy Novozhilov
2c74796b0b Fix detecting upper bounds of generics of typealiases constructors in NI 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
21f0557502 Fix compatibility of CapturedTypeConstructor and NewCapturedTypeConstructor
Now both of those classes implements one interface with `TypeProjection`
  property. That allows old captured type approximator use new captured types.

That change fixes tests related to diagnostics:
- SETTER_PROJECTED_OUT
- DEBUG_INFO_UNRESOLVED_WITH_TARGET
- UNRESOLVED_REFERENCE_WRONG_RECEIVER

Also `typeProjection` property renamed to `projection` according to naming in NI.
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
42b333f6fd Update some testdata according to new inference behaviour 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
667f5032b6 Minor: reformat CapturedTypeConstructor.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
53432eaf99 Minor: reformat CapturedTypeApproximation.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
2da3366a47 Fix PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic in new inference 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
090c2998d2 Add running additional receiver checkers in new inference
That commit fix next diagnostics:

* RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS
* NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS (partially, see #KT-29367)
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
7f48897e21 Add NON_VARARG_SPREAD and SPREAD_OF_NULLABLE diagnostics to new inference 2019-01-24 10:53:58 +03:00
Toshiaki Kameyama
622fd8d8cf Add intention to add/remove underscores in numeric literal
#KT-28953 Fixed
2019-01-24 09:52:21 +03:00
Toshiaki Kameyama
225a6ea288 Convert parameter to receiver: don't remove 'override' and 'vararg' when function has 'vararg' parameter
#KT-28851 Fixed
2019-01-24 09:49:53 +03:00
Toshiaki Kameyama
de7adf55ff Non-canonical modifiers order: do not highlight annotation
#KT-29238 Fixed
2019-01-24 09:47:54 +03:00
Toshiaki Kameyama
0075e90042 Convert to lambda: report at INFORMATION level if anonymous object super type does not match function parameter type exactly
#KT-28081 Fixed
2019-01-24 09:42:16 +03:00
Toshiaki Kameyama
3649e61c2f Boolean literal arguments: do not report for varargs parameters
#KT-29469 Fixed
2019-01-24 09:40:21 +03:00
Alexey Tsvetkov
8672d2adc0 Remove call to await after kapt work is submitted
Await blocks parallel execution within a project.
Since there are no actions in the task after
`await()`, it is safe to delete the call.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
5a6df10522 Measure time spent on backing up and restoring outputs 2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
beabbb95db Enable assertions for Kotlin daemon in Gradle tests 2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
9176f9b254 Fix clearing IC caches on rebuild
Previously IC caches in Gradle were not cleared correctly on rebuild,
because only `clean` method was called, but `flush` and `close`
were not.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
7dcdba7e1a Restore outputs when Kotlin task fails
#KT-12295 Fixed

Gradle forces non-incremetnal builds,
when a task failed, but its outputs were changed.
This is an issue for Kotlin incremental compilation,
because it also forces all dependent modules to be rebuilt.
This change fixes the issue by reading all output and
restoring it on a compile error/exception.
This change does not affect non-incremental builds.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
467090bd9e Don't override task action in KaptGenerateStubsTask 2019-01-23 23:30:28 +03:00
Mikhail Glukhikh
f782f26c4f ClassClsStubBuilder: do not report errors for nested stubs
We log differently case with obfuscated library (KT-29427)
and regular case (KT-9618 and others)

#KT-29427 Fixed
#KT-9618 Fixed
2019-01-23 18:42:58 +03:00
Denis Zharkov
ae9cd4aa55 Require JVM_TARGET=1.8 in test that depends on the method from JDK8 2019-01-23 18:25:10 +03:00
Mads Ager
fb6eafddf1 JVM_IR: Generate better code for null checks.
Simplify ifs when branches have condition true/false.

Simplify blocks containing only a variable declaration
and a variable get of the same variable. Simplify to
just the condition.

Do not introduce temporary variables for constants for
null checks. Constants have no side-effects and can be
reloaded freely instead of going through a local.

This simplifies code such as "42.toLong()!!" so that the
resulting code has no branches and uses no locals. The
simplifications happen as follows:

```
block
  temp = 42.toLong()
  when
    (temp == null) throw NPE
    (true) load temp

---> null test simplification

block
  temp = 42.toLong()
  when
    (false) throw NPE
    (true) load temp

---> when simplification

block
  temp = 42.toLong()
  load temp

---> block simplification

42.toLong()
```
2019-01-23 15:11:14 +01:00
Vadim Brilyantov
d8309f3bd7 Remove statistics extension points for 182 and 191 bunches 2019-01-23 10:49:56 +03:00
Natalia Selezneva
85bd729715 Fix NPE starting IDE Repl Console
consoleView field is initialized in initAndRun inside invokeLaterIfNeeded call.
This may cause NPE in setupGutters if consoleView isn't initialized yet
^KT-29400 Fixed
2019-01-23 10:39:18 +03:00
Nikolay Krasko
0548454581 Minor: clean warnings in KotlinTypedHandler 2019-01-22 17:07:58 +03:00
Nikolay Krasko
5587af95de Auto-close {}` before identifiers in string only after typed '$' (KT-11143)
#KT-11143 Fixed
2019-01-22 17:07:58 +03:00
Yaroslav Ulanovych
30c2b26339 Do not insert closing brace for string template between open brace and identifier (KT-11143)
#KT-11143 Fixed
2019-01-22 17:07:57 +03:00
Nicolay Mitropolsky
44926df47e DelegatingProgressIndicator.setModalityProgress param made nullable in 191 2019-01-22 16:22:04 +03:00
Dmitry Petrov
ae8a90f7b4 KT-29144 Interface companion object field should always be ACC_PUBLIC 2019-01-22 15:05:51 +03:00
Dmitry Petrov
129ea49d64 Use effective modality for enum class in JVM_IR 2019-01-22 10:52:54 +03:00
Dmitry Petrov
360bfcaf6a KT-29340 Provide effective modality for enum class in IR
* if enum class has abstract members, then it is ABSTRACT
* otherwise, if enum class has entries with members, then it is OPEN
* otherwise, it is FINAL.
2019-01-22 10:52:54 +03:00
Denis Zharkov
efdb4e1d5d Fix assertion caused by wrong equality of DescriptorBasedFunctionHandleForJvm
In case of the same class defined in different modules they contain
different descriptors instances in their scope that might lead
to failing assertion in findConcreteSuperDeclaration
because there are overridden from different modules

It might happen even in the compiler because of different built-in modules
defined for sources-module and for dependencies' one

^KT-29320 Fixed
2019-01-22 09:48:42 +03:00
Vyacheslav Gerasimov
168d2d8cce Add more accept android sdk license hashes 2019-01-22 00:16:24 +03:00
Alexey Tsvetkov
12e481192a Don't use project root as working directory for Kotlin daemon
On windows using a project's root
as a working directory for the daemon
seems to prevent removing the directory
when the daemon runs.

Different projects may share an instance of the daemon,
so the issue will be present only in a project
which started the daemon.
2019-01-21 22:42:55 +03:00
Vyacheslav Gerasimov
f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Vyacheslav Gerasimov
9973446e02 Update bootstrap to 1.3.30-dev-991 2019-01-21 21:09:40 +03:00
Alexander Udalov
4daee6d282 Extract JVM IR backend module out of compiler/backend
The old backend does not depend on IR modules anymore
2019-01-21 19:06:41 +01:00
Yan Zhulanow
ad974137b8 Remove Android Extensions from the default JPS classpath 2019-01-21 18:50:11 +03:00
Vyacheslav Gerasimov
f30a14ff0f as34: Set until-build to 183.* to support AS 3.4 Beta 2 2019-01-21 18:05:52 +03:00
Vyacheslav Gerasimov
082217a2bd Build: Publish internal maven artifact for jvm-minimal-for-test
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
1ba80adc7f Build: Publish internal maven artifact for builtins
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
46d9d5456f Build: Change builtins artifact configuration to default 2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
0d8c779190 Build: Change builtins serialization task output directory to local 2019-01-21 17:01:43 +03:00
Mikhail Glukhikh
8201756a4c Use correct project for settings.gradle manipulations #KT-29333 Fixed
Otherwise we get an error "Element from alien project".
See details in added comment.
2019-01-21 14:30:44 +03:00
Mikhael Bogdanov
f10c9206e2 Minor. Fix test data 2019-01-21 12:12:34 +01:00
Mikhael Bogdanov
b763104ca0 Fix package name to fix android tests 2019-01-21 11:21:16 +01:00
Dmitry Petrov
202e992ae3 psi2ir: handle 'this' as reference to a super companion object
In super class constructor arguments, 'this' can be resolved
as a reference to a companion object of a superclass.
This breaks an assumption in psi2ir that 'this' can only refer to some
receiver from the current scope.

If 'this' refers to an 'object' (including 'companion obejct'),
and we are not inside the corresponding class scope,
then 'this' represents a reference to a singleton instance "by name"
(represented as IrGetObjectValue).
2019-01-21 10:56:02 +03:00
Nicolay Mitropolsky
9c8188002d 191: ProjectScopeStatsReporters.kt: adding KotlinMavenTargetTrigger and KotlinJPSTargetTrigger to the bunch 2019-01-19 12:06:42 +03:00
Mads Ager
690b8e0ac9 JVM_IR: Optimize null checks.
Introduce lowering to remove null checks for primitive type
expressions and replace them with true/false. Side-effects
are preserved.

Generate ifnull/ifnonnull instructions for null checks instead
of materializing a null literal for an equality check.
2019-01-19 09:43:43 +01:00
Vadim Brilyantov
f5312f42c5 Collect Maven and JPS targets 2019-01-19 02:37:09 +03:00
Vyacheslav Gerasimov
04b705ef2c 183: Set until-build to 183.*
We have separate plugin for 191 now
2019-01-18 22:52:57 +03:00
Vyacheslav Gerasimov
ff34078663 191: Temporary drop ProjectScopeStatsReporters (apis heavily refactored) 2019-01-18 21:52:45 +03:00
Ilya Chernikov
877dd7ee47 Change default jvmTarget for scripts compilation via jvmhost to 1.8
#KT-29319 fixed
2019-01-18 18:17:47 +01:00
Ilya Chernikov
a6c90f13c2 Implement test for #KT-29301, #KT-29296 and #KT-29293 2019-01-18 18:17:46 +01:00
Ilya Chernikov
5fffeda534 Keep ivy resolvers in the main-kts.jar
#KT-29301 fixed
2019-01-18 18:17:45 +01:00
Ilya Chernikov
2bb5e8f51f Implement and use helpers for economical classpath update in script configs 2019-01-18 18:17:45 +01:00
Ilya Chernikov
c7e5ad861c Allow explicit nulls for props with default, allow null as base classloader for evaluation
and use proper default evaluation configuration if not supplied explicitly;
also add reset method to the properties builder and containsKey method to
the properties collection
#KT-29296 fixed
2019-01-18 18:17:44 +01:00
Ilya Chernikov
086c4fd5b9 Add stdlib, etc. to the script dependencies on compilation
#KT-29293 fixed
2019-01-18 18:17:44 +01:00
Vyacheslav Gerasimov
cf5657e916 as34: Limit AS 3.4 until-build to be lesser than AS 3.5 2019-01-18 20:09:10 +03:00
Vyacheslav Gerasimov
b2db027ded Add constant for AS 3.5 to IdeCompatibilityDsl 2019-01-18 20:09:10 +03:00
Vyacheslav Gerasimov
7aee03a2b0 as35: Set since build to AS 3.5 C1 build number 2019-01-18 20:09:09 +03:00
Vyacheslav Gerasimov
9a4a4d0c14 as35: Add bunch files for AS 3.5 2019-01-18 20:09:09 +03:00
Nikolay Krasko
ad3114aa5f Allow generate closed start tags and do not reorder specific tags 2019-01-18 19:42:44 +03:00
Nikolay Krasko
3548d25095 Introduce wrapper for EditorFactoryListener to warn about compatibility issues 2019-01-18 19:42:43 +03:00
Nikolay Krasko
74bc440e44 Remove all that left from 173 branch 2019-01-18 19:42:43 +03:00
Nikolay Krasko
046a0e059c Always add last version of idea for which change is needed to BUNCH
BUNCH directive should contain last idea IDEA version this change is
meant for.
2019-01-18 19:42:43 +03:00
Alexander Podkhalyuzin
36b2640ab7 Removed usages to deprecated API, which is going to be removed in 2019.1 2019-01-18 17:17:30 +03:00
Natalia Selezneva
76b06cd747 Scratch: associate inlay with preceding text
This allow to avoid some unintentional movements of caret after inserting scratch output
2019-01-18 16:04:53 +03:00
Natalia Selezneva
290ae16235 Scratch: implement interactive mode
^KT-27955 Fixed
2019-01-18 16:04:53 +03:00
Max Medvedev
9b0b3971e4 Wrong position of type hint while renaming Kotlin variable
#KT-19558 fixed
2019-01-18 14:31:46 +03:00
Max Medvedev
a9362d844a Implemented "Complete statement" for completion
#KT-18663 fixed
2019-01-18 14:28:49 +03:00
Ilmir Usmanov
e8c52e0a8f Do not mark fake inliner variables as alive
This prevents them from spilling.
 #KT-29317 Fixed
2019-01-18 13:45:20 +03:00
Ilmir Usmanov
7e4e1b9a4d Add regression test
#KT-29327
2019-01-18 13:44:07 +03:00
Ilmir Usmanov
dc6bb4cd08 Revert "Simplify tail-call optimisation check"
This reverts commit a5bcd3495e.

 #KT-27190: Open
 #KT-29327: Fixed
2019-01-18 13:44:05 +03:00
Mikhael Bogdanov
8fb2633bf4 Minor. Patch test to avoid failing in Native 2019-01-18 09:52:56 +01:00
Anton Yalyshev
a4386cf28a Merge remote-tracking branch 'origin/master' 2019-01-18 11:14:17 +03:00
Andrey Uskov
2659011440 Fix compilation of GradleImportingTestCase in bunches 2019-01-18 00:45:20 +03:00
Georgy Bronnikov
c3352d5fdb Unmute several tests, mute one 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
7df0cffac9 Move declaration origins to IrDeclarationOrigin.kt 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
bccb451afd Add isSyntheic flag to IrDeclarationOrigin 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
ec0842c0f4 Remove descriptors from CallableReferenceLowering 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
67ab8624c3 Add DeepCopyIrTreeWithDescriptors 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
da0a823992 Remove descriptors from LocalDeclarationslowering 2019-01-17 23:46:26 +03:00
Vyacheslav Gerasimov
b525146009 Build: Switch to prebuilt protobuf-lite from teamcity repo
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
1efd859909 Exclude protobuf-relocated build directory in CodeConformanceTest
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
c7ab69829e Build: Convert protobuf to includable build with maven publication
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
6a3e5c4c94 Build: Move protobuf projects to subdirectory
#KT-29202
2019-01-17 20:45:11 +03:00
Ilya Gorbunov
0ac85ad715 Document that sorting is stable in each platform
#KT-12473 Fixed
2019-01-17 18:38:37 +03:00
Ilya Gorbunov
56672c2564 Ensure stable sorting in MutableList.sort/sortWith
MutableList.sortWith now works correctly in JS_IR backend too

#KT-12473
2019-01-17 18:38:23 +03:00
Andrey Uskov
7191624a92 Fix compilation of KotlinGradleProjectResolverExtension in bunches 2019-01-17 17:20:43 +03:00
Denis Zharkov
82537cdc8b Add recovery for missing comma between arguments
^KT-13497 Fixed
2019-01-17 14:58:01 +03:00
Denis Zharkov
37614254d7 Fix test on unused import suppression
Before the fix for KT-7185, the file looked like:
package suppression
@file:Suppress("UnusedImport")

import java.io.* // unused

And it was parsed incorrectly, because @file: annotations
should come before package directive
But after fix, import directives started being parsed that lead
to wrong unused import (because suppression wasn't parsed still)
2019-01-17 14:56:42 +03:00
Denis Zharkov
db53c4bea4 Add test for obsolete recovery case (semi-finished extension)
^KT-7405 Obsolete
2019-01-17 14:56:42 +03:00
Denis Zharkov
65e6e21d0f Add recovery for import lists in the middle of the file
Note, that it only works for top-level declarations

^KT-7185 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
e6710b6fa2 Add recovery for value parameter without type or name
The case for KT-7237 belongs to /NoGTInTypeArguments test
It was fixed implicitly: before it recovery was working but the name for
the next parameter was attached to type argument list.
After that change, parameter without name gets parsed correctly (with an
error of course)

^KT-13731 Fixed
^KT-7237 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
5437a0e478 Add recovery for enum declaration without 'class' keyword
^KT-13703 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
1688fed0b7 Minor. Rename PropertyParsingMode -> DeclarationParsingMode 2019-01-17 14:56:42 +03:00
Denis Zharkov
8b3ffee183 Minor. Rename defaultDetected -> companionDetected 2019-01-17 14:56:42 +03:00
Denis Zharkov
ee75b8c7e5 Minor. Extract KotlinParsing::parseCommonDeclaration 2019-01-17 14:56:42 +03:00
Dmitry Petrov
c1de845d29 Generate switch instruction for 'when' with unsigned subject 2019-01-17 13:49:39 +03:00
Dmitriy Dolovov
3c2d026128 CIDR: Always relax upper limit of product version in K/N plugin for non-public CIDR builds
Issue #KT-29338:fixed
2019-01-17 17:30:16 +07:00
Andrey Uskov
618a7c3747 Improve logging in gradle import tests 2019-01-17 13:20:58 +03:00
Andrey Uskov
5302470f6b Fix "testUnresolvedDependency"
This fix is work-around fixing incompatibility issue between gradle
tooling api bundled in IDEA and gradle tooling api in gradle 4.x.
When null messages were logged it resulted in the following error:
"java.io.StreamCorruptedException: invalid stream header: ED000573"
2019-01-17 13:20:28 +03:00
Dmitry Savvinov
e483f83666 Make 'is'-operator more stupid
Consider following expression: 'call() is Foo'. Suppose that we know
something about the 'call()', e.g. 'returns(foo) -> <condition>'

Previously, we've tried to re-use knowledge about 'call()', constructing
some smart clause, like 'returns(true) -> foo is Foo && <condition>'.

The conceptual error here is that *we can't* argue that <condition>
holds. Imagine that 'call()' actually has unspecified 'returns(foo2) ->
<!condition>', and 'foo2 is Foo' also holds. Then we would get
'returns(true) -> foo2 is Foo && <condition>' <=> 'returns(true) ->
<condition>' for the whole call, which is not correct.

More concrete example would be something like:
'if (!x.isNullOrEmpty() is Boolean)'

^KT-27241 Fixed
2019-01-17 12:47:27 +03:00
Dmitry Savvinov
04ff2a3ee7 Add test on isNullOrEmpty-like contract
Currently, behavior is undesired, see KT-27241
2019-01-17 12:47:27 +03:00
Anton Yalyshev
fe746bd505 drop 182 support, as context info works from 183 2019-01-17 12:43:20 +03:00
Anton Yalyshev
23b0f27f3b moved PluginVersion from collector instance to context for each trigger() 2019-01-17 12:43:18 +03:00
Anton Yalyshev
124ab5a896 added Kotlin plugin version Collector 2019-01-17 12:42:41 +03:00
Andrey Uskov
48d832298b Compile Kotlin project with "-Xjvm-default=compatibility" flag
#KT-29073 Fixed
2019-01-17 12:40:10 +03:00
Andrey Uskov
7da8c41f3f Remove build script bunches in idea/idea-maven 2019-01-17 12:40:09 +03:00
Andrey Uskov
99de00362e Fix NSME during reimport of maven project
#KT-29251 Fixed
2019-01-17 12:40:08 +03:00
Andrey Uskov
68347e89cf Remove build script bunch for 191. The -Xjvm-default flag should be set in the whole project 2019-01-17 12:39:11 +03:00
Anton Yalyshev
53f07536f9 Merge remote-tracking branch 'origin/master' 2019-01-17 11:12:32 +03:00
Mikhail Glukhikh
40b88d874e Fix broken test (KT-18715) 2019-01-17 10:41:31 +03:00
Anton Yalyshev
ebeff1e0d8 Merge remote-tracking branch 'origin/rr/ayalyshev/stat-refactorings-fixes' into rr/ayalyshev/stat-refactorings-fixes
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinFileProcessor.kt.173
2019-01-16 22:31:58 +03:00
Anton Yalyshev
30df986f93 removed unused collectors 2019-01-16 22:26:51 +03:00
Anton Yalyshev
e434733341 removed trigger() calls when refactoring is performed automatically or recursively 2019-01-16 22:26:50 +03:00
Anton Yalyshev
70d6020025 Removed second override as findReferences(element: PsiElement) is called anyway. It duplicates trigger(). 2019-01-16 22:26:50 +03:00
Ilmir Usmanov
2ec1222cd1 Fix test data 2019-01-16 20:40:33 +03:00
Ilmir Usmanov
76e9b574cd Put default value to vars iff they are not boxed
#KT-24672 Fixed
2019-01-16 20:40:29 +03:00
Svyatoslav Kuzmich
62322dec5c Regenerate and unmute tests 2019-01-16 16:37:52 +03:00
Mikhail Glukhikh
7908663687 Fix part of tests broken by a71bb709 (too many line breaks were added) 2019-01-16 16:07:41 +03:00
Alexey Tsvetkov
b6102c52b9 Fix kotlin-serialization plugins build scripts
1. There is no need to specify repositories.
2. We don't use 'org.jetbrains.kotlin:gradle-api:1.6' anymore.
3. kotlin-serialization-unshaded does not need dependencies,
because it does not contain source code (it simply packages jar).
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
3a91db836a Minor: remove workaround for KT-24915 from tests
The issue was fixed in AGP 3.2.0-beta02
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
c59c5361d1 Test KAPT with AGP 3.1.0 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
d1cd98cf8b Minor: remove repositories blocks from subprojects of databinding test
Repositories are set in top-level build.gradle file
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
a59be05792 Fix testDatabinding with AGP 3.0.x
AGP 3.0.x requires explicit 'kapt' dependency on databinding compiler.
Also databinding v2 (enabled by default in AGP 3.2.0) generates different
java classes.
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
3b806dca68 Drop support for gradle 4.0
#KT-29275 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
9de66c4165 Fix Gradle JS test with Gradle 4.0+ 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
4110eb3587 Fix AGP version checks in kapt android tests 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
6782d8c5c8 Use class instead of string to hold AGP version in tests 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
ca79efdeec Remove unused methods from Gradle plugin 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
e9abd69fc0 Drop support for Android Gradle plugin 2.x
#KT-27886 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
b51461b5c5 Drop support for Gradle 3.x
#KT-27885 Fixed
2019-01-16 15:57:32 +03:00
Svyatoslav Kuzmich
c92a6f9ca2 [JS IR BE] Unmute inlineClasses tests 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich
befc371f6a [JS IR BE] Fix bridges construction function handle 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich
912f0a267f [JS IR BE] Use return type in function signature for inline classes
Bridge function should be created when return type of override function
is specialised to unboxed inline class. Thus return type should be used in
function signature.

Non-inline-class return types are not added to signature for interop and
infrastructure reasons ("toString" would become "toString_ret$kotlin_String")
2019-01-16 12:11:27 +03:00
Svyatoslav Kuzmich
ebdbe7ec30 [JS IR BE] Fix fake override functions resolve
Use signature of function 'target' (a real function that will
be called instad of fake override) to make boxing/unboxing decision for
return value and type parameters on call site.
2019-01-16 12:11:27 +03:00
Dmitry Petrov
08abf5f2a2 Specialize unsigned range and progression iterator calls 2019-01-16 11:00:23 +03:00
Dmitry Petrov
723e739960 Minor: convert ProgressionIteratorBasicValue to Kotlin 2019-01-16 11:00:23 +03:00
Felix Guo
a71bb70901 KT-18715: don't swallow comments for if->elvis
Adds a CommentSaver to the IfThenToElvis intention that will save and
restore comments when converting an if expression to elvis expression.
2019-01-16 09:41:06 +03:00
Alexander Udalov
05c25342ad Make CommonToolArguments.nullable
#KT-28974 Fixed
2019-01-15 17:21:43 +01:00
Nicolay Mitropolsky
9559346199 191: Uast: implementation of UMethod.returnTypeReference (KT-29012) 2019-01-15 18:51:50 +03:00
Nicolay Mitropolsky
630b39d6b0 191: Uast: compiling with -Xjvm-default=compatibility 2019-01-15 18:51:49 +03:00
Nicolay Mitropolsky
f4d585f836 Uast: removing unused KotlinUComponentQualifiedReferenceExpression 2019-01-15 17:22:07 +03:00
Nicolay Mitropolsky
c139901889 Uast: all Kotlin versions of org.jetbrains.uast.test.* moved to org.jetbrains.uast.test.*.kotlin
To avoid having same class names in Kotlin and IDEA
2019-01-15 17:22:04 +03:00
Sergey Igushkin
3d208c31c8 Run Gradle integration tests against Gradle 5.1.1 2019-01-15 15:50:15 +03:00
Alexander Gorshenev
2775153c1a Got rid of an unecessary explicit cast. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
606c622e61 Removed unnecessary nullability marks. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
1e6240730b Added a TODO statement on special treatment of properties in deserializer. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
f10e826b52 Less eagerly fail on the boundary between deserializer and DeclarationStubGenerator. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
884e6e15e9 Added a comment for separate treatment of properties in IrDeserializer interface. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
32c2e841f2 Reversed DumpIrTree.kt fix for now, as it breaks tests comparing textual IR representation. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
1ba4770800 A little fix to allow Wrapped and non-Wrapped descriptors to coexist. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
cea32bd4e3 Minor changes in preparation for IR deserialization. 2019-01-15 14:54:27 +03:00
Mikhail Zarechenskiy
01ab4965b1 [NI] Support SAM conversions in backend for special expressions 2019-01-15 13:14:41 +03:00
Mikhail Zarechenskiy
bcc720f1db [NI] Run arguments checker before outer call checker
This is needed because arguments checker updates unsubstituted and
 non-denotable types (type variables, IntegerValueType...)

 #KT-28718 Fixed
2019-01-15 13:14:41 +03:00
Nikolay Krasko
55498450d1 Minor: extract function without manager parameter 2019-01-15 12:49:48 +03:00
Nikolay Krasko
4e9c8cee70 Drop bunch code by introduction wrapper for PopupChooserBuilder 2019-01-15 12:49:48 +03:00
Denis Zharkov
3707812fc2 Revert "Temporary remove some tests after a fix for KT-24937"
This reverts commit ddb4e8b128.
2019-01-15 12:35:12 +03:00
Ilya Matveev
ac1b4cf6b2 Allow setting test binary linker options using a test compilation
#KT-29254 Fixed
2019-01-15 12:07:55 +07:00
Vyacheslav Gerasimov
2157c777b3 Remove obsolete bunch fixes for 173 & as31 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov
b1f25874d8 Remove warnings from incompatible api inspection 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov
13d87e8eae Remove as31 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov
818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov
96c21297b6 Remove 173 and AS 3.1 from .bunch 2019-01-14 21:29:02 +03:00
Yan Zhulanow
e4087b5a7a Fix testJavacIsLoadedOnce() kapt integration test 2019-01-14 17:41:09 +03:00
Max Medvedev
99ffcda5fc Type hints: don't show hint for qualified constructor calls or enum cases
#KT-29196 fixed
2019-01-14 17:23:45 +03:00
Denis Zharkov
2a156fe90c Do not check target when generating bridges with default impl
In many other places, e.g. org.jetbrains.kotlin.codegen.ClassBodyCodegen#generateDelegatesToDefaultImpl
we implicitly assume that whenever we use a default interface method
our target is 1.8

But here, we don't and it might lead to exception in org.jetbrains.kotlin.backend.common.bridges.BridgesKt#findConcreteSuperDeclaration
when actual target is 1.6 and we extend some AbstractMap implementation
with JDK8 (i.e., with @PlatformDependent getOrDefault)
2019-01-14 14:54:18 +03:00
Denis Zharkov
5ec93f2718 Avoid assertion in bridges-generation for light classes
^KT-11656
2019-01-14 14:54:18 +03:00
Denis Zharkov
e0ff7281b4 Minor. Introduce FunctionHandle::mightBeIncorrectCode 2019-01-14 14:54:18 +03:00
Denis Zharkov
cd51658976 Replace JvmTarget with GenerationState in DescriptorBasedFunctionHandleForJvm 2019-01-14 14:54:18 +03:00
Denis Zharkov
254380d418 Generate special bridges for removeAt/getOrDefault
In case we extending some Map specialization with non-trivial type arguments,
e.g. Map<String, String> from Kotlin point-of-view it has
"remove(String, String)" signature while in Java it's "remove(Object, Object)".

So, we generate an override "remove(String, String)" in first Kotlin class of the hierarchy,
which body delegates to "super.remove(Object, Object)"

Also, we generate a final override for "remove(Object, Object)" to allow
for Java inheritors choose only the version with String while overriding.

The main idea of the fix is to make mayBeUsedAsSuperImplementation
return true in case of PlatformDependent annotations.
Otherwise, we weren't able to choose the impl from the java.util.Map
as a delegate in our bridge.

Another part of the fix is overriding `isDeclaration`:
it was necessary because otherwise bridge-generation algorithm
was assuming that there's already an actual declaration
in the first sub-class (TestMap) in the test and we need to
delegate to the latter instead of the method from the interface

^KT-26069 Fixed
2019-01-14 14:54:18 +03:00
Denis Zharkov
949214c10b Refactor bridges generation for JVM
Make a separate subclass for DescriptorBasedFunctionHandle
to allow customize the behavior without complex abstract concepts
like `areDeclarationAndDefinitionSame`
2019-01-14 14:54:18 +03:00
Denis Zharkov
5cc242e878 Refactor FunctionHandle::isInterfaceDeclaration
- Give it more clear name mayBeUsedAsSuperImplementation
  because defining if it can be used as super-implementation
  this is what it used for
- The meaning is negated, so it's needed to negate its usages and impls
- Also, reuse it in findSuperImplementationForStubDelegation
2019-01-14 14:54:18 +03:00
Denis Zharkov
9736975d52 Minor. Reformat builtinSpecialBridges.kt 2019-01-14 14:54:18 +03:00
Dmitry Petrov
9973d59643 Use java.lang.Long.divideUnsigned/remainderUnsigned in Java 1.8+
#KT-24876
2019-01-14 14:17:52 +03:00
Dmitry Petrov
a344feff5c Convert IntrinsicsMap to Kotlin 2019-01-14 14:17:52 +03:00
Dmitry Savvinov
a4d1a8f60a Get rid of FUNCTOR slice, use lazy value in ContractDecription instead
Functor is an imperative representation of function's contract (contrary
to ContractDescription, which is a declarative one). ContractDescription
is convenient when we deal with sources of contracts declarations
(binaries, source), while Functors are convenient for analyzing code
with contracts.

It means that we have to convert ContractDescription into Functor when
we start working with contracts. This computation isn't trivial, and
Functor and ContractDescription are in 1-1 correspondence, so we would
like to cache Functor for each ContractDescription somewhere.

We used to do this in binding trace, in slice FUNCTOR.

Now, it turns out that this approach causes "Rewrite at slice"
exception, see KT-28847. We won't go into details of why that happens
here, you can see the issue comments for details (but be prepared for the
very long and nitty-gritty story)

This commit removes the problematic slice and introduces another
approach, where Functor is attached to the ContractDescription, computed
lazily and cached here.

^KT-28847 Fixed
2019-01-14 11:11:03 +03:00
Dmitry Savvinov
594a6588f9 Add test on rewrite at slice FUNCTOR 2019-01-14 11:10:37 +03:00
Dmitry Savvinov
0b1ff1a457 Minor: improve rendering of Traces in debugger
- add toString for ObservableBindingTrace (for debugging)
- add toString for LockProtectedTrace (for debugging)
- extract anonymous AbstractFilteringTrace to EffectFilteringTrace
2019-01-14 11:10:37 +03:00
Dmitry Savvinov
69fff12384 Drop LockBasedStorageManager.defaultDebugName, use meaningful name everywhere
Also, drop `createDelegatingWithSameLock` as it was unused
2019-01-14 11:10:37 +03:00
Alexander Podkhalyuzin
893479bd5e Implemented KotlinResolveScopeEnlarger for modules
Before that we had dependency to iml file, which is incorrect
2019-01-14 10:53:41 +03:00
Ting-Yuan Huang
72e351a0e3 Allow specifying isolation mode for KAPT workers
There are a few isolation modes for Gradle workers. KAPT uses 2 of them.

IsolationMode.NONE is the default. It runs workers in Gradle daemon and
is more memory efficient.

IsolationMode.PROCESS forks workers into individual processes. This
keeps some resource leaking annotation processors from affecting the
rest of compilation.

Users can specify kapt.workers.isolation=process, if they need to use
some annotation processor that are known to be resource leaking.
2019-01-11 23:48:09 +03:00
Ilya Gorbunov
a26aa30714 Change implementations of contentEquals and minOf/maxOf for Native
To conform to the behavior in other platforms.
2019-01-11 21:49:19 +03:00
Ilya Gorbunov
a951805218 Refactor: introduce PrimitiveType.isFloatingPoint 2019-01-11 21:49:19 +03:00
Ilya Gorbunov
23950042f6 Clarify how elements of arrays are compared by contentEquals function
Add clarification only for the particular group of overloads including
 arrays of object and floating point numbers.

#KT-22942 Fixed
2019-01-11 21:04:03 +03:00
Ilya Gorbunov
ef278ea030 Improve Any.equals/hashCode docs
- add code formatting
- remove 'reference' adjective, as Kotlin doesn't distinguish primitives from reference types
- add the requirement of inequality to null
- replace inaccurate note with a link to the reference (relates to KT-26604)

#KT-14866
2019-01-11 21:03:19 +03:00
Ilya Gorbunov
51eb21d44b Provide stable sorting when JS engine sorting doesn't look stable
#KT-12473
2019-01-11 20:53:29 +03:00
Ilya Gorbunov
7c3c454654 Remove specialization of toTypedArray for LongArray and BooleanArray in JS
The default implementation for primitive arrays returns an array of correct type.

#KT-29187 Fixed
2019-01-11 20:53:29 +03:00
Sergey Igushkin
8bc7ac32f3 Fixes for review KOTLIN-CR-2599
* Move source artifacts to KotlinVariant classes (since joint Android
 variants may have multiple source artifacts, make it a set)

* Change lowerSpinalCaseName to dashSeparatedName (doesn't transform
 the strings to lower case inside)

* Don't transform the project name to lower case (in the future, it may
 be reasonable to stop transforming the target and component names, too)
 Still transform the target names and the component names.
 Currently, this is the way we don't break existing publications and may
 still reconsider this in the future.

* Add a workaround for a list of GString's assigned to
 publishLibraryVariants

* Check for Android library variants existence in a more strict way,
 report existing variants that are not library variants.
2019-01-11 20:32:38 +03:00
Sergey Igushkin
7e6527ca65 Properly setup localToProject attribute in jvmWithJava (KT-29035)
A dependency on a multiplatform module with a jvmWithJava target failed
to resolve because the 'apiElements' and 'runtimeElements'
configurations didn't have the attribute 'localToProject' set to
'public'.

Those configurations need to have have the attribute set as per the
fix of KT-28795, but it doesn't happen.

Issue #KT-29035 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
0abd044800 Expose 'allKotlinSourceSets' in KotlinCompilation (KT-28749)
As KotlinCompilation only contains the directly added source sets in its
`kotlinSourceSets` property, we need to provide a convenient way to
collect the whole source sets hierarchy for a compilation.

We added internal `allKotlinSourceSets` some time ago, and it seems
reasonable to expose it as public API.

Issue #KT-28749 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
0cf95f84cb Link the 'api' configuration to 'apiElements' (KT-28355)
As we introduced the 'api' configurations for Kotlin source sets, the
Java plugin did not link these configurations to its 'apiElements', and
those dependencies would only get published with the 'runtime' scope
through the 'implementation' configuration.

To fix this, manually specify that 'apiElements' extendsFrom 'api'.

Issue #KT-28355 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
82f13b90e6 Fix transitive dependencies overriding default Kotlin version (KT-28820)
In Gradle 5.0, the 'prefer' function semantics has changed, and now a
transitive dependency version wins over the 'preferred' one. Instead,
'require' has been introduced in 5.0 with the old semantics.

Our users expect that the default Kotlin dependency version will be
at least as new as the plugin version, so we now need to use 'require'
with Gradle 5.0+

Issue KT-28820 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
f9c45c30a2 Always rewrite dependencies in POMs when publishing an MPP (KT-28482)
As non-Gradle consumers and Gradle consumers with metadata disabled
cannot read Gradle metadata, in POMs (the only source of dependencies
for the consumers mentioned above), we should publish the dependencies
on modules with metadata as the target artifact IDs rather than the root
MPP module ID (e.g. 'foo-jvm' rather than 'foo').

To do that, we rewrite the POMs of the publications even when Gradle
metadata is enabled. Note: in the POMs, a project dependency is already
written in the form of the artifact ID of the root Kotlin software
component, so it complicates the dependencies rewriting a little.

To rewrite third-party dependencies, we detect dependencies that
resolved to no artifact and have a single child in the Gradle
dependencies graph of the resolved configuration – this is what a
dependency looks like which was redirected to another module via
'available-at'.

Issue #KT-28482 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
2fd524f1c0 Fix failure when creating a compilation in afterEvaluate (KT-28896)
To configure a compilation's sources, we run an action in
`whenEvaluated { ... }`, expecting that the compilation's task already
exists. This was not true with compilations created from a user build
script or a 3rd-party plugin in `afterEvaluate { ... }`.

Fix this by expecting that a task may possibly not exist at that point,
and also using `whenEvaluated { ... }` instead of
`afterEvaluate { ... }` in several places that are executed for each new
compilation as a workaround for
https://github.com/gradle/gradle/issues/1135.

Issue #KT-28896 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
de5e86ae9f Publish Android variants from multiplatform projects
Also update the code for rewriting the dependencies, as Android variants
have their dependencies configurations formed a bit differently, and
also introduce the logic for choosing the right component by the
configuration name the dependency resolves to.

Issue #KT-27535 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
9a2dce7ea5 Restructure source JARs logic, move it to components management
Move the logic of attaching a source JAR to a publication to the
components management part, as building a source JAR will be done
differently for Android.
2019-01-11 20:32:36 +03:00
Sergey Igushkin
d211bd53c9 Allow a target to have multiple publications, restructure the code
Instead of exposing a single `component` in a target, allow it to have a
set of `components`, then create a Maven publication for each of the
components.

Move `createUsageContexts` to private API since a target that has
multiple publications may need to create the usage contexts for those
publications differently.

Move some of the components technical stuff to interfaces
`DelegatedToPublication` and
`ComponentWithCoordinatesDelegatedToPublication` in order to reuse it
later for Android's components.
2019-01-11 20:32:36 +03:00
Sergey Igushkin
a6b55cc5d7 refactor: Support creating AndroidProjectHandler from outside the plugin 2019-01-11 20:32:36 +03:00
Roman Artemev
d35b20f764 [JS IR BE] Implement private members lowering to extract private methods from class and transform them into static function
* fix kotlin.Long
 * update tests
2019-01-11 20:28:04 +03:00
Roman Artemev
75996b1c8e [JS IR BE] Fix class generator 2019-01-11 20:28:04 +03:00
Roman Artemev
23fc950ae6 [JS IR BE] Fix suspend function lowering 2019-01-11 20:28:04 +03:00
Ilya Gorbunov
fcef876c7e Update copyright in generated stdlib sources 2019-01-11 19:23:12 +03:00
Andrey Uskov
da6de11c15 Disable GradleFacetImportTest for AS33 and AS34 2019-01-11 18:51:21 +03:00
Andrey Uskov
a9be8aac5a Create Kotlin SDK on load or import project with JS/Common modules
#KT-22590 Fixed
2019-01-11 18:48:24 +03:00
Andrey Uskov
a9df9b22e9 Fix scope detection for MPP projects
#KT-27718 Fixed
#KT-28626 Fixed
2019-01-11 18:47:20 +03:00
Ilya Gorbunov
de1d15aa9a Improve test coverage for contentEquals and minOf/maxOf 2019-01-11 17:41:52 +03:00
Pavel Punegov
dc8cb103c5 Replace class instantiation with object in JS tests 2019-01-11 17:38:58 +03:00
Pavel Punegov
1c4ecd287d DefaultAsserter object. Add function to replace constructor invoke. 2019-01-11 17:38:58 +03:00
Pavel Punegov
ac0f612781 Make kotlin.test asserter be ThreadLocal 2019-01-11 17:38:58 +03:00
Pavel Punegov
4b3693bf37 Exclude native annotations in JS IR tests 2019-01-11 17:38:58 +03:00
Pavel Punegov
122ec85bf0 Add ThreadLocal and SharedImmutable native annotations as OptionalExpectation
to kotlin.native.concurrent
2019-01-11 17:38:58 +03:00
Mikhael Bogdanov
2bdf68ad67 Delete dead code on last optimization step, otherwise ASM will split exception table on it.
ASM has logic that splits exception tables in MethodWriter.computeAllFrames:
     // Loop over all the basic blocks and visit the stack map frames that must be stored in the
     // StackMapTable attribute. Also replace unreachable code with NOP* ATHROW, and remove it from
     // exception handler ranges.
     ...
     firstHandler = Handler.removeRange(firstHandler, basicBlock, nextBasicBlock);
     ...
  https://gitlab.ow2.org/asm/asm/issues/317867

  #KT-28546 Fixed
2019-01-11 15:27:52 +01:00
Mikhael Bogdanov
306a982722 Temporary disable line numbers generation for default values from expect declarations
Proper SMAP support for default values from expect declarations is required.
 Default value in expect declaration could has line number that
 exceed line count in actual file that causes an error

  #KT-23739 Fixed
  #KT-29174 Open
2019-01-11 15:27:51 +01:00
Roman Artemev
c725f4ce32 [JS IR BE] Secondary constructors lowering refactoring
* make it per-file
2019-01-11 16:13:26 +03:00
Anton Yalyshev
e49c350550 removed unused collectors 2019-01-11 15:31:07 +03:00
Anton Yalyshev
4b5c5d77bc removed trigger() calls when refactoring is performed automatically or recursively 2019-01-11 15:31:07 +03:00
Anton Yalyshev
5672e0fb6e Removed second override as findReferences(element: PsiElement) is called anyway. It duplicates trigger(). 2019-01-11 15:31:07 +03:00
Mikhail Glukhikh
927b94a6e0 Regenerate FIR test 2019-01-11 15:14:14 +03:00
Mikhail Zarechenskiy
6361df28fe Fix dependency for Gradle integration tests module
After d5ebe2e6
2019-01-11 14:47:11 +03:00
Sergey Rostov
75e59fdc46 JPS: exclude source roots from other targets
Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed
2019-01-11 12:53:11 +03:00
Dmitry Savvinov
8a0057b387 Introduce specific version of NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY for KT-28061
In 1.3.0 there was introduced KT-28061 bug, which caused some of the
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostics to be lost (turning
"red" code into "green")

500dc11514 fixes the bug and returns
lost diagnostics back. This commit adds additional information for some
of the cases where diagnostics were list and then brought back (for the
user sanity).

The heuristic used for detecting cases which need additional information
is simple: if function has return in in-place called lambda, and
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY should be reported, then we
enhance it with additional information.

^KT-28061 Fixed
2019-01-11 11:44:39 +03:00
Mikhail Glukhikh
4fd773a38b IDEA plugin: remove "Show FIR action" and fir-view without fir.enabled
#KT-28813 Fixed
(it's planned to include FIR in artifacts after 1.3.30)
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
f0c9a3daa2 FIR: add default simple importing scope to support kotlin.ByteArray etc 2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
6e369e156d FIR: implements multi-module resolve, add tests #KT-24093 Fixed
This commit introduces FIR session provider, dependency provider,
library session + other infrastructure necessary for multi-module resolve
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
bc82f2f940 Use FirModuleBasedSession with module info, use platform default imports
In this commit, FIR sessions made bound to a particular module
2019-01-11 09:55:40 +03:00
Ilya Matveev
9ca07bc706 Fix linkTaskName getters of K/N compilations 2019-01-11 13:21:46 +07:00
Ilya Matveev
5eea0145b3 Support getting the default K/N test binary from a compilation
Fix for https://github.com/JetBrains/kotlin-native/issues/2487
2019-01-11 13:21:46 +07:00
Mikhail Zarechenskiy
d5ebe2e66a Reorganize dependencies around kotlin-compiler.jar
#KT-26807 Fixed
2019-01-11 00:14:23 +03:00
Ilya Gorbunov
30c769c19a Avoid hitting max argument limit in String(chars)
Rewrite CharArray to String conversions to appending chars one by one.

Refine parameter checking in String(chars, offset, length) to adhere to
the common exception contract and document it.

#KT-29003
2019-01-10 23:35:52 +03:00
Dmitry Petrov
b878626919 Intrinsify 'in' with unsigned ranges 2019-01-10 17:17:51 +03:00
Dmitry Petrov
e6e0e9976c Tests for for-in optimization with unsigned ranges 2019-01-10 17:17:51 +03:00
Dmitry Petrov
a2c618366b Tests for loops with possible index variable overflow 2019-01-10 17:17:51 +03:00
Dmitry Petrov
54cba32426 Support unsigned range and progression values in range intrinsics 2019-01-10 17:17:51 +03:00
Dmitry Petrov
68e2d8dcd9 Support unsigned integers in intrinsic range values 2019-01-10 17:17:51 +03:00
Dmitry Petrov
d22a31cb90 Use elementKotlinType in primitive number range intrinsics 2019-01-10 17:17:51 +03:00
Dmitry Petrov
5ae8df4d88 Use ComparisonGenerator for range element type in counter loops 2019-01-10 17:17:51 +03:00
Dmitry Petrov
4e48ce02f1 Minor: move RangeCodegenUtil to range package 2019-01-10 17:17:51 +03:00
Dmitry Petrov
fc94254320 Minor: refactor getRangeOrProgressionElementType + reformat 2019-01-10 17:17:51 +03:00
Dmitry Petrov
6414abb277 Minor: reformat & optimize imports 2019-01-10 17:17:51 +03:00
Igor Chevdar
e640f01b4e Fixed bug with IR parameter copying.
Constructors don't have their own type parameters
but rather inherit them from the parent.
2019-01-10 14:35:11 +03:00
Igor Chevdar
1bef26c80e [JS IR] Fixed bug with constructors type parameters 2019-01-10 14:35:11 +03:00
Igor Chevdar
5afa44edea Added a coroutine test 2019-01-10 14:35:11 +03:00
Igor Chevdar
1eaf2d2c42 Typo fix 2019-01-10 14:35:11 +03:00
Igor Chevdar
2c0f93b133 IR: Supported special coroutine intrinsic
See https://youtrack.jetbrains.com/issue/KT-26317 for details
2019-01-10 14:35:11 +03:00
Igor Chevdar
621a9bd1df Removed a Native specific lowering 2019-01-10 14:35:10 +03:00
Igor Chevdar
9fee03ca81 IR: Fixed some parents 2019-01-10 14:35:10 +03:00
Igor Chevdar
a78b80f8bf IR fixes to help symbolization of K/N 2019-01-10 14:35:10 +03:00
Roman Artemev
d363763420 Fix wrapped descriptors 2019-01-10 14:35:10 +03:00
Denis Zharkov
2b40ecfd29 Fix exception in ultra-light classes in case of complex mpp hierarchy
Without the introduced override, default implementation of isEquivalentTo
runs delegate computation of `another` that is illegal
for KtUltraLightClass

^KT-28912 Fixed
2019-01-10 14:11:20 +03:00
denisgaebler
be881442da One more fix for MinGW path in K/N runner 2019-01-10 17:29:34 +07:00
Ilya Chernikov
02f2c941c8 Add import support to main-kts, with test 2019-01-10 10:59:32 +01:00
Ilya Chernikov
4571e273a4 Add shared script instances support, fix and refactor evaluation accordingly
also fix arguments order in the evaluator
2019-01-10 10:59:32 +01:00
Ilya Chernikov
7bb4233e17 Add mapping function for transformations with ResultsWithDiagnostics
also improve chaining helpers
2019-01-10 10:59:32 +01:00
Ilya Chernikov
01f2a21192 [minor] add comment to the "Fix locking in script definition provider" commit 2019-01-10 10:59:32 +01:00
Ilya Chernikov
e5febddaf7 [minor] fix scripting test on windows 2019-01-10 10:59:32 +01:00
denisgaebler
1ca2e4fdba Update JavaSdkUtil.java
Added path for IBM JDK on platform z/OS
2019-01-10 12:46:05 +03:00
Anton Yalyshev
c809cfd800 Merge branch 'rr/ayalyshev/KT-29062' 2019-01-10 12:05:53 +03:00
Mikhail Glukhikh
7095182e2d FIR: support suspend functions #KT-24084 Fixed 2019-01-10 10:51:28 +03:00
Mikhail Glukhikh
7aba441234 FIR tree: support const expressions (adds IR dependency) #KT-24023 Fixed
Also support generic tree elements in FIR visitor generator
2019-01-10 10:51:08 +03:00
Mikhail Glukhikh
18ea86cfb4 Remove parentheses: add semicolon before lambda if necessary
In 2010b175, it was suggested just not to suggest parentheses removal.
However, it contradicts with behaviour of "Replace contains" which
adds semicolon before lambda in this case. So in this commit I made
behaviour of remove parentheses the same.

This commit reverts production part of 2010b175
Fixes failing test of "replace contains"
2019-01-10 10:45:46 +03:00
Sergey Rostov
62222460b6 JPS build, workarounds for idea importing: fix runtime classpath 2019-01-10 08:50:41 +03:00
Sergey Rostov
5cda676c9f JPS: Print components of CacheVersion, add tests 2019-01-10 08:50:39 +03:00
Sergey Rostov
b3985d2735 JPS: remove cache version from test data 2019-01-10 08:50:38 +03:00
Andrey Uskov
b6aed5b98a Change task creation with task registration in Kotlin plugin
#KT-27657 Fixed
2019-01-10 01:41:21 +03:00
Yan Zhulanow
7d660834e1 Fix 'CommandLineProcessor' extension point calling, switch it to using ServiceLoaderLite 2019-01-09 21:54:52 +03:00
Yan Zhulanow
34818b0bbe Remove JPS support for Android Extensions 2019-01-09 21:54:52 +03:00
Alexander Udalov
cca6ba38be Add tests for obsolete codegen issues
#KT-16790 Obsolete
 #KT-16858 Obsolete
 #KT-17441 Obsolete
2019-01-09 19:18:54 +01:00
Mikhael Bogdanov
0bb97cf590 Add test for Obsolete issue
#KT-12208 Obsolete
2019-01-09 16:00:03 +01:00
Ilya Matveev
dcaa56bc0b Fix MinGW path in Kotlin/Native runner 2019-01-09 20:43:29 +07:00
Anton Yalyshev
ef8bbafeff Checked null condition for JPanel createDestinationRootPanel() #KT-29062 Fixed 2019-01-09 13:04:23 +03:00
Anton Yalyshev
bec07ae7d9 createFileFromTemplate() call from ExtractSuperRefactoring doesn't affect statistics trigger anymore 2019-01-09 12:29:15 +03:00
Anton Yalyshev
a893a26585 Added statistics for Scratches to new_file_templates collector 2019-01-09 12:29:15 +03:00
Anton Yalyshev
6510c17804 Added statistics collector for new_file_templates and set trigger to createFileFromTemplate 2019-01-09 12:29:14 +03:00
Mikhael Bogdanov
f7ce8c18c6 Add tests for Obsolete issues
#KT-18977 Obsolete
2019-01-09 10:20:54 +01:00
Toshiaki Kameyama
f389c31d8e Replace with binary operator: don't highlight when receiver is dynamic type
#KT-28773 Fixed
2019-01-09 12:17:40 +03:00
Toshiaki Kameyama
2010b1756e Remove unnecessary parentheses: don't suggest when parentheses are for lambda 2019-01-09 12:16:01 +03:00
Toshiaki Kameyama
05d8932fa6 Remove useless cast: don't remove parentheses for lambda
#KT-28641 Fixed
2019-01-09 12:16:01 +03:00
Toshiaki Kameyama
d02867a831 Add "Wrap with array literal" quick fix for annotation parameters
#KT-28969 Fixed
2019-01-09 12:12:27 +03:00
Toshiaki Kameyama
53b0aa5813 "Wrap element with arrayOf() call": don't suggest for annotation parameters
#KT-28969 Fixed
2019-01-09 12:12:27 +03:00
Nicolay Mitropolsky
41b6bcf8c3 Converting object literal to class allows to choose a name (KT-19254) 2019-01-09 11:12:47 +03:00
Alexander Udalov
a9afee77d7 Add tests for obsolete codegen issues
#KT-8203 Obsolete
 #KT-15950 Obsolete
2019-01-08 20:43:46 +01:00
Mikhael Bogdanov
9a059809bf Add test for Obsolete issues
#KT-15956 Obsolete
 #KT-15751 Obsolete
 #KT-16417 Obsolete
 #KT-21787 Obsolete
2019-01-08 13:52:47 +01:00
Mikhael Bogdanov
6a19e45e27 Avoid ConcurrentModificationException
#KT-26384 Fixed
2019-01-08 13:52:46 +01:00
Mikhael Bogdanov
8ce7112123 New tests for TYPE_USE annotations in enums and inner classes
Main test data  (testName.txt) a not totally valid cause of IDEA-205039.
 Javac test data (testName.javac.txt) a not valid
 cause of type annotations support absence.
 Runtime tests are disabled cause reflection support absence.
2019-01-08 13:52:45 +01:00
Mads Ager
57489febf0 JVM IR: simplify chains of negations in if conditions.
Introduce lowering phase that turns !!exp -> exp for the boolean
'not' builtin. This makes sure that code such as

```
if (!!!!!booleanValue) {
    doStuff()
}
```

generates only one branch.
2019-01-08 12:09:23 +01:00
Mikhael Bogdanov
90c787e102 Minor. Reformat code 2019-01-07 15:49:27 +01:00
Mikhael Bogdanov
cfc21ffa56 Test for obsolete KT-16496
#KT-16496 Obsolete
2019-01-07 15:49:26 +01:00
Nikolay Krasko
c968a362f6 Fix test data after file rename 2019-01-06 01:08:25 +03:00
Toshiaki Kameyama
827e04ae3e Keyword completion: add "class/interface/object + filename" completion for top level (KT-28394)
#KT-28394 Fixed
2019-01-05 19:06:22 +03:00
Toshiaki Kameyama
ed9d53acaa Keyword completion: do not add braces after 'companion object' (KT-27915)
^KT-27915 Fixed
2019-01-05 19:00:25 +03:00
Toshiaki Kameyama
18ed031e7e Fix completion for back-ticked name (KT-19863, KT-19864)
^KT-19863 Fixed
^KT-19864 Fixed
2019-01-05 18:52:26 +03:00
Mads Ager
864b90f8c0 JVM_IR: Do not materialize negated boolean for branches.
Instead, flip the branch targets. This generates java byte code
such as:

   L2
    IFNE L3
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L4
   L3

instead of:

   L2
    IFNE L3
    ICONST_1
    GOTO L4
   L3
    ICONST_0
   L4
    IFEQ L5
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L6
   L5
2019-01-03 08:21:31 +01:00
Mikhael Bogdanov
02d9c526e2 Proper resort variables on inlining lowered ir closures
Original problem is that lowered ir closures doesn't meet inliner expectations
 about captured variable position in inlining method.
 E.g.: Call 'foo(valueParam) { capturedParam }' to
  inline function 'foo' with declaration

      inline fun foo(valueParam: Foo, inlineParamWithCaptured: Bar.() ->) ....

 is reorganized through inlining to equivalent call foo(valueParam, capturedParam1, cp2 ...).
 But lowered closure for lambda parameter has totally different parameters order:

     fun loweredLambda$x(extensionReceiver, captured1, cp2..., valueParam1, vp2...)

 So before inlining lowered closure should be transformed to

     fun loweredLambda$x(extensionReceiver, valueParam1, vp2..., captured1, cp2..)

 #KT-28547 Fixed
2019-01-03 07:57:36 +01:00
Mikhael Bogdanov
fcf8ea44b2 Update copyright in generated FIR related stuff 2019-01-03 07:45:16 +01:00
Mikhael Bogdanov
dfee1787e5 Regenerate builtins 2019-01-02 14:47:48 +01:00
Mikhael Bogdanov
e963c52c80 Update copyright in generated non-compiler tests 2019-01-02 13:34:03 +01:00
Mikhael Bogdanov
e0bcba5c0e Add test for obsolete KT-17431 issue
#KT-17431 Obsolete
2019-01-02 12:37:07 +01:00
Mikhael Bogdanov
cf47bc0130 Update copyright in generated compiler tests 2019-01-02 12:37:06 +01:00
Mikhael Bogdanov
6bf70a5dd2 Properly find invoke method on default lambda inlining
In general case parameter type could differ from actual default lambda type.
  E.g.: fun inlineFun(s: (Child) -> Base = { a: Base -> a as Child}),
  where type of default lambda is '(Base) -> Child'.
  In such case we should find somehow actual invoke method in bytecode knowing
  only name, number of parameters and that's actual invoke is non-synthetic
  regardless of bridge one.

  #KT-21946 Fixed
2019-01-02 12:37:06 +01:00
Toshiaki Kameyama
3040a2b145 Add quickfix for RETURN_TYPE_MISMATCH_ON_OVERRIDE
#KT-27972 Fixed
2018-12-29 10:41:14 +03:00
Vyacheslav Gerasimov
683ed4eb95 Build: Add asm-7 sources
#KT-29044 Fixed
2018-12-28 21:18:33 +03:00
Vyacheslav Gerasimov
ad85707a2d Build: move buildscripts & versions from root directory to ./gradle
javaInstrumentation.gradle.kts
report.gradle.kts
versions.gradle.kts
and all versions.properties
2018-12-28 21:18:33 +03:00
Nikita Katkov
4db9174b4d Error on calling suspend functions inside Lock.withLock body
See SuspensionPointInsideCriticalSectionChecker
2018-12-28 19:56:26 +03:00
Ilmir Usmanov
1d52fb2e26 Fix test data 2018-12-28 19:51:59 +03:00
Vyacheslav Gerasimov
343560c533 181: Fix QuickFixTestGenerated$TypeMismatch.testParamTypeLambdaMismatch 2018-12-28 19:01:39 +03:00
Nicolay Mitropolsky
19108d8821 InterpolatedStringInjectorProcessor in functional-style 2018-12-28 15:12:54 +03:00
Ilmir Usmanov
8a01da6ec6 Support val initialization in non-inline function with EXACTLY_ONCE effect
by generating a box for the value.
 #KT-26126 Fixed
2018-12-28 15:09:11 +03:00
Ilmir Usmanov
a52f430d8f Put default value (null or zero) to slot for uninitialized values
This way range of the variable is correct in LVT.
 #KT-24672 Fixed
2018-12-28 15:09:07 +03:00
Alexander Udalov
8ab9226805 Fix loading default Java annotation values in actual typealias from binary classes
#KT-22704 Fixed
2018-12-28 13:02:15 +01:00
Alexander Udalov
3fee84b966 Use fast .class file reading implementation in boxAgainstJava tests
Since these tests compile Kotlin code against compiled Java code, it's
only reasonable to use the same .class file reading implementation as is
used in production for the same purpose
2018-12-28 12:53:10 +01:00
Ilmir Usmanov
871134cff8 Update test data
#KT-28309
2018-12-28 14:18:39 +03:00
Ilmir Usmanov
666fec41b9 Do not spill fake variables
#KT-28309
2018-12-28 14:18:39 +03:00
Ilmir Usmanov
ab472793ed Add continuation parameter of suspend lambda's invoke to frame map
thus it will not overlap with $i$a and $i$f fake variables.
 #KT-28309
2018-12-28 14:18:38 +03:00
Ilmir Usmanov
a107b5d6b6 Set type of inliner's fake variable slots to int by storing 0
Otherwise, D8 drops the whole LVT.
 #KT-28309 Fixed
2018-12-28 14:18:37 +03:00
Nicolay Mitropolsky
55404ea00d 191: Making MockExternalAnnotationsManager not throwing exceptions in non action-required cases 2018-12-28 11:56:08 +03:00
Nicolay Mitropolsky
5d2002c742 Fixes to be compatible with IDEA 191 2018-12-28 11:54:30 +03:00
Simon Ogorodnik
cfb446df9e Move FIR tests to fir modules 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh
95af0268b8 FIR: add transformer consistency test 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh
cdc536b147 Add visitor consistency test 2018-12-27 21:32:21 +03:00
Mikhail Glukhikh
5716bda15d Raw FIR builder: add performance test to build FIR for all Kotlin
#KT-24086 Fixed
2018-12-27 21:32:21 +03:00
goodsauce
72be9ef738 #KT-27670 Add quick fix: wrap expression in a lambda if compatible functional type is required (#2010) 2018-12-27 20:12:10 +03:00
Mikhail Glukhikh
ed8d9be483 Fix EA-125880 2018-12-27 20:10:05 +03:00
Mikhail Glukhikh
8de2ff2163 Improve expect / actual markers on one line
Before this commit, only one-line enums and annotation classes were
considered. Now we can have enum header on one line and
some entries on another lines, and it still works.
Same with primary constructor parameters.

#KT-22637 Fixed
2018-12-27 19:45:28 +03:00
Mikhail Glukhikh
cdef811c55 Do not report "redundant arrow" with parameters without expected type
#KT-29049 Fixed
Part of KT-29005
2018-12-27 19:21:34 +03:00
Nicolay Mitropolsky
ebd6caaa71 Light-annotations: fix for reading class-literal varargs (KT-29027, IDEA-204252) 2018-12-27 16:04:05 +03:00
Alexander Udalov
bcb220b919 Minor, uncomment previously non-working code in test data 2018-12-27 13:12:38 +01:00
Dmitriy Dolovov
af4c2b8030 Fix: Rebuild common or native module with Delegate to gradle does nothing
Issues #KT-27295:fixed, #KT-27296:fixed
2018-12-27 18:24:43 +07:00
Nikolay Krasko
3b0cb2258a Notify about incompatible methods in ExtensionPointName 2018-12-26 21:10:03 +03:00
Nikolay Krasko
5a40fc8679 Add UI options for comments generation (KT-5590)
#KT-5590 Fixed
2018-12-26 21:10:03 +03:00
Nikolay Krasko
3eb4895acf Refactoring: rewrite without local any values 2018-12-26 21:09:28 +03:00
Nikolay Krasko
b232386d9d Fix losing suffix in multiline literals with interpolation (KT-29013)
Element was looped in internal loop, but this was missing in add suffix
check.
2018-12-26 21:09:28 +03:00
Vadim Brilyantov
6d8439e9fb add kotlinTarget field to non-mpp kotlin gradle model 2018-12-26 20:09:14 +03:00
Vadim Brilyantov
7e41384a60 add more precise target reporting with presets
fix report message to be more useful
2018-12-26 20:09:13 +03:00
Vadim Brilyantov
7e374e0f5a fix target statistics: report target_platform_id istead of target_name 2018-12-26 20:09:11 +03:00
Ilya Gorbunov
743d0f4917 Refactor kotlin-stdlib-gen
- Make targetsToGenerate Collection to accept set in addition to list
- Unify generated file name schema to '_<source name><platform suffix>.kt'
2018-12-26 19:53:11 +03:00
Ilya Gorbunov
5584b435dc Provide implementation templates for Native platform 2018-12-26 19:52:50 +03:00
Ilya Gorbunov
f05efd58de Support Native target platform in kotlin-stdlib-gen
- Allow to select target platform and target directory to generate source for
- Put copyright profile to resources to have it in the resulting jar
- Output error for missing bodies, but do not stop generation on the first error
2018-12-26 19:52:49 +03:00
kenji tomita
7b43d5c972 Add inspection for converting !collection.isEmpty() -> isNotEmpty()
#KT-27556 Fixed
2018-12-26 19:25:14 +03:00
Toshiaki Kameyama
538a746df9 Introduce "Function with = { ... }" inspection
#KT-17119 Fixed
2018-12-26 19:14:06 +03:00
Toshiaki Kameyama
301b3aad06 Condition of 'if' expression is constant: report enum entries comparison
#KT-28803 Fixed
2018-12-26 19:04:22 +03:00
Leonid Startsev
662c1b6d4a Make serialization plugin for Maven consistent with all other plugins:
Use correct import handler because old one was not working in IDE
Change maven artifact id to match pattern from other plugins
2018-12-26 18:53:53 +03:00
Mikhail Glukhikh
8420fceb8c Support '.toType()' and literal fixes related to unsigned type mismatch
#KT-26836 Fixed
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh
73b6148407 Do not suggest cast for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
Related to KT-27590
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh
d7ce79cc76 Suggest quick-fixes for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
#KT-27590 Fixed
2018-12-26 18:21:49 +03:00
Ilya Gorbunov
9289a2c573 Remove redundant clause from 'until' function docs 2018-12-26 17:54:56 +03:00
Natalia Selezneva
022b21efa0 Scratch: move 'Make module' checkbox closer to modules combobox
^KT-28910
2018-12-26 16:56:49 +03:00
Natalia Selezneva
404c3ea57b Set scratch file extension using API for IDEA 182 or higher 2018-12-26 16:56:49 +03:00
Natalia Selezneva
6eff314b9d Script tests: check that script is highlighted 2018-12-26 16:56:49 +03:00
Natalia Selezneva
d389c9fd85 Refactoring: move scratch options to ScratchFile from ScratchPanel 2018-12-26 16:56:49 +03:00
Natalia Selezneva
a408711f37 Scratch: do not show error message when scratch execution is cancelled by user 2018-12-26 16:56:49 +03:00
Natalia Selezneva
2fbbf2400d Refactoring: unify methods to report errors in scratches 2018-12-26 16:56:48 +03:00
Natalia Selezneva
2f32c6e164 Refactoring: move test output handler to separate class 2018-12-26 16:56:48 +03:00
Natalia Selezneva
392e69c690 Refactoring: add composite output handler to avoid multiple forEach calls 2018-12-26 16:56:48 +03:00
Natalia Selezneva
2511f70bd9 Scratch: implement stop action
^KT-28643 Fixed
2018-12-26 16:56:48 +03:00
Natalia Selezneva
d403514cee Scratch: get scratch panel from selected editor
CommonDataKeys.EDITOR key isn't present for some events (for example when user click on isRepl checkbox on scratch panel or there isn't any file open in the editor)
^KT-28045 Fixed
2018-12-26 16:56:47 +03:00
Natalia Selezneva
59a32ff94d Refactoring: use output handlers to make action enabled or disabled 2018-12-26 16:56:47 +03:00
Vyacheslav Gerasimov
38d836dece Build: Don't instrument NotNulls during form instrumentation 2018-12-26 16:39:24 +03:00
Vyacheslav Gerasimov
f40635c2d2 Reformat instrument.kt 2018-12-26 16:39:23 +03:00
Nikolay Krasko
571ee4a1fe Don't ruin indentation for comments inside expression declarations (KT-23295)
#KT-23295 Fixed
2018-12-26 15:39:40 +03:00
Nikolay Krasko
36a6c0881c Check file is valid before executing toPsiFile (EA-133882) 2018-12-26 15:39:40 +03:00
Nikolay Krasko
3e55b6e9f5 Consider qualified name is null if some part is null (EA-126499) 2018-12-26 15:39:39 +03:00
Andrey Uskov
62c5972eca Minor refactoring in MoveKotlinDeclarationsHandler during unique container calculation 2018-12-26 15:31:44 +03:00
Mikhail Glukhikh
c0c9841e62 Switch laziness OFF in script light classes tests
Laziness works no more in this tests after dummyContextProvider is removed
for script light classes (see fix of KT-25395).

However, now 2/2 script light classes tests still fail in IDE mode,
because after fix of KT-26505 IDE light classes do not see
ScriptTemplateWithArgs as super-class
2018-12-26 15:11:26 +03:00
Max Medvedev
2621c7fc9e Appcode/CLion: fix a couple of boolean property usages 2018-12-26 14:32:02 +03:00
Mikhail Glukhikh
a9147ff446 More tests for KT-28997, fix isLocal for anonymous object in script 2018-12-26 12:53:25 +03:00
Mikhail Glukhikh
661ac711c0 Fix light class generation for local classes in scripts
Before this commit, we used script context for all classes
defined in script. However, for local classes in scripts it's mistake,
and now we generate them as usual, despite of the fact we are in script.

#KT-28997 Fixed
2018-12-26 12:53:24 +03:00
Sergey Rostov
883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Sergey Rostov
423653d225 JPS build: workarounds for idea importing 2018-12-26 09:02:44 +03:00
Sergey Rostov
ea0cf659b0 AbstractMultiPlatformIntegrationTest: search stdlib-common in dist 2018-12-26 08:43:00 +03:00
Sergey Rostov
c6b4117fb9 ScriptGenTest: search classes in JPS from native IDEA gradle import output too 2018-12-26 08:43:00 +03:00
Sergey Rostov
8d8d6ece88 kotlin-ant: move resources to separate folder 2018-12-26 08:43:00 +03:00
Sergey Rostov
74271cfecd JPS: Use module name from compiler arguments (JVM) 2018-12-26 08:43:00 +03:00
Ilya Gorbunov
37e706ef12 Remove fixed default values of org.gradle.* properties
To allow overriding them with local host gradle.properties, for example to enable locally 'org.gradle.parallel=true'.
2018-12-26 05:17:08 +03:00
Ilya Gorbunov
7f8263ec4e Fix gradle default encoding to UTF-8
To avoid platform-dependent filtering charset in copy tasks.
2018-12-26 05:17:08 +03:00
Ilya Gorbunov
6a9ceb2af7 Add more convenient aggregate tasks for core libraries
Add 'coreLibs*' aggregate tasks for 'clean', 'assemble', 'install'
and 'dist' tasks of core libs projects.
Remove '-jre7/8' libs from the list of core libs.
2018-12-25 19:34:25 +03:00
Andrey Uskov
bc71a7605a Fix KNPE in introduce when expression (EA-118718) 2018-12-25 19:27:02 +03:00
Andrey Uskov
69613d25f0 Fix KNPE during enable unsupported feature (EA-129025) 2018-12-25 19:26:14 +03:00
Andrey Uskov
467d5a3cf0 Fix KNPE during move nested class to upper level (EA-128165) 2018-12-25 19:25:47 +03:00
Andrey Uskov
9ec8ec4f3d Fix KNPE during lookup items calculation (EA-130318) 2018-12-25 19:25:27 +03:00
Andrey Uskov
95caabf22f Fix KNPE in introduce new variable (EA-131176) 2018-12-25 19:25:06 +03:00
Andrey Uskov
710baf969f Fix KNPE during adding new parameter to constructor (EA-125789) 2018-12-25 19:24:37 +03:00
Andrey Uskov
d4e5620b9c Fix KNPE in FacetSettings (EA-132084) 2018-12-25 19:22:25 +03:00
Andrey Uskov
1ec63c16f8 Fix KNPE in Introduce new variable (EA-132675) 2018-12-25 19:22:08 +03:00
Andrey Uskov
7dcb9db8cb Fix KNPE during language level calculation (EA-132679) 2018-12-25 19:21:29 +03:00
Andrey Uskov
c24520e2bd Fix KNPE in build template (EA-133006) 2018-12-25 19:21:03 +03:00
victor.petukhov
04fa6e8ab4 Add tests for local variables with type parameters (KT-8341) 2018-12-25 17:51:05 +03:00
victor.petukhov
a72515d822 Add tests for constructors of annotation classes with JvmOverloads (KT-25702) 2018-12-25 17:50:55 +03:00
Simon Ogorodnik
ea24a3c602 KT-28898: Optimize type-alias extensions and type-alias expansions lookup
#KT-28898 Fixed
2018-12-25 16:49:47 +03:00
Natalia Selezneva
9dc57567e4 Kotlin code fragments in markdown should have script definition because they are parsed as scripts 2018-12-25 15:32:27 +03:00
Natalia Selezneva
4e6fb84bae Create one instance of StandardIdeScriptDefinition per project
ScriptModuleInfo for scripts outside source roots in compared by virtualFile and script definition.
So when we use ScriptDefinitionsManaged.getDefaultScriptDefinition we shouldn't create a new one on each call

EA-132810 - assert: DiagnoseUnknownModuleInfoReporter.report
2018-12-25 15:32:26 +03:00
Natalia Selezneva
ba2f211384 Remove ScriptModificationListener from 183 branch
Since 183 changes in .gradle.kts files are tracked correctly by platform and notification 'Gradle project needs to be imported' is shown when those files are modified
2018-12-25 15:32:26 +03:00
Natalia Selezneva
6042a3a0f7 Scripts: fix NPE during accessing ScriptDependenciesCache
Getting value from SLRUMap needs write lock, because it can move value from one queue to another
EA-105195 Fixed
2018-12-25 15:32:26 +03:00
Natalia Selezneva
8ceae8bd6d Fix 'Invalid file' exception during script dependencies update
Fix EA-125840 - assert: FileManagerImpl.findFile
2018-12-25 15:32:25 +03:00
Natalia Selezneva
816a8d74a2 Fix order of initialization of project language version in ConfigureKotlinTest
Project.getLanguageVersion with contextModule == null returns latest stable version.
But Module.getLanguageVersion save it's version to project setting if useProjectSettings checkbox is selected.
So Project.getLanguageVersion can return different versions before and after invocation Module.getLanguageVersion
2018-12-25 15:32:25 +03:00
Dmitriy Dolovov
073c02c0f5 CIDR: Ability to relax upper limit of product version in K/N plugin
Issue #KT-29006:fixed
2018-12-25 18:54:21 +07:00
Dmitry Petrov
61ebe6a9aa Minor: add non-intrinsified cases for javaObjectType/javaPrimitiveType 2018-12-25 13:23:48 +03:00
Toshiaki Kameyama
d00236d366 "Remove redundant backticks": Fix false positive for underscore
#KT-28592 Fixed
2018-12-25 10:37:18 +03:00
Mikhail Zarechenskiy
84222afe2f Fix exception when expected type is subtype of a function type
#KT-28984 Fixed
 #EA-132850 Fixed
2018-12-24 19:41:51 +03:00
Simon Ogorodnik
68c65a5014 KT-25156: Fix stack overflow on top level destructuring with lambda init
Support destructuring in additional resolve pass (resolveToElements)
 #KT-25156 Fixed
2018-12-24 18:29:48 +03:00
Simon Ogorodnik
fefd2bf427 KT-23268: Highlight destructuring declaration entries as properties
#KT-23268 Fixed
2018-12-24 18:29:47 +03:00
Dmitry Petrov
a4897641d4 Minor: mute some tests in JS/JS_IR 2018-12-24 16:10:35 +03:00
Dmitry Petrov
6768ae02c3 Support inline classes in javaObjectType/javaPrimitiveType
#KT-28290 Fixed Target versions 1.3.30
2018-12-24 16:10:31 +03:00
Dmitry Petrov
5abbf3562b Unbox possibly null inline class value mapped to primitive type 2018-12-24 16:09:48 +03:00
Dmitry Petrov
2f6c4a0472 Use original method signature to call accessor for hidden constructor
#KT-28855 Fixed Target versions 1.3.30
2018-12-24 16:09:44 +03:00
Ilmir Usmanov
10f0a2f660 Obtain correct captured suspend local function
if we call the function inside, for example, lambda.
 #KT-28844 Fixed
2018-12-24 15:58:10 +03:00
Mikhael Bogdanov
ac5f5bd453 Get rid of jvm specific code in some tests 2018-12-24 13:40:40 +01:00
Mikhail Glukhikh
7d51be17c8 Extract 'PsiElement.hasJavaResolutionFacade()' (related to KT-28199) 2018-12-24 15:00:57 +03:00
Mikhail Glukhikh
d599bb160f Launch constructor delegation search only for elements from a file
This should fix EA-133791
2018-12-24 14:58:25 +03:00
Mikhail Glukhikh
399ec5c961 Launch convention method reference search only for elements from a file
#KT-28199 Fixed
2018-12-24 14:57:53 +03:00
Mikhail Zarechenskiy
e4a4d1169e Prohibit JvmOverloads on constructors of annotation classes
In LV >= 1.4 & -progressive

 #KT-25702 Fixed
2018-12-24 12:48:00 +03:00
Mikhail Zarechenskiy
958aeff94b Prohibit type parameters for local variables in LV >= 1.4 & -progressive
#KT-8341 Fixed
2018-12-24 12:47:58 +03:00
Mikhail Zarechenskiy
e509649132 Fix mapping of platform inline class types
For the inline class:
 ```
 inline class IC(val x: Int)
 ```

 Type (IC..IC?) should be mapped to the wrapper `IC`
 because it can hold object and also because it does so for primitives

 #KT-28983 Fixed
2018-12-24 12:32:22 +03:00
Dmitriy Dolovov
7c9ca99388 CLion: New version 2018.3.2 (183.4886.39) 2018-12-24 11:35:10 +07:00
Max Medvedev
ef49e792b0 AppCode/CLion: patch java plugin xmls in AppCode as well 2018-12-21 23:43:17 +03:00
Bernhard Posselt
19906f13ea Update Maps.kt 2018-12-21 22:01:01 +03:00
Bernhard Posselt
300f68e0d8 Add documentation on how merging works for toMap() for Iterables, Arrays and Sequences 2018-12-21 22:01:01 +03:00
Mads Ager
48bd99730d Suppress final failure which relies on line numbers. 2018-12-21 16:20:45 +01:00
Mads Ager
3a11322506 Enable bytecode text tests for the JVM_IR backend. 2018-12-21 16:20:45 +01:00
Mikhael Bogdanov
d1efac617d Get rid of reduntant jvm parts in tests 2018-12-21 16:09:12 +01:00
Mikhael Bogdanov
f59b6a350f Specify JVM target backend for other java related tests 2018-12-21 16:09:11 +01:00
Mikhael Bogdanov
d76cb32781 Specify JVM target backend for test with java type inheritance 2018-12-21 16:09:11 +01:00
Mikhael Bogdanov
3c048d7f57 Specify JVM target backend for test with casts to jvm types 2018-12-21 16:09:10 +01:00
Mikhael Bogdanov
3e6f8db975 Specify JVM target backend for test with 'import kotlin.reflect.jvm' 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov
a75d57a20b Remove redundant jvm reflection import 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov
a2904b8e53 Regenerate test data 2018-12-21 16:09:08 +01:00
Mikhael Bogdanov
f4e532e449 Specify JVM target backend for test with '@JvmXXX' annotations 2018-12-21 16:09:07 +01:00
Mikhael Bogdanov
a8a1bfca72 Specify JVM target backend for test with '// File: *.java' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov
3ef06c1e44 Specify JVM target backend for test with 'import java...' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov
f36519d4f5 Specify JVM target backend for test with '.javaClass' usage 2018-12-21 16:09:05 +01:00
Mikhael Bogdanov
1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Mikhael Bogdanov
a2e4553040 Minor. Remove obsolete supressions 2018-12-21 16:09:04 +01:00
Ilya Chernikov
c4b3580c31 Implement script filename extensions discovery via artifact transforms
to avoid using never-up-to-date task and make discovery cacheable and
checkable for up-to-dateness
#KT-28469 fixed
2018-12-21 15:44:48 +01:00
Ilya Chernikov
a3217982f7 Fix script filename extension discovery from asm-readed class
and improve diagnostics on definition loading failure
2018-12-21 15:44:28 +01:00
Ilya Gorbunov
7c7c11e916 Fix current Kotlin version to avoid changing it in local builds 2018-12-21 17:21:50 +03:00
Shagen Ogandzhanian
6dd69ea3d6 Support named constructors in idl-backed code generation
this resolves https://youtrack.jetbrains.com/issue/KT-27361
2018-12-21 14:53:59 +01:00
Ilya Gorbunov
68f898153c Fix link to sealed classes doc page
#KT-28829 Fixed
2018-12-21 16:25:43 +03:00
Marcin Moskala
686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Marcin Moskala
33961acb8d Fix typos in spec-docs 2018-12-21 16:06:51 +03:00
Nikolay Krasko
5d08df1bf7 Remove ignore roots added by IdeaOpenApiClassFinder
Fixed in newer IDEA build.
2018-12-21 16:06:51 +03:00
Nikolay Krasko
9dd40cb904 Extract contributing guide for better GitHub integration 2018-12-21 16:06:51 +03:00
Nikolay Krasko
58b7277ea8 Update to 183.4886.37 2018-12-21 16:06:51 +03:00
Nikolay Krasko
f03a3945c5 Rethrow IndexNotReady exceptions without modifications 2018-12-21 16:06:50 +03:00
Ilya Gorbunov
614139755c Minor: fix Random companion reference in docs
Random's companion is named 'Default' rather than 'Companion'
2018-12-21 14:17:25 +03:00
Ilya Chernikov
71729f8e8f [minor] use psi original file if virtual file is not available...
for script dependencies, fixes completion tests
2018-12-20 17:09:24 +01:00
Ilya Chernikov
44ea2bf1d4 Introduce script names and location ids, use them in diagnostics and...
for virtual file names. Also fix compiled script serialization.
2018-12-20 17:09:23 +01:00
Ilya Chernikov
77095cb895 [minor] add missing dependency 2018-12-20 17:09:22 +01:00
Ilya Chernikov
e4f245d15a Implement script dependencies collection tests 2018-12-20 17:09:22 +01:00
Ilya Chernikov
48965fb64a [minor] refactor scripting tests: extract cli testdata into separate dir, remove annotation 2018-12-20 17:09:21 +01:00
Ilya Chernikov
c165666d94 Refactor core env: extract script compilation dependencies collection 2018-12-20 17:09:20 +01:00
Ilya Chernikov
8529ed314c [minor] fix compilation - avoid proguarding of addToStdLib.kt 2018-12-20 17:09:20 +01:00
Ilya Chernikov
1e74ab5a62 Implement import test, fix import support in compiler and evaluator 2018-12-20 17:09:19 +01:00
Ilya Chernikov
fce68102bd Implement imported scripts evaluation and construction 2018-12-20 17:09:18 +01:00
Ilya Chernikov
19a969a521 Implement script import support in the compiler 2018-12-20 17:09:17 +01:00
Ilya Chernikov
729ebcac9b Implement simple "add to compilation" functionality for scripts
(incomplete import - scripts added to the compilation but not yet
imported into scope)
Base functionality needed for #KT-27960
2018-12-20 17:09:16 +01:00
Dmitry Petrov
57c12476d7 Provide parent reference for temporary variables immediately 2018-12-20 15:57:31 +03:00
Mikhael Bogdanov
4e53e7d663 Inline OPTIMIZATION_ASM_API_VERSION constant 2018-12-20 12:55:12 +01:00
Mikhael Bogdanov
026ac1bee6 Inline API constant 2018-12-20 12:55:11 +01:00
Mikhael Bogdanov
f900d598c7 Inline ABI_EXTENSION_ASM_API_VERSION 2018-12-20 12:55:10 +01:00
Mikhael Bogdanov
87d99907f6 Remove redundant proguard option
Removed option is covered by
 -keep class org.jetbrains.org.objectweb.asm.Opcodes { *; }
2018-12-20 12:55:09 +01:00
Mikhael Bogdanov
c19c979b7d Use last asm api for visitor construction 2018-12-20 12:55:09 +01:00
Mikhael Bogdanov
c2837cf7d9 Switch buildSrc to ASM7 Jetbrains ASM 2018-12-20 12:55:08 +01:00
Mikhael Bogdanov
2072d7806f Switch kotlinp to ASM7 Jetbrains ASM 2018-12-20 12:55:07 +01:00
Alexander Udalov
f5ff3d2fa9 Remove directives that have no effect from bytecode text tests
All bytecode text tests are run with stdlib in the classpath and only
for JVM backend, therefore directives WITH_RUNTIME, TARGET_BACKEND,
IGNORE_BACKEND are not needed
2018-12-20 12:53:24 +01:00
Alexander Udalov
00caa23307 Do not support LANGUAGE_VERSION directive in codegen tests
Test data of crossinline_1_2.txt has changed because now we do not
automatically enable 1.2 (with _all_ of its features) when we're
executing a common coroutines test with old coroutines; and so the
NewCapturedReceiverFieldNamingConvention language feature (which is
introduced in 1.3) is now enabled in this test
2018-12-20 12:53:24 +01:00
Alexander Udalov
77c87fa6c9 Remove API_VERSION 1.3 from compiler tests
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov
37e1b486f4 Minor, remove obsolete API_VERSION directives 2018-12-20 12:53:23 +01:00
Alexander Udalov
d58cf4a83a Minor, fix language versions in two diagnostic tests on coroutines 2018-12-20 12:53:23 +01:00
Alexander Udalov
a0a70dd60d Remove LANGUAGE_VERSION from compileKotlinAgainstKotlin tests
Support test directives not at the beginning of the test file for
multi-file tests where separate files need separate language features
2018-12-20 12:53:23 +01:00
Alexander Udalov
ec2dd58165 Remove LANGUAGE_VERSION from codegen tests on coroutines
Use `// !LANGUAGE: -ReleaseCoroutines` instead in tests which require
old (1.2) coroutines, and nothing in tests which require new coroutines
because master is already 1.3. Also remove superfluous API_VERSION and
other directives which have no effect anymore. Do not include runtime
automatically with `WITH_COROUTINES`/`COMMON_COROUTINES_TEST` in box
tests; require `WITH_RUNTIME` for that (majority of tests already had it
anyway), but remove it from bytecode text tests where runtime is always
added automatically. Fix the coroutine package selection code in
KotlinTestUtils and update the bunch files correspondingly.

Disable tests in `box/coroutines/noStdLib` on JVM: despite the name,
these tests were launched with stdlib because of the code in
CodegenTestCase, and they do not work without it because at least
CoroutineUtil.kt requires stdlib to compile correctly
2018-12-20 12:53:23 +01:00
Alexander Udalov
5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Alexander Udalov
e3c381a298 Remove API_VERSION 1.3 from tests on JvmDefault
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov
9b6a52ccba Remove LANGUAGE_VERSION from boxInline tests 2018-12-20 12:53:22 +01:00
Alexander Udalov
0871a3cc4d Use API_VERSION instead of LANGUAGE_VERSION in IEEE754 tests
See `ExpressionCodegen.genEqualsForExpressionsPreferIeee754Arithmetic`:
the behavior here actually depends on the API version, not any language
feature
2018-12-20 12:53:22 +01:00
Alexander Udalov
83528a75be Minor, fix typo in IEEE754 bytecode text tests
The runtime function in kotlin.jvm.internal.Intrinsics is called
"areEqual", not "areEquals"
2018-12-20 12:53:22 +01:00
Andrey Uskov
250eee48a1 Fix reimport of Kotlin projects created via wizard
#KT-27941 Fixed
2018-12-20 13:56:41 +03:00
Ilya Matveev
e520c98182 Fix K/N test for windows: rename target usage 2018-12-20 10:24:48 +03:00
Vyacheslav Gerasimov
95a3b337c6 Build: add instrumentation to all JavaCompile tasks 2018-12-19 20:59:34 +03:00
Vyacheslav Gerasimov
9ad899fb01 Fix splitExportedSuspendInlineFunctionDeclarations usages, argument must not be null 2018-12-19 20:43:15 +03:00
Mikhail Glukhikh
93882736ed OverrideMemberChooserObject refactoring: introduce MemberGenerateMode 2018-12-19 19:56:16 +03:00
Mikhail Glukhikh
ca3d758fba Create expect/actual class: fix inline class generation
#KT-28744 Fixed
#KT-28745 Fixed
2018-12-19 19:55:56 +03:00
Mikhail Glukhikh
d3a5b0dcd6 MPP JVM/JS wizard: fix classpath of 'run' task #KT-28869 Fixed 2018-12-19 19:55:40 +03:00
Mikhail Glukhikh
55666f3f03 MPP wizard tests: use 1.3.20-eap-25 2018-12-19 19:55:27 +03:00
Dmitry Petrov
e5d946a96c Parent for thisReceiver of IrLazyClass is the corresponding class
Fixes issue in Kotlin/Native.
2018-12-19 15:48:07 +03:00
Ilya Matveev
c5783c5abd Fix native binary tests for Windows 2018-12-19 19:20:04 +07:00
Toshiaki Kameyama
c248fa71c8 Add ConvertToAlsoIntention to plugin-common.xml 2018-12-19 15:10:34 +03:00
Dmitry Petrov
85f55dec9a Support SAM conversion in psi2ir
SAM conversion takes a function value (function type or a subtype),
and produces a SAM interface value.
2018-12-19 10:58:34 +03:00
Dmitriy Dolovov
2c327564d5 CIDR: Better detection when running in CIDR-based IDE
- Drop unnecessary bunch files for `KotlinFacetType` and `KotlinFacetTypeImpl`
- Use cached val `isRunningInCidrIde` to check if the code is running under CIDR
2018-12-19 11:20:54 +07:00
Vyacheslav Gerasimov
38efc7e823 Remove useless bunch for KaptWithKotlincTask 2018-12-18 21:58:32 +03:00
Alexander Udalov
c1ef89df2c Make anonymous classes for callable references synthetic
#KT-28453 Fixed
2018-12-18 17:48:19 +01:00
Shagen Ogandzhanian
ca4521d57d Support ClipboardEvent in definitions generated from idl 2018-12-18 15:07:34 +01:00
Pavel Punegov
d90a92ae06 Add stdlib to composite build of Kotlin + Kotlin/Native 2018-12-18 16:06:17 +03:00
Roman Artemev
e436e7cf61 [JS IR BE] Support call super with default parameters 2018-12-18 15:55:09 +03:00
Alexey Tsvetkov
df69e25d56 Refactor: move logging code to org.jetbrains.kotlin.gradle.logging 2018-12-18 15:23:13 +03:00
Alexey Tsvetkov
c87c5f11aa Report compiler messages from daemon in Gradle thread
#KT-28836 fixed

RMI messages are reported from RMI threads.
When Gradle logger is used from non-Gradle thread,
messages are not grouped in command-line
and they are not shown in build scans.
To fix this, we store all messages from Kotlin daemon
in a buffer, then report them from a Gradle thread.
2018-12-18 15:23:13 +03:00
Alexey Tsvetkov
78d9cd1277 Use task's logger where appropriate
KT-28836

Using project's logger prevents messages
from showing in task's output (in command-line and build scans)
2018-12-18 15:23:13 +03:00
Roman Artemev
256317da15 [IR BE] Fix SharedVariableLowering
* make it able to detect shared vars under any declaration kind, not only IrFunction
 * Add & update tests
2018-12-18 15:19:17 +03:00
Vadim Brilyantov
04395366fa add stats collertors extensions to plugin-common_xml 2018-12-18 15:06:21 +03:00
Ilya Matveev
eed41ea405 Add a klib export method consuming a configure action 2018-12-18 18:34:56 +07:00
Ilya Matveev
b668a896ba Don't create run tasks for non-host targets 2018-12-18 18:34:56 +07:00
Ilya Matveev
0a253ef30a Change executable of a run task when binary's baseName is changed 2018-12-18 18:34:56 +07:00
Ilya Matveev
7b1552f3d6 Add tests for new binaries DSL 2018-12-18 18:34:55 +07:00
Ilya Matveev
833e9a90a2 Update Kotlin/Native: 1.1.0-rc1-5227 2018-12-18 18:34:55 +07:00
Ilya Matveev
6f6764a42f Fix existing MPP tests 2018-12-18 18:34:55 +07:00
Ilya Matveev
2a889ef350 Don't hardcode a toolchain path for K/N on Windows 2018-12-18 18:34:55 +07:00
Ilya Matveev
1748eef4cd Fix error message about incorrect kotlin.native.home property 2018-12-18 18:34:55 +07:00
Ilya Matveev
9592a14367 Support aggregate tasks to build binaries per compilation 2018-12-18 18:34:55 +07:00
Ilya Matveev
ad3aac6f90 Support free compiler args for binaries 2018-12-18 18:34:55 +07:00
Ilya Matveev
89c1170e5d Allow changing base name for a Kotlin/Native binary 2018-12-18 18:34:54 +07:00
Ilya Matveev
a28902d358 Support bitcode embedding for frameworks 2018-12-18 18:34:54 +07:00
Ilya Matveev
c963da7761 Support -Xexport-library for K/N in the MPP plugin 2018-12-18 18:34:54 +07:00
Ilya Matveev
0bcb253e53 Provide aggregate link tasks 2018-12-18 18:34:54 +07:00
Ilya Matveev
ea21662bed Provide an extended DSL for final native binaries
In 1.3.0 only basic settings for final native binaries (e.g.
executables or frameworks) are available. They allow a user to
specify what kinds of binaries should be produced from one or another
compilation but they don't allow specifying different options for
different binaries or creating more than 2 (debug and release)
binaries of the same kind (e.g. executable) from the same
compilation. Also link tasks for these binaries are created after
project evaluation thus they are inaccessible for a user outside
of an afterEvaluate block.

This patch adds an extended binary DSL allowing a user to declare
binaries independently from compilations and to specify different
options (e.g. linker arguments) for different binaries. Also
link tasks for binaries declared in this DSL are created at a
configuration time so user can access them outside of an
afterEvaluate block.

Also this patch adds creating run tasks for all executables
declared in the buildscript (KT-28106)

Initial DSL methods for binaries declaration are still supported.

Kotlin DSL example is the following:

kotlin {
    macosX64 {
        binaries {
            // Create debug and release executable with
            // a name prefix 'Foo'.
            // Two domain objects will be created:
            // fooDebugExecutable and fooReleaseExecutable
            executable("Foo", listOf(RELEASE, DEBUG)) {
                compilation = compilations["foo"]
                entryPoint = "foo.main"
                linkerOpts.add("-Llib/path")
                println(runTask.name)
            }

            // Name prefix and build types are optional.
            // debugFramework and releaseFramework are created here.
            framework()
        }
    }
}
2018-12-18 18:34:54 +07:00
Shagen Ogandzhanian
44af5b783f Introduce TrackEvent, MediaStreamTrackEvent-related IDL definitions 2018-12-18 12:19:12 +01:00
Georgy Bronnikov
3b16fa6af9 Do not generate interface delegation for default parameter stubs 2018-12-18 13:57:23 +03:00
Mikhail Zarechenskiy
c924a6efe8 Fix unbound class literals for inline classes
#KT-28361 Fixed
2018-12-18 11:35:36 +03:00
Mikhail Glukhikh
8f821c9ef5 Merge pull request #2033 from t-kameyama/KT-28699
KT-28699 Add "Convert to also" intention
2018-12-18 09:37:34 +03:00
Denis Zharkov
5052623c0b Minor. Add a comment to KtLightElement::givenAnnotations 2018-12-18 09:31:13 +03:00
Denis Zharkov
e0975df1c0 Create annotation arguments in ultra-light classes via PsiElementFactory 2018-12-18 09:31:13 +03:00
Denis Zharkov
5c083d798e Restrict search scope for KtUltraLightParameter
^KT-28365 Fixed
2018-12-18 09:31:13 +03:00
Denis Zharkov
859223baa2 Fix throws-list for case of kotlin.Throwable in ultra-light classes 2018-12-18 09:31:13 +03:00
Denis Zharkov
b16bfad079 Do not generate no-arg constructor for sealed ultra-light class 2018-12-18 09:31:13 +03:00
Denis Zharkov
2f8b214e76 Support annotation based on descriptor in ultra-light classes
It helps to generate properly the annotations for delegates
Also note in test, that annotations in Base class have really weird
text of arguments and also don't have names
2018-12-18 09:31:13 +03:00
Denis Zharkov
63907b1a6b Minor. Introduce typeMapper val into UltraLightSupport
To avoid multiple creation
2018-12-18 09:31:13 +03:00
Toshiaki Kameyama
f2cf3a8e7b Replace with binary operator: don't suggest for non-operator function
#KT-12273 Fixed
2018-12-18 09:30:38 +03:00
Toshiaki Kameyama
ea0f9d124d Split property declaration: don't add parentheses for anonymous function
#KT-7593 Fixed
2018-12-18 09:28:57 +03:00
Toshiaki Kameyama
6a4c6eacd7 Add "Convert to also" intention
#KT-28699 Fixed
2018-12-18 12:21:56 +09:00
Shagen Ogandzhanian
c1f75d2324 Introduce idl definition for SVGMaskElement 2018-12-17 16:11:22 +01:00
Vyacheslav Gerasimov
7155c5c0be 173: Remove obsolete bunch file for idea-gradle/build.gradle.kts 2018-12-17 16:17:20 +03:00
Sergey Igushkin
67e82a54e5 Fix Gradle 5.0 deprecation warnings:
* DefaultSourceDirectorySet constructor is deprecated -> objects()
* IvyRepository.layout('pattern') { } is deprecated -> patternLayout { }

Issue #KT-26808 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin
557fb07f44 Fix the localToProject attribute schema for Gradle 4.10.2+
In Gradle 4.10.2, a change was made in the attributes disambiguation
process: if some of the candidates have a single attribute value and
others don't have that attribute (i.e. have a null value), the
disambiguation rule for that attribute doesn't get called.
Effectively, null values are excluded from disambiguation, but still may
cause ambiguity (sic!)

See: https://github.com/gradle/gradle/issues/6747#issuecomment-445921139

This change affected our attribute `localToProject` that we use to
disambiguate the deprecated but still consumable configurations like
`compile`, `runtime`, `testCompile`, `testRuntime` from those
configurations which should have priority during project dependency
resolution: the `*Element` ones. Our scheme marked the former
configurations with the attribute and the latter were not marked, with
a disambiguation rule that preferred null values.

To fix this logic with Gradle 4.10.2, we instead mark both kinds of
configurations with the attribute, which now has a value 'public'
that is preferred by the rule over the other values. We also make sure
that the attribute doesn't leak into the published Gradle metadata, as
it is only needed for project-to-project dependencies resolution.

Issue #KT-28795 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin
2349aaf488 Workaround for ConcurrentModificationException in KotlinModelBuilder
In Gradle 5.0, iterating over the `.withType<...>()` result below
caused a ConcurrentModificationException. Workaround that by first
collecting the items into a list.
2018-12-17 16:09:56 +03:00
Sergey Igushkin
d7522e2283 Fix some tests for Gradle 5.0 and update some dependency versions
* Introduce GradleVersionRequired.InRange and thus prevent older
tests (e.g. Android 2.3.0) from running with newer Gradle versions

* Add a task outputs pattern suitable for Gradle 5.0

* Run some of the Android tests with AGP 3.1.0 (and Gradle 4.4) instead
of 3.0.0 to ensure compatibility with Gradle 5.0

* Update test projects according to Gradle 5.0 dropped deprecated
features: classesDir, left-shift operator, default org.gradle.util.*
imports

* Fix a Gradle test after Gradle 5.0 changed `publishing` behavior to
run the closure eagerly rather than after evaluation
2018-12-17 16:09:56 +03:00
Sergey Igushkin
5f21ced26b Advance test Gradle version to 5.0 2018-12-17 16:09:56 +03:00
Vyacheslav Gerasimov
e422eb56b2 173: Fix test compilation for AS 3.1 2018-12-17 15:57:06 +03:00
Alexey Tsvetkov
2196d81322 Enable JS IC by default
#KT-28842 Fixed
2018-12-17 15:46:11 +03:00
Alexey Tsvetkov
ce9150f2b2 Add project property to disable AP discovery in compile classpath
AP discovery in compile classpath can be disabled in all subprojects
by adding "kapt.include.compile.classpath = false" to 'gradle.properties' file.

KT-24530

The setting can be overrided per project by using KAPT DSL
in a 'build.gradle' file:
```
kapt {
    includeCompileClasspath = false
}
```
2018-12-17 15:41:34 +03:00
Vadim Brilyantov
7fb43144d4 fix KotlinVersion and set it to be 1_3_0 2018-12-17 15:07:10 +03:00
Mikhael Bogdanov
1a0c3dfaa6 Use last ASM version to read binaries
#KT-28798 Fixed
2018-12-17 12:18:52 +01:00
Alexey Tsvetkov
0ea7716eb1 Test that javac is loaded once when worker is reused 2018-12-16 04:28:44 +03:00
Ting-Yuan Huang
6c627fa5c1 Cache classloaders for tools.jar and kapt in Gradle workers
#KT-28852 fixed

The loaders and hence some classes were repeatedly loaded and
jit-compiled everytime when KaptExecution were dispatched. Those
classes, like JavaCompiler, can be very large and therefore created a
significant overhead. In some projects, the overhead accounted for more
than 40% of total CPU time of annotation processing.

This change tries to cache the classloaders so that they won't be
reloaded and re-jitted.
2018-12-16 04:28:44 +03:00
Alexey Tsvetkov
1ba6d5361b Run in-process compiler in separate thread
The compiler uses thread local values,
so when the compiler runs Gradle's thread,
it leaks classes preventing
a compiler's classloader from being collected.

    #KT-28037 fixed
2018-12-15 23:39:06 +03:00
Alexey Tsvetkov
a6fca47871 Minor: remove unused util 2018-12-15 23:39:06 +03:00
Alexey Tsvetkov
cab32f0e43 Print stacktrace to Gradle logger instead of writing directly to stderr 2018-12-15 23:39:06 +03:00
Vadim Brilyantov
bc08c966a8 fix RenameKotlinFileProcessor for 173 bunch 2018-12-14 20:20:57 +03:00
Vadim Brilyantov
1fcf8a5587 add 173 bunch for build_gradle_kts of usage-statistics 2018-12-14 20:19:23 +03:00
Vadim Brilyantov
fb12de8ff6 fix stats reporters (dummies) Rename Handlers for 181 bunch files
fix bunch files again

fix RenameBackingFieldReferenceHandler for 181 bunch

fix RenameKotlinImplicitLambdaParameter for 181 bunch
2018-12-14 20:19:22 +03:00
Vadim Brilyantov
65982bbee8 disable statistics for 181 as FUS is only available since 182 2018-12-14 20:19:22 +03:00
Vadim Brilyantov
15fec50a0f remove intensions and quickfixes triggers (already present in Idea) 2018-12-14 20:19:20 +03:00
Vadim Brilyantov
93d93cd40e fix report kotlin targets for android case 2018-12-14 20:19:19 +03:00
Vadim Brilyantov
df5ec5c218 report stats for pullUp/pushDown refactorings
tmp
2018-12-14 20:19:19 +03:00
Vadim Brilyantov
37239cbcd7 report stats for all renaming refactorings 2018-12-14 20:19:18 +03:00
Vadim Brilyantov
00f630b31d add target reporting 2018-12-14 20:19:17 +03:00
Vadim Brilyantov
c307d07b47 fix build for idea plugin with usage statistics 2018-12-14 20:19:16 +03:00
Vadim Brilyantov
ae9f16d964 trigger intentions, inspections and some of rename refactorings 2018-12-14 20:19:15 +03:00
Vadim Brilyantov
1b716ea2ee create usage-statistics module 2018-12-14 20:19:14 +03:00
Shagen Ogandzhanian
714b4f25c0 Introduce better typing for on[event-name] attributes from idl
see https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2548
2018-12-14 13:17:41 +01:00
victor.petukhov
8c0ad321e2 Add black box tests for objects inheritance problem (KT-25289) 2018-12-14 14:36:17 +03:00
victor.petukhov
fc381e25c8 Remove diagnostic tags from black box spec tests for annotations 2018-12-14 14:36:17 +03:00
victor.petukhov
f3774b8e19 Add black box spec tests validation 2018-12-14 14:36:16 +03:00
Denis Zharkov
a422db91b2 Transform KotlinClassFinder::findKotlinClass to extension 2018-12-13 20:38:25 +03:00
Denis Zharkov
f153d97f40 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-13 20:38:24 +03:00
Denis Zharkov
bc61e5a3bc Minor. Reformat BinaryJavaClass 2018-12-13 20:37:46 +03:00
Denis Zharkov
e59d9bf9e4 Convert JavaClassFinder.java to kotlin 2018-12-13 20:37:46 +03:00
Denis Zharkov
9ddee565e0 Convert JavaClassFinder.java to kotlin: rename file 2018-12-13 20:37:46 +03:00
Denis Zharkov
0a70a957e9 Minor. Reformat LazyJavaPackageScope.kt 2018-12-13 20:37:46 +03:00
Ilya Chernikov
77a4505ec2 [minor] get rid of obsolete "environment" wording 2018-12-13 18:00:12 +01:00
Ilya Chernikov
0b9770f8d1 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:00:12 +01:00
Ilya Chernikov
9e5d04b836 Add generic interfaces to dependency resolvers 2018-12-13 18:00:11 +01:00
Ilya Chernikov
e0a542234f Add script config refinement before compilation into API 2018-12-13 18:00:10 +01:00
Ilya Chernikov
3fe324bbb4 Add UrlScriptSource 2018-12-13 18:00:08 +01:00
Ilya Chernikov
fb929c290d [minor] copy utility fun to reduce dependencies 2018-12-13 18:00:08 +01:00
Ilya Chernikov
5602bcf9e1 Fix vararg argument mapping for generic args convertor 2018-12-13 18:00:07 +01:00
Ivan Gavrilovic
6b20ef0208 Complete Java usage tracker if analysis extension finishes (KT-27487)
In cases when kapt compiler plugin runs in stubs generation mode,
Java usage tracker was not completed. This caused issues with
the incremental compilation if Java files changed.

E.g. if a constant defined in Java source file changed, stubs
would not be recompiled because the Java usage tracker would
not report changed type. This commit fixes that issue.
2018-12-13 17:12:08 +03:00
Pavel V. Talanov
dec2da8247 dumbUtils: remove console spam 2018-12-13 14:35:05 +01:00
Pavel V. Talanov
1d7a74bfcd Minor: fix exception message 2018-12-13 14:35:04 +01:00
Alexander Udalov
8c74312cf6 Fix isInitialized for companion lateinit properties
Instead of trying to access a missing field `Foo.foo`, call the
synthetic accessor `Foo.access$getFoo$cp` which, as per previous commit,
no longer contains the lateinit assertion

 #KT-21862 Fixed
2018-12-13 14:12:33 +01:00
Alexander Udalov
43413fcc44 Move lateinit assertion for companion property to companion object
Previously, for a property named `x` in the companion object of a class
named `Foo`, we generated:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x` and lateinit
  assertion
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`

Now, we generate:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x`
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`
  and lateinit assertion

The reason is that this way we can avoid generating another accessor and
reuse `Foo.access$getX$cp` in case `isInitialized` is called on a
lateinit property from companion.

For private properties, getX is not generated, but instead the assertion
is generated on each access to the field (which can be improved, see
KT-28331). The same happens for access to non-private properties from
inside the same context where they're declared.

 #KT-21862 In Progress
2018-12-13 14:12:33 +01:00
Alexander Udalov
8617365983 Minor, reformat & fix warnings in intermediateValueForProperty 2018-12-13 14:12:32 +01:00
Alexey Tsvetkov
8aa069a774 Make AbstractJvmAbiContentTest system independent 2018-12-13 15:39:39 +03:00
Alexey Tsvetkov
7953a9154c Register classpath as inputs of SmartJavaExec tasks 2018-12-13 15:39:39 +03:00
Alexander Udalov
bbc7edf9d1 Fix incorrect character replacement in ClassName.jvmInternalName
#KT-28682 Fixed
2018-12-13 13:23:45 +01:00
victor.petukhov
725832a281 Fix incomplete printing of exceptions (of the all types) in tests 2018-12-13 12:50:10 +03:00
Nikolay Krasko
0a8e29838f Add file comparison feature to surround with tests 2018-12-13 12:36:02 +03:00
Nikolay Krasko
0482fe9414 Move check with selection tags to base check 2018-12-13 12:36:02 +03:00
shiraji
06dad5f45b Surround with try/catch should generate more Kotlin-style code (KT-5435)
#KT-5435 Fixed
2018-12-13 12:36:02 +03:00
Nikolay Krasko
c7c51a3d6b Refactoring: drop MoveDeclarationsOutHelper object 2018-12-13 12:36:02 +03:00
Nikolay Krasko
8dd02126d9 Convert MoveDeclarationsOutHelper to Kotlin and minor improvements 2018-12-13 12:36:02 +03:00
Nikolay Krasko
eda1f1f3a0 Convert MoveDeclarationsOutHelper to Kotlin - rename 2018-12-13 12:36:02 +03:00
Nikolay Krasko
5fb90a8a81 Better caret position after Insert curly braces around variable (KT-28739)
Introduce helper class and move caret to it's original position.

 #KT-28739 Fixed
2018-12-13 12:36:01 +03:00
Nikolay Krasko
44a36e70ec Exit when property has no name (EA-129932) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
aada1e4c1b Do not try to run reformat inspection on read-only file (EA-126979) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
fc4971aa98 Minor: log instead of asserting error (EA-126493) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
a5724293b0 Diagnostic null value in operations node (EA-126606) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
7c23564bc5 Minor: fix nullability warnings and extract method 2018-12-13 12:36:00 +03:00
Nikolay Krasko
1d3d86023e Log NPE from getting operation reference in binary expression (EA-129499) 2018-12-13 12:36:00 +03:00
Andrey Uskov
ffb277d978 Fix KT-28626, KT-27263, KT-27718 in Idea 191 2018-12-12 19:04:56 +03:00
Andrey Uskov
595e75e059 Fix build in bunch 191 2018-12-12 19:04:15 +03:00
Vyacheslav Gerasimov
201522c6c8 as31: Fix KaptWithKotlincTask compilation 2018-12-12 17:58:29 +03:00
Vyacheslav Gerasimov
b942f00409 as31: set intellijUltimateEnabled flag 2018-12-12 17:58:29 +03:00
victor.petukhov
ee0fa2220e Fix incomplete printing of runtime exceptions in box tests 2018-12-12 17:44:05 +03:00
Mikhail Zarechenskiy
1d69f35f27 Revert "[NI] Take into account captured types for type depth computation"
This reverts commit 383c2d1bff.

 It seems this commit causes problems with bootstraping, so it'll be
 investigated and refined later
2018-12-12 17:41:30 +03:00
Leonid Startsev
fdf4f02dde Declare real external symbols for overriden by synthetic function
instead of unbound

Unbound symbols were throwing an exception on attempt to analyze them
in the other parts of compiler and are generally incorrect
2018-12-12 17:26:01 +03:00
Mikhail Glukhikh
a15b47c93c Add "Ambiguous context due to scope receiver in suspend fun" inspection
#KT-28696 Fixed
2018-12-12 17:10:37 +03:00
Shagen Ogandzhanian
44da3c89b7 Introduce PointerEvent-related definitions
* Resolves https://youtrack.jetbrains.com/issue/KT-23932
 * Backed by review https://upsource.jetbrains.com/kotlin/branch/KT-23932-POINTER-EVENT-FROM-REMOTE-IDL
2018-12-12 14:53:18 +01:00
Shagen Ogandzhanian
2d49268a0b Support float initializers in fun params generated from idl definitions 2018-12-12 14:12:27 +01:00
Mikhail Glukhikh
42fa6ce6f0 Refactor "change type to mutable" in suspicious collection reassignment
Related to KT-20626
2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
b17ee60c6f Change description of boolean argument/augmented assignment inspections 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
13b09f532c Boolean literal arguments: check previous arg, fix all args in a row 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
235b50d86e Boolean literal arguments: do not highlight with single boolean argument 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
d31e0b9632 Boolean literal arguments: don't report on a call, just on an element 2018-12-12 15:56:12 +03:00
Toshiaki Kameyama
0d7116aa5d Introduce "Boolean literal arguments" inspection #KT-2029 Fixed 2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
aa9e48b9b6 Augmented list assignment inspection: add "replace with ordinary" fix
Relates to KT-20626
2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
ed8305995e Don't highlight "replace with +=" for read-only collections
Related to KT-20626
2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
c560aada3d Add "Suspicious collection reassignment" inspection #KT-20626 Fixed 2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
3e936f64bf Introduce KtReferenceSearch to use LocalSearchScope, when possible
This fixes a set of problems in J2K tests in 183
#KT-28368 Fixed
2018-12-12 15:56:10 +03:00
Yan Zhulanow
ef08110354 Evaluator: Render inline class values using its toString() implementation (KT-27414) 2018-12-12 21:40:46 +09:00
Yan Zhulanow
425467ca99 Kapt: Switch to more appropriate way of converting URIs to Files 2018-12-12 21:40:46 +09:00
Yan Zhulanow
eb28ce3007 Fix Android Lint tests (182 bunch only) 2018-12-12 21:40:45 +09:00
Yan Zhulanow
f5bb9d5866 Remove Lint tests for annotation argument API check.
Looks like newer Lint API checker ignores type usage in annotations, so these tests are no more needed.
2018-12-12 21:40:45 +09:00
Yan Zhulanow
aa5f1cefd0 Fix testSimple() for "Remove Parcelable" action 2018-12-12 21:40:45 +09:00
Yan Zhulanow
648fb2ef0b AllOpen: Update test data (enum constructors are now private) 2018-12-12 21:40:45 +09:00
Yan Zhulanow
9ec321b918 Update debugger test data, fix the current behavior 2018-12-12 21:40:45 +09:00
Yan Zhulanow
1734726d50 Remove a magic constant from 'KotlinLambdaMethodFilter' 2018-12-12 21:40:45 +09:00
Yan Zhulanow
a6ba7e6e87 Revert "Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282)"
This reverts commit 6c868701
2018-12-12 21:40:45 +09:00
Yan Zhulanow
79bb609e1e Uast: Update test data (enum constructors are now private) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
0dda7bd7ca NoArg: Update test data (enum constructors are now private) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
a090541108 Kapt: Update test data (stub converter tests) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
1963571be3 Add missing 'disallowRootAccess()' to debugger and stub tests 2018-12-12 21:40:44 +09:00
Yan Zhulanow
dd49d35320 Fix backend tests after changing format of synthetic variables for inline functions 2018-12-12 21:40:44 +09:00
Yan Zhulanow
e6643ef2b7 Fix quick evaluation for array expressions (KT-13268) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
4b4d8dd660 Fix breakpoints for the same inline function nested calls (KT-22366)
This commit changes the format of the synthetic local variables for inline functions.
2018-12-12 21:40:44 +09:00
Yan Zhulanow
ae4f05cf62 Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
e12af0e2d1 Fix evaluation for captured inline classes (KT-28487) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
27ea02929a Fix evaluation for static interface methods declared in Java (KT-23585) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
3d7b503cd6 Fix source mapping for stepping into package facades from libraries (KT-28028) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
3c8714696d Add a LookupLocation to 'getSyntheticExtensionProperties()', use it in 'DebuggerFieldSyntheticScopeProvider' 2018-12-12 21:40:43 +09:00
Yan Zhulanow
dc34f11f50 Evaluate: Enable 'foo_field' convention only for Jvm/Common code 2018-12-12 21:40:43 +09:00
Yan Zhulanow
8334769eb0 Refactoring: Replace 'ParametersDescriptor' with a simple 'List' 2018-12-12 21:40:43 +09:00
Yan Zhulanow
c88d8a5e0d Evaluate: Support synthetic 'field' variable evaluation (KT-28342) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
60d2490c45 Minor: Move changeSuperToMagicAccessor() function to its single use site, J2K it 2018-12-12 21:40:43 +09:00
Yan Zhulanow
9498eb8d4d Kapt: Preserve 'getJarPathForClass()' (used in kapt-cli) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
ada71ce3cd Evaluate: Use '<name>_field' syntax for field value evaluation (KT-14075) 2018-12-12 21:40:42 +09:00
Yan Zhulanow
c2f33c0dfd Provide a default implementation for 'SyntheticScope' 2018-12-12 21:40:42 +09:00
Denis Zharkov
a83f0e5fb7 Add diagnostic for calling ConcurrentHashMap::contains by convention
^KT-18053 Fixed
2018-12-12 15:37:50 +03:00
Simon Ogorodnik
f8e7c8856a PerModulePackageCache: Process events where whole psi file was added 2018-12-12 15:28:16 +03:00
Simon Ogorodnik
1f6fde4bc2 KT-20706: Fix auto-popup completion after digit in KDoc
#KT-20706 Fixed
2018-12-12 15:27:20 +03:00
Alexander Podkhalyuzin
c607b8e556 Removed unnecessary warning
#KT-28360 Fixed
2018-12-12 14:34:04 +03:00
Mikhail Glukhikh
3889bb05d6 Do not modify highlighting settings for non-Kotlin files #KT-28716 Fixed 2018-12-12 14:20:06 +03:00
Alexey Tsvetkov
01fbcfad23 Minor: replace UsefulTestCase with KtUsefulTestCase
For some reason assertSameLinesWithFile from UsefulTestCase
fails with exception on TeamCity, whereas the one KtUsefulTestCase
does not
2018-12-12 02:53:13 +03:00
Alexey Tsvetkov
7c767e0789 Exclude InsnList from proguard
It is used by jvm-abi-gen plugin
2018-12-12 02:52:07 +03:00
Shagen Ogandzhanian
03966985a1 Add mininal test suite to idl2k, remove deprecated ANTLRFileStream 2018-12-11 22:46:01 +01:00
Alexey Tsvetkov
57f8f216d1 Exclude local variables and try catch blocks of non-inline functions from ABI 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
495cfec9e9 Check descriptor visibility before excluding method from ABI class 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
34d96dff28 Minor: rename const according to style guide 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
b87058b532 Attempt to fix ABI tests on TC
Locally they work fine
2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
09dbf427ee Disable removing private/synthetic/local classes temporarily 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
96f3c67b3b Report output classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
05c5196aaa Reuse BytecodeListingTextCollectingVisitor in tests 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
497df17eb7 Reuse TransformationMethodVisitor in ABI gen plugin 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
82eb7c17e6 Convert TransformationMethodVisitor: step 2 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
56b72c96eb Convert TransformationMethodVisitor: step 1 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
50d8fe611c Minor fixes after review 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
d54ce2da6f Exclude nested classes of private classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
64380f55d2 Report locations of errors in ABI classes tests 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
9dd09151f0 Add tests for compilation against abi classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
8992ee6280 Add tests for non-compatible ABI changes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
5891617674 Exclude clinit from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
519211036d Exclude synthetic classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
fe047a0092 Minor: extract function 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
f231817559 Delay I/O when transforming ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
d74185a74d Remove unused cosntant pool entries from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
3a29b337a0 Exclude private typealiases from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
1f5ca7274d Exclude local and private classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
7c2f7cab9a Exclude non-inline method bodies from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
903f6bc79b Exclude private members from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
33faa00184 Add plugin for JVM ABI classes generation
#KT-25128 Fixed

ABI class generation is implemented as a compiler plugin.
Command-line usage:
1. Add a path to 'jvm-abi-gen.jar' to the plguin classpath argument
(`-Xplugin`). By default the jar is located at
'kotlinc/lib/jvm-abi-gen.jar' in the kotlinc distribution archive.
2. Specify an output directory for ABI classes via
`-Pplugin:org.jetbrains.kotlin.jvm.abi:outputDir=<DIR>`.
2018-12-11 22:48:53 +03:00
Mikhail Glukhikh
7fcd29843e Fix JS compilation for branch 181 2018-12-11 22:14:44 +03:00
Mikhail Glukhikh
588e94b917 File rename: TargetPlatform.kt -> PlatformConfiguratorBase.kt
Made to match file content better
2018-12-11 22:07:41 +03:00
Simon Ogorodnik
e3aed04d96 Extract module info & target platform to separate frontend.common 2018-12-11 22:07:41 +03:00
Vyacheslav Gerasimov
cd614b5bf8 Build: fix missing dx sources 2018-12-11 21:59:52 +03:00
Vyacheslav Gerasimov
02fbdc54d9 Build: Fix up-to-date for :kotlin-compiler-client-embeddable:shadowJar
The task was never up-to-date because default jar and shadowJar tasks overwritten each other's output

 #KT-28656 Fixed
2018-12-11 18:11:53 +03:00
Ilya Chernikov
abc13589c8 Fix locking in script definition provider
fixes possible parallel modifications on definitions loading, e.g.
as in https://github.com/shyiko/ktlint/issues/287
2018-12-11 15:20:08 +01:00
Mikhail Glukhikh
b143a1c8f7 For each parameter not used: handle char sequences correctly
An enhancement for KT-27209
2018-12-11 16:42:04 +03:00
Mikhail Glukhikh
833f564f0e Disable extract actions on non-JVM classes #KT-28476 Fixed 2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
11909a86a8 For each parameter not used: introduce "replace with repeat"
An enhancement for KT-27209
2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
e06c995516 For each parameter not used: cleanup 2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
9aa1d1495b Redundant arrow: don't report on forEach call with underscore
#KT-27209 Fixed
2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
c8c485d27e Redundant arrow: support removing of 'it ->' #KT-28631 Fixed 2018-12-11 16:42:03 +03:00
Denis Zharkov
92150d847a Unwrap InvocationTargetException in dependency injection
^KT-28348 Fixed
2018-12-11 16:12:28 +03:00
Denis Zharkov
957e7cd5f3 Optimize searching constructor delegation calls
^KT-28755 Fixed
2018-12-11 16:12:28 +03:00
Denis Zharkov
9e07b0d31a Minor. Reformat usagesSearch/utils.kt 2018-12-11 16:12:28 +03:00
Roman Artemev
2b436b493c Move test from js to common part 2018-12-11 16:11:01 +03:00
Alexey Tsvetkov
b6c975739c Deprecate AP discovery in compile configurations in Gradle
#KT-24368 Fixed
2018-12-11 16:08:16 +03:00
Alexey Tsvetkov
d6459e6c49 Add option to disable AP discovery in compile classpath
#KT-24530 Fixed

To disable discovery and enable avoidance for kapt tasks,
use "kapt.includeCompileClasspath = false"
2018-12-11 16:08:16 +03:00
Simon Ogorodnik
445c85f829 Support overriding module/library/sdk for particular light PsiClass
To support light R classes
2018-12-11 15:46:11 +03:00
Ilmir Usmanov
7f9e91eabe Use File.pathSeparator instead of : 2018-12-11 15:08:34 +03:00
Dmitry Petrov
08d1c47ac3 KT-14227 Intrinsify MutableMap.set
This fixes the most common (and rather annoying) bug in augmented
assignment desugaring with collection element receiver.

Fix is somewhat hackish: introduce an intrinsic for MutableMap.set,
thus bypassing discrepancies in 'get' and 'set' call generation.
Fixing it properly requires design decisions for corner cases where
ad hoc augmented assignment desugaring with collection element receiver
"accidentally" works, producing identical objects and vararg arrays for
arguments of 'get' and 'set'.
2018-12-11 12:43:03 +03:00
Yan Zhulanow
9a98a4525b ServiceLoaderLite: Support paths with spaces (KT-28527) 2018-12-11 17:45:46 +09:00
Mikhail Zarechenskiy
e8a8318ead [NI] Fix input/output types for callable reference atom
Input and output types are crucial for type variable fixation order and
 analysis of postponed arguments (callable references, lambdas).

 Specifically, if there is non-fixed type variable inside input types of
 a callable reference, then we'll postpone resolution for such callable
 reference.

 Initial example with the expected type `KMutableProperty1<*, F>` caused
 problems because input types were computed incorrectly (while there
 aren't input types here)

 #KT-25431 Fixed
2018-12-11 11:33:29 +03:00
Mikhail Zarechenskiy
6ebbb6eae3 [NI] Fix not-null smartcast on intersection of nullable types
#KT-28670 Fixed
2018-12-11 11:29:59 +03:00
Mikhail Zarechenskiy
383c2d1bff [NI] Take into account captured types for type depth computation
It's needed to estimate the count of steps for type approximation algorithm.
 After the estimated count of steps, we consider such type recursive and this
 algorithm returns some default value

 #KT-28598 Fixed
2018-12-11 11:29:55 +03:00
Denis Zharkov
ddb4e8b128 Temporary remove some tests after a fix for KT-24937
Otherwise, our project is failed to be indexed
2018-12-11 09:45:39 +03:00
Denis Zharkov
5992896d76 Relax assertion in parser for a recovery case with annotations
^KT-24937 Fixed
2018-12-11 09:45:14 +03:00
Nicolay Mitropolsky
3727fabb0f AddConstModifierFix and AddReifiedToTypeParameterOfFunctionFix updated to implement invokeImpl 2018-12-11 08:46:02 +03:00
Dmitry Batkovich
654f728c12 AddModifierFix and RemoveModifierFix made extend KotlinCrossLanguageQuickFixAction 2018-12-11 08:46:02 +03:00
Georgy Bronnikov
2b0ec8abe3 Update tests 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
5dd9cfca4d Repair after merge 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
a695e21e44 Introduce IrLazyProperty 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
f4a189fe82 Change order of arguments in IrValueParameter.copyTo 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
c018109bca React to review comments 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
c9343c89bc Mark java external declarations in IrFunction.origin 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
1764423860 JVM_IR. Mostly remove descriptors from InterfaceDelegationLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
cbc46fe6e4 JVM_IR. Mostly remove descriptors from InterfaceLowering
Descriptors are only used to generate a new method name via a call to
KotlinTypeMapper.
2018-12-10 17:26:55 +03:00
Georgy Bronnikov
55b65546fa IR. Take care of type parameters for calls in DefaultArgumentStubGenerator 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
bba711a189 JVM_IR. Remove descriptors from ConstAndJvmFieldPropertiesLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
41da078de5 IR. Create IrAnonymousInitializerSymbolImpl using a class symbol 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
481bef9799 JVM_IR. Copy annotations properly in MoveCompanionObjectFieldsLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
a5fea34f12 Remove some dead code 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
bf4f552478 IR. Remove descriptors from KCallableNamePropertyLowering 2018-12-10 17:26:55 +03:00
Simon Ogorodnik
33f937c923 Remove property with @JvmDefault to make test pass
In sake of #KT-28708
2018-12-10 16:08:54 +03:00
Simon Ogorodnik
2165cfe91d JavaAgainstKotlinBinaries: Allow specifying extra compiler options 2018-12-10 16:08:53 +03:00
Simon Ogorodnik
bd774766f1 Add test debug logging for PerModulePackageCacheService 2018-12-10 16:08:52 +03:00
Simon Ogorodnik
e3b181e412 Restore processing of delete events 2018-12-10 16:08:51 +03:00
Dmitry Petrov
8ede477f99 KT-28585 Fix boxing for values of captured vars of inline class type 2018-12-10 14:57:09 +03:00
Dmitry Petrov
45035d3e11 KT-28405 Fix toString for inline classes with underlying arrays 2018-12-10 14:57:09 +03:00
Dmitry Savvinov
500dc11514 Fix missed returned expression if the last expression was condition jump
See ticket comments for the detailed description

^KT-28061 Fixed
2018-12-10 13:38:43 +03:00
Dmitry Savvinov
c9e87bf353 Add test on in-place lambda with return + safecall
Currently, diagnostics behavior is undesired. The next commit fixes it

^KT-28061 In Progress
2018-12-10 13:38:43 +03:00
Nicolay Mitropolsky
b918786336 Uast: enabling multiresolve by default 2018-12-10 13:26:25 +03:00
Toshiaki Kameyama
07ffac72cf Assign backing field: don't add empty line
#KT-28694 Fixed
2018-12-10 12:06:55 +03:00
21853 changed files with 652790 additions and 995843 deletions

15
.bunch
View File

@@ -1,10 +1,7 @@
183
182
181_182
173_181_182
as31_173_181_182
as32_181_182
as33_182
as34
191
cidr183
192
183
182_183
as33_182_183
as34_183
as35

25
.gitignore vendored
View File

@@ -2,7 +2,7 @@
.idea/shelf
/android.tests.dependencies
/confluence/target
/dependencies
/dependencies/repo
/dist
/local
/gh-pages
@@ -15,10 +15,6 @@ workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
.gradle/
@@ -29,13 +25,30 @@ build/
!**/testData/**/*.iml
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/artifacts
.idea/artifacts/PILL_*.xml
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
.idea/libraries
.idea/modules.xml
.idea/gradle.xml
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
.idea/artifacts/dist_auto_*
.idea/artifacts/dist.xml
.idea/artifacts/ideaPlugin.xml
.idea/artifacts/kotlinc.xml
.idea/artifacts/kotlin_compiler_jar.xml
.idea/artifacts/kotlin_plugin_jar.xml
.idea/artifacts/kotlin_jps_plugin_jar.xml
.idea/artifacts/kotlin_daemon_client_jar.xml
.idea/artifacts/kotlin_imports_dumper_compiler_plugin_jar.xml
.idea/artifacts/kotlin_main_kts_jar.xml
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
.idea/artifacts/kotlin_reflect_jar.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-nodejs-runner/lib/
local.properties

8
.idea/ant.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/libraries/build-docs.xml">
<maximumHeapSize value="1024" />
</buildFile>
</component>
</project>

8
.idea/artifacts/dist_root.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact build-on-make="true" name="dist_root">
<output-path>$PROJECT_DIR$/dist</output-path>
<root id="root">
<element id="artifact" artifact-name="dist" />
</root>
</artifact>
</component>

View File

@@ -1,7 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="allowReplaceRegexp" value="JetBrains" />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license &#10;that can be found in the license/LICENSE.txt file." />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. and Kotlin Programming Language contributors.&#10;Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file." />
<option name="myName" value="apache" />
</copyright>
</component>

View File

@@ -3,7 +3,12 @@
<words>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
<w>jdks</w>
<w>protobuf</w>
<w>redirector</w>
<w>remapper</w>
<w>unpresent</w>
</words>
</dictionary>
</component>

View File

@@ -10,6 +10,7 @@
<w>infos</w>
<w>intrinsics</w>
<w>kdoc</w>
<w>lateinit</w>
<w>memoize</w>
<w>memoized</w>
<w>multiline</w>
@@ -18,11 +19,15 @@
<w>preloader</w>
<w>preloading</w>
<w>preprocess</w>
<w>proximities</w>
<w>redeclarations</w>
<w>reparsed</w>
<w>smap</w>
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>
<w>tailrec</w>
<w>typealias</w>
</words>
</dictionary>
</component>

View File

@@ -3,12 +3,14 @@
<words>
<w>debuggee</w>
<w>deserializes</w>
<w>destructured</w>
<w>hacky</w>
<w>impls</w>
<w>kapt</w>
<w>parceler</w>
<w>repl</w>
<w>uast</w>
<w>unbox</w>
<w>unboxed</w>
<w>unmute</w>
</words>

View File

@@ -21,7 +21,6 @@
</inspection_tool>
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastConflictsWithInstanceof" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastToIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ChainedEquality" enabled="false" level="WARNING" enabled_by_default="true" />
@@ -76,6 +75,7 @@
<option name="m_ignoreLoopsWithoutConditions" value="false" />
</inspection_tool>
<inspection_tool class="ForLoopThatDoesntUseLoopVariable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
@@ -98,24 +98,22 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Not null starting from 181. Use getProgressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettings#copyFrom" reason="Absent in 173. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettingsManager#copy" reason="Removed since 181. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.notification.NotificationAction#createSimple" reason="Absent in 173." />
<Problem reference="com.intellij.notification.NotificationAction#create" reason="Absent in 173." />
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
<Problem reference="com.intellij.execution.JavaRunConfigurationExtensionManager#getInstance" reason="Can't be used in Kotlin, because method was replaced with property after J2K in 183. Use JavaRunConfigurationExtensionManagerUtil instead." />
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.execution.configurations.RunConfigurationBase" reason="Generalized in 183. Use RunConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.LocatableConfigurationBase" reason="Generalized in 183. Use LocatableConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.ModuleBasedConfiguration" reason="Generalized in 183. Use ModuleBasedConfigurationElement instead." />
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
<Problem reference="com.intellij.testFramework.codeInsight.hierarchy.HierarchyViewTestFixture" reason="Absent in &lt;= 181. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
<Problem reference="org.jetbrains.kotlin.test.HierarchyViewTestFixtureCompat" reason="Do not use the wrapper for 181 directly. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
<Problem reference="com.intellij.psi.codeStyle.CodeStyleSettingsProvider" reason="Additional method is introduced in 183 instead of deprecated one. Use CodeStyleSettingsProviderCompat instead." />
<Problem reference="com.intellij.openapi.ui.popup.PopupChooserBuilder#PopupChooserBuilder(javax.swing.JList)" reason="Generified in 182. Use PopupChooserBuilderWrapper instead." />
<Problem reference="com.intellij.openapi.editor.event.EditorFactoryListener" reason="Default implementations were added in 183. Use EditorFactoryListenerWrapper for inheritance instead." />
<Problem reference="com.intellij.openapi.diagnostic.LoggerKt#debugOrInfoIfTestMode" reason="Absent in 182." />
<Problem reference="com.intellij.psi.search.PsiSearchHelper.SERVICE" reason="Deprecated since 182. Use psiSearchHelperInstance() instead." />
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.codeInspection.dataFlow.Nullness" reason="Deprecated since 182. Use org.jetbrains.kotlin.idea.util.compat.Nullability instead." />
</list>
</option>
</inspection_tool>
@@ -268,6 +266,10 @@
<option name="ignoreObjectMethods" value="true" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="MissingRecentApi" enabled="true" level="ERROR" enabled_by_default="true">
<option name="sinceBuildString" value="182.0" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledEquals" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -299,16 +301,6 @@
<inspection_tool class="PackageName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="namePattern" value="[a-z_][a-z\d_]*(\.[a-z_][a-zA-Z\d_]*)*" />
</inspection_tool>
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
</list>
</option>
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="ERROR" enabled_by_default="true">
@@ -324,16 +316,11 @@
</inspection_tool>
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true">
<searchConfiguration name="SwingUtilities.invokeLater" text="SwingUtilities.invokeLater($runnable$)" recursive="false" caseInsensitive="false" type="JAVA">
<constraint name="Instance" regexp="SwingUtilities" minCount="0" target="true" within="" contains="" />
<constraint name="MethodCall" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
<constraint name="runnable" within="" contains="" />
</searchConfiguration>
<replaceConfiguration name="DirectCallOfDispose" text="$Instance$.dispose()" recursive="false" caseInsensitive="false" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="Disposer.dispose($Instance$)">
<constraint name="Instance" regexp="super" nameOfExprType="Disposable" withinHierarchy="true" exprTypeWithinHierarchy="true" minCount="0" negateName="true" within="" contains="" />
<constraint name="MethodCall" target="true" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
</replaceConfiguration>
<replaceConfiguration name="new Object[0]" text="new Object[0]" recursive="false" caseInsensitive="true" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="com.intellij.util.ArrayUtil.EMPTY_OBJECT_ARRAY" />
@@ -397,6 +384,7 @@
</inspection_tool>
<inspection_tool class="StringEquality" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StringOperationCanBeSimplifiedMerged" />
<inspection_tool class="SwitchStatementWithConfusingDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SynchronizeOnThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true">

View File

@@ -1,7 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="idea.default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

8
.idea/misc.xml generated
View File

@@ -47,6 +47,8 @@
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
<option name="myNullables">
<value>
<list size="9">
@@ -84,6 +86,9 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PsiViewerSettings">
<option name="splitDividerLocation" value="35" />
</component>
<component name="SuppressABINotification">
<option name="modulesWithSuppressedNotConfigured">
<set>
@@ -100,4 +105,7 @@
<option name="autoscroll" value="false" />
<option name="showOnlyWarnings" value="false" />
</component>
<component name="intellij-api-watcher-check-current-project">
<option name="shouldCheckCurrentProject" value="true" />
</component>
</project>

View File

@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (Not Internal)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-Pidea.is.internal=false" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
</configuration>
</component>

4
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,4 @@
## Code of Conduct
This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_dev_Compiler.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_dev_Compiler&branch_Kotlin_dev=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
# Kotlin Programming Language
@@ -15,7 +15,7 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Forum](https://discuss.kotlinlang.org/)
* [Kotlin Blog](https://blog.jetbrains.com/kotlin/)
* [Follow Kotlin on Twitter](https://twitter.com/kotlin)
* [Public Slack channel](http://slack.kotlinlang.org/)
* [Public Slack channel](https://slack.kotlinlang.org/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Editing Kotlin
@@ -41,7 +41,11 @@ For local development, if you're not working on bytecode generation or the stand
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
On Windows you might need to add long paths setting to the repo:
git config core.longpaths true
## Building
@@ -83,7 +87,7 @@ Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
### Building for different versions of IntelliJ IDEA and Android Studio
Kotlin plugin is indented to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting non-default platform.
Kotlin plugin is intended to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting non-default platform.
More detailed description of this scheme can be found at https://github.com/JetBrains/bunches/blob/master/ReadMe.md.
@@ -133,49 +137,4 @@ includeBuild('/path/to/kotlin') {
# Contributing
We love contributions! There's [lots to do on Kotlin](https://youtrack.jetbrains.com/issues/KT) and on the
[standard library](https://youtrack.jetbrains.com/issues/KT?q=%23Kotlin%20%23Unresolved%20and%20(links:%20KT-2554,%20KT-4089%20or%20%23Libraries)) so why not chat with us
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://slack.kotlinlang.org/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20and%20State:%20Open) which should find all open Kotlin issues that are marked as "up-for-grabs".
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
A nice gentle way to contribute would be to review the [standard library docs](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
and find classes or functions which are not documented very well and submit a patch.
In particular it'd be great if all functions included a nice example of how to use it such as for the
[`hashMapOf()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/1.1.0/libraries/stdlib/src/kotlin/collections/Maps.kt#L91)
macro to include code from a test function. The benefits of this approach are twofold; First, the API's documentation is improved via beneficial examples that help new users and second, the code coverage is increased.
Some of the code in the standard library is created by generating code from templates. See the [README](libraries/stdlib/ReadMe.md) in the stdlib section for how to run the code generator. The existing templates can be used as examples for creating new ones.
Also the [JavaScript back-end](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
If you want to contribute a new language feature, it is important to discuss it through a [KEEP](https://github.com/Kotlin/KEEP) first and get an approval from the language designers. This way you'll make sure your work will be in line with the overall language evolution plan and no other design decisions or considerations will block its acceptance.
## Submitting patches
The best way to submit a patch is to [fork the project on GitHub](https://help.github.com/articles/fork-a-repo/) and then send us a
[pull request](https://help.github.com/articles/creating-a-pull-request/) via [GitHub](https://github.com).
If you create your own fork, it might help to enable rebase by default
when you pull by executing
``` bash
git config --global pull.rebase true
```
This will avoid your local repo having too many merge commits
which will help keep your pull request simple and easy to apply.
## Checklist
Before submitting the pull request, make sure that you can say "YES" to each point in this short checklist:
- You provided the link to the related issue(s) from YouTrack
- You made a reasonable amount of changes related only to the provided issues
- You can explain changes made in the pull request
- You ran the build locally and verified new functionality
- You ran related tests locally and they passed
- You do not have merge commits in the pull request
Please be sure to review Kotlin's [contributing guidelines](docs/contributing.md) to learn how to help the project.

View File

@@ -8,7 +8,7 @@ plugins {
dependencies {
compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader"))
compile(project(":kotlin-stdlib"))
compile(kotlinStdlib())
}
sourceSets {
@@ -17,9 +17,5 @@ sourceSets {
}
runtimeJar {
from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "$compilerManifestClassPath kotlin-preloader.jar")
manifest.attributes["Class-Path"] = "$compilerManifestClassPath kotlin-preloader.jar"
}
dist()

View File

@@ -129,7 +129,7 @@ class KotlinCompilerAdapter : Javac13() {
}
companion object {
private val KOTLIN_EXTENSIONS = Arrays.asList("kt", "kts")
private val KOTLIN_EXTENSIONS = listOf("kt", "kts")
private fun filterOutKotlinSources(files: Array<File>): Array<File> {
return files.filterNot {

View File

@@ -14,14 +14,14 @@ dependencies {
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(project(":kotlin-reflect-api"))
testCompileOnly(project(":compiler:cli-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(project(":kotlin-stdlib"))
testCompile(kotlinStdlib())
testCompileOnly(intellijDep()) { includeJars("openapi") }
testRuntime(project(":kotlin-reflect"))
@@ -32,12 +32,12 @@ sourceSets {
"test" { projectDefault() }
}
publish()
runtimeJar()
sourcesJar()
javadocJar()
testsJar()
projectTest()
publish()
projectTest(parallel = true)

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.build

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.build

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.build

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.build

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
@@ -25,6 +24,7 @@ import kotlin.reflect.KVisibility;
import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
@@ -60,7 +60,7 @@ public class ArgumentUtils {
@NotNull List<String> result
) throws IllegalAccessException, InstantiationException, InvocationTargetException {
for (KProperty1 property : KClasses.getMemberProperties(clazz)) {
Argument argument = ContainerUtil.findInstance(property.getAnnotations(), Argument.class);
Argument argument = findInstance(property.getAnnotations(), Argument.class);
if (argument == null) continue;
if (property.getVisibility() != KVisibility.PUBLIC) continue;
@@ -90,4 +90,14 @@ public class ArgumentUtils {
}
}
}
@Nullable
private static <T> T findInstance(Iterable<? super T> iterable, Class<T> clazz) {
for (Object item : iterable) {
if (clazz.isInstance(item)) {
return clazz.cast(item);
}
}
return null;
}
}

View File

@@ -16,15 +16,15 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class OutputItemsCollectorImpl implements OutputItemsCollector {
private final List<SimpleOutputItem> outputs = ContainerUtil.newArrayList();
private final List<SimpleOutputItem> outputs = new ArrayList<>();
@Override
public void add(Collection<File> sourceFiles, File outputFile) {

View File

@@ -45,7 +45,10 @@ interface IncrementalCacheCommon {
/**
* Incremental cache common for JVM and JS for specifit ClassName type
*/
abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
abstract class AbstractIncrementalCache<ClassName>(
workingDir: File,
protected val pathConverter: FileToPathConverter
) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
companion object {
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
@@ -70,17 +73,16 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile, pathConverter))
internal abstract val sourceToClassesMap: AbstractSourceToOutputMap<ClassName>
internal abstract val dirtyOutputClassesMap: AbstractDirtyClassesMap<ClassName>
/**
* A file X is a complementary to a file Y if they contain corresponding expect/actual declarations.
* Complementary files should be compiled together during IC so the compiler does not complain
* about missing parts.
* TODO: provide a better solution (maintain an index of expect/actual declarations akin to IncrementalPackagePartProvider)
*/
private val complementaryFilesMap = registerMap(FilesMap(COMPLEMENTARY_FILES.storageFile))
private val complementaryFilesMap = registerMap(ComplementarySourceFilesMap(COMPLEMENTARY_FILES.storageFile, pathConverter))
override fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
@@ -153,14 +155,17 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(storageFile: File) :
protected class ClassFqNameToSourceMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
storage[fqName.asString()] = pathConverter.toPath(sourceFile)
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
storage[fqName.asString()]?.let(pathConverter::toFile)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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

View File

@@ -1,17 +1,6 @@
/*
* Copyright 2010-2016 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.
* Copyright 2010-2019 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
@@ -21,14 +10,10 @@ import java.io.File
interface ICReporter {
fun report(message: () -> String)
fun reportVerbose(message: () -> String)
// used in Gradle plugin
@Suppress("unused")
fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {}
fun pathsAsString(files: Iterable<File>): String =
files.joinToString { it.canonicalPath }
fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
}
fun reportCompileIteration(incremental: Boolean, sourceFiles: Collection<File>, exitCode: ExitCode)
fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String)
fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String)
fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String)
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2010-2019 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 java.io.File
abstract class ICReporterBase(private val pathsBase: File? = null) : ICReporter {
override fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String) {
reportMarkDirty(affectedFiles, "dirty class $classFqName")
}
override fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String) {
reportMarkDirty(affectedFiles, "dirty member $scope#$name")
}
override fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String) {
affectedFiles.forEach { file ->
reportVerbose { "${pathsAsString(file)} is marked dirty: $reason" }
}
}
protected fun relativizeIfPossible(files: Iterable<File>): List<File> =
files.map { it.relativeOrCanonical() }
protected fun pathsAsString(files: Iterable<File>): String =
relativizeIfPossible(files).map { it.path }.sorted().joinToString()
protected fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
protected fun File.relativeOrCanonical(): File =
pathsBase?.let { relativeToOrNull(it) } ?: canonicalFile
}

View File

@@ -19,10 +19,7 @@ package org.jetbrains.kotlin.incremental
import com.intellij.util.io.DataExternalizer
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
import org.jetbrains.kotlin.incremental.storage.BasicStringMap
import org.jetbrains.kotlin.incremental.storage.DirtyClassesFqNameMap
import org.jetbrains.kotlin.incremental.storage.SourceToFqNameMap
import org.jetbrains.kotlin.incremental.storage.StringToLongMapExternalizer
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
import org.jetbrains.kotlin.metadata.deserialization.getExtensionOrNull
@@ -30,25 +27,31 @@ import org.jetbrains.kotlin.metadata.js.JsProtoBuf
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.parentOrNull
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
import java.io.DataInput
import java.io.DataOutput
import java.io.File
open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName>(cachesDir) {
open class IncrementalJsCache(
cachesDir: File,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<FqName>(cachesDir, pathConverter) {
companion object {
private val TRANSLATION_RESULT_MAP = "translation-result"
private val INLINE_FUNCTIONS = "inline-functions"
private val HEADER_FILE_NAME = "header.meta"
private const val TRANSLATION_RESULT_MAP = "translation-result"
private const val INLINE_FUNCTIONS = "inline-functions"
private const val HEADER_FILE_NAME = "header.meta"
private const val PACKAGE_META_FILE = "packages-meta"
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesFqNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
private val translationResults = registerMap(TranslationResultMap(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 dirtySources = hashSetOf<File>()
@@ -63,6 +66,12 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
}
override fun markDirty(removedAndCompiledSources: Collection<File>) {
removedAndCompiledSources.forEach { sourceFile ->
// The common prefix of all FQN parents has to be the file package
sourceToClassesMap[sourceFile].map { it.parentOrNull()?.asString() ?: "" }.minBy { it.length }?.let {
packageMetadata.remove(it)
}
}
super.markDirty(removedAndCompiledSources)
dirtySources.addAll(removedAndCompiledSources)
}
@@ -72,7 +81,7 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
for ((srcFile, data) in translatedFiles) {
dirtySources.remove(srcFile)
val (binaryMetadata, binaryAst) = data
val (binaryMetadata, binaryAst, inlineData) = data
val oldProtoMap = translationResults[srcFile]?.metadata?.let { getProtoData(srcFile, it) } ?: emptyMap()
val newProtoMap = getProtoData(srcFile, binaryMetadata)
@@ -89,12 +98,16 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
changesCollector.collectProtoChanges(oldProtoMap[classId], newProtoMap[classId])
}
translationResults.put(srcFile, binaryMetadata, binaryAst)
translationResults.put(srcFile, binaryMetadata, binaryAst, inlineData)
}
for ((srcFile, inlineDeclarations) in incrementalResults.inlineFunctions) {
inlineFunctions.process(srcFile, inlineDeclarations, changesCollector)
}
for ((packageName, metadata) in incrementalResults.packageMetadata) {
packageMetadata.put(packageName, metadata)
}
}
private fun registerOutputForFile(srcFile: File, name: FqName) {
@@ -113,14 +126,20 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
}
fun nonDirtyPackageParts(): Map<File, TranslationResultValue> =
hashMapOf<File, TranslationResultValue>().apply {
for (path in translationResults.keys()) {
val file = File(path)
if (file !in dirtySources) {
put(file, translationResults[path]!!)
}
hashMapOf<File, TranslationResultValue>().apply {
for (file in translationResults.keys()) {
if (file !in dirtySources) {
put(file, translationResults[file]!!)
}
}
}
fun packageMetadata(): Map<String, ByteArray> = hashMapOf<String, ByteArray>().apply {
for (fqNameString in packageMetadata.keys()) {
put(fqNameString, packageMetadata[fqNameString]!!)
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -130,6 +149,9 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
output.writeInt(value.binaryAst.size)
output.write(value.binaryAst)
output.writeInt(value.inlineData.size)
output.write(value.inlineData)
}
override fun read(input: DataInput): TranslationResultValue {
@@ -141,39 +163,46 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
val binaryAst = ByteArray(binaryAstSize)
input.readFully(binaryAst)
return TranslationResultValue(metadata = metadata, binaryAst = binaryAst)
val inlineDataSize = input.readInt()
val inlineData = ByteArray(inlineDataSize)
input.readFully(inlineData)
return TranslationResultValue(metadata = metadata, binaryAst = binaryAst, inlineData = inlineData)
}
}
private class TranslationResultMap(storageFile: File) : BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
private class TranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}"
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
fun put(file: File, newMetadata: ByteArray, newBinaryAst: ByteArray) {
storage[file.canonicalPath] = TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst)
fun put(sourceFile: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[pathConverter.toPath(sourceFile)] =
TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
}
operator fun get(file: File): TranslationResultValue? =
storage[file.canonicalPath]
operator fun get(sourceFile: File): TranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
operator fun get(key: String): TranslationResultValue? =
storage[key]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
fun keys(): Collection<String> =
storage.keys
fun remove(file: File, changesCollector: ChangesCollector) {
val protoBytes = storage[file.canonicalPath]!!.metadata
val protoMap = getProtoData(file, protoBytes)
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
val protoMap = getProtoData(sourceFile, protoBytes)
for ((_, protoData) in protoMap) {
changesCollector.collectProtoChanges(oldData = protoData, newData = null)
}
storage.remove(file.canonicalPath)
storage.remove(path)
}
}
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, JsSerializerProtocol.extensionRegistry)
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
@@ -192,15 +221,17 @@ fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData>
return classes
}
private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private class InlineFunctionsMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
fun process(srcFile: File, newMap: Map<String, Long>, changesCollector: ChangesCollector) {
val key = srcFile.canonicalPath
val key = pathConverter.toPath(srcFile)
val oldMap = storage[key] ?: emptyMap()
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
@@ -212,9 +243,40 @@ private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String,
}
fun remove(sourceFile: File) {
storage.remove(sourceFile.canonicalPath)
storage.remove(pathConverter.toPath(sourceFile))
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
value.dumpMap { java.lang.Long.toHexString(it) }
}
private object ByteArrayExternalizer : DataExternalizer<ByteArray> {
override fun save(output: DataOutput, value: ByteArray) {
output.writeInt(value.size)
output.write(value)
}
override fun read(input: DataInput): ByteArray {
val size = input.readInt()
val array = ByteArray(size)
input.readFully(array)
return array
}
}
private class PackageMetadataMap(storageFile: File) : BasicStringMap<ByteArray>(storageFile, ByteArrayExternalizer) {
fun put(packageName: String, newMetadata: ByteArray) {
storage[packageName] = newMetadata
}
fun remove(packageName: String) {
storage.remove(packageName)
}
fun keys() = storage.keys
operator fun get(packageName: String) = storage[packageName]
override fun dumpValue(value: ByteArray): String = "Package metadata: ${value.md5()}"
}

View File

@@ -43,8 +43,12 @@ val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalJvmCache(
private val targetDataRoot: File,
targetOutputDir: File?
) : AbstractIncrementalCache<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
targetOutputDir: File?,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<JvmClassName>(
workingDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME),
pathConverter = pathConverter
), IncrementalCache {
companion object {
private val PROTO_MAP = "proto"
private val CONSTANTS_MAP = "constants"
@@ -58,7 +62,7 @@ open class IncrementalJvmCache(
private val MODULE_MAPPING_FILE_NAME = "." + ModuleMapping.MAPPING_FILE_EXT
}
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesJvmNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val protoMap = registerMap(ProtoMap(PROTO_MAP.storageFile))
@@ -68,7 +72,8 @@ open class IncrementalJvmCache(
private val partToMultifileFacade = registerMap(MultifileClassPartMap(MULTIFILE_CLASS_PARTS.storageFile))
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
// todo: try to use internal names only?
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile, pathConverter))
// gradle only
private val javaSourcesProtoMap = registerMap(JavaSourcesProtoMap(JAVA_SOURCES_PROTO_MAP.storageFile))
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory" } }
@@ -350,7 +355,7 @@ open class IncrementalJvmCache(
private fun getConstantsMap(bytes: ByteArray): Map<String, Any> {
val result = HashMap<String, Any>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE
if (value != null && access and staticFinal == Opcodes.ACC_STATIC or Opcodes.ACC_FINAL) {
@@ -440,14 +445,16 @@ open class IncrementalJvmCache(
override fun dumpValue(value: String): String = value
}
inner class InternalNameToSourcesMap(storageFile: File) :
BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Iterable<File>) {
storage[internalName] = sourceFiles.map { it.canonicalPath }
inner class InternalNameToSourcesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Collection<File>) {
storage[internalName] = pathConverter.toPaths(sourceFiles)
}
operator fun get(internalName: String): Collection<File> =
(storage[internalName] ?: emptyList()).map(::File)
pathConverter.toFiles(storage[internalName] ?: emptyList())
fun remove(internalName: String) {
storage.remove(internalName)
@@ -470,7 +477,7 @@ open class IncrementalJvmCache(
val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitMethod(
access: Int,
name: String,
@@ -478,9 +485,9 @@ open class IncrementalJvmCache(
signature: String?,
exceptions: Array<out String>?
): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
val dummyClassWriter = ClassWriter(Opcodes.API_VERSION)
return object : MethodVisitor(Opcodes.ASM5, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
return object : MethodVisitor(Opcodes.API_VERSION, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
override fun visitEnd() {
val jvmName = name + desc
if (jvmName !in inlineFunctions) return

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2000-2018 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 java.io.File
import java.io.Serializable
data class IncrementalModuleEntry(
private val projectPath: String,
val name: String,
val buildDir: File,
val buildHistoryFile: File
) : Serializable {
companion object {
private const val serialVersionUID = 0L
}
}
class IncrementalModuleInfo(
val projectRoot: File,
val dirToModule: Map<File, IncrementalModuleEntry>,
val nameToModules: Map<String, Set<IncrementalModuleEntry>>,
val jarToClassListFile: Map<File, File>,
// only for js and mpp
val jarToModule: Map<File, IncrementalModuleEntry>
) : Serializable {
companion object {
private const val serialVersionUID = 0L
}
}

View File

@@ -71,7 +71,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
override fun serializeProperty(
descriptor: PropertyDescriptor,
proto: ProtoBuf.Property.Builder,
versionRequirementTable: MutableVersionRequirementTable,
versionRequirementTable: MutableVersionRequirementTable?,
childSerializer: DescriptorSerializer
) {
super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)

View File

@@ -30,15 +30,18 @@ import java.io.IOException
import java.util.*
open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
open class LookupStorage(
targetDataDir: File,
pathConverter: FileToPathConverter
) : BasicMapsOwner(targetDataDir) {
companion object {
private val DELETED_TO_SIZE_TRESHOLD = 0.5
private val MINIMUM_GARBAGE_COLLECTIBLE_SIZE = 10000
}
private val countersFile = "counters".storageFile
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile))
private val fileToId = registerMap(FileToIdMap("file-to-id".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))
@Volatile
@@ -152,7 +155,7 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
size = 0
deletedCount = 0
for ((file, oldId) in oldFileToId.entries) {
for ((file, oldId) in oldFileToId.entries.sortedBy { it.key.path }) {
val newId = addFileIfNeeded(file)
oldIdToNewId[oldId] = newId
}
@@ -174,11 +177,19 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
flush(false)
}
@TestOnly fun dump(lookupSymbols: Set<LookupSymbol>, basePath: File? = null): String {
@TestOnly
fun dump(lookupSymbols: Set<LookupSymbol>): String {
flush(false)
val sb = StringBuilder()
val p = Printer(sb)
p.println("====== File to id map")
p.println(fileToId.dump())
p.println("====== Id to file map")
p.println(idToFile.dump())
val lookupsStrings = lookupSymbols.groupBy { LookupSymbolKey(it.name, it.scope) }
for (lookup in lookupMap.keys.sorted()) {
@@ -186,12 +197,11 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
val key = if (lookup in lookupsStrings) {
lookupsStrings[lookup]!!.map { "${it.scope}#${it.name}" }.sorted().joinToString(", ")
}
else {
} else {
lookup.toString()
}
val value = fileIds.map { idToFile[it]?.let { if (basePath == null) it.absolutePath else it.toRelativeString(basePath) } ?: it.toString() }.sorted().joinToString(", ")
val value = fileIds.map { it.toString() }.sorted().joinToString(", ")
p.println("$key -> $value")
}

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.JvmSourceRoot
@@ -31,8 +29,10 @@ import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.synthetic.SAM_LOOKUP_NAME
import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
import java.io.File
import java.util.*
import kotlin.collections.HashSet
const val DELETE_MODULE_FILE_PROPERTY = "kotlin.delete.module.file.after.build"
@@ -65,11 +65,23 @@ fun makeModuleFile(
friendDirs
)
val scriptFile = File.createTempFile("kjps", StringUtil.sanitizeJavaIdentifier(name) + ".script.xml")
FileUtil.writeToFile(scriptFile, builder.asText().toString())
val scriptFile = File.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml")
scriptFile.writeText(builder.asText().toString())
return scriptFile
}
private fun sanitizeJavaIdentifier(string: String) =
buildString {
for (char in string) {
if (char.isJavaIdentifierPart()) {
if (length == 0 && !char.isJavaIdentifierStart()) {
append('_')
}
append(char)
}
}
}
fun makeCompileServices(
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,
@@ -130,7 +142,7 @@ fun ChangesCollector.getDirtyData(
val dirtyClassesFqNames = HashSet<FqName>()
for (change in changes()) {
reporter.report { "Process $change" }
reporter.reportVerbose { "Process $change" }
if (change is ChangeInfo.SignatureChanged) {
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
@@ -143,8 +155,7 @@ fun ChangesCollector.getDirtyData(
val name = classFqName.shortName().identifier
dirtyLookupSymbols.add(LookupSymbol(name, scope))
}
}
else if (change is ChangeInfo.MembersChanged) {
} else if (change is ChangeInfo.MembersChanged) {
val fqNames = withSubtypes(change.fqName, caches)
// need to recompile subtypes because changed member might break override
dirtyClassesFqNames.addAll(fqNames)
@@ -161,16 +172,16 @@ fun ChangesCollector.getDirtyData(
}
fun mapLookupSymbolsToFiles(
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
for (lookup in lookupSymbols) {
val affectedFiles = lookupStorage.get(lookup).map(::File).filter { it !in excludes }
reporter.report { "${lookup.scope}#${lookup.name} caused recompilation of: ${reporter.pathsAsString(affectedFiles)}" }
reporter.reportMarkDirtyMember(affectedFiles, scope = lookup.scope, name = lookup.name)
dirtyFiles.addAll(affectedFiles)
}
@@ -183,19 +194,22 @@ fun mapClassesFqNamesToFiles(
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
val fqNameToAffectedFiles = HashMap<FqName, MutableSet<File>>()
for (cache in caches) {
for (dirtyClassFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(dirtyClassFqName)
for (classFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(classFqName)
if (srcFile == null || srcFile in excludes || srcFile.isJavaFile()) continue
reporter.report { ("Class $dirtyClassFqName caused recompilation of: ${reporter.pathsAsString(srcFile)}") }
dirtyFiles.add(srcFile)
fqNameToAffectedFiles.getOrPut(classFqName) { HashSet() }.add(srcFile)
}
}
return dirtyFiles
for ((classFqName, affectedFiles) in fqNameToAffectedFiles) {
reporter.reportMarkDirtyClass(affectedFiles, classFqName.asString())
}
return fqNameToAffectedFiles.values.flattenTo(HashSet())
}
fun withSubtypes(

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.js
@@ -18,4 +18,7 @@ class IncrementalDataProviderFromCache(private val cache: IncrementalJsCache) :
override val metadataVersion: IntArray
get() = JsMetadataVersion.INSTANCE.toArray() // TODO: store and load correct metadata version
override val packageMetadata: Map<String, ByteArray>
get() = cache.packageMetadata()
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2010-2018 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 ComplementarySourceFilesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, complementaryFiles: Collection<File>) {
storage[pathConverter.toPath(sourceFile)] = pathConverter.toPaths(complementaryFiles)
}
operator fun get(sourceFile: File): Collection<File> {
val paths = storage[pathConverter.toPath(sourceFile)].orEmpty()
return pathConverter.toFiles(paths)
}
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(pathConverter.toPath(file)) }
}

View File

@@ -18,26 +18,27 @@ package org.jetbrains.kotlin.incremental.storage
import java.io.File
internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescriptor, IntExternalizer) {
override fun dumpKey(key: File): String = key.toString()
internal class FileToIdMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Int>(file, IntExternalizer) {
override fun dumpValue(value: Int): String = value.toString()
operator fun get(file: File): Int? = storage[file]
operator fun get(file: File): Int? = storage[pathConverter.toPath(file)]
operator fun set(file: File, id: Int) {
storage[file] = id
storage[pathConverter.toPath(file)] = id
}
fun remove(file: File) {
storage.remove(file)
storage.remove(pathConverter.toPath(file))
}
fun toMap(): Map<File, Int> {
val result = HashMap<File, Int>()
for (key in storage.keys) {
val value = storage[key] ?: continue
result[key] = value
result[pathConverter.toFile(key)] = value
}
return result
}

View File

@@ -0,0 +1,25 @@
/*
* Copyright 2010-2019 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 java.io.File
interface FileToPathConverter {
fun toPath(file: File): String
fun toFile(path: String): File
}
fun FileToPathConverter.toPaths(files: Collection<File>): List<String> =
files.map { toPath(it) }
fun FileToPathConverter.toFiles(paths: Collection<String>): List<File> =
paths.map { toFile(it) }
object FileToCanonicalPathConverter : FileToPathConverter {
override fun toPath(file: File): String = file.canonicalPath
override fun toFile(path: String): File = File(path)
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. 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 FilesMap(storageFile: File)
: BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, outputFiles: Collection<File>) {
storage[sourceFile.absolutePath] = outputFiles.map { it.absolutePath }
}
operator fun get(sourceFile: File): Collection<File> =
storage[sourceFile.absolutePath].orEmpty().map(::File)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(file.absolutePath) }
}

View File

@@ -16,20 +16,24 @@
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.ExternalIntegerKeyDescriptor
import java.io.File
internal class IdToFileMap(file: File) : BasicMap<Int, File>(file, ExternalIntegerKeyDescriptor(), FileKeyDescriptor) {
internal class IdToFileMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicMap<Int, String>(file, ExternalIntegerKeyDescriptor(), EnumeratorStringDescriptor.INSTANCE) {
override fun dumpKey(key: Int): String = key.toString()
override fun dumpValue(value: File): String = value.toString()
override fun dumpValue(value: String): String = value
operator fun get(id: Int): File? = storage[id]
operator fun get(id: Int): File? = storage[id]?.let { pathConverter.toFile(it) }
operator fun contains(id: Int): Boolean = id in storage
operator fun set(id: Int, file: File) {
storage[id] = file
storage[id] = pathConverter.toPath(file)
}
fun remove(id: Int) {

View File

@@ -21,32 +21,40 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
internal class SourceToJvmNameMap(storageFile: File) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile)
internal class SourceToFqNameMap(storageFile: File) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile)
internal class SourceToJvmNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile, pathConverter)
internal class SourceToFqNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile, pathConverter)
internal abstract class AbstractSourceToOutputMap<Name>(
private val nameTransformer: NameTransformer<Name>,
storageFile: File
private val nameTransformer: NameTransformer<Name>,
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(sourceFile.absolutePath)
remove(pathConverter.toPath(sourceFile))
}
fun add(sourceFile: File, className: Name) {
storage.append(sourceFile.absolutePath, nameTransformer.asString(className))
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
}
fun contains(sourceFile: File): Boolean =
sourceFile.absolutePath in storage
pathConverter.toPath(sourceFile) in storage
operator fun get(sourceFile: File): Collection<Name> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asName)
fun getFqNames(sourceFile: File): Collection<FqName> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asFqName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asFqName)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)

View File

@@ -177,20 +177,6 @@ object PathStringDescriptor : EnumeratorStringDescriptor() {
override fun isEqual(val1: String, val2: String?) = FileUtil.pathsEqual(val1, val2)
}
object FileKeyDescriptor : KeyDescriptor<File> {
override fun read(input: DataInput): File = File(input.readUTF())
override fun save(output: DataOutput, value: File) {
output.writeUTF(value.canonicalPath)
}
override fun getHashCode(value: File?): Int =
FileUtil.FILE_HASHING_STRATEGY.computeHashCode(value)
override fun isEqual(val1: File?, val2: File?): Boolean =
FileUtil.FILE_HASHING_STRATEGY.equals(val1, val2)
}
open class CollectionExternalizer<T>(
private val elementExternalizer: DataExternalizer<T>,
private val newCollection: () -> MutableCollection<T>

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.modules
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.openapi.util.text.StringUtil.escapeXml
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser.*
import org.jetbrains.kotlin.config.IncrementalCompilation
@@ -137,6 +135,13 @@ class KotlinModuleXmlBuilder {
}
private fun getEscapedPath(sourceFile: File): String {
return escapeXml(toSystemIndependentName(sourceFile.path))
return escapeXml(sourceFile.invariantSeparatorsPath)
}
private companion object {
private val xmlEscapeReplacement = mapOf("<" to "&lt;", ">" to "&gt;", "&" to "&amp;", "'" to "&#39;", "\"" to "&quot;")
private val xmlEscapeRegex = Regex(xmlEscapeReplacement.keys.joinToString("|", "(?:", ")") { Regex.escape(it) })
private fun escapeXml(string: String) = string.replace(xmlEscapeRegex) { xmlEscapeReplacement.getValue(it.value) }
}
}

View File

@@ -205,7 +205,7 @@ private fun kjsmToString(kjsmFile: File): String {
}
private fun sourceMapFileToString(sourceMapFile: File, generatedJsFile: File): String {
val sourceMapParseResult = SourceMapParser.parse(StringReader(sourceMapFile.readText()))
val sourceMapParseResult = SourceMapParser.parse(sourceMapFile.readText())
return when (sourceMapParseResult) {
is SourceMapSuccess -> {
val bytesOut = ByteArrayOutputStream()

View File

@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import java.io.File
import java.util.*
import kotlin.math.max
private val COMMANDS = listOf("new", "touch", "delete")
private val COMMANDS_AS_REGEX_PART = COMMANDS.joinToString("|")
@@ -166,7 +167,7 @@ class TouchFile(path: String, private val touchPolicy: TouchPolicy) : Modificati
TouchPolicy.TIMESTAMP -> {
val oldLastModified = file.lastModified()
//Mac OS and some versions of Linux truncate timestamp to nearest second
file.setLastModified(Math.max(System.currentTimeMillis(), oldLastModified + 1000))
file.setLastModified(max(System.currentTimeMillis(), oldLastModified + 1000))
}
TouchPolicy.CHECKSUM -> {
file.appendText(" ")

View File

@@ -2643,7 +2643,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
boolean hasArrayDimensionCount();
@@ -2657,7 +2659,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
int getArrayDimensionCount();
@@ -3220,7 +3224,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -3236,7 +3242,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4365,7 +4373,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -4381,7 +4391,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4397,7 +4409,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder setArrayDimensionCount(int value) {
@@ -4416,7 +4430,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder clearArrayDimensionCount() {

View File

@@ -4613,7 +4613,7 @@ public final class DebugJvmProtoBuf {
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
*
* <pre>
* If absent, assumed to be JvmAbi.DEFAULT_MODULE_NAME
* If absent, assumed to be "main" (JvmProtoBufUtil.DEFAULT_MODULE_NAME)
* </pre>
*/
public static final

View File

@@ -1,23 +1,25 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import java.util.*
import java.io.File
import org.gradle.api.tasks.bundling.Jar
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
import proguard.gradle.ProGuardTask
import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.20-dev-1708", onlySuccessBootstrap = false))
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.50-dev-526", onlySuccessBootstrap = false))
repositories.withRedirector(project) {
repositories {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
} else {
maven("https://plugins.gradle.org/m2")
}
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
@@ -30,15 +32,16 @@ buildscript {
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:5.3.3")
classpath("net.sf.proguard:proguard-gradle:6.1.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
}
}
plugins {
`build-scan` version "1.15"
`build-scan`
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
}
pill {
@@ -56,11 +59,11 @@ buildScan {
}
val configuredJdks: List<JdkId> =
getConfiguredJdks().also {
it.forEach {
logger.info("Using ${it.majorVersion} home: ${it.homeDir}")
}
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)
@@ -75,19 +78,7 @@ allprojects {
extra["kotlin_root"] = rootDir
val cidrKotlinPlugin by configurations.creating
val appcodeKotlinPlugin by configurations.creating
val clionKotlinPlugin by configurations.creating
val includeCidr by extra(project.getBooleanProperty("cidrPluginsEnabled") ?: false)
dependencies {
if (includeCidr) {
cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
appcodeKotlinPlugin(project(":prepare:appcode-plugin", "runtimeJar"))
clionKotlinPlugin(project(":prepare:clion-plugin", "runtimeJar"))
}
}
val jpsBootstrap by configurations.creating
val commonBuildDir = File(rootDir, "build")
val distDir by extra("$rootDir/dist")
@@ -96,13 +87,20 @@ val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val clionSandboxDir = "$commonLocalDataDir/clionSandbox"
val appcodeSandboxDir = "$commonLocalDataDir/appcodeSandbox"
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
val cidrPluginDir = "$distDir/artifacts/cidrPlugin/Kotlin"
val appcodePluginDir = "$distDir/artifacts/appcodePlugin/Kotlin"
val clionPluginDir = "$distDir/artifacts/clionPlugin/Kotlin"
val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
extra["ktorExcludesForDaemon"] = listOf(
"org.jetbrains.kotlin" to "kotlin-reflect",
"org.jetbrains.kotlin" to "kotlin-stdlib",
"org.jetbrains.kotlin" to "kotlin-stdlib-common",
"org.jetbrains.kotlin" to "kotlin-stdlib-jdk8",
"org.jetbrains.kotlin" to "kotlin-stdlib-jdk7",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-jdk8",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-core",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-core-common"
)
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
@@ -110,13 +108,8 @@ extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["clionSandboxDir"] = project.file(ideaSandboxDir)
extra["appcodeSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["cidrPluginDir"] = project.file(cidrPluginDir)
extra["appcodePluginDir"] = project.file(appcodePluginDir)
extra["clionPluginDir"] = project.file(clionPluginDir)
extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
@@ -138,20 +131,33 @@ fun checkJDK() {
if (jdkChecked) {
return
}
var unpresentJdks = JdkMajorVersion.values().filter { it.isMandatory() }.map { it -> it.name }.filter { it == null || extra[it] == jdkNotFoundConst }.toList()
if (!unpresentJdks.isEmpty()) {
throw GradleException("Please set environment variable${if (unpresentJdks.size > 1) "s" else ""}: ${unpresentJdks.joinToString()} to point to corresponding JDK installation.")
val unpresentJdks = JdkMajorVersion.values()
.filter { it.isMandatory() }
.map { it.name }
.filter { extra[it] == jdkNotFoundConst }
.toList()
if (unpresentJdks.isNotEmpty()) {
throw GradleException("Please set environment variable" +
(if (unpresentJdks.size > 1) "s" else "") +
": " + unpresentJdks.joinToString() +
" to point to corresponding JDK installation.")
}
jdkChecked = true
}
rootProject.apply {
from(rootProject.file("versions.gradle.kts"))
from(rootProject.file("report.gradle.kts"))
from(rootProject.file("gradle/versions.gradle.kts"))
from(rootProject.file("gradle/report.gradle.kts"))
from(rootProject.file("gradle/javaInstrumentation.gradle.kts"))
from(rootProject.file("gradle/jps.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(this)
extra["versions.protobuf-java"] = "2.6.1"
extra["versions.protobuf"] = "2.6.1"
extra["versions.javax.inject"] = "1"
extra["versions.jsr305"] = "1.3.9"
extra["versions.jansi"] = "1.16"
@@ -160,8 +166,9 @@ extra["versions.junit"] = "4.12"
extra["versions.javaslang"] = "2.0.6"
extra["versions.ant"] = "1.8.2"
extra["versions.android"] = "2.3.1"
extra["versions.kotlinx-coroutines-core"] = "1.0.1"
extra["versions.kotlinx-coroutines-jdk8"] = "1.0.1"
val coroutinesVersion = if (Platform[192].orHigher()) "1.2.1" else "1.1.1"
extra["versions.kotlinx-coroutines-core"] = coroutinesVersion
extra["versions.kotlinx-coroutines-jdk8"] = coroutinesVersion
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
@@ -171,105 +178,114 @@ extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild
// NOTE: please, also change KTOR_NAME in pathUtil.kt and all versions in corresponding jar names in daemon tests.
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.3.50-dev-11052"
}
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
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 intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
extra["intellijUltimateEnabled"] = intellijUltimateEnabled
extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf("annotations",
if (Platform[191].orHigher()) "asm-all-7.0" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java",
"streamex",
"trove4j")
listOf(
if (Platform[191].orHigher()) "asm-all-7.0.1" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
)
extra["compilerModules"] = arrayOf(
":compiler:util",
":compiler:container",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
*if (project.findProperty("fir.enabled") == "true") {
arrayOf(
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir"
)
} else {
emptyArray()
},
":compiler:frontend",
":compiler:frontend.java",
":compiler:frontend.script",
":compiler:cli-common",
":compiler:daemon-common",
":compiler:daemon",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.js",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:cli",
":compiler:incremental-compilation-impl",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime"
":compiler:util",
":compiler:container",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:cli-common",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":kotlin-util-io",
":kotlin-util-klib",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:cli",
":compiler:cli-js",
":compiler:incremental-compilation-impl",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime",
":core:type-system",
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:fir2ir",
":compiler:fir:java"
)
val coreLibProjects = listOf(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-reflect"
val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
// Local builds are disabled at the request of the lib team
// TODO: Enable when tests are fixed
":kotlin-stdlib-js-ir".takeIf { isTeamcityBuild },
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-reflect"
)
val gradlePluginProjects = listOf(
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
// ":kotlin-gradle-plugin-integration-tests", // TODO: build fails
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
)
apply {
@@ -298,28 +314,29 @@ val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toSt
allprojects {
jvmTarget = defaultJvmTarget
if (defaultJavaHome != null) {
javaHome = defaultJavaHome
} else {
logger.error("Could not find default java home. Please set environment variable JDK_${defaultJavaHome} to point to JDK ${defaultJavaHome} installation.")
}
configurations.maybeCreate("embedded")
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
// - 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 {
intellijSdkRepo(project)
androidDxJarRepo(project)
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
jcenter()
maven(protobufRepo)
maven(intellijRepo)
maven("https://dl.bintray.com/kotlin/ktor")
maven("https://kotlin.bintray.com/kotlin-dependencies")
bootstrapKotlinRepo?.let(::maven)
internalKotlinRepo?.let(::maven)
}
configureJvmProject(javaHome!!, jvmTarget!!)
@@ -327,6 +344,7 @@ allprojects {
val commonCompilerArgs = listOfNotNull(
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
)
@@ -352,10 +370,6 @@ allprojects {
enabled = false
}
task<Jar>("javadocJar") {
classifier = "javadoc"
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
@@ -375,21 +389,30 @@ allprojects {
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
fun FileCollection.printClassPath(role: String) =
println("${project.path} $role classpath:\n ${joinToString("\n ") { it.toProjectRootRelativePathOrSelf() } }")
println("${project.path} $role classpath:\n ${joinToString("\n ") { it.toProjectRootRelativePathOrSelf() }}")
try { javaPluginConvention() } catch (_: UnknownDomainObjectException) { null }?.let { javaConvention ->
try {
javaPluginConvention()
} catch (_: UnknownDomainObjectException) {
null
}?.let { javaConvention ->
task("printCompileClasspath") { doFirst { javaConvention.sourceSets["main"].compileClasspath.printClassPath("compile") } }
task("printRuntimeClasspath") { doFirst { javaConvention.sourceSets["main"].runtimeClasspath.printClassPath("runtime") } }
task("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } }
task("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } }
}
run configureCompilerClasspath@ {
run configureCompilerClasspath@{
val bootstrapCompilerClasspath by rootProject.buildscript.configurations
configurations.findByName("kotlinCompilerClasspath")?.let {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
}
// Aggregate task for build related checks
tasks.register("checkBuild")
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
}
}
@@ -414,13 +437,8 @@ gradle.taskGraph.whenReady {
}
}
val dist by task<Copy> {
val childDistTasks = getTasksByName("dist", true) - this@task
dependsOn(childDistTasks)
into(distDir)
from(files("compiler/cli/bin")) { into("kotlinc/bin") }
from(files("license")) { into("kotlinc/license") }
val dist = tasks.register("dist") {
dependsOn(":kotlin-compiler:dist")
}
val copyCompilerToIdeaPlugin by task<Copy> {
@@ -431,8 +449,7 @@ val copyCompilerToIdeaPlugin by task<Copy> {
val ideaPlugin by task<Task> {
dependsOn(copyCompilerToIdeaPlugin)
val childIdeaPluginTasks = getTasksByName("ideaPlugin", true) - this@task
dependsOn(childIdeaPluginTasks)
dependsOn(":prepare:idea-plugin:ideaPlugin")
}
tasks {
@@ -445,28 +462,30 @@ tasks {
create("cleanupArtifacts") {
doLast {
delete(ideaPluginDir)
delete(ideaUltimatePluginDir)
delete(cidrPluginDir)
delete(appcodePluginDir)
delete(clionPluginDir)
delete(artifactsDir)
}
}
listOf("clean", "assemble", "install", "dist").forEach { taskName ->
create("coreLibs${taskName.capitalize()}") {
coreLibProjects.forEach { projectName -> dependsOn("$projectName:$taskName") }
}
}
create("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
)).forEach {
dependsOn(it + ":check")
dependsOn("$it:check")
}
}
create("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn(it + ":check")
dependsOn("$it:check")
}
}
@@ -476,10 +495,12 @@ tasks {
create("jvmCompilerTest") {
dependsOn("dist")
dependsOn(":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests")
dependsOn(
":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests"
)
dependsOn(":plugins:jvm-abi-gen:test")
}
@@ -488,15 +509,27 @@ tasks {
dependsOn(":js:js.tests:runMocha")
}
create("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:fir2ir:test")
}
create("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-jvm-host:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
dependsOn(":kotlin-scripting-jsr223-test:test")
dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
}
create("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("firCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
@@ -543,45 +576,59 @@ tasks {
create("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(":idea:idea-gradle:test",
":idea:idea-maven:test",
":j2k:test",
":eval4j:test")
dependsOn(
":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":nj2k:test",
":idea:jvm-debugger:jvm-debugger-core:test",
":idea:jvm-debugger:jvm-debugger-evaluation:test",
":idea:jvm-debugger:jvm-debugger-sequence:test",
":idea:jvm-debugger:eval4j:test"
)
}
create("idea-plugin-tests") {
dependsOn("dist")
dependsOn("idea-plugin-main-tests",
"idea-plugin-additional-tests")
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests"
)
}
create("android-ide-tests") {
dependsOn("dist")
dependsOn(":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test")
dependsOn(
":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test"
)
}
create("plugins-tests") {
dependsOn("dist")
dependsOn(":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-ide-plugin:test")
dependsOn(
":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-compiler-plugin:test",
":kotlinx-serialization-ide-plugin:test"
)
}
create("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
"idea-plugin-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
)
}
@@ -616,16 +663,27 @@ val zipCompiler by task<Zip> {
}
}
val zipStdlibTests by task<Zip> {
destinationDirectory.set(file(distDir))
archiveFileName.set("kotlin-stdlib-tests.zip")
from("libraries/stdlib/common/test") { into("common") }
from("libraries/stdlib/test") { into("test") }
doLast {
logger.lifecycle("Stdlib tests are packed to ${archiveFile.get()}")
}
}
val zipTestData by task<Zip> {
destinationDir = file(distDir)
archiveName = "kotlin-test-data.zip"
dependsOn(zipStdlibTests)
destinationDirectory.set(file(distDir))
archiveFileName.set("kotlin-test-data.zip")
isZip64 = true
from("compiler/testData") { into("compiler") }
from("idea/testData") { into("ide") }
from("idea/idea-completion/testData") { into("ide/completion") }
from("libraries/stdlib/common/test") { into("stdlib/common") }
from("libraries/stdlib/test") { into("stdlib/test") }
from("compiler/tests-common/tests/org/jetbrains/kotlin/coroutineTestUtil.kt") { into("compiler") }
doLast {
logger.lifecycle("Test data packed to $archivePath")
logger.lifecycle("Test data packed to ${archiveFile.get()}")
}
}
@@ -653,74 +711,14 @@ val zipPlugin by task<Zip> {
}
}
fun cidrPlugin(product: String, pluginDir: String) = tasks.creating(Copy::class.java) {
if (!includeCidr) {
throw GradleException("CIDR plugins require 'cidrPluginsEnabled' property turned on")
}
val prepareCidrPlugin = getTasksByName("cidrPlugin", true)
val prepareCurrentPlugin = (getTasksByName(product.toLowerCase() + "Plugin", true) - this)
prepareCurrentPlugin.forEach { it.mustRunAfter(prepareCidrPlugin) }
dependsOn(ideaPlugin)
dependsOn(prepareCidrPlugin)
dependsOn(prepareCurrentPlugin)
into(pluginDir)
from(ideaPluginDir) {
exclude("lib/kotlin-plugin.jar")
exclude("lib/android-lint.jar")
exclude("lib/android-ide.jar")
exclude("lib/android-output-parser-ide.jar")
exclude("lib/android-extensions-ide.jar")
exclude("lib/android-extensions-compiler.jar")
exclude("lib/kapt3-idea.jar")
exclude("lib/jps-ide.jar")
exclude("lib/jps/**")
exclude("kotlinc/**")
exclude("lib/maven-ide.jar")
}
from(cidrKotlinPlugin) { into("lib") }
from(configurations[product.toLowerCase() + "KotlinPlugin"]) { into("lib") }
}
fun zipCidrPlugin(product: String, productVersion: String) = tasks.creating(Zip::class.java) {
// Note: "cidrPluginVersion" has different format and semantics from "pluginVersion" used in IJ and AS plugins.
val cidrPluginVersion = project.findProperty("cidrPluginVersion") as String? ?: "beta-1"
val destPath = project.findProperty("pluginZipPath") as String?
?: "$distDir/artifacts/kotlin-plugin-$kotlinVersion-$product-$cidrPluginVersion-$productVersion.zip"
val destFile = File(destPath)
destinationDir = destFile.parentFile
archiveName = destFile.name
from(tasks[product.toLowerCase() + "Plugin"])
into("Kotlin")
setExecutablePermissions()
doLast {
logger.lifecycle("Plugin artifacts packed to $archivePath")
}
}
if (includeCidr) {
val appcodePlugin by cidrPlugin("AppCode", appcodePluginDir)
val appcodeVersion = extra["versions.appcode"] as String
val zipAppCodePlugin by zipCidrPlugin("AppCode", appcodeVersion)
val clionPlugin by cidrPlugin("CLion", clionPluginDir)
val clionVersion = extra["versions.clion"] as String
val zipCLionPlugin by zipCidrPlugin("CLion", clionVersion)
}
configure<IdeaModel> {
module {
excludeDirs = files(
project.buildDir,
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
project.buildDir,
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
).toSet()
}
}
@@ -728,7 +726,7 @@ configure<IdeaModel> {
fun jdkPath(version: String): String {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath?:jdkNotFoundConst
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath ?: jdkNotFoundConst
}
@@ -745,6 +743,7 @@ fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<KotlinCompile> {
kotlinOptions.jdkHome = javaHome
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.freeCompilerArgs += "-Xjvm-default=compatibility"
}
tasks.withType<Test> {
@@ -789,12 +788,3 @@ tasks.create("findShadowJarsInClasspath").doLast {
project.checkConfig("testCompileClasspath")
}
}
allprojects {
afterEvaluate {
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}

View File

@@ -1,15 +1,19 @@
import java.util.Properties
extra["versions.shadow"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val buildSrcKotlinVersion: String by extra(findProperty("buildSrc.kotlin.version")?.toString() ?: embeddedKotlinVersion)
val buildSrcKotlinRepo: String? by extra(findProperty("buildSrc.kotlin.repo") as String?)
extra["versions.shadow"] = "2.0.2"
extra["versions.native-platform"] = "0.14"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
} else {
jcenter()
}
buildSrcKotlinRepo?.let {
@@ -59,12 +63,15 @@ fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)
}
rootProject.apply {
from(rootProject.file("../versions.gradle.kts"))
from(rootProject.file("../gradle/versions.gradle.kts"))
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled by extra(project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild)
val flags = LocalBuildProperties(project)
val isTeamcityBuild = flags.isTeamcityBuild
val intellijUltimateEnabled by extra(flags.intellijUltimateEnabled)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
extra["intellijReleaseType"] = if (extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true)
"snapshots"
@@ -73,28 +80,29 @@ else
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build.custom.deps"
extra["customDepsOrg"] = "kotlin.build"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
}
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
jcenter()
extra["buildSrcKotlinRepo"]?.let {
maven(url = it)
}
jcenter()
}
dependencies {
compile(kotlin("stdlib", embeddedKotlinVersion))
compile("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}")
compile("com.jakewharton.dex:dex-method-list:3.0.0")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.ow2.asm:asm-all:6.0_BETA")
compile("org.jetbrains.intellij.deps:asm-all:7.0.1")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
}
samWithReceiver {
@@ -104,4 +112,39 @@ samWithReceiver {
fun Project.`samWithReceiver`(configure: org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverExtension.() -> Unit): Unit =
extensions.configure("samWithReceiver", configure)
tasks["build"].dependsOn(":prepare-deps:android-dx:build", ":prepare-deps:intellij-sdk:build")
tasks["build"].dependsOn(":prepare-deps:build")
allprojects {
tasks.register("checkBuild")
afterEvaluate {
apply(from = "$rootDir/../gradle/cacheRedirector.gradle.kts")
}
}
// TODO: hide these classes in special gradle plugin for kotlin-ultimate which will support local.properties
class LocalBuildPropertiesProvider(private val project: Project) {
private val localProperties: Properties = Properties()
val rootProjectDir: File = project.rootProject.rootDir.parentFile
init {
rootProjectDir.resolve("local.properties").takeIf { it.isFile }?.let {
it.reader().use(localProperties::load)
}
}
fun getString(name: String): String? = project.findProperty(name)?.toString() ?: localProperties[name]?.toString()
fun getBoolean(name: String): Boolean = getString(name)?.toBoolean() == true
}
class LocalBuildProperties(project: Project) {
val propertiesProvider = LocalBuildPropertiesProvider(project)
val isTeamcityBuild = propertiesProvider.getString("teamcity") != null || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled =
(propertiesProvider.getBoolean("intellijUltimateEnabled") || isTeamcityBuild)
&& propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
}

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -1,11 +0,0 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,11 +0,0 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -0,0 +1,8 @@
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,109 +0,0 @@
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
import org.gradle.jvm.tasks.Jar
val toolsOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "macosx"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
val buildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
val dxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
repositories {
ivy {
artifactPattern("https://dl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://android.googlesource.com/platform/dalvik/+archive/android-$dxSourcesVersion/[artifact].[ext]")
metadataSources {
artifact()
}
}
}
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val dxModuleName = "android-dx"
val dxRevision = buildToolsVersion
val dxRepoModuleDir = File(customDepsRepoDir, "$customDepsOrg/$dxModuleName/$dxRevision")
val buildToolsZip by configurations.creating
val dxSourcesTar by configurations.creating
dependencies {
buildToolsZip("google:build-tools:$buildToolsVersion:$toolsOs@zip")
dxSourcesTar("google:dx:0@tar.gz")
}
val unzipDxJar by tasks.creating {
dependsOn(buildToolsZip)
inputs.files(buildToolsZip)
outputs.files(File(dxRepoModuleDir, "dx.jar"))
doFirst {
project.copy {
from(zipTree(buildToolsZip.singleFile).files)
include("**/dx.jar")
into(dxRepoModuleDir)
}
}
}
val dxSourcesTargetDir = File(buildDir, "dx_src")
val untarDxSources by tasks.creating {
dependsOn(dxSourcesTar)
inputs.files(dxSourcesTar)
outputs.dir(dxSourcesTargetDir)
doFirst {
project.copy {
from(tarTree(dxSourcesTar.singleFile))
include("src/**")
includeEmptyDirs = false
into(dxSourcesTargetDir)
}
}
}
val prepareDxSourcesJar by tasks.creating(Jar::class) {
dependsOn(untarDxSources)
from("$dxSourcesTargetDir/src")
destinationDir = dxRepoModuleDir
baseName = "dx"
classifier = "sources"
}
val prepareIvyXml by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar)
inputs.files(unzipDxJar, prepareDxSourcesJar)
val ivyFile = File(dxRepoModuleDir, "$dxModuleName.ivy.xml")
outputs.file(ivyFile)
doLast {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, dxModuleName, dxRevision))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
addArtifact(FileBasedIvyArtifact(File(dxRepoModuleDir, "dx.jar"), DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)).also { it.conf = "default" })
addArtifact(FileBasedIvyArtifact(File(dxRepoModuleDir, "dx-sources.jar"), DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)).also { it.conf = "sources" })
writeTo(ivyFile)
}
}
}
val build by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar, prepareIvyXml)
}
val clean by tasks.creating(Delete::class) {
delete(dxRepoModuleDir)
delete(buildDir)
}

View File

@@ -0,0 +1,431 @@
@file:Suppress("PropertyName", "HasPlatformType", "UnstableApiUsage")
import org.gradle.internal.os.OperatingSystem
import java.io.Closeable
import java.io.FileWriter
import java.io.OutputStreamWriter
import java.net.URI
import java.text.SimpleDateFormat
import java.util.*
import javax.xml.stream.XMLOutputFactory
plugins {
base
}
val verifyDependencyOutput: Boolean by rootProject.extra
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
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
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("verifyDependencyOutput: $verifyDependencyOutput")
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
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 {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
url = URI("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease")
patternLayout {
artifact("[artifact]-[revision]-$androidStudioOs.[ext]")
}
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/")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val jpsStandalone by configurations.creating
val intellijCore by configurations.creating
val nodeJSPlugin by configurations.creating
/**
* Special repository for annotations.jar required for idea runtime only.
*
* See IntellijDependenciesKt.intellijRuntimeAnnotations for more details.
*/
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val customDepsRepoDir = rootProject.rootDir.parentFile.resolve("dependencies/repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
dependencies {
if (androidStudioRelease != null) {
val extension = if (androidStudioOs == "linux" && androidStudioRelease.startsWith("3.5"))
"tar.gz"
else
"zip"
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")
}
}
if (asmVersion != null) {
sources("org.jetbrains.intellij.deps:asm-all:$asmVersion:sources@jar")
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.creating(Copy::class.java) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
val targetDir = File(repoDir, "$intellijRuntimeAnnotations/$intellijVersion")
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doLast {
writeIvyXml(
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
)
}
}
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
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)
val buildNodeJsPlugin = buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") {
dependsOn(
makeIntellijCore,
makeIde,
buildJpsStandalone,
makeIntellijAnnotations
)
if (installIntellijUltimate) {
dependsOn(buildNodeJsPlugin)
}
}
// Task to delete legacy repo locations
tasks.create("cleanLegacy", Delete::class.java) {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}
tasks.named<Delete>("clean") {
delete(customDepsRepoDir)
}
fun buildIvyRepositoryTask(
configuration: Configuration,
organization: String,
repoDirectory: File,
pathRemap: ((String) -> String)? = null,
sources: File? = null
) = tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
fun ResolvedArtifact.moduleDirectory(): File =
File(repoDirectory, "$organization/${moduleVersion.id.name}/${moduleVersion.id.version}")
dependsOn(configuration)
inputs.files(configuration)
if (verifyDependencyOutput) {
outputs.dir(provider {
configuration.resolvedConfiguration.resolvedArtifacts.single().moduleDirectory()
})
} else {
outputs.upToDateWhen {
configuration.resolvedConfiguration.resolvedArtifacts.single()
.moduleDirectory()
.exists()
}
}
doFirst {
configuration.resolvedConfiguration.resolvedArtifacts.single().run {
val moduleDirectory = moduleDirectory()
val artifactsDirectory = File(moduleDirectory(), "artifacts")
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
"tar.gz" -> tarTree(file)
"zip" -> zipTree(file)
else -> error("Unsupported artifact extension: $extension")
}
from(fileTree.matching {
exclude("**/plugins/Kotlin/**")
})
into(artifactsDirectory)
if (pathRemap != null) {
eachFile {
path = pathRemap(path)
}
}
includeEmptyDirs = false
}
writeIvyXml(
organization,
moduleVersion.id.name,
moduleVersion.id.version,
moduleVersion.id.name,
File(artifactsDirectory, "lib"),
File(artifactsDirectory, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
val pluginsDirectory = File(artifactsDirectory, "plugins")
if (pluginsDirectory.exists()) {
file(File(artifactsDirectory, "plugins"))
.listFiles { file: File -> file.isDirectory }
.forEach {
writeIvyXml(
organization,
it.name,
moduleVersion.id.version,
it.name,
File(it, "lib"),
File(it, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
}
}
}
}
}
fun writeIvyXml(
organization: String,
moduleName: String,
version: String,
fileName: String,
baseDir: File,
artifactDir: File,
targetDir: File,
vararg sourcesJar: File,
allowAnnotations: Boolean = false
) {
fun shouldIncludeIntellijJar(jar: File) =
jar.isFile
&& jar.extension == "jar"
&& !jar.name.startsWith("kotlin-")
&& (allowAnnotations || jar.name != "annotations.jar") // see comments for [intellijAnnotations] above
val ivyFile = targetDir.resolve("$fileName.ivy.xml")
ivyFile.parentFile.mkdirs()
with(XMLWriter(FileWriter(ivyFile))) {
document("UTF-8", "1.0") {
element("ivy-module") {
attribute("version", "2.0")
attribute("xmlns:m", "http://ant.apache.org/ivy/maven")
emptyElement("info") {
attributes(
"organisation" to organization,
"module" to moduleName,
"revision" to version,
"publication" to SimpleDateFormat("yyyyMMddHHmmss").format(Date())
)
}
element("configurations") {
listOf("default", "sources").forEach { configurationName ->
emptyElement("conf") {
attributes("name" to configurationName, "visibility" to "public")
}
}
}
element("publications") {
artifactDir.listFiles()?.filter(::shouldIncludeIntellijJar)?.forEach { jarFile ->
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
emptyElement("artifact") {
attributes(
"name" to relativeName,
"type" to "jar",
"ext" to "jar",
"conf" to "default"
)
}
}
sourcesJar.forEach { jarFile ->
emptyElement("artifact") {
val sourcesArtifactName = jarFile.name
.substringBeforeLast("-")
.substringBeforeLast("-")
attributes(
"name" to sourcesArtifactName,
"type" to "jar",
"ext" to "jar",
"conf" to "sources",
"m:classifier" to "sources"
)
}
}
}
}
}
close()
}
}
fun skipToplevelDirectory(path: String) = path.substringAfter('/')
fun skipContentsDirectory(path: String) = path.substringAfter("Contents/")
class XMLWriter(private val outputStreamWriter: OutputStreamWriter) : Closeable {
private val xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStreamWriter)
private var depth = 0
private val indent = " "
fun document(encoding: String, version: String, init: XMLWriter.() -> Unit) = apply {
xmlStreamWriter.writeStartDocument(encoding, version)
init()
xmlStreamWriter.writeEndDocument()
}
fun element(name: String, init: XMLWriter.() -> Unit) = apply {
writeIndent()
xmlStreamWriter.writeStartElement(name)
depth += 1
init()
depth -= 1
writeIndent()
xmlStreamWriter.writeEndElement()
}
fun emptyElement(name: String, init: XMLWriter.() -> Unit) = apply {
writeIndent()
xmlStreamWriter.writeEmptyElement(name)
init()
}
fun attribute(name: String, value: String): Unit = xmlStreamWriter.writeAttribute(name, value)
fun attributes(vararg attributes: Pair<String, String>) {
attributes.forEach { attribute(it.first, it.second) }
}
private fun writeIndent() {
xmlStreamWriter.writeCharacters("\n")
repeat(depth) {
xmlStreamWriter.writeCharacters(indent)
}
}
override fun close() {
xmlStreamWriter.flush()
xmlStreamWriter.close()
outputStreamWriter.close()
}
}

View File

@@ -1,273 +0,0 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] 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
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val studioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
if (cacheRedirectorEnabled) {
artifactPattern("https://cache-redirector.jetbrains.com/dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
}
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
metadataSources {
artifact()
}
}
}
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven")
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
val `plugins-NodeJS` by configurations.creating
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
val repoDir = customDepsRepoModulesDir
dependencies {
if (androidStudioRelease != null) {
intellij("google:android-studio-ide:$androidStudioBuild")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
`plugins-NodeJS`("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration,
pathRemap: (String) -> String = { it },
extractor: (Configuration) -> Any) {
dependsOn(sourceConfig)
inputs.files(sourceConfig)
val targetDir = File(repoDir, sourceConfig.name)
outputs.dirs(targetDir)
doFirst {
project.copy {
from(extractor(sourceConfig))
into(targetDir)
eachFile {
path = pathRemap(path)
}
}
}
}
fun removePathPrefix(path: String): String {
if (androidStudioRelease == null) return path
val slashes = if (studioOs == "mac") 2 else 1
var result = path
repeat(slashes) {
result = result.substringAfter('/')
}
return result
}
val unzipIntellijSdk by tasks.creating {
configureExtractFromConfigurationTask(intellij, pathRemap = { removePathPrefix(it) }) {
zipTree(it.singleFile).matching {
exclude("**/plugins/Kotlin/**")
}
}
}
val unzipIntellijUltimateSdk by tasks.creating {
configureExtractFromConfigurationTask(intellijUltimate) {
zipTree(it.singleFile).matching {
exclude("plugins/Kotlin/**")
}
}
}
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(`intellij-core`) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val copyIntellijSdkSources by tasks.creating(Copy::class.java) {
from(sources)
into(File(repoDir, sources.name))
}
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
val unzipNodeJSPlugin by tasks.creating { configureExtractFromConfigurationTask(`plugins-NodeJS`) { zipTree(it.singleFile) } }
fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection, baseDir: File, sourcesJar: File?) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
jarFiles.asFileTree.files.forEach { jarFile ->
if (jarFile.isFile && jarFile.extension == "jar") {
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(
FileBasedIvyArtifact(jarFile, DefaultIvyPublicationIdentity(customDepsOrg, relativeName, intellijVersion)).also {
it.conf = "default"
}
)
}
}
if (sourcesJar != null) {
val sourcesArtifactName = sourcesJar.name.substringBefore("-")
addArtifact(
FileBasedIvyArtifact(sourcesJar, DefaultIvyPublicationIdentity(customDepsOrg, sourcesArtifactName, intellijVersion)).also {
it.conf = "sources"
it.classifier = "sources"
}
)
}
writeTo(File(customDepsRepoModulesDir, "$fileName.ivy.xml"))
}
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
if (installIntellijCommunity) {
dependsOn(unzipIntellijSdk)
inputs.dir(intellijSdkDir)
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
}
if (installIntellijUltimate) {
dependsOn(unzipIntellijUltimateSdk)
inputs.dir(intellijUltimateSdkDir)
outputs.file(File(repoDir, "${intellijUltimate.name}.ivy.xml"))
}
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
flatDeps.forEach {
inputs.dir(File(repoDir, it.name))
outputs.file(File(repoDir, "${it.name}.ivy.xml"))
}
inputs.dir(File(repoDir, sources.name))
if (intellijUltimateEnabled) {
dependsOn(unzipNodeJSPlugin)
inputs.dir(File(repoDir, `plugins-NodeJS`.name))
outputs.file(File(repoDir, "${`plugins-NodeJS`.name}.ivy.xml"))
}
doFirst {
val sourcesFile = if (sources.isEmpty) null else File(repoDir, "${sources.name}/${sources.singleFile.name}")
if (installIntellijCommunity) {
val libDir = File(intellijSdkDir, "lib")
writeIvyXml(intellij.name,
intellij.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
File(intellijSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
}
}
if (installIntellijUltimate) {
val libDir = File(intellijUltimateSdkDir, "lib")
writeIvyXml(intellij.name, // important! the module name should be "intellij"
intellijUltimate.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
File(intellijUltimateSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellijUltimate.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
}
}
flatDeps.forEach {
writeIvyXml(it.name, it.name, files("$repoDir/${it.name}"), File(repoDir, it.name), sourcesFile)
}
if (intellijUltimateEnabled) {
val nodeJsBaseDir = "${`plugins-NodeJS`.name}/NodeJS/lib"
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), sourcesFile)
}
}
}
val build by tasks.creating {
dependsOn(prepareIvyXmls)
}
val clean by tasks.creating(Delete::class) {
delete(customDepsRepoModulesDir)
delete(buildDir)
}

View File

@@ -1,15 +1,64 @@
pluginManagement {
repositories {
if (cacheRedirectorEnabled == 'true') {
logger.info("Using cache redirector for settings.gradle pluginManagement")
maven {
url "https://cache-redirector.jetbrains.com/plugins.gradle.org/m2"
}
} else {
gradlePluginPortal()
}
gradlePluginPortal()
}
}
include "prepare-deps:android-dx",
"prepare-deps:intellij-sdk"
include "prepare-deps"
def flags = new LocalBuildProperties(settings as Settings)
if (flags.includeCidrPlugins) {
logger.info("Including CIDR plugins in buildSrc/settings.gradle")
include ":prepare-deps:kotlin-native-platform-deps"
project(":prepare-deps:kotlin-native-platform-deps").projectDir = file("${flags.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
} else {
logger.info("NOT including CIDR plugins in buildSrc/settings.gradle")
}
class LocalBuildPropertiesProvider {
private Settings settings
private Properties localProperties = new Properties()
File rootProjectDir
LocalBuildPropertiesProvider(Settings settings) {
this.settings = settings
this.rootProjectDir = settings.rootProject.projectDir.parentFile
File propertiesFile = new File(rootProjectDir, 'local.properties')
if (propertiesFile.isFile()) {
propertiesFile.withInputStream { localProperties.load(it) }
}
}
String getString(String name) {
if (settings.hasProperty(name)) {
return settings[name]?.toString()
} else {
return localProperties[name]?.toString()
}
}
Boolean getBoolean(String name) {
return Boolean.parseBoolean(getString(name))
}
}
class LocalBuildProperties {
LocalBuildPropertiesProvider propertiesProvider
boolean includeCidrPlugins
LocalBuildProperties(Settings settings) {
propertiesProvider = new LocalBuildPropertiesProvider(settings)
includeCidrPlugins = propertiesProvider.getBoolean('cidrPluginsEnabled') && new File(propertiesProvider.rootProjectDir, 'kotlin-ultimate').exists()
}
}

View File

@@ -1,15 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.kotlin.dsl.extra
import java.io.File
fun RepositoryHandler.androidDxJarRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = File("${project.rootDir}/buildSrc/prepare-deps/android-dx/build/repo")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).jar")
}
fun Project.androidDxJar() = "kotlin.build.custom.deps:android-dx:${rootProject.extra["versions.androidBuildTools"]}"

View File

@@ -7,10 +7,14 @@ import org.gradle.kotlin.dsl.*
var Project.bootstrapKotlinVersion: String
get() = this.property("bootstrapKotlinVersion") as String
private set(value) { this.extra["bootstrapKotlinVersion"] = value }
var Project.bootstrapKotlinRepo: String?
get() = this.property("bootstrapKotlinRepo") as String?
private set(value) { this.extra["bootstrapKotlinRepo"] = value }
val Project.internalKotlinRepo: String?
get() = bootstrapKotlinRepo?.replace("artifacts/content/maven/", "artifacts/content/internal/repo")
fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
val customRepo = project.findProperty("bootstrap.kotlin.repo") as String?

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.gradle.api.Project
@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P173, P181, P182, P183, P191;
P181, P182, P183, P191, P192;
val version: Int = name.drop(1).toInt()
@@ -41,16 +41,16 @@ enum class Platform : CompatibilityPredicate {
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ173(Platform.P173),
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
IJ192(Platform.P192),
AS31(Platform.P173),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183);
AS34(Platform.P183),
AS35(Platform.P183);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.gradle.api.tasks.JavaExec

View File

@@ -4,13 +4,17 @@ import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.
*/
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaExec@{
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> {
configure()
passClasspathInJar()
}
// Moves the classpath into a jar metadata, to shorten the command line length and to avoid hitting the limit on Windows
fun JavaExec.passClasspathInJar() {
val jarTask = project.task("${name}WriteClassPath", Jar::class) {
val classpath = classpath
val main = main
@@ -28,21 +32,16 @@ fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaE
)
}
}
archiveName = "$main.${this@javaExec.name}.classpath.container.$extension"
archiveName = "$main.${this@passClasspathInJar.name}.classpath.container.$extension"
destinationDir = temporaryDir
}
dependsOn(jarTask)
doFirst {
main = "-jar"
classpath = project.files()
val copyArgs = args.orEmpty().toList()
args(jarTask.outputs.files.singleFile)
args(copyArgs)
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
}
}

View File

@@ -1,39 +1,25 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.*
import org.gradle.api.artifacts.*
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ConfigurablePublishArtifact
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.Copy
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.kotlin.dsl.*
import java.io.File
// can be used now only for the non-published projects, due to conflicts in the "archives" config
// TODO: fix the problem above
fun Project.classesDirsArtifact(): FileCollection {
task("uploadArchives") {
// hides rule-based task with the same name, which appears to be broken in this project
}
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
val classesDirs = mainSourceSet.output.classesDirs
val classesTask = tasks["classes"]
afterEvaluate {
classesDirs.files.forEach {
addArtifact(classesDirsCfg, classesTask, it)
}
}
return classesDirs
}
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -51,14 +37,26 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
}
}
var Project.artifactsRemovedDiagnosticFlag: Boolean
get() = extra.has("artifactsRemovedDiagnosticFlag") && extra["artifactsRemovedDiagnosticFlag"] == true
set(value) {
extra["artifactsRemovedDiagnosticFlag"] = value
}
fun Project.removeArtifacts(configuration: Configuration, task: Task) {
configuration.artifacts.removeAll { artifact ->
artifact.file in task.outputs.files
}
artifactsRemovedDiagnosticFlag = true
}
fun Project.noDefaultJar() {
tasks.findByName("jar")?.let { defaultJarTask ->
defaultJarTask.enabled = false
defaultJarTask.actions = emptyList()
configurations.forEach { cfg ->
cfg.artifacts.removeAll { artifact ->
artifact.file in defaultJarTask.outputs.files
}
removeArtifacts(cfg, defaultJarTask)
}
}
}
@@ -71,12 +69,18 @@ fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: Configurabl
}
}
fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
extra["runtimeJarTask"] = task
tasks.findByName("jar")?.let { defaultJarTask ->
configurations.getOrCreate("archives").artifacts.removeAll { (it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false }
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
}
return task.apply {
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
from {
embedded.map(::zipTree)
}
}
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
body()
@@ -86,37 +90,45 @@ fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.sourcesJar(sourceSet: String? = "main", body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("sourcesJar") {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "sources"
try {
if (sourceSet != null) {
project.pluginManager.withPlugin("java-base") {
from(project.javaPluginConvention().sourceSets[sourceSet].allSource)
}
}
} catch (e: UnknownDomainObjectException) {
// skip default sources location
}
body()
project.addArtifact("archives", this, this)
fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
val task = tasks.register<Jar>("sourcesJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("sources")
from(project.mainSourceSet.allSource)
project.configurations.findByName("embedded")?.let { embedded ->
from(provider {
embedded.resolvedConfiguration
.resolvedArtifacts
.map { it.id.componentIdentifier }
.filterIsInstance<ProjectComponentIdentifier>()
.map { project(it.projectPath).mainSourceSet.allSource }
})
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("javadocJar") {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "javadoc"
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
project.addArtifact("archives", this, this)
}
body()
}
addArtifact("archives", task)
addArtifact("sources", task)
return task
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "javadoc"
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
project.addArtifact("archives", this, this)
}
fun Project.standardPublicJars(): Unit {
fun Project.standardPublicJars() {
runtimeJar()
sourcesJar()
javadocJar()
@@ -125,6 +137,10 @@ fun Project.standardPublicJars(): Unit {
fun Project.publish(body: Upload.() -> Unit = {}): Upload {
apply<plugins.PublishedKotlinModule>()
if (artifactsRemovedDiagnosticFlag) {
error("`publish()` should be called before removing artifacts typically done in `noDefaultJar()` or `runtimeJar()` call")
}
afterEvaluate {
if (configurations.findByName("classes-dirs") != null)
throw GradleException("classesDirsArtifact() is incompatible with publish(), see sources comments for details")
@@ -135,50 +151,6 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit): Copy {
val thisProject = this
val pluginTask = task<Copy>("ideaPlugin") {
body()
into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path)
rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "")
}
task("idea-plugin") {
dependsOn(pluginTask)
}
return pluginTask
}
fun Project.ideaPlugin(subdir: String = "lib"): Copy = ideaPlugin(subdir) {
runtimeJarTaskIfExists()?.let {
from(it)
}
}
fun Project.dist(targetDir: File? = null,
targetName: String? = null,
fromTask: Task? = null,
body: AbstractCopyTask.() -> Unit = {}): AbstractCopyTask {
val distJarCfg = configurations.getOrCreate("distJar")
val distLibDir: File by rootProject.extra
val distJarName = targetName ?: (the<BasePluginConvention>().archivesBaseName + ".jar")
val thisProject = this
return task<Copy>("dist") {
body()
(fromTask ?: runtimeJarTaskIfExists())?.let {
from(it)
if (targetName != null) {
rename(it.outputs.files.singleFile.name, targetName)
}
}
rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "")
into(targetDir ?: distLibDir)
project.addArtifact(distJarCfg, this, File(targetDir ?: distLibDir, distJarName))
}
}
private fun Project.runtimeJarTaskIfExists(): Task? =
if (extra.has("runtimeJarTask")) extra["runtimeJarTask"] as Task
else tasks.findByName("jar")
@@ -206,7 +178,12 @@ fun Project.addArtifact(configuration: Configuration, task: Task, artifactRef: A
}
fun Project.addArtifact(configurationName: String, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) =
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
fun <T : Task> Project.addArtifact(configurationName: String, task: TaskProvider<T>, body: ConfigurablePublishArtifact.() -> Unit = {}) {
configurations.maybeCreate(configurationName)
artifacts.add(configurationName, task, body)
}
fun Project.cleanArtifacts() {
configurations["archives"].artifacts.let { artifacts ->

View File

@@ -0,0 +1,115 @@
import org.gradle.api.Project
import org.gradle.api.initialization.Settings
import org.gradle.api.internal.DynamicObjectAware
import java.io.File
import java.util.*
/*
* Copyright 2010-2019 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.
*/
interface PropertiesProvider {
val rootProjectDir: File
fun getProperty(key: String): Any?
}
class KotlinBuildProperties(
private val propertiesProvider: PropertiesProvider
) {
private val localProperties: Properties = Properties()
init {
val localPropertiesFile = propertiesProvider.rootProjectDir.resolve("local.properties")
if (localPropertiesFile.isFile) {
localPropertiesFile.reader().use(localProperties::load)
}
}
private operator fun get(key: String): Any? = localProperties.getProperty(key) ?: propertiesProvider.getProperty(key)
private fun getBoolean(key: String, default: Boolean = false): Boolean =
(this[key]?.toString()?.toBoolean() ?: default) == true
val isJpsBuildEnabled: Boolean = getBoolean("jpsBuild")
val isInIdeaSync: Boolean = run {
// "idea.sync.active" was introduced in 2019.1
System.getProperty("idea.sync.active")?.toBoolean() == true || let {
// before 2019.1 there is "idea.active" that was true only on sync,
// but since 2019.1 "idea.active" present in task execution too.
// So let's check Idea version
val majorIdeaVersion = System.getProperty("idea.version")
?.split(".")
?.getOrNull(0)
val isBeforeIdea2019 = majorIdeaVersion == null || majorIdeaVersion.toInt() < 2019
isBeforeIdea2019 && System.getProperty("idea.active")?.toBoolean() == true
}
}
val isInJpsBuildIdeaSync: Boolean
get() = isJpsBuildEnabled && isInIdeaSync
val includeJava9: Boolean
get() = !isInJpsBuildIdeaSync && getBoolean("kotlin.build.java9", true)
val useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync || getBoolean("kotlin.build.useBootstrapStdlib", false)
val kotlinUltimateExists: Boolean = propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
val includeCidrPlugins: Boolean = kotlinUltimateExists && getBoolean("cidrPluginsEnabled")
val isTeamcityBuild: Boolean = getBoolean("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled: Boolean
get() {
val explicitlyEnabled = getBoolean("intellijUltimateEnabled")
if (!kotlinUltimateExists && explicitlyEnabled) {
error("intellijUltimateEnabled property is set, while kotlin-ultimate repository is not provided")
}
return kotlinUltimateExists && (explicitlyEnabled || isTeamcityBuild)
}
val postProcessing: Boolean get() = isTeamcityBuild || getBoolean("kotlin.build.postprocessing", true)
val relocation: Boolean get() = postProcessing
val proguard: Boolean get() = postProcessing && getBoolean("kotlin.build.proguard", isTeamcityBuild)
val jsIrDist: Boolean get() = getBoolean("kotlin.stdlib.js.ir.dist")
}
private const val extensionName = "kotlinBuildProperties"
class ProjectProperties(val project: Project) : PropertiesProvider {
override val rootProjectDir: File
get() = project.projectDir
override fun getProperty(key: String): Any? = project.findProperty(key)
}
val Project.kotlinBuildProperties: KotlinBuildProperties
get() = rootProject.extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(ProjectProperties(rootProject)).also {
rootProject.extensions.add(extensionName, it)
}
class SettingsProperties(val settings: Settings) : PropertiesProvider {
override val rootProjectDir: File
get() = settings.rootDir
override fun getProperty(key: String): Any? {
val obj = (settings as DynamicObjectAware).asDynamicObject
return if (obj.hasProperty(key)) obj.getProperty(key) else null
}
}
fun getKotlinBuildPropertiesForSettings(settings: Any) = (settings as Settings).kotlinBuildProperties
val Settings.kotlinBuildProperties: KotlinBuildProperties
get() = extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(SettingsProperties(this)).also {
extensions.add(extensionName, it)
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2010-2019 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.gradle.api.Action
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
import org.gradle.kotlin.dsl.accessors.runtime.addExternalModuleDependencyTo
import org.gradle.kotlin.dsl.add
val NamedDomainObjectContainer<Configuration>.embedded: NamedDomainObjectProvider<Configuration> get() = named("embedded")
fun DependencyHandler.embedded(dependencyNotation: Any): Dependency? =
add("embedded", dependencyNotation)
fun DependencyHandler.embedded(
dependencyNotation: String,
dependencyConfiguration: Action<ExternalModuleDependency>
): ExternalModuleDependency =
addDependencyTo(this, "embedded", dependencyNotation, dependencyConfiguration)
fun DependencyHandler.embedded(
group: String,
name: String,
version: String? = null,
configuration: String? = null,
classifier: String? = null,
ext: String? = null,
dependencyConfiguration: Action<ExternalModuleDependency>? = null
): ExternalModuleDependency = addExternalModuleDependencyTo(
this, "embedded", group, name, version, configuration, classifier, ext, dependencyConfiguration
)
fun <T : ModuleDependency> DependencyHandler.embedded(
dependency: T,
dependencyConfiguration: T.() -> Unit
): T = add("embedded", dependency, dependencyConfiguration)

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2000-2018 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 tasks

View File

@@ -1,16 +1,21 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
@file:Suppress("unused")
// usages in build scripts are not tracked properly
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.tasks.AbstractCopyTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import java.io.File
val Project.isSnapshotIntellij get() = rootProject.extra["versions.intellijSdk"].toString().endsWith("SNAPSHOT")
val Project.intellijRepo get() = "https://www.jetbrains.com/intellij-repository/" + if (isSnapshotIntellij) "snapshots" else "releases"
fun Project.commonDep(coord: String): String {
val parts = coord.split(':')
@@ -28,13 +33,18 @@ fun Project.commonDep(group: String, artifact: String, vararg suffixesAndClassif
}
fun Project.commonVer(group: String, artifact: String) =
when {
rootProject.extra.has("versions.$artifact") -> rootProject.extra["versions.$artifact"]
rootProject.extra.has("versions.$group") -> rootProject.extra["versions.$group"]
else -> throw GradleException("Neither versions.$artifact nor versions.$group is defined in the root project's extra")
}
when {
rootProject.extra.has("versions.$artifact") -> rootProject.extra["versions.$artifact"]
rootProject.extra.has("versions.$group") -> rootProject.extra["versions.$group"]
else -> throw GradleException("Neither versions.$artifact nor versions.$group is defined in the root project's extra")
}
fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File(rootDir, "dependencies"), subdir: String? = null, optional: Boolean = false): ConfigurableFileCollection {
fun Project.preloadedDeps(
vararg artifactBaseNames: String,
baseDir: File = File(rootDir, "dependencies"),
subdir: String? = null,
optional: Boolean = false
): ConfigurableFileCollection {
val dir = if (subdir != null) File(baseDir, subdir) else baseDir
if (!dir.exists() || !dir.isDirectory) {
if (optional) return files()
@@ -42,9 +52,17 @@ fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File
}
val matchingFiles = dir.listFiles { file -> artifactBaseNames.any { file.matchMaybeVersionedArtifact(it) } }
if (matchingFiles == null || matchingFiles.size < artifactBaseNames.size) {
throw GradleException("Not all matching artifacts '${artifactBaseNames.joinToString()}' found in the '$dir' " +
"(missing: ${artifactBaseNames.filterNot { request -> matchingFiles.any { it.matchMaybeVersionedArtifact(request) } }.joinToString()};" +
" found: ${matchingFiles?.joinToString { it.name }})")
throw GradleException(
"Not all matching artifacts '${artifactBaseNames.joinToString()}' found in the '$dir' " +
"(missing: ${artifactBaseNames.filterNot { request ->
matchingFiles.any {
it.matchMaybeVersionedArtifact(
request
)
}
}.joinToString()};" +
" found: ${matchingFiles?.joinToString { it.name }})"
)
}
return files(*matchingFiles.map { it.canonicalPath }.toTypedArray())
}
@@ -55,23 +73,34 @@ fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir:
else files()
}
fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"
fun Project.kotlinDep(artifactBaseName: String, version: String, classifier: String? = null): String =
listOfNotNull("org.jetbrains.kotlin:kotlin-$artifactBaseName:$version", classifier).joinToString(":")
fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): Any {
return if (kotlinBuildProperties.useBootstrapStdlib)
kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion, classifier)
else
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"), classifier)
}
fun Project.kotlinBuiltins(): Any =
if (kotlinBuildProperties.useBootstrapStdlib) "org.jetbrains.kotlin:builtins:$bootstrapKotlinVersion"
else dependencies.project(":core:builtins")
@Deprecated("Depend on the default configuration instead", ReplaceWith("project(name)"))
fun DependencyHandler.projectDist(name: String): ProjectDependency = project(name)
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
fun DependencyHandler.projectClasses(name: String): ProjectDependency = project(name, configuration = "classes-dirs")
val protobufLiteProject = ":custom-dependencies:protobuf-lite"
val protobufRelocatedProject = ":custom-dependencies:protobuf-relocated"
fun DependencyHandler.protobufLite(): ProjectDependency =
project(protobufLiteProject, configuration = "default").apply { isTransitive = false }
val protobufLiteTask = "$protobufLiteProject:prepare"
val Project.protobufVersion: String get() = findProperty("versions.protobuf") as String
fun DependencyHandler.protobufFull(): ProjectDependency =
project(protobufRelocatedProject, configuration = "default").apply { isTransitive = false }
val Project.protobufRepo: String
get() =
"https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_Protobuf),status:SUCCESS,pinned:true,tag:$protobufVersion/artifacts/content/internal/repo/"
fun Project.protobufLite(): String = "org.jetbrains.kotlin:protobuf-lite:$protobufVersion"
fun Project.protobufFull(): String = "org.jetbrains.kotlin:protobuf-relocated:$protobufVersion"
val Project.kotlinNativeVersion: String get() = property("versions.kotlin-native") as String
fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex())
@@ -93,8 +122,6 @@ private fun String.toMaybeVersionedJarRegex(): Regex {
return Regex(if (hasJarExtension) escaped else "$escaped(-\\d.*)?\\.jar") // TODO: consider more precise version part of the regex
}
fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = File(this.property("JDK_18") as String)): File? =
paths.map { File(jdkHome, it) }.firstOrNull { it.exists() }.also {
if (it == null)
@@ -105,48 +132,8 @@ fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): F
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
val compilerManifestClassPath
get() = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
get() = "annotations-13.0.jar kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
object EmbeddedComponents {
val CONFIGURATION_NAME = "embeddedComponents"
val CONFIGURATION_NAME = "embedded"
}
fun AbstractCopyTask.fromEmbeddedComponents() {
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
if (this is ShadowJar) {
from(embeddedComponents)
} else {
dependsOn(embeddedComponents)
from {
embeddedComponents.map { file ->
if (file.isDirectory)
project.files(file)
else
project.zipTree(file)
}
}
}
}
// TODO: it seems incomplete, find and add missing dependencies
val testDistProjects = listOf(
"", // for root project
":kotlin-stdlib:jvm-minimal-for-test",
":kotlin-compiler",
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-stdlib-js",
":kotlin-reflect",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-js",
":kotlin-preloader",
":plugins:android-extensions-compiler",
":kotlin-ant",
":kotlin-annotations-jvm",
":kotlin-annotations-android"
)

View File

@@ -0,0 +1,40 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.ideaExt
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.configure
import org.gradle.plugins.ide.idea.model.IdeaProject
import org.jetbrains.gradle.ext.*
/*
* Copyright 2010-2019 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.
*/
fun org.gradle.api.Project.idea(configure: org.gradle.plugins.ide.idea.model.IdeaModel.() -> Unit): Unit =
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("idea", configure)
fun IdeaProject.settings(block: ProjectSettings.() -> Unit) =
(this@settings as ExtensionAware).extensions.configure(block)
fun ProjectSettings.compiler(block: IdeaCompilerConfiguration.() -> Unit) =
(this@compiler as ExtensionAware).extensions.configure(block)
fun ProjectSettings.delegateActions(block: ActionDelegationConfig.() -> Unit) =
(this@delegateActions as ExtensionAware).extensions.configure(block)
fun ProjectSettings.runConfigurations(block: DefaultRunConfigurationContainer.() -> Unit) =
(this@runConfigurations as ExtensionAware).extensions.configure("runConfigurations", block)
inline fun <reified T: RunConfiguration> DefaultRunConfigurationContainer.defaults(noinline block: T.() -> Unit) =
defaults(T::class.java, block)
fun DefaultRunConfigurationContainer.junit(name: String, block: JUnit.() -> Unit) =
create(name, JUnit::class.java, block)
fun DefaultRunConfigurationContainer.application(name: String, block: Application.() -> Unit) =
create(name, Application::class.java, block)
fun ProjectSettings.ideArtifacts(block: NamedDomainObjectContainer<org.jetbrains.gradle.ext.TopLevelArtifact>.() -> Unit) =
(this@ideArtifacts as ExtensionAware).extensions.configure("ideArtifacts", block)

View File

@@ -1,4 +1,4 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
@file:Suppress("unused")
/*
* Copyright 2010-2017 JetBrains s.r.o.
@@ -23,13 +23,12 @@ import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.ConventionTask
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
fun Project.configureInstrumentation() {
fun Project.configureFormInstrumentation() {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.all {
// When we change the output classes directory, Gradle will automatically configure
// the test compile tasks to use the instrumented classes. Normally this is fine,
@@ -46,8 +45,8 @@ fun Project.configureInstrumentation() {
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
}
}
@@ -68,7 +67,8 @@ fun Project.configureInstrumentation() {
logger.info("Saving old sources dir for project ${project.name}")
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask = project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
val instrumentTask =
project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
@@ -100,6 +100,9 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
@Input
var originalClassesDirs: FileCollection? = null
@get:Input
var instrumentNotNull: Boolean = false
@get:InputFiles
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
@@ -109,21 +112,30 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
@TaskAction
fun instrumentClasses() {
logger.info("input files are: ${originalClassesDirs?.joinToString("; ", transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)" }"})}")
logger.info(
"input files are: ${originalClassesDirs?.joinToString(
"; ",
transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)"}" })}"
)
output.deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
ant.withGroovyBuilder {
"taskdef"("name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions")
"taskdef"(
"name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions"
)
}
logger.info("Compiling forms and instrumenting code with nullability preconditions")
val instrumentNotNull = prepareNotNullInstrumenting(classpath.asPath)
if (instrumentNotNull) {
prepareNotNullInstrumenting(classpath.asPath)
}
instrumentCode(sourceDirs, instrumentNotNull)
}
@@ -134,14 +146,15 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
}
}
private fun prepareNotNullInstrumenting(classpath: String): Boolean {
private fun prepareNotNullInstrumenting(classpath: String) {
ant.withGroovyBuilder {
"typedef"("name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS)
"typedef"(
"name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS
)
}
return true
}
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
@@ -149,20 +162,22 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
// 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 }
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
val instrumentationClasspath =
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
logger.info("Running instrumentIdeaExtensions with srcdir=${srcDirs.asPath}}, destdir=$output and classpath=$instrumentationClasspath")
ant.withGroovyBuilder {
"instrumentIdeaExtensions"("srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull) {
"instrumentIdeaExtensions"(
"srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull
) {
if (instrumentNotNull) {
ant.withGroovyBuilder {
"skip"("pattern" to "kotlin/Metadata")

View File

@@ -1,180 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
/*
* Copyright 2010-2017 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.
*/
import org.gradle.api.Project
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.internal.ConventionTask
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
fun Project.configureInstrumentation() {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.all {
// 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:
// The "internal" modifier can be used to restrict access to the same module.
// To make it possible to use internal methods from the main source set in test classes,
// the Kotlin Gradle plugin adds the original output directory of the Java task
// as "friendly directory" which makes it possible to access internal members
// of the main module. Also this directory should be available on classpath during compilation
// 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 {
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
}
}
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
dependencies {
instrumentationClasspathCfg(intellijDep()) { includeJars("javac2", "jdom", "asm-all", "jgoodies-forms", rootProject = rootProject) }
}
afterEvaluate {
sourceSets.all { sourceSetParam ->
// This copy will ignore filters, but they are unlikely to be used.
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
val classesDirsCopy = project.files(classesDirs.toTypedArray()).filter { it.exists() }
(sourceSetParam as ExtensionAware).extra.set("classesDirsCopy", classesDirsCopy)
logger.info("Saving old sources dir for project ${project.name}")
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask = project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
}
instrumentTask.outputs.dir(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() {
companion object {
private const val FILTER_ANNOTATION_REGEXP_CLASS = "com.intellij.ant.ClassFilterAnnotationRegexp"
private const val LOADER_REF = "java2.loader"
}
var sourceSet: SourceSet? = null
var instrumentationClasspath: Configuration? = null
@Input
var originalClassesDirs: FileCollection? = null
@get:InputFiles
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
@get:OutputDirectory
lateinit var output: File
@TaskAction
fun instrumentClasses() {
logger.info("input files are: ${originalClassesDirs?.joinToString("; ", transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)" }"})}")
output.deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
ant.withGroovyBuilder {
"taskdef"("name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions")
}
logger.info("Compiling forms and instrumenting code with nullability preconditions")
val instrumentNotNull = prepareNotNullInstrumenting(classpath.asPath)
instrumentCode(sourceDirs, instrumentNotNull)
}
private fun copyOriginalClasses() {
project.copy {
from(originalClassesDirs)
into(output)
}
}
private fun prepareNotNullInstrumenting(classpath: String): Boolean {
ant.withGroovyBuilder {
"typedef"("name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS)
}
return true
}
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
val headlessOldValue = System.setProperty("java.awt.headless", "true")
// 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 {
logger.info("Using following dependency source dirs: $it")
}
logger.info("Running instrumentIdeaExtensions with srcdir=${srcDirs.asPath}}, destdir=$output and classpath=$instrumentationClasspath")
ant.withGroovyBuilder {
"instrumentIdeaExtensions"("srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull) {
if (instrumentNotNull) {
ant.withGroovyBuilder {
"skip"("pattern" to "kotlin/Metadata")
}
}
}
}
if (headlessOldValue != null) {
System.setProperty("java.awt.headless", headlessOldValue)
} else {
System.clearProperty("java.awt.headless")
}
}
}

View File

@@ -1,170 +0,0 @@
/*
* Copyright 2010-2017 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.
*/
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.*
import java.io.File
private fun Project.intellijRepoDir() = File("${project.rootDir.absoluteFile}/buildSrc/prepare-deps/intellij-sdk/build/repo")
fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = project.intellijRepoDir()
val intellijEnforceCommunitySdk = project.getBooleanProperty("intellijEnforceCommunitySdk") == true
setUrl(baseDir)
if (!intellijEnforceCommunitySdk) {
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]Ultimate.ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellijUltimate.plugin.[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]Ultimate/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellijUltimate/plugins/[module]/lib/[artifact](-[classifier]).jar")
}
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellij.plugin.[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/plugins-[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellij/plugins/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/plugins-[module]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact].jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact](-[revision])(-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/sources/[artifact]-[revision]-[classifier].[ext]")
metadataSources {
ivyDescriptor()
}
}
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijCoreDep() = intellijDep("intellij-core")
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijUltimateDep() = intellijDep("intellij")
fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
names.forEach {
var baseName = it.removeSuffix(".jar")
if (rootProject != null && rootProject.extra.has("ignore.jar.$baseName")) {
return@forEach
}
if (rootProject != null && rootProject.extra.has("versions.jar.$baseName")) {
baseName += "-${rootProject.extra["versions.jar.$baseName"]}"
}
artifact {
name = baseName
type = "jar"
extension = "jar"
}
}
}
// Workaround. Top-level Kotlin function in a default package can't be called from a non-default package
object IntellijRootUtils {
fun getRepositoryRootDir(project: Project): File = with (project.rootProject) {
return File(intellijRepoDir(), "kotlin.build.custom.deps/${extra["versions.intellijSdk"]}")
}
fun getIntellijRootDir(project: Project): File = with (project.rootProject) {
return File(getRepositoryRootDir(this), "intellij${if (isIntellijCommunityAvailable()) "" else "Ultimate"}")
}
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).toTypedArray(), rootProject = project.rootProject)
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(), 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(intellijRepoDir(), "kotlin.build.custom.deps/${rootProject.extra["versions.intellijSdk"]}/intellijUltimate")
else
throw GradleException("intellij ultimate SDK is not available")
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.extra.has("versions.androidStudioRelease")) {
block()
}
}
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
return task<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = mainSourceSet.runtimeClasspath
main = "com.intellij.idea.Main"
workingDir = File(intellijRootDir(), "bin")
jvmArgs(
"-Xmx1250m",
"-XX:ReservedCodeCacheSize=240m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-ea",
"-Didea.is.internal=true",
"-Didea.debug.mode=true",
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (rootProject.findProperty("versions.androidStudioRelease") != null) {
jvmArgs("-Didea.platform.prefix=AndroidStudio")
}
if (project.hasProperty("noPCE")) {
jvmArgs("-Didea.ProcessCanceledException=disabled")
}
args()
doFirst {
val disabledPluginsFile = File(ideaSandboxConfigDir, "disabled_plugins.txt")
val disabledPluginsContents = disabledPluginsFile.takeIf { it.isFile }?.readLines()
val filteredContents = disabledPluginsContents?.filterNot { it.contains("org.jetbrains.kotlin") }
if (filteredContents != null && filteredContents.size != disabledPluginsContents.size) {
with(disabledPluginsFile.printWriter()) {
filteredContents.forEach(this::println)
}
}
}
body()
}
}

View File

@@ -1,63 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. 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.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
import java.net.URI
// https://youtrack.jetbrains.com/issue/ADM-23180
val mirroredUrls = listOf(
"https://dl.bintray.com/groovy/maven",
"https://dl.bintray.com/kotlin/kotlin-dev",
"https://dl.bintray.com/kotlin/kotlin-eap",
"https://dl.google.com/dl/android/maven2",
"https://dl.google.com/go",
"https://download.jetbrains.com",
"https://jcenter.bintray.com",
"https://jetbrains.bintray.com/dekaf",
"https://jetbrains.bintray.com/intellij-jdk",
"https://jetbrains.bintray.com/intellij-plugin-service",
"https://jetbrains.bintray.com/intellij-third-party-dependencies",
"https://jetbrains.bintray.com/markdown",
"https://jetbrains.bintray.com/teamcity-rest-client",
"https://jetbrains.bintray.com/test-discovery",
"https://jetbrains.bintray.com/jediterm",
"https://jitpack.io",
"https://maven.exasol.com/artifactory/exasol-releases",
"https://plugins.gradle.org/m2",
"https://plugins.jetbrains.com/maven",
"https://repo.grails.org/grails/core",
"https://repo.jenkins-ci.org/releases",
"https://repo.spring.io/milestone",
"https://repo1.maven.org/maven2",
"https://services.gradle.org",
"https://www.jetbrains.com/intellij-repository",
"https://www.myget.org/F/intellij-go-snapshots/maven",
"https://www.myget.org/F/rd-snapshots/maven",
"https://www.myget.org/F/rd-model-snapshots/maven",
"https://www.python.org/ftp",
"https://dl.google.com/dl/android/studio/ide-zips",
"https://dl.bintray.com/kotlin/ktor",
"https://cdn.azul.com/zulu/bin"
)
fun URI.toCacheRedirectorUri() = URI("https://cache-redirector.jetbrains.com/$host/$path")
fun RepositoryHandler.redirect() = filterIsInstance<MavenArtifactRepository>().forEach { repository ->
val uri = repository.url
if (uri.toString().trimEnd('/') in mirroredUrls) {
repository.url = uri.toCacheRedirectorUri()
}
}
fun Project.cacheRedirectorEnabled(): Boolean = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
fun RepositoryHandler.withRedirector(project: Project, configuration: RepositoryHandler.() -> Unit) {
configuration()
if (project.cacheRedirectorEnabled()) {
redirect()
}
}

View File

@@ -43,7 +43,7 @@ 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 majorJersion = when (matchString) {
val majorJdkVersion = when (matchString) {
"6" -> JdkMajorVersion.JDK_16
"7" -> JdkMajorVersion.JDK_17
"8" -> JdkMajorVersion.JDK_18
@@ -53,9 +53,9 @@ fun MutableCollection<JdkId>.addIfBetter(project: Project, version: String, id:
return false
}
}
val prev = find { it.majorVersion == majorJersion }
val prev = find { it.majorVersion == majorJdkVersion }
if (prev == null) {
add(JdkId(false, majorJersion, version, homeDir))
add(JdkId(false, majorJdkVersion, version, homeDir))
return true
}
if (prev.explicit) return false

View File

@@ -0,0 +1,208 @@
/*
* Copyright 2010-2017 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.
*/
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.*
import java.io.File
private fun Project.kotlinBuildLocalRepoDir() = File("${project.rootDir.absoluteFile}/dependencies/repo")
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> "android-studio-ide"
Ide.Kind.IntelliJ -> {
if (kotlinBuildProperties.intellijUltimateEnabled) "ideaIU" else "ideaIC"
}
}
private fun Project.ideModuleVersion() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> rootProject.findProperty("versions.androidStudioBuild")
Ide.Kind.IntelliJ -> rootProject.findProperty("versions.intellijSdk")
}
fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = project.kotlinBuildLocalRepoDir()
url = baseDir.toURI()
patternLayout {
ivy("[organisation]/[module]/[revision]/[module].ivy.xml")
ivy("[organisation]/[module]/[revision]/ivy/[module].ivy.xml")
ivy("[organisation]/${project.ideModuleName()}/[revision]/ivy/[module].ivy.xml") // bundled plugins
artifact("[organisation]/[module]/[revision]/artifacts/lib/[artifact](-[classifier]).[ext]")
artifact("[organisation]/[module]/[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]")
}
metadataSources {
ivyDescriptor()
}
}
fun Project.intellijDep(module: String? = null) = "kotlin.build:${module ?: ideModuleName()}:${ideModuleVersion()}"
fun Project.intellijCoreDep() = "kotlin.build:intellij-core:${rootProject.extra["versions.intellijSdk"]}"
fun Project.jpsStandalone() = "kotlin.build:jps-standalone:${rootProject.extra["versions.intellijSdk"]}"
fun Project.nodeJSPlugin() = "kotlin.build:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}"
fun Project.androidDxJar() = "org.jetbrains.kotlin:android-dx:${rootProject.extra["versions.androidBuildTools"]}"
fun Project.jpsBuildTest() = "com.jetbrains.intellij.idea:jps-build-test:${rootProject.extra["versions.intellijSdk"]}"
/**
* Runtime version of annotations that are already in Kotlin stdlib (historically Kotlin has older version of this one).
*
* SHOULD NOT BE USED IN COMPILE CLASSPATH!
*
* `@NonNull`, `@Nullabe` from `idea/annotations.jar` has `TYPE` target which leads to different types treatment in Kotlin compiler.
* On the other hand, `idea/annotations.jar` contains org/jetbrains/annotations/Async annations which is required for IDEA debugger.
*
* So, we are excluding `annotaions.jar` from all other `kotlin.build` and using this one for runtime only
* to avoid accidentally including `annotations.jar` by calling `intellijDep()`.
*/
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 ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
names.forEach {
var baseName = it.removeSuffix(".jar")
if (rootProject != null && rootProject.extra.has("ignore.jar.$baseName")) {
return@forEach
}
if (rootProject != null && rootProject.extra.has("versions.jar.$baseName")) {
baseName += "-${rootProject.extra["versions.jar.$baseName"]}"
}
artifact {
name = baseName
type = "jar"
extension = "jar"
}
}
}
// Workaround. Top-level Kotlin function in a default package can't be called from a non-default package
object IntellijRootUtils {
fun getRepositoryRootDir(project: Project): File = with(project.rootProject) {
return File(kotlinBuildLocalRepoDir(), "kotlin.build")
}
fun getIntellijRootDir(project: Project): File = with(project.rootProject) {
return File(
getRepositoryRootDir(this),
"${ideModuleName()}/${ideModuleVersion()}/artifacts"
)
}
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).toTypedArray(), rootProject = project.rootProject)
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean) =
includeJars(
*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(),
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()
}
}
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
return task<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = mainSourceSet.runtimeClasspath
main = "com.intellij.idea.Main"
workingDir = File(intellijRootDir(), "bin")
jvmArgs(
"-Xmx1250m",
"-XX:ReservedCodeCacheSize=240m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-ea",
"-Didea.debug.mode=true",
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (rootProject.findProperty("versions.androidStudioRelease") != null) {
jvmArgs("-Didea.platform.prefix=AndroidStudio")
}
if (project.hasProperty("noPCE")) {
jvmArgs("-Didea.ProcessCanceledException=disabled")
}
jvmArgs("-Didea.is.internal=${project.findProperty("idea.is.internal") ?: true}")
project.findProperty("idea.args")?.let { arguments ->
jvmArgs(arguments.toString().split(" "))
}
args()
doFirst {
val disabledPluginsFile = File(ideaSandboxConfigDir, "disabled_plugins.txt")
val disabledPluginsContents = disabledPluginsFile.takeIf { it.isFile }?.readLines()
val filteredContents = disabledPluginsContents?.filterNot { it.contains("org.jetbrains.kotlin") }
if (filteredContents != null && filteredContents.size != disabledPluginsContents.size) {
with(disabledPluginsFile.printWriter()) {
filteredContents.forEach(this::println)
}
}
}
body()
}
}

View File

@@ -2,27 +2,30 @@
package org.jetbrains.kotlin.pill
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.component.*
class DependencyMapper(
val predicate: (ResolvedDependency) -> Boolean,
vararg val configurations: String,
val mapping: (ResolvedDependency) -> MappedDependency?
) {
constructor(
group: String,
module: String,
vararg configurations: String,
version: String? = null,
mapping: (ResolvedDependency) -> MappedDependency?
) : this(
{ dep ->
dep.moduleGroup == group
&& dep.moduleName == module
&& (version == null || dep.moduleVersion == version)
},
configurations = *configurations,
mapping = mapping
)
class DependencyMapper(val predicate: (ResolvedArtifact) -> Boolean, val mapping: (ResolvedArtifact) -> MappedDependency?) {
companion object {
fun forProject(path: String, mapping: (ResolvedArtifact) -> MappedDependency?): DependencyMapper {
return DependencyMapper(
predicate = { artifact ->
val identifier = artifact.id.componentIdentifier as? ProjectComponentIdentifier
identifier?.projectPath == path
},
mapping = mapping
)
}
fun forModule(group: String, module: String, version: String?, mapping: (ResolvedArtifact) -> MappedDependency?): DependencyMapper {
return DependencyMapper(
predicate = { artifact ->
val identifier = artifact.id.componentIdentifier as? ModuleComponentIdentifier
identifier?.group == group && identifier?.module == module && (version == null || identifier?.version == version)
},
mapping = mapping
)
}
}
}
class MappedDependency(val main: PDependency?, val deferred: List<PDependency> = emptyList())

View File

@@ -0,0 +1,94 @@
/*
* Copyright 2010-2019 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:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.component.*
data class PDependencies(val main: List<PDependency>, val deferred: List<PDependency>) {
fun join(): List<PDependency> {
return main + deferred
}
}
fun Project.resolveDependencies(
configuration: Configuration,
forTests: Boolean,
dependencyMappers: List<DependencyMapper>,
withEmbedded: Boolean = false
): PDependencies {
val dependencies = mutableListOf<PDependency>()
val deferred = mutableListOf<PDependency>()
nextArtifact@ for (artifact in configuration.resolvedConfiguration.resolvedArtifacts) {
val identifier = artifact.id.componentIdentifier
for (mapper in dependencyMappers) {
if (mapper.predicate(artifact)) {
val mapped = mapper.mapping(artifact)
if (mapped != null) {
mapped.main?.let { dependencies += it }
deferred += mapped.deferred
}
continue@nextArtifact
}
}
fun addProjectDependency(projectPath: String) {
val project = rootProject.findProject(projectPath) ?: error("Cannot find project $projectPath")
fun addSourceSet(name: String, suffix: String): Boolean {
val sourceSet = project.sourceSets?.findByName(name)?.takeIf { !it.allSource.isEmpty() } ?: return false
dependencies += PDependency.Module(project.pillModuleName + '.' + suffix)
return true
}
if (forTests && artifact.classifier == "tests") {
addSourceSet(SourceSet.TEST_SOURCE_SET_NAME, "test") || addSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "src")
} else {
addSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "src")
}
if (withEmbedded) {
val embeddedConfiguration = project.configurations.findByName(EmbeddedComponents.CONFIGURATION_NAME)
if (embeddedConfiguration != null) {
dependencies += resolveDependencies(embeddedConfiguration, forTests, dependencyMappers, withEmbedded).join()
}
}
}
when (identifier) {
is ProjectComponentIdentifier -> addProjectDependency(identifier.projectPath)
is LibraryBinaryIdentifier -> addProjectDependency(identifier.projectPath)
is ModuleComponentIdentifier -> {
val file = artifact.file
val library = PLibrary(file.name, classes = listOf(file))
dependencies += PDependency.ModuleLibrary(library)
}
}
}
val existingFiles = mutableSetOf<File>()
for (dependency in configuration.dependencies) {
if (dependency !is SelfResolvingDependency) {
continue
}
val files = dependency.resolve().filter { it !in existingFiles }.takeIf { it.isNotEmpty() } ?: continue
existingFiles.addAll(files)
val library = PLibrary(dependency.name, classes = files.toList())
deferred += PDependency.ModuleLibrary(library)
}
return PDependencies(dependencies, deferred)
}

View File

@@ -5,6 +5,7 @@ package org.jetbrains.kotlin.pill
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.tasks.Copy
@@ -34,6 +35,10 @@ sealed class ArtifactElement {
myChildren += child
}
fun add(children: List<ArtifactElement>) {
myChildren += children
}
abstract fun render(context: PathContext): xml
fun renderRecursively(context: PathContext): xml {
@@ -102,99 +107,37 @@ sealed class ArtifactElement {
}
}
fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
val mainIdeaPluginTask = rootProject.tasks.getByName("ideaPlugin")
val gradleArtifactDir = File(rootProject.extra["ideaPluginDir"] as File, "lib")
val ideaPluginTasks = mainIdeaPluginTask.taskDependencies
.getDependencies(mainIdeaPluginTask)
.filter { it.name == "ideaPlugin" }
.filterIsInstance<Copy>()
fun generateKotlinPluginArtifactFile(rootProject: Project, dependencyMappers: List<DependencyMapper>): PFile {
val root = Root()
// Copy kotlinc directory
fun Project.getProject(name: String) = findProject(name) ?: error("Cannot find project $name")
val prepareIdeaPluginProject = rootProject.getProject(":prepare:idea-plugin")
root.add(Directory("kotlinc").apply {
val kotlincDirectory = rootProject.extra["distKotlinHomeDir"].toString()
add(DirectoryCopy(File(kotlincDirectory)))
})
for (task in ideaPluginTasks) {
val spec = task.rootSpec.children.filterIsInstance<SingleParentCopySpec>().singleOrNull()
?: error("Copy spec is not unique in ${rootProject.name}. Available specs: ${task.rootSpec.children}")
root.add(Directory("lib").apply {
val librariesConfiguration = prepareIdeaPluginProject.configurations.getByName("libraries")
add(getArtifactElements(rootProject, librariesConfiguration, dependencyMappers, false))
val sourcePaths = spec.sourcePaths
for (sourcePath in sourcePaths) {
if (sourcePath is ShadowJar) {
if (sourcePath.project.path == ":prepare:idea-plugin") {
val kotlinPluginJar = Archive(sourcePath.archiveName).also { root.getDirectory("lib").add(it) }
add(Directory("jps").apply {
val prepareJpsPluginProject = rootProject.getProject(":kotlin-jps-plugin")
add(Archive(prepareJpsPluginProject.name + ".jar").apply {
val jpsPluginConfiguration = prepareIdeaPluginProject.configurations.getByName("jpsPlugin")
add(getArtifactElements(rootProject, jpsPluginConfiguration, dependencyMappers, true))
})
})
kotlinPluginJar.add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
add(Archive("kotlin-plugin.jar").apply {
add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
for (jarFile in sourcePath.project.configurations.getByName("packedJars").resolve()) {
kotlinPluginJar.add(ExtractedDirectory(jarFile))
}
@Suppress("UNCHECKED_CAST")
for (projectPath in sourcePath.project.extra["projectsToShadow"] as List<String>) {
val jpsModuleName = rootProject.findProject(projectPath)!!.name + ".src"
kotlinPluginJar.add(ModuleOutput(jpsModuleName))
}
continue
}
}
fun fileCopySnapshotAware(file: File): FileCopy {
val SHAPSHOT_JAR_SUFFIX = "-SNAPSHOT.jar"
if (file.name.endsWith(SHAPSHOT_JAR_SUFFIX)) {
return FileCopy(file, file.name.dropLast(SHAPSHOT_JAR_SUFFIX.length).substringBeforeLast("-") + ".jar")
}
return FileCopy(file)
}
when (sourcePath) {
is Jar -> {
val targetDir = ("lib/" + task.destinationDir.toRelativeString(gradleArtifactDir)).withoutSlash()
val archiveForJar = Archive(sourcePath.project.name + ".jar").apply {
if (task.project.plugins.hasPlugin(JavaPlugin::class.java)) {
add(ModuleOutput(sourcePath.project.name + ".src"))
}
root.getDirectory(targetDir).add(this)
}
val embeddedComponents = sourcePath.project.configurations
.findByName(EmbeddedComponents.CONFIGURATION_NAME)?.resolvedConfiguration
if (embeddedComponents != null) {
val configuration = CollectedConfiguration(embeddedComponents, Scope.COMPILE)
for (dependencyInfo in listOf(configuration).collectDependencies()) {
val dependency = (dependencyInfo as? DependencyInfo.ResolvedDependencyInfo)?.dependency ?: continue
if (dependency.isModuleDependency) {
archiveForJar.add(ModuleOutput(dependency.moduleName + ".src"))
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
error("Test configurations are not allowed here")
} else {
for (file in dependency.moduleArtifacts.map { it.file }) {
archiveForJar.add(ExtractedDirectory(file))
}
}
}
}
}
is Configuration -> {
require(sourcePath.name == "sideJars") { "Configurations other than 'sideJars' are not supported" }
for (file in sourcePath.resolve()) {
root.getDirectory("lib").add(fileCopySnapshotAware(file))
}
}
else -> error("${task.name} Unexpected task type ${task.javaClass.name}")
}
}
}
val embeddedConfiguration = prepareIdeaPluginProject.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
add(getArtifactElements(rootProject, embeddedConfiguration, dependencyMappers, true))
})
})
val artifact = PArtifact("KotlinPlugin", File(rootProject.projectDir, "out/artifacts/Kotlin"), root)
return PFile(
@@ -203,3 +146,37 @@ fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
)
}
private fun getArtifactElements(
rootProject: Project,
configuration: Configuration,
dependencyMappers: List<DependencyMapper>,
extractDependencies: Boolean
): List<ArtifactElement> {
val dependencies = rootProject.resolveDependencies(configuration, false, dependencyMappers, withEmbedded = true).join()
val artifacts = mutableListOf<ArtifactElement>()
for (dependency in dependencies) {
when (dependency) {
is PDependency.Module -> {
val moduleOutput = ModuleOutput(dependency.name)
if (extractDependencies) {
artifacts += moduleOutput
} else {
artifacts += Archive(dependency.name + ".jar").apply {
add(moduleOutput)
}
}
}
is PDependency.Library -> artifacts += ProjectLibrary(dependency.name)
is PDependency.ModuleLibrary -> {
val files = dependency.library.classes
if (extractDependencies) files.mapTo(artifacts) { ExtractedDirectory(it) }
else files.mapTo(artifacts) { FileCopy(it) }
}
}
}
return artifacts
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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:Suppress("PackageDirectoryMismatch")
@@ -33,13 +33,11 @@ data class PProject(
data class PModule(
val name: String,
val bundleName: String,
val rootDirectory: File,
val moduleFile: File,
val contentRoots: List<PContentRoot>,
val orderRoots: List<POrderRoot>,
val moduleForProductionSources: PModule? = null,
val group: String? = null
val moduleForProductionSources: PModule? = null
)
data class PContentRoot(
@@ -64,8 +62,6 @@ data class PSourceRootKotlinOptions(
val apiVersion: String?,
val languageVersion: String?,
val jvmTarget: String?,
val addCompilerBuiltIns: Boolean?,
val loadBuiltInsFromDependencies: Boolean?,
val extraArguments: List<String>
) {
fun intersect(other: PSourceRootKotlinOptions) = PSourceRootKotlinOptions(
@@ -75,8 +71,6 @@ data class PSourceRootKotlinOptions(
if (apiVersion == other.apiVersion) apiVersion else null,
if (languageVersion == other.languageVersion) languageVersion else null,
if (jvmTarget == other.jvmTarget) jvmTarget else null,
if (addCompilerBuiltIns == other.addCompilerBuiltIns) addCompilerBuiltIns else null,
if (loadBuiltInsFromDependencies == other.loadBuiltInsFromDependencies) loadBuiltInsFromDependencies else null,
extraArguments.intersect(other.extraArguments).toList()
)
}
@@ -102,7 +96,8 @@ data class PLibrary(
val javadoc: List<File> = emptyList(),
val sources: List<File> = emptyList(),
val annotations: List<File> = emptyList(),
val dependencies: List<PLibrary> = emptyList()
val dependencies: List<PLibrary> = emptyList(),
val originalName: String = name
) {
fun attachSource(file: File): PLibrary {
return this.copy(sources = this.sources + listOf(file))
@@ -134,13 +129,13 @@ fun parse(project: Project, libraries: List<PLibrary>, context: ParserContext):
('idea' module has 'intellij-core' as transitive dependency, and we really need to get rid of it.)
*/
private val CONFIGURATION_MAPPING = mapOf(
listOf("runtime") to Scope.RUNTIME,
listOf("compile") to Scope.COMPILE,
listOf("runtimeClasspath") to Scope.RUNTIME,
listOf("compile", "embedded") to Scope.COMPILE,
listOf("compileOnly") to Scope.PROVIDED
)
private val TEST_CONFIGURATION_MAPPING = mapOf(
listOf("runtime", "testRuntime") to Scope.RUNTIME,
listOf("runtimeClasspath", "testRuntimeClasspath") to Scope.RUNTIME,
listOf("compile", "testCompile") to Scope.COMPILE,
listOf("compileOnly", "testCompileOnly") to Scope.PROVIDED,
listOf("jpsTest") to Scope.TEST
@@ -162,7 +157,7 @@ private fun ParserContext.parseModules(project: Project, excludedProjects: List<
var productionSourcesModule: PModule? = null
fun getModuleFile(suffix: String = ""): File {
val relativePath = File(project.projectDir, project.name + suffix + ".iml")
val relativePath = File(project.projectDir, project.pillModuleName + suffix + ".iml")
.toRelativeString(project.rootProject.projectDir)
return File(project.rootProject.projectDir, ".idea/modules/$relativePath")
@@ -177,13 +172,12 @@ private fun ParserContext.parseModules(project: Project, excludedProjects: List<
var dependencies = parseDependencies(project, mainRoot.forTests)
if (productionContentRoots.isNotEmpty() && mainRoot.forTests) {
val productionModuleDependency = PDependency.Module(project.name + ".src")
val productionModuleDependency = PDependency.Module(project.pillModuleName + ".src")
dependencies += POrderRoot(productionModuleDependency, Scope.COMPILE, true)
}
val module = PModule(
project.name + nameSuffix,
project.name,
project.pillModuleName + nameSuffix,
mainRoot.path,
getModuleFile(nameSuffix),
roots,
@@ -199,13 +193,12 @@ private fun ParserContext.parseModules(project: Project, excludedProjects: List<
}
val mainModuleFileRelativePath = when (project) {
project.rootProject -> File(project.rootProject.projectDir, project.name + ".iml")
project.rootProject -> File(project.rootProject.projectDir, project.rootProject.name + ".iml")
else -> getModuleFile()
}
modules += PModule(
project.name,
project.name,
project.pillModuleName,
project.projectDir,
mainModuleFileRelativePath,
listOf(PContentRoot(project.projectDir, false, emptyList(), allExcludedDirs)),
@@ -242,53 +235,56 @@ private fun parseSourceRoots(project: Project): List<PSourceRoot> {
val sourceRoots = mutableListOf<PSourceRoot>()
for (sourceSet in project.sourceSets) {
val kotlinCompileTask = kotlinTasksBySourceSet[sourceSet.name]
val kind = if (sourceSet.name == SourceSet.TEST_SOURCE_SET_NAME) Kind.TEST else Kind.PRODUCTION
val sourceSets = project.sourceSets
if (sourceSets != null) {
for (sourceSet in sourceSets) {
val kotlinCompileTask = kotlinTasksBySourceSet[sourceSet.name]
val kind = if (sourceSet.isTestSourceSet) Kind.TEST else Kind.PRODUCTION
fun Any.getKotlin(): SourceDirectorySet {
val kotlinMethod = javaClass.getMethod("getKotlin")
val oldIsAccessible = kotlinMethod.isAccessible
try {
kotlinMethod.isAccessible = true
return kotlinMethod(this) as SourceDirectorySet
} finally {
kotlinMethod.isAccessible = oldIsAccessible
fun Any.getKotlin(): SourceDirectorySet {
val kotlinMethod = javaClass.getMethod("getKotlin")
val oldIsAccessible = kotlinMethod.isAccessible
try {
kotlinMethod.isAccessible = true
return kotlinMethod(this) as SourceDirectorySet
} finally {
kotlinMethod.isAccessible = oldIsAccessible
}
}
}
val kotlinSourceDirectories = (sourceSet as HasConvention).convention
.plugins["kotlin"]?.getKotlin()?.srcDirs
val kotlinSourceDirectories = (sourceSet as HasConvention).convention
.plugins["kotlin"]?.getKotlin()?.srcDirs
?: emptySet()
val directories = (sourceSet.java.sourceDirectories.files + kotlinSourceDirectories).toList()
.filter { it.exists() }
.takeIf { it.isNotEmpty() }
val directories = (sourceSet.java.sourceDirectories.files + kotlinSourceDirectories).toList()
.filter { it.exists() }
.takeIf { it.isNotEmpty() }
?: continue
val kotlinOptions = kotlinCompileTask?.let { getKotlinOptions(it) }
val kotlinOptions = kotlinCompileTask?.let { getKotlinOptions(it) }
for (resourceRoot in sourceSet.resources.sourceDirectories.files) {
if (!resourceRoot.exists() || resourceRoot in directories) {
continue
for (resourceRoot in sourceSet.resources.sourceDirectories.files) {
if (!resourceRoot.exists() || resourceRoot in directories) {
continue
}
val resourceRootKind = when (kind) {
Kind.PRODUCTION -> Kind.RESOURCES
Kind.TEST -> Kind.TEST_RESOURCES
else -> error("Invalid source root kind $kind")
}
sourceRoots += PSourceRoot(resourceRoot, resourceRootKind, kotlinOptions)
}
val resourceRootKind = when (kind) {
Kind.PRODUCTION -> Kind.RESOURCES
Kind.TEST -> Kind.TEST_RESOURCES
else -> error("Invalid source root kind $kind")
for (directory in directories) {
sourceRoots += PSourceRoot(directory, kind, kotlinOptions)
}
sourceRoots += PSourceRoot(resourceRoot, resourceRootKind, kotlinOptions)
}
for (directory in directories) {
sourceRoots += PSourceRoot(directory, kind, kotlinOptions)
}
for (root in parseResourceRootsProcessedByProcessResourcesTask(project, sourceSet)) {
if (sourceRoots.none { it.path == root.path }) {
sourceRoots += root
for (root in parseResourceRootsProcessedByProcessResourcesTask(project, sourceSet)) {
if (sourceRoots.none { it.path == root.path }) {
sourceRoots += root
}
}
}
}
@@ -298,9 +294,8 @@ private fun parseSourceRoots(project: Project): List<PSourceRoot> {
private fun parseResourceRootsProcessedByProcessResourcesTask(project: Project, sourceSet: SourceSet): List<PSourceRoot> {
val isMainSourceSet = sourceSet.name == SourceSet.MAIN_SOURCE_SET_NAME
val isTestSourceSet = sourceSet.name == SourceSet.TEST_SOURCE_SET_NAME
val resourceRootKind = if (isTestSourceSet) PSourceRoot.Kind.TEST_RESOURCES else PSourceRoot.Kind.RESOURCES
val resourceRootKind = if (sourceSet.isTestSourceSet) PSourceRoot.Kind.TEST_RESOURCES else PSourceRoot.Kind.RESOURCES
val taskNameBase = "processResources"
val taskName = if (isMainSourceSet) taskNameBase else sourceSet.name + taskNameBase.capitalize()
val task = project.tasks.findByName(taskName) as? ProcessResources ?: return emptyList()
@@ -319,20 +314,26 @@ private fun parseResourceRootsProcessedByProcessResourcesTask(project: Project,
return roots.map { PSourceRoot(it, resourceRootKind, null) }
}
private val SourceSet.isTestSourceSet: Boolean
get() = name == SourceSet.TEST_SOURCE_SET_NAME
|| name.endsWith("Test")
|| name.endsWith("Tests")
private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions? {
val compileArguments = kotlinCompileTask.invokeInternal("getSerializedCompilerArguments") as List<String>
val compileArguments = run {
val method = kotlinCompileTask::class.java.getMethod("getSerializedCompilerArguments")
method.isAccessible = true
method.invoke(kotlinCompileTask) as List<String>
}
fun parseBoolean(name: String) = compileArguments.contains("-$name")
fun parseString(name: String) = compileArguments.dropWhile { it != "-$name" }.drop(1).firstOrNull()
val addCompilerBuiltins = "Xadd-compiler-builtins"
val loadBuiltinsFromDependencies = "Xload-builtins-from-dependencies"
fun isOptionForScriptingCompilerPlugin(option: String)
= option.startsWith("-Xplugin=") && option.contains("kotlin-scripting-compiler")
val extraArguments = compileArguments.filter {
it.startsWith("-X") && !isOptionForScriptingCompilerPlugin(it)
&& it != "-$addCompilerBuiltins" && it != "-$loadBuiltinsFromDependencies"
}
return PSourceRootKotlinOptions(
@@ -342,8 +343,6 @@ private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions?
parseString("api-version"),
parseString("language-version"),
parseString("jvm-target"),
parseBoolean(addCompilerBuiltins),
parseBoolean(loadBuiltinsFromDependencies),
extraArguments
)
}
@@ -361,93 +360,25 @@ private fun Any.invokeInternal(name: String, instance: Any = this): Any? {
}
private fun ParserContext.parseDependencies(project: Project, forTests: Boolean): List<POrderRoot> {
val configurations = project.configurations
val configurationMapping = if (forTests) TEST_CONFIGURATION_MAPPING else CONFIGURATION_MAPPING
with(project.configurations) {
val mainRoots = mutableListOf<POrderRoot>()
val deferredRoots = mutableListOf<POrderRoot>()
val mainRoots = mutableListOf<POrderRoot>()
val deferredRoots = mutableListOf<POrderRoot>()
fun collectConfigurations(): List<CollectedConfiguration> {
val configurations = mutableListOf<CollectedConfiguration>()
for ((configurationNames, scope) in configurationMapping) {
for (configurationName in configurationNames) {
val configuration = findByName(configurationName)?.also { it.resolve() } ?: continue
val extraDependencies = resolveExtraDependencies(configuration)
configurations += CollectedConfiguration(configuration.resolvedConfiguration, scope, extraDependencies)
}
}
return configurations
for ((configurationNames, scope) in configurationMapping) {
for (configurationName in configurationNames) {
val configuration = configurations.findByName(configurationName) ?: continue
val (main, deferred) = project.resolveDependencies(configuration, forTests, dependencyMappers)
mainRoots += main.map { POrderRoot(it, scope) }
deferredRoots += deferred.map { POrderRoot(it, scope) }
}
nextDependency@ for (dependencyInfo in collectConfigurations().collectDependencies()) {
val scope = dependencyInfo.scope
if (dependencyInfo is DependencyInfo.CustomDependencyInfo) {
val files = dependencyInfo.files
val library = PLibrary(files.firstOrNull()?.nameWithoutExtension ?: "unnamed", classes = files)
mainRoots += POrderRoot(PDependency.ModuleLibrary(library), scope)
continue
}
val dependency = (dependencyInfo as DependencyInfo.ResolvedDependencyInfo).dependency
for (mapper in dependencyMappers) {
if (dependency.configuration in mapper.configurations && mapper.predicate(dependency)) {
val mappedDependency = mapper.mapping(dependency)
if (mappedDependency != null) {
val mainDependency = mappedDependency.main
if (mainDependency != null) {
mainRoots += POrderRoot(mainDependency, scope)
}
for (deferredDep in mappedDependency.deferred) {
deferredRoots += POrderRoot(deferredDep, scope)
}
}
continue@nextDependency
}
}
mainRoots += if (dependency.isModuleDependency && scope != Scope.TEST) {
POrderRoot(PDependency.Module(dependency.moduleName + ".src"), scope)
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
POrderRoot(
PDependency.Module(dependency.moduleName + ".test"),
scope,
isProductionOnTestDependency = true
)
} else {
val classes = dependency.moduleArtifacts.map { it.file }
val library = PLibrary(dependency.moduleName, classes)
POrderRoot(PDependency.ModuleLibrary(library), scope)
}
}
return removeDuplicates(mainRoots + deferredRoots)
}
return removeDuplicates(mainRoots + deferredRoots)
}
private fun resolveExtraDependencies(configuration: Configuration): List<File> {
return configuration.dependencies
.filterIsInstance<SelfResolvingDependency>()
.map { it.resolve() }
.filter { isGradleApiDependency(it) }
.flatMap { it }
}
private fun isGradleApiDependency(files: Iterable<File>): Boolean {
return listOf("gradle-api", "groovy-all").all { dep ->
files.any { it.extension == "jar" && it.name.startsWith("$dep-") }
}
}
private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
val dependenciesByScope = roots.groupBy { it.scope }.mapValues { it.value.mapTo(mutableSetOf()) { it.dependency } }
fun dependenciesFor(scope: Scope) = dependenciesByScope[scope] ?: emptySet<PDependency>()
@@ -480,59 +411,11 @@ private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
return result.toList()
}
data class CollectedConfiguration(
val configuration: ResolvedConfiguration,
val scope: Scope,
val extraDependencies: List<File> = emptyList())
val Project.pillModuleName: String
get() = path.removePrefix(":").replace(':', '.')
sealed class DependencyInfo(val scope: Scope) {
class ResolvedDependencyInfo(scope: Scope, val dependency: ResolvedDependency) : DependencyInfo(scope)
class CustomDependencyInfo(scope: Scope, val files: List<File>) : DependencyInfo(scope)
}
val ResolvedDependency.isModuleDependency
get() = configuration in JpsCompatiblePlugin.MODULE_CONFIGURATIONS
fun List<CollectedConfiguration>.collectDependencies(): List<DependencyInfo> {
val dependencies = mutableListOf<DependencyInfo>()
val unprocessed = LinkedList<DependencyInfo>()
val existing = mutableSetOf<Pair<Scope, ResolvedDependency>>()
for ((configuration, scope, extraDependencies) in this) {
for (dependency in configuration.firstLevelModuleDependencies) {
unprocessed += DependencyInfo.ResolvedDependencyInfo(scope, dependency)
}
if (!extraDependencies.isEmpty()) {
unprocessed += DependencyInfo.CustomDependencyInfo(scope, extraDependencies)
}
}
while (unprocessed.isNotEmpty()) {
val info = unprocessed.removeAt(0)
dependencies += info
info as? DependencyInfo.ResolvedDependencyInfo ?: continue
val data = Pair(info.scope, info.dependency)
existing += data
for (child in info.dependency.children) {
if (Pair(info.scope, child) in existing) {
continue
}
unprocessed += DependencyInfo.ResolvedDependencyInfo(info.scope, child)
}
}
return dependencies
}
private val Project.sourceSets: SourceSetContainer
val Project.sourceSets: SourceSetContainer?
get() {
lateinit var result: SourceSetContainer
project.configure<JavaPluginConvention> { result = sourceSets }
return result
val convention = project.convention.findPlugin(JavaPluginConvention::class.java) ?: return null
return convention.sourceSets
}

View File

@@ -13,51 +13,37 @@ import java.io.File
class PillConfigurablePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
project.configurations.maybeCreate(EmbeddedComponents.CONFIGURATION_NAME)
project.extensions.create("pill", PillExtension::class.java)
}
}
class JpsCompatiblePlugin : Plugin<Project> {
companion object {
val MODULE_CONFIGURATIONS = arrayOf("apiElements", "runtimeElements")
private fun mapper(module: String, vararg configurations: String): DependencyMapper {
return DependencyMapper("org.jetbrains.kotlin", module, *configurations) { MappedDependency(PDependency.Library(module)) }
}
private fun getDependencyMappers(projectLibraries: List<PLibrary>): List<DependencyMapper> {
val mappersForKotlinLibrariesExeptStdlib = projectLibraries
.filter { it.name != "kotlin-stdlib" }
.mapTo(mutableListOf()) { mapper(it.name, "default", "distJar", *MODULE_CONFIGURATIONS) }
.map { DependencyMapper.forProject(it.originalName) { MappedDependency(PDependency.Library(it.name)) } }
return mappersForKotlinLibrariesExeptStdlib + listOf(
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib", "distJar", *MODULE_CONFIGURATIONS) {
val disabledModuleMappers = listOf(
":kotlin-stdlib-common",
":core:builtins",
":kotlin-compiler",
":kotlin-compiler-embeddable",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-annotations-common"
).map { DependencyMapper.forProject(it) { null } }
return listOf(
DependencyMapper.forProject(":kotlin-stdlib") {
MappedDependency(
PDependency.Library("kotlin-stdlib"),
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper("org.jetbrains", "annotations", "default", version = "13.0") {
MappedDependency(
null,
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-reflect-api", *MODULE_CONFIGURATIONS) {
MappedDependency(PDependency.Library("kotlin-reflect"))
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler-embeddable", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "compiler", *MODULE_CONFIGURATIONS) { null },
DependencyMapper("kotlin.build.custom.deps", "android", "default") { dep ->
val (sdkCommon, otherJars) = dep.moduleArtifacts.map { it.file }.partition { it.name == "sdk-common.jar" }
val mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars))
val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon))
MappedDependency(mainLibrary, listOf(deferredLibrary))
}
)
DependencyMapper.forProject(":kotlin-test:kotlin-test-jvm") { MappedDependency(PDependency.Library("kotlin-test-jvm")) },
DependencyMapper.forProject(":kotlin-reflect-api") { MappedDependency(PDependency.Library("kotlin-reflect")) }
) + mappersForKotlinLibrariesExeptStdlib + disabledModuleMappers
}
fun getProjectLibraries(rootProject: Project): List<PLibrary> {
@@ -78,7 +64,8 @@ class JpsCompatiblePlugin : Plugin<Project> {
PLibrary(
library.name,
classes = listOf(File(libraryPath, "$archivesBaseName.jar")).filterExisting(),
sources = listOf(File(libraryPath, "$archivesBaseName-sources.jar")).filterExisting()
sources = listOf(File(libraryPath, "$archivesBaseName-sources.jar")).filterExisting(),
originalName = library.path
)
}
@@ -141,17 +128,20 @@ class JpsCompatiblePlugin : Plugin<Project> {
}
val projectLibraries = getProjectLibraries(rootProject)
val parserContext = ParserContext(getDependencyMappers(projectLibraries), variant)
val dependencyMappers = getDependencyMappers(projectLibraries)
val parserContext = ParserContext(dependencyMappers, variant)
val jpsProject = parse(rootProject, projectLibraries, parserContext)
.mapLibraries(this::attachPlatformSources, this::attachAsmSources)
generateKotlinPluginArtifactFile(rootProject).write()
val files = render(jpsProject)
removeExistingIdeaLibrariesAndModules()
removeJpsRunConfigurations()
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
generateKotlinPluginArtifactFile(rootProject, dependencyMappers).write()
copyRunConfigurations()
setOptionsForDefaultJunitRunConfiguration(rootProject)
@@ -163,7 +153,8 @@ class JpsCompatiblePlugin : Plugin<Project> {
initEnvironment(project)
removeExistingIdeaLibrariesAndModules()
removeJpsRunConfigurations()
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
}
private fun removeExistingIdeaLibrariesAndModules() {
@@ -171,10 +162,17 @@ class JpsCompatiblePlugin : Plugin<Project> {
File(projectDir, ".idea/modules").deleteRecursively()
}
private fun removeJpsRunConfigurations() {
private fun removeJpsAndPillRunConfigurations() {
File(projectDir, ".idea/runConfigurations")
.walk()
.filter { it.name.startsWith("JPS_") && it.extension.toLowerCase() == "xml" }
.filter { (it.name.startsWith("JPS_") || it.name.startsWith("Pill_")) && it.extension.toLowerCase() == "xml" }
.forEach { it.delete() }
}
private fun removeAllArtifactConfigurations() {
File(projectDir, ".idea/artifacts")
.walk()
.filter { it.extension.toLowerCase() == "xml" }
.forEach { it.delete() }
}
@@ -263,7 +261,8 @@ class JpsCompatiblePlugin : Plugin<Project> {
addOrReplaceOptionValue("idea.home.path", platformDirProjectRelative)
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
addOrReplaceOptionValue("robolectric.classpath", robolectricClasspath)
addOrReplaceOptionValue("use.pill", "true")
addOrReplaceOptionValue("use.jps", "true")
addOrReplaceOptionValue("kotlinVersion", project.rootProject.extra["kotlinVersion"].toString())
val isAndroidStudioBunch = project.findProperty("versions.androidStudioRelease") != null
addOrReplaceOptionValue("idea.platform.prefix", if (isAndroidStudioBunch) "AndroidStudio" else null)
@@ -299,7 +298,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
}
private fun attachPlatformSources(library: PLibrary): PLibrary {
val platformSourcesJar = File(platformDir, "../sources/ideaIC-$platformVersion-sources.jar")
val platformSourcesJar = File(platformDir, "../../../sources/intellij-$platformVersion-sources.jar")
if (library.classes.any { it.startsWith(platformDir) }) {
return library.attachSource(platformSourcesJar)

View File

@@ -31,12 +31,7 @@ private fun renderModulesFile(project: PProject) = PFile(
for (module in project.modules) {
val moduleFilePath = pathContext(module.moduleFile)
if (module.group != null) {
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath, "group" to module.group)
} else {
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath)
}
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath)
}
}
}
@@ -85,10 +80,8 @@ private fun renderModule(project: PProject, module: PModule) = PFile(
kotlinCompileOptions.noStdlib.option("noStdlib")
kotlinCompileOptions.noReflect.option("noReflect")
kotlinCompileOptions.moduleName.option("moduleName")
module.name.option("moduleName")
xml("option", "name" to "jvmTarget", "value" to platformVersion)
kotlinCompileOptions.addCompilerBuiltIns.option("addCompilerBuiltIns")
kotlinCompileOptions.loadBuiltInsFromDependencies.option("loadBuiltInsFromDependencies")
kotlinCompileOptions.languageVersion.option("languageVersion")
kotlinCompileOptions.apiVersion.option("apiVersion")
@@ -204,4 +197,4 @@ private fun renderLibraryToXml(library: PLibrary, pathContext: PathContext, name
}
}
fun PLibrary.renderName() = name?.takeIf { it != "unspecified" } ?: classes.first().nameWithoutExtension
fun PLibrary.renderName() = name.takeIf { it != "unspecified" } ?: classes.first().nameWithoutExtension

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 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.jakewharton.dex.*

View File

@@ -1,15 +1,8 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.*
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.language.jvm.tasks.ProcessResources
//import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
inline fun Project.sourceSets(crossinline body: SourceSetsBuilder.() -> Unit) =
SourceSetsBuilder(this).body()
inline fun Project.sourceSets(crossinline body: SourceSetsBuilder.() -> Unit) = SourceSetsBuilder(this).body()
class SourceSetsBuilder(val project: Project) {
@@ -40,23 +33,6 @@ val SourceSet.projectDefault: Project.() -> Unit
}
}
// TODO: adding KotlinSourceSet dep to the plugin breaks the build unexpectedly, resolve and uncomment
//val SourceSet.kotlin: SourceDirectorySet
// get() =
// (this as HasConvention)
// .convention
// .getPlugin(KotlinSourceSet::class.java)
// .kotlin
//
//
//fun SourceSet.kotlin(action: SourceDirectorySet.() -> Unit) =
// kotlin.action()
fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
evaluationDependsOn(projectPath)
return project(projectPath).sourceSets
}
val Project.sourceSets: SourceSetContainer
get() = javaPluginConvention().sourceSets

View File

@@ -1,7 +1,7 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.logging.Logger
import org.objectweb.asm.*
import org.jetbrains.org.objectweb.asm.*
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
@@ -23,7 +23,7 @@ fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFil
var changed = false
val classWriter = ClassWriter(0)
val classVisitor = object : ClassVisitor(Opcodes.ASM5, classWriter) {
val classVisitor = object : ClassVisitor(Opcodes.API_VERSION, classWriter) {
override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? {
if (Type.getType(desc).internalName == "kotlin/Metadata") {
changed = true

View File

@@ -25,10 +25,13 @@ import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.task
import java.io.File
import java.lang.Character.isLowerCase
import java.lang.Character.isUpperCase
import java.nio.file.Files
import java.nio.file.Path
fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}): Test = getOrCreateTask(taskName) {
fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, body: Test.() -> Unit = {}): Test = getOrCreateTask(taskName) {
doFirst {
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
val patterns = filter.includePatterns + commandLineIncludePatterns
@@ -98,6 +101,36 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
environment("PROJECT_BUILD_DIR", buildDir)
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
var subProjectTempRoot: Path? = null
doFirst {
val teamcity = rootProject.findProperty("teamcity") as? Map<Any?, *>
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 {
subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), project.name + "Project_" + taskName + "_")
systemProperty("java.io.tmpdir", subProjectTempRoot.toString())
}
}
doLast {
subProjectTempRoot?.let {
try {
delete(it)
} catch (e: Exception) {
project.logger.warn("Can't delete test temp root folder $it", e.printStackTrace())
}
}
}
if (parallel) {
maxParallelForks =
project.findProperty("kotlin.test.maxParallelForks")?.toString()?.toInt()
?: Math.max(Runtime.getRuntime().availableProcessors() / 2, 1)
}
body()
}
@@ -122,7 +155,7 @@ private fun Task.useAndroidConfiguration(systemPropertyName: String, configName:
.also {
dependencies.add(
configName,
dependencies.project(":custom-dependencies:android-sdk", configuration = configName)
dependencies.project(":dependencies:android-sdk", configuration = configName)
)
}
}

View File

@@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] All Compiler Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="JUnit" name="[JPS] Compiler Tests" />
<toRun type="JUnit" name="[JPS] JS Backend Tests" />
<toRun type="JUnit" name="[JPS] Java 8 Tests" />
<method />
</configuration>
</component>

View File

@@ -1,37 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] All IDEA Plugin Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="idea.test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,35 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Compiler Tests" type="JUnit" factoryName="JUnit">
<module name="compiler.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Generate All Tests" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.pill.generateAllTests.Main" />
<module name="generate-all-tests.test" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<method />
</configuration>
</component>

View File

@@ -1,41 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] IDEA" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -1,41 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] JS Backend Tests" type="JUnit" factoryName="JUnit">
<module name="js.tests.test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.js.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true -Duse.pill=true -Dkotlin.js.skipMinificationTest=false" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,35 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] JVM Backend Tests" type="JUnit" factoryName="JUnit">
<module name="compiler.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,26 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Java 8 Tests" type="JUnit" factoryName="JUnit">
<module name="tests-java8.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Dkotlin.colors.enabled=false -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,21 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Refresh JPS Model" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="pill" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
</component>

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