Commit Graph

45728 Commits

Author SHA1 Message Date
Mikhael Bogdanov bb6c837f6b Use symbols in IrGet/SetValue in EnumClassLowering 2018-05-03 11:38:52 +02:00
Mikhael Bogdanov 5a2e62dd4f Use symbols in IrGet/SetValue 2018-05-03 11:38:50 +02:00
Mikhael Bogdanov 077f3a4ed2 Minor. Reformat 2018-05-03 11:27:57 +02:00
Mikhael Bogdanov ed44327569 Properly set parents in JvmLower 2018-05-03 11:23:57 +02:00
Mikhael Bogdanov e793a7eea7 Use symbols in synthetic accessor to access accessor parameters 2018-05-03 11:23:56 +02:00
Mikhael Bogdanov 92e02e35fc Convert FrameMap to Kotlin and extract base logic 2018-05-03 11:23:56 +02:00
Mikhael Bogdanov 76bab8f3b0 Rename FrameMap.java to FrameMap.kt 2018-05-03 11:23:55 +02:00
Natalia Selezneva 49a1788728 Update testData after switching on kotlin internal mode in tests 2018-05-03 11:32:52 +03:00
Mikhail Zarechenskiy 5815e790ba Minor, use utility to get default type for number type constructor 2018-05-03 11:04:55 +03:00
Mikhail Zarechenskiy d6405c8147 Fix exception on mapping internal types to UAST types with NI
#EA-119071 Fixed
2018-05-03 11:04:54 +03:00
Ilmir Usmanov f507a26a12 Generate decomposed lambda params in suspend lambda's local variables
Unlike ordinary lambdas, suspend lambdas do the computation in
doResume(Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;
method. As you can see, there are no decomposed parameters. As a result,
they used not to be generated.
To fix the issue, I add decomposed parameters to value parameters while
generating local variables table.

In addition, when generating suspend lambda for inline, the codegen
does not take this kind of parameters into account. This is also fixed.

 #KT-18576: Fixed
2018-05-03 10:35:13 +03:00
Alexander Udalov 712a796637 Fix MultiModuleHighlightingTestGenerated.testUseCorrectBuiltInsForCommonModule
Add dependency from a_jvm8 on stdlib. Otherwise, `getEmptyList` from
a_common was resolved to have an error return type
2018-05-02 16:56:54 +02:00
Alexander Udalov ac4edbba5b Regenerate tests 2018-05-02 16:17:14 +02:00
Alexander Udalov f59963ef73 Simplify test case on deterministic null-checks 2018-05-02 14:40:15 +02:00
Denis Vnukov c5373c9029 Ensure deterministic insertion of checkExpressionValueIsNotNull.
Kotlinc source’s file DescriptorUtils.kt demonstarted non-deterministic
insertion of checkExpressionValueIsNotNull for value returned by
CallableDescriptor::getOriginal(). It was difficult to reproduce
this behavior on ф smaller example, but I added a test which was
failing once in 5-10 times while I was testing manually.

I believe this bug is close to KT-23704.

This PR addresses non-determinism to a degree when I can run 120
Compilations with './gradlew dist' and get same classes in all
jars in 'dist'.

NOTE that thew fact that insertion of checkExpressionValueIsNotNull may
depend on order of the types seems suspicios. This CL only addresses
non-determinism part, but I believe it’s worth looking into this more
from semantics point of view.
2018-05-02 14:36:04 +02:00
Alexander Udalov 10da41b136 Regenerate tests 2018-04-30 18:51:28 +02:00
Alexander Udalov c63cd430d1 Fix no-arg constructor generation for actual class 2018-04-30 15:26:50 +02:00
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