Commit Graph

50638 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich 39cdee8d6c [JS IR BE] Enable IrValidator 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich 2172a12df4 [JS IR BE] Eliminate identical IrElements duplicates 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich ba0f652e02 [JS IR BE] Fix parameters parents 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich d5f8c63130 [IR] Add returnType to consturcotrs of IrFunctionBase 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich fe6b36391d [JS IR] JsIrBuilder - add returnType and parent to buildFunction 2018-11-29 15:36:56 +03:00
Ilmir Usmanov 0934db8fbd Do not transform state-machine when inlining
Sometimes, state-machine, generated in inline functions with
crossinline parameter, is transformed, since all usages should be
renamed.
However, this is wrong: in this case, we will have state-machine
inside state-machine.
This fix addresses the issue.

 #KT-25893 Fixed
2018-11-29 14:58:35 +03:00
Toshiaki Kameyama d3908aeb2e Add "map.get() with not-null assertion operator" inspection #KT-25171 Fixed 2018-11-29 14:42:18 +03:00
Mikhail Glukhikh c5c0cbccde Redundant companion reference: simplify name conflict checking code
Before this commit, function with same name but different signature
wasn't counted as name conflict, now it is - just because that exact
check in this place could be too complex and error-prone

Enhancement for KT-27539
2018-11-29 14:32:08 +03:00
Toshiaki Kameyama 1db7a0e0cc Redundant companion reference: don't report in case of name conflicts
#KT-27539 Fixed
2018-11-29 14:32:08 +03:00
Mikhail Zarechenskiy 6e27d7a2a5 [NI] Refactor common supertype calculator
Make filtration phases more explicit, get rid of `filterNot`
2018-11-29 14:08:04 +03:00
Mikhael Bogdanov 623f31a178 Remove redundant tests 2018-11-29 12:02:05 +01:00
Mikhael Bogdanov aa12439e65 Add 'visitAnnotableParameterCount' to MethodBodyVisitor.kt 2018-11-29 12:02:04 +01:00
Mikhael Bogdanov c6268d72c9 Separate RemapVisitor and MethodBodyVisitor 2018-11-29 12:02:03 +01:00
Nikolay Krasko 226ade615c Show build number in internal mode (KT-28254)
^KT-28254 Fixed
2018-11-29 13:31:09 +03:00
Nikolay Krasko 0aec18c440 Minor: explain in comment when light class can be null 2018-11-29 13:31:08 +03:00
Nikolay Krasko 05b2443988 Make assignment indent conforms with indent for expression bodies (KT-28484)
Do not make plain list of binary expression for assignment expressions.

 #KT-28484 Fixed
2018-11-29 13:31:07 +03:00
Nikolay Krasko 699e3397d9 Warn about bad options in usage parsers in tests 2018-11-29 13:31:04 +03:00
Mikhail Glukhikh 9b4bcabbd3 Fold initializer & if to elvis: add test, rename tests, simplify code
Enhancement for KT-27016
2018-11-29 13:20:54 +03:00
Toshiaki Kameyama fd6f34f8ca "Replace 'if' with elvis operator": don't suggest on super type check
#KT-27016 Fixed
2018-11-29 13:20:54 +03:00
Georgy Bronnikov ffa3d7c57a Update test data 2018-11-29 12:48:52 +03:00
Georgy Bronnikov 32640750ee Add CompilerPhase and corresponding compiler keys 2018-11-29 12:48:52 +03:00
Alexander Prendota ecba313223 ReadMe: update Kotlin playground link 2018-11-29 12:16:57 +03:00
Ilya Chernikov 7719a5849f Refactor templates from dependencies loading:
move into background thread
avoid parallel execution
other refactorings

#KT-27669 fixed
2018-11-29 09:47:15 +01:00
Ilya Chernikov e91fd63a15 Add config entry for main.kts to recognise it in all locations 2018-11-29 09:47:15 +01:00
Ilya Chernikov c67df19281 Improve classpath calculation for locally-defined script templates
Since at least in gradle-imported projects, the template could be found
in several modules, some of them - incomplete (parent/buildscript module)
the previous logic of filtering for already processed templates and roots
is incorrect, and therefore removed.
Also fixes the exception in our project "cannot load script definition"
2018-11-29 09:47:15 +01:00
Natalia Selezneva 4b5ba83c77 Tests: synchronize script dependencies in the beginning of the test because it invalidates the tested psi file
Fix for StandaloneScriptRunConfigurationTest.testOnFileMoveWithNonDefaultWorkingDir
2018-11-28 16:04:50 +03:00
Natalia Selezneva 9f372c3c66 Update dependencies for AS34 (Canary 3.4.0.5) 2018-11-28 16:04:50 +03:00
Natalia Selezneva 25043a720c Tests: allow document modification during highlighting for scripts in LocalInspectionTest
Fix 'java.lang.AssertionError: PSI/document/model changes are not allowed during highlighting'
For script when there are some new dependencies we are restarting highlighting (see ScriptDependenciesCache)
2018-11-28 16:04:49 +03:00
Natalia Selezneva 902c4688a2 Tests: register jdk in project table to avoid leaking of VirtualPointer 2018-11-28 16:04:49 +03:00
Natalia Selezneva 1b0919a019 Fix navigation on stdlib in non-gradle projects (KT-28398)
In non-gradle project kotlin-stdlib-sources.jar contains sources for common and jvm part, so both (expect and actual) declarations are present in the same library sources scope.
We are moving expect declarations in the bottom of this list to avoid navigation on expect declaration when actual declaration is present in the same scope
^KT-28398 Fixed
2018-11-28 16:04:49 +03:00
Natalia Selezneva 8033ec469c Revert wrong testdata fix in NavigateToStdlibSourceTest 2018-11-28 16:04:49 +03:00
Simon Ogorodnik 29a1204b48 Fix test failures on CI due to ProGuard-ed Guava 2018-11-28 15:29:01 +03:00
Dmitriy Dolovov 42392fff23 Fix: Analysis in scratch ends with ISE
Issue #KT-28427:fixed
2018-11-28 18:58:57 +07:00
Toshiaki Kameyama dc2a707444 Keyword completion: add 'class' after 'data' #KT-26632 Fixed 2018-11-28 14:47:37 +03:00
Dmitry Petrov 42e253b5ff KT-28456 generate index arguments per expression
In the desugaring for compound assignment to a collection element,
argument expression 'i' is mapped to value parameters 'iG' and 'iS' of
corresponding 'get' and 'set' operators.
In general, these value parameters can have different indices.

This requires extra machinery in argument generation - that is, to be
able to generate a particular expression argument using an arbitrary
callback. In the vast majority of the cases this callback will just use
the corresponding StatementGenerator to generate IR subtree for the
provided expression. In case of 'get' and 'set' operator calls for an
augmented assignment expression this will map corresponding argument
expressions to pregenerated temporary variables.

Thus, in the following context:
```
  class A

  operator fun A.get(vararg xs: Int) = 0
  operator fun A.set(i: Int, j: Int, v: Int) {}
```

statement `a[1, 2] += 3` will be desugared as (in a really pseudo
Kotlin):
```
  {
    val tmp_array = a
    val tmp_index0 = 1
    val tmp_index1 = 2
    tmp_array.set(
      i = tmp_index0,
      j = tmp_index1,
      v = tmp_array.get(xs = [tmp_index0, tmp_index1]).plus(3)
    )
  }
```
2018-11-28 14:36:44 +03:00
Toshiaki Kameyama 036b12f408 Extract interface: do not show private contstractor parameter on dialog
#KT-28408 Fixed
2018-11-28 13:46:57 +03:00
Mikhail Glukhikh 8fb213021c Create expect: remove false positive in inaccessible type detector 2018-11-28 12:36:29 +03:00
Mikhail Glukhikh 9ae7bc935d Create expect / actual refactoring: extract AbstractCreateDeclarationFix 2018-11-28 12:36:22 +03:00
Mikhail Glukhikh 222939efe7 Create expect / actual refactoring: extract common part to utilities 2018-11-28 12:00:55 +03:00
Mikhail Glukhikh 17e0e529e0 Create actual refactoring: get rid of actualNeeded 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh d54b5b68cc Create expect / actual refactoring: get element description at one place 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh 933d10e75d Create expect / actual refactoring: remove all declarations at start 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh d3fada89b7 Generate enum entries in create actual / expected fixes as all other
This makes code a bit cleaner
2018-11-28 12:00:54 +03:00
Cuihtlauac ALVARADO a9280cdbcd Add support for proxies to scripts
Update jcabi-aether dependency from 0.10.1 to 1.0-SNAPSHOT. In order to
do that, add https://oss.sonatype.org/content/repositories/snapshots to
the repositories in tools/kotlin-script-util/build.gradle.kts

Script dependencies are resolved using jcabi-aether. Unfortunately "stable"
release (0.10.1) does not support proxies. Therefore, script dependencies
are not pulled behind a proxy. Issue is fixed in SNAPSHOT release of
jcabi-aether.

FIXED: KT-22363
2018-11-28 09:30:05 +01:00
Natalia Selezneva e3eda012c4 Tests: synchronize script dependencies in the beggining of the test because it invalidates the tested psi file 2018-11-28 11:16:26 +03:00
Natalia Selezneva 2d2a073c55 Tests: replace immediate run with TransactionGuard.submitTransaction to fix write in write-unsafe context in tests 2018-11-28 11:16:26 +03:00
Sergey Rostov 62b0b3e4e9 JPS: report about unsupported targets once
Report about unsupported targets once per target type, show presentable
chunks list and don't show more then 5 chunks.

Example: "Native is not yet supported in IDEA internal build system.
Please use Gradle to build a, b, c, d, e and 10 other  (enable 'Delegate
IDE build/run actions to Gradle' in Settings)."

#KT-26980 Fixed
#KT-28316 Fixed
2018-11-28 11:08:57 +03:00
Sergey Rostov ab2b4311fd JPS: fix SimpleKotlinJpsBuildTest.testDaemon
Make it the same as testJpsDaemonIC
2018-11-28 10:46:57 +03:00
Sergey Rostov 0c39358b5f JPS: fix testJpsDaemonIC
1. Checking for COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was moved to COMPILE_DAEMON_DEFAULT_RUN_DIR_PATH.

Looks like COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was introduced incorrectly in 220fab0d3f.
Checking of this property was added in DaemonOptions.runFilesPathOrDefault, while DaemonOptions.runFilesPath was internally used in runFilesPathOrDefault and in many other places.
For example DaemonOptions.runFilesPath used to pass this option to daemon server.
So daemon was started with runFilesPath that ignores COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS.

2. JpsKotlinCompilerRunner._jpsCompileServiceSession was leaked between tests.

Fixed by extracting @TestOnly releaseCompileServiceSession() and calling it in tests tearDown()

3. The result of compileWithDaemon was ignored in compileWithDaemonOrFallback.

So, the fallback was never called, and the FAIL_ON_FALLBACK_PROPERTY was actually was never worked.
This was fixed. Also the message was improved to make it easier to find the original fail cause.
2018-11-28 10:46:57 +03:00
Sergey Rostov c06b000e8d JPS: Test for "Cyclically dependent modules should have same compiler"
KT-27285
2018-11-28 10:46:57 +03:00