Commit Graph

45134 Commits

Author SHA1 Message Date
Nikolay Krasko c5e8374fa8 Minor: typo fix (KT-23309)
#KT-23309 Fixed
2018-03-23 17:58:12 +03:00
Nikolay Krasko 0f441760c2 Refactoring: remove usages of analyzeFully
Function isn't removed because it has usages from other plugins
2018-03-23 17:58:11 +03:00
Nikolay Krasko 059013a8d3 Rename: analyzeFullyAndGetResult -> analyzeWithAllCompilerChecks in ResolutionFacade 2018-03-23 17:58:11 +03:00
Nikolay Krasko f2b478f304 Rename: analyzeFullyAndGetResult -> analyzeWithAllCompilerChecks in resolutionApi.kt 2018-03-23 17:58:10 +03:00
Mikhail Glukhikh 804d340c5f Fix more broken QF tests 2018-03-23 15:26:21 +03:00
Mikhail Glukhikh e937a350fe Fix broken QF tests 2018-03-23 14:57:33 +03:00
Ilmir Usmanov 481dbee96a Do not ignore copy operations while finding source instructions
in redundant locals elimination.

Since IgnoringCopySourceInterpreter ignores ALOADs and ASTOREs,
the source instruction of ALOAD K in {ALOAD N, ASTORE K, ALOAD K}
sequence is not ASTORE K. In this case we cannot simply replace K
with N, since there can be multiple {ALOAD N, ASTORE K} sequences
in separate branches. After replacement we get different stack
frames.
This change resolves this.

However, in ReturnUnitMethodTransformer we want to ignore copies
of the same GETSTATIC kotlin/Unit.INSTANCE, since we do not mess
with local variables and just replace ASTORE with ARETURN to help
tail-call optimization.
 #KT-23373: Fixed
2018-03-23 14:32:48 +03:00
Mikhail Zarechenskiy 15b46cdda9 [NI] Don't perform useless computation for smartcasts 2018-03-23 14:18:32 +03:00
Toshiaki Kameyama e06c13732f Add intentions for specifying use-site targets for an annotation
So #KT-19871 Fixed
2018-03-23 13:03:00 +03:00
Denis Zharkov e162749366 Add a cache for PsiBasedClassResolver instances
The PsiBasedClassResolver constructor isn't very cheap to call
because it runs computation of conflicting names each time

Again, this is helpful for Spring-interop because PsiBasedClassResolver
is used very frequently there

 #KT-23380 Fixed
2018-03-23 12:36:15 +03:00
Denis Zharkov f060604d98 Add a cache for KtImportDirective::importedFqName
It's very useful for Spring users because KotlinAnnotatedElementsSearcher
calls PsiBasedClassResolver::canBeTargetReference rather frequently
on a file and the latter function retreives importedFqName for each
import in the file that becomes a problem because computing fq-name
from PSI is a heavy computation

 #KT-23380 In Progress
2018-03-23 12:36:15 +03:00
Denis Zharkov 673d1aa91d Fix a memory leak of old resolve session from light classes
The problem is that diagnostics might indirectly retain a reference to an
obsolete ResolverForProject (it becomes outdated after out of block
modification).

At the same time light class instances may survive afer OOM when they
are leaked somewhere (e.g. to Java resolve)

The idea is to store the Diagnostics instance inside a
ResolverForProject component which will be collected once
ResolverForProject is collected itself.

 #KT-23380 In Progress
2018-03-23 12:36:15 +03:00
Dmitry Petrov bd7e9d5397 Fix type argument mapping for members imported from objects 2018-03-23 11:43:44 +03:00
Dmitry Petrov 37040523ad valueArgumentsCount 2018-03-23 11:43:44 +03:00
Dmitry Petrov 3c7914b0c1 Minor: drop obsolete code 2018-03-23 11:43:44 +03:00
Dmitry Petrov 135d3ab57a Fix type arguments mapping 2018-03-23 11:43:44 +03:00
Dmitry Petrov eb5904ea8e Underlying constructor for type alias should always be substituted
Otherwise PSI2IR fails because of type mismatch.
2018-03-23 11:43:44 +03:00
Dmitry Petrov bfcf1584a2 Minor: reformat code 2018-03-23 11:43:44 +03:00
Toshiaki Kameyama 26dc5840f1 Fix two exceptions in "Convert concatenation to template
So #KT-23045 Fixed
So #KT-23045 Fixed
2018-03-23 09:36:49 +03:00
Toshiaki Kameyama 7328f75103 Don't suggest 'Redundant semicolon' before lambda extension call
So #KT-23152 Fixed
2018-03-23 09:35:34 +03:00
Ilya Gorbunov 5d06c2c584 Code conformance test: actualize stdlib and tools exclusions 2018-03-23 04:25:07 +03:00
Ilya Gorbunov bb04198f7e kotlin-stdlib-gen: add dsl option for multiple suppressed diagnostics 2018-03-23 04:23:25 +03:00
Ilmir Usmanov bd7ad8c9d5 Raise deprecation level to ERROR of coroutineContext
inside kotlin.coroutines.experimental.intrinsics package
 #KT-22400
2018-03-22 22:12:27 +03:00
Ilya Gorbunov dd8a00f651 Make kotlin-test-js implement both kotlin-test-common and kotlin-test-annotations-common 2018-03-22 21:55:04 +03:00
Natalia Selezneva c7513b5ffa Fix compatibility with LivePlugin
^KT-23371 Fixed
2018-03-22 17:17:59 +03:00
Ilya Gorbunov 7a40b4c5f1 Refactor: extract JVM-specific tests into separate files
Make KotlinVersion random comparison test running in JS
2018-03-22 17:08:43 +03:00
Ilya Gorbunov 2d099a29b8 Clean up redundant -Xmulti-platform option from multiplatform projects
It was necessary before, but now it's provided automatically.
2018-03-22 15:16:33 +03:00
Nikolay Krasko 117890dba8 Fix generating cls stubs when is metadata using type tables (KT-23345)
Affected cases:
 - return type for suspend lambda
 - aliased type in type alias declaration
 - using type alias instead of aliased type in declarations

 #KT-23345 Fixed
2018-03-22 11:54:03 +03:00
Nikolay Krasko 875e0a64e7 Add -Xuse-type-table to jvm compiler options 2018-03-22 11:54:01 +03:00
Toshiaki Kameyama a67068d37e Suggest "Add annotation target" quick fix also for field use-site
So #KT-23227 Fixed
2018-03-22 10:30:46 +03:00
Toshiaki Kameyama e328d2d1ca Suggest "Remove braces" in nested if correctly #KT-14270 Fixed 2018-03-22 09:56:22 +03:00
Toshiaki Kameyama 8082a5daf7 Fix "Add braces to if" when semicolon is used instead of a new line
So #KT-23123 Fixed
2018-03-22 09:45:54 +03:00
Yan Zhulanow 369dbd604b Android modules should not be imported as common modules (#KT-23367) 2018-03-22 04:53:00 +03:00
Yan Zhulanow db20c1a38f Minor: Add Android Studio platform prefix in Android patchset branches to fix 'runIde' task for them 2018-03-22 04:52:59 +03:00
Yan Zhulanow 3932c745df Minor: Fix bundled Kotlin plugin removal in Android Studio bundle for macOS 2018-03-22 04:52:58 +03:00
Mikhail Zarechenskiy effdfe8ec0 Prohibit incorrect annotations with use-site targets more precisely
#KT-21696 Fixed

The problem is coming from the fact that `AnnotationTarget.VALUE_PARAMETER` is mapped to receiver parameter and to value parameter, but annotation with use-site target `receiver` can be used only on type reference of receiver parameter
2018-03-22 04:03:08 +03:00
Mikhail Zarechenskiy 6007559af1 Minor, remove unused method, add TODO 2018-03-22 04:03:06 +03:00
Mikhail Zarechenskiy 6086cd2cf4 Prohibit non-const expressions through varargs in annotations
Fixes #KT-23153 for Kotlin 1.3

 The problem was in the type check of expression type against expected type. When feature `AssigningArraysToVarargsInNamedFormInAnnotations` (KT-20171) appeared, expected type could be wrong, which led to failed type check
2018-03-22 04:03:04 +03:00
Mikhail Zarechenskiy 4ebd11a7ae Refactoring: rename parameter to argument for annotation diagnostics 2018-03-22 03:59:55 +03:00
Mikhail Zarechenskiy baf16895f2 Refactor and prettify checkCompileTimeConstant method 2018-03-22 03:03:56 +03:00
Vyacheslav Gerasimov 96caf7f4ce Build: Get rid of build scan deprecated methods 2018-03-21 20:08:42 +03:00
Alexey Tsvetkov 605bcc66a1 IC: add destination dir to start of classpath instead of end
Otherwise IC fails when a project declares a class with the same name
as in one of its dependencies.
The issue is relevant only for non-JPS IC (Gradle, Maven, etc.),
but I added the test for JPS too.

  #KT-20516 fixed
2018-03-21 18:44:42 +03:00
Alexey Tsvetkov 55cbd28910 Do not exclude :ultimate:generateTests in "Generate All Tests"
:ultimate is excluded by default now,
so `-x :ultimate:generateTests` fails
2018-03-21 18:44:42 +03:00
Ilya Gorbunov 5d13b1681f Refactor: extract JVM API into separate files
Increase visibility to internal for:
- copyToArrayOfAny
- UNINITIALIZED_VALUE
- InitializedLazyImpl

Change file classes to multifile:
- LazyKt
- GroupingKt
- IntrinsicsKt (coroutines)
2018-03-21 18:08:00 +03:00
Nikolay Krasko 5dc4e31918 Update idea to 173.3.5 (173.4674.33) 2018-03-21 17:25:45 +03:00
Nikolay Krasko 3b4ca3558b Add hard dependency to Java module in plugin.xml
Otherwise resulting plugin will be installable to PyCharm, WebStorm and
other Intellij IDE without Java.

It can be resolved with `xi:include`, but it should be done with care,
because some declarations in `jvm.xml` should be placed after some
declarations in `plugin.xml` (action groups suffer from this issue for
sure).
2018-03-21 17:25:40 +03:00
Nikolay Krasko d847f9f7ac Use stringValue for getting version of *jre usage in Maven (KT-23271)
#KT-23271 Fixed
2018-03-21 17:25:34 +03:00
Natalia Selezneva 3b11b890e9 Set FATAL severity for errors from GradleScriptTemplateProvider 2018-03-21 16:51:53 +03:00
Roman Artemev 0d0adbbc05 Fixed handling of default params in declaration (KT-23239) 2018-03-21 12:44:24 +03:00
Roman Artemev a121a4a6b2 Added test to check default params in declaration (issue KT-23239) 2018-03-21 12:44:24 +03:00