Commit Graph

45711 Commits

Author SHA1 Message Date
Alexander Udalov adb15d2d1a Do not report JvmOverloads warning on actual function with expected defaults
#KT-23910
2018-04-30 15:26:50 +02:00
Alexander Udalov 056c41bc00 Minor, improve kdoc of default args utilities in ArgumentsUtils.kt 2018-04-30 15:26:50 +02:00
Alexander Udalov a8488cf298 Fix JvmOverloads generation for actual methods
`countDefaultParameters` uses `hasDefaultValue` to compute the number of
parameters which have default values, which handles actual parameters
(who have default values in the expected declaration) correctly. Thus,
`getRemainingParameters` should use it as well to determine the list of
parameters to be skipped in each generated overload

 #KT-23910 Fixed
2018-04-30 15:26:50 +02:00
Alexander Udalov 516e7df4b7 Reformat DefaultParameterValueSubstitutor, fix inspections 2018-04-30 15:26:49 +02:00
Nicolay Mitropolsky efd743284e CommonIntentionActionsTest.testRemoveConstructorParameters test fix for 181, 182, as32 2018-04-29 11:48:28 +03:00
Nikolay Krasko 398795b832 Fix AddRequireModuleTest in 181
- Application is null before setUp call in individual run
- Inline "module.info.add.requires.family.name" as 181 has other constant
- isScriptDependenciesUpdaterDisabled call seems to be useless
2018-04-28 22:27:35 +03:00
Nikolay Krasko af930b8364 Review and fix raw string quotes inserting and remove (KT-2582)
- Add more tests
 - Fix inserting close quotes after multiline string in file end
 - Use parent instead of parentOfType where possible
 - Add bunch files

 #KT-2582 Fixed
2018-04-28 22:27:34 +03:00
Steven Spungin 8252b35ed5 Add support for closing and deleting raw strings (KT-2582)
#KT-2582 Fixed
2018-04-28 22:27:34 +03:00
Nikolay Krasko 5216dfcc59 Add internal errors to test data in multi module tests
Tests started to fail after 82a21b3955.
2018-04-28 22:24:39 +03:00
Ilya Gorbunov 2c9c6eb746 Reformat stdlib: new coroutines 2018-04-28 18:58:56 +03:00
Mikhail Glukhikh 2854e6b7a1 Reformat: BranchedFoldingUtils 2018-04-28 18:44:29 +03:00
Toshiaki Kameyama 89981ecbbb Lift Assignment: process lambda assignments in when correctly
So #KT-23346 Fixed
2018-04-28 18:44:29 +03:00
Ilya Gorbunov 7438d12ad7 Move builtins generators to their own source set
Make them depend on bootstrap stdlib.
This is to prevent recompiling the entire project when we need just to
generate builtins sources.
2018-04-28 17:38:13 +03:00
Ilya Gorbunov a704a1b6d0 Allow to create new sourcesets with our helper
New sourceSet is created if it doesn't exist, instead of being silently ignored.
Fix receiver of `none()`: it was applied on sourceSetName rather than on the sourceSet,
therefore it was a no-operation.
2018-04-28 17:35:30 +03:00
Denis Zharkov 8e1b0c5ab7 Optimize memory footprint for PartialBodyResolveFilter
There is a single PartialBodyResolveFilter instance per module
and each of them were containing just the same sets of available
in project Nothing-typed functions (including duplicating String instances),
in case of Kotlin project it might sum up to 27M of heap.

The solution is to share the global sets between all modules in a project
2018-04-28 17:12:52 +03:00
Denis Zharkov 26714d56d8 Use WeakKeySoftValueMap in ResolveElementCache
Otherwise results are effectively retained in the maps until we're close
to OutOfMemory.
While we mostly need them for a short time (especially in the case we
run resolution during usages search).

The possible problem is that the values may become too short-living,
but now using these maps is a conventional solution for similar tasks in
Java resolve
2018-04-28 17:12:52 +03:00
Denis Zharkov 96ab705de1 Use PsiField::computeConstantValue to avoid building AST 2018-04-28 17:12:52 +03:00
Denis Zharkov bb45959470 Avoid switching to AST in CodegenAnnotatingVisitor for light classes 2018-04-28 17:12:52 +03:00
Denis Zharkov 2a713a972d Postpone computing AST when it's used only for reporting 2018-04-28 17:12:52 +03:00
Denis Zharkov 0788afe92c Avoid computing AST for IdentifierChecker
Basically, it's unnecessary to check anything when analysing stubs,
but it's complicated now to avoid that, so we just postpone
computing AST until reporting happens
2018-04-28 17:12:52 +03:00
Mikhail Glukhikh 6e8247f7cf Fix leaking this test in 181 branch 2018-04-28 15:46:37 +03:00
Roman Artemev d9fdddceb9 Update test data 2018-04-27 20:02:59 +03:00
Roman Artemev 8bc80a9829 Fix secondary constructor lowering 2018-04-27 20:02:57 +03:00
Roman Artemev 8721990a7f Implement access to members of super class 2018-04-27 20:02:56 +03:00
Roman Artemev cf31e544eb Implement default interface members 2018-04-27 20:01:45 +03:00
Roman Artemev d861fb498f Implement string plus operator 2018-04-27 20:00:41 +03:00
Roman Artemev 01fea13467 Fix name clashing between local variables 2018-04-27 20:00:41 +03:00
Roman Artemev 997328f584 Refactoring and fixes 2018-04-27 20:00:40 +03:00
Roman Artemev deab0a017b Add support for inner clases 2018-04-27 20:00:40 +03:00
Roman Artemev 746eb4b93e Implement object class in JS BE 2018-04-27 20:00:39 +03:00
Roman Artemev 17ee38a0b7 Refactor secondary constructor lowering using new builders 2018-04-27 20:00:38 +03:00
Roman Artemev 752cbf2714 Implemented KFunction interface 2018-04-27 20:00:32 +03:00
Roman Artemev 09c54f1da3 Add symbol & IR builders to JS backend 2018-04-27 19:53:47 +03:00
Roman Artemev c1a4aeb67f Lift InnerClassesLowering from JVM to common since it is used by every backend in the same way 2018-04-27 19:53:47 +03:00
Roman Artemev ed0c26ef07 Implement function literals in JS BE 2018-04-27 19:53:47 +03:00
Nikolay Krasko c83ff5e75f Remove files introduced in 181 from 173 branch 2018-04-27 19:45:23 +03:00
Nikolay Krasko 6683e07112 181: [Tests] Revert "Allow different diagnostics in Javac tests - workaround for IDEA-184289"
It is fixed in 181
2018-04-27 18:29:57 +03:00
Vyacheslav Gerasimov c16a5c2538 Switch .bunch file to 181 2018-04-27 18:25:23 +03:00
Vyacheslav Gerasimov 8c88ac69df Cleanup .181 bunch files 2018-04-27 18:25:21 +03:00
Vyacheslav Gerasimov bc403ce744 Switch to 181 platform 2018-04-27 18:25:17 +03:00
Mikhail Glukhikh df59af8ee8 Move sort modifiers test to inspection local group
This should fix test in 181 branch
2018-04-27 17:26:56 +03:00
Mikhail Glukhikh 8f0c53d0de If then to elvis: handle nullability even with implicit receiver
So #KT-22741 Fixed
2018-04-27 17:26:50 +03:00
Mikhail Glukhikh 49165bdbef Cleanup: better visibility 2018-04-27 17:26:37 +03:00
Mikhail Glukhikh 7601aaf89f Reformat IfThenToElvisIntention 2018-04-27 17:26:36 +03:00
Denis Zharkov b75024e3e0 Fix memory leak related to diagnostics computation within light classes
Before this change, when somebody has requested the exact light class
we also store LazyJvmDiagnostic for it in a map inside DiagnosticHolder.

The problem is that LazyJvmDiagnostic retains a lot of memory:
GenerationState, bindingContext, etc.

At the same time, it commonly happens that light classes are being computed from Java resolve and diagnostics are obviously
unnecessary there.

The solution has two parts:
1. We don't retain diagnostics until somebody explicitly requested them
2. We force computation of LazyJvmDiagnostic to avoid retaining
backend's parts

The solution has a kind of drawback: for an opened in editor Kotlin file,
we'll run back-end twice for contained classes (analysis parts should be reused, though)

 #KT-24048 Fixed
2018-04-27 16:13:59 +03:00
Natalia Selezneva 26f1d6ae7c Update Icon for .kts and .gradle.kts files
^KT-23431 Fixed
2018-04-27 13:52:31 +03:00
Natalia Selezneva 9107ef6490 New Script File Action
^KT-10935 Fixed
2018-04-27 13:52:26 +03:00
Natalia Selezneva 1d8d1e847a Minor: add debug name for ErrorGradleScriptDefinition 2018-04-27 13:52:22 +03:00
Natalia Selezneva ec63efec3c Debugger: refactor list of breakpoints for the line with lambdas.
^KT-24136 Fixed

Rename main line breakpoint to "Line"
Change icon for lambda-breakpoint
Move "all breakpoint" to the end of the breakpoints list
2018-04-27 13:52:06 +03:00
Nikolay Krasko 8bce29df3a Show plugin installation status in Kotlin Updates settings (KT-23980)
#KT-23980 Fixed
2018-04-27 13:08:28 +03:00