Commit Graph

70223 Commits

Author SHA1 Message Date
Alexander Udalov 4bd08e5e0c IR: clear callToSubstitutedDescriptorMap for each file to avoid leaking memory
This map is populated during psi2ir and is only used in
insertImplicitCasts, after which it makes sense to clear it, otherwise
it strongly references a lot of descriptors for calls in other files
which would never be used.
2020-10-23 20:50:08 +02:00
Alexander Udalov 7ac981d4d3 Psi2ir: refactor ModuleGenerator.generateModuleFragment
Move `postprocess` into `generateSingleFile` and do those steps on each
file instead. This will allow to create
`GeneratorContext.callToSubstitutedDescriptorMap` for each file and
clear it after its only call site (InsertImplicitCasts) has used it.
Also simplify code a bit.
2020-10-23 20:50:08 +02:00
Victor Petukhov 7b53d668ab Fix test after 4f06162446 2020-10-23 18:33:23 +03:00
Yan Zhulanow c07f25fa44 Revert "FoldInitializerAndIfToElvisInspection: don't add explicit type if var is used as non-nullable"
This reverts commit bb7d4c22
2020-10-24 00:22:41 +09:00
Yan Zhulanow 87574dddd9 Revert "ReplaceWith: suggest for "invoke" extension"
This reverts commit be194c34
2020-10-24 00:22:41 +09:00
Yan Zhulanow 04457e92d0 Revert ""Put/Join arguments/parameters" intention: don't suggest on nested argument list"
This reverts commit 4a328981
2020-10-24 00:22:41 +09:00
Yan Zhulanow 3321ce6325 Revert ""Code Cleanup": don't remove deprecated imports when file has @file:Suppress("DEPRECATION") annotation"
This reverts commit cf5a6274
2020-10-24 00:22:41 +09:00
Yan Zhulanow 839c30d04b Revert "Additional minor fixes for KT-33594: avoid using hard-coded annotation name, simplify hasAnnotationToSuppressDeprecation()"
This reverts commit 2a841550
2020-10-24 00:22:40 +09:00
Yan Zhulanow 9320637efe Revert "Redundant companion reference: do not report 'values/valueOf' function in enum"
This reverts commit 55d55446
2020-10-24 00:22:40 +09:00
Yan Zhulanow 383190f25e Revert "Replace with ordinary assignment: do not suggest when operator is augmented assignment operator function"
This reverts commit 73e319ca
2020-10-24 00:22:40 +09:00
Yan Zhulanow 7fccd0153b Revert "Refactoring: Remove hard-coded augmented assignment check with a Name check"
This reverts commit 016e78e4
2020-10-24 00:22:40 +09:00
Yan Zhulanow 0ae21a157f Revert ""Change to return with label" quick fix: apply for type mismatch"
This reverts commit f76e9886
2020-10-24 00:22:39 +09:00
Yan Zhulanow 601198634d Revert "Minor: Extract lambda return expression handling"
This reverts commit 55038e19
2020-10-24 00:22:39 +09:00
Yan Zhulanow b18de1e3ff Revert "Provide quickfix for specifying type of variable initialized with null"
This reverts commit cdf7f46c
2020-10-24 00:22:39 +09:00
Yan Zhulanow 4327bc4ac3 Revert "KT-23394: Add a test with a property"
This reverts commit f2dc132d
2020-10-24 00:22:38 +09:00
Yan Zhulanow fe64fcf8a3 Revert "Minor: update order in IntentionTestGenerated"
This reverts commit 6515d53b
2020-10-24 00:22:38 +09:00
Yan Zhulanow c4a48598c0 Revert ""Add parameter to function" for TYPE_MISMATCH: fix it works correctly for extension function"
This reverts commit 03e725d5
2020-10-24 00:22:38 +09:00
Yan Zhulanow 16dbf7ba74 Revert "Convert to range check: don't report it if recursive call will be created"
This reverts commit 73184884
2020-10-24 00:22:38 +09:00
Yan Zhulanow d735637f1e Revert "RemoveBracesIntention: add new line for long expression"
This reverts commit f4b9c477
2020-10-24 00:22:37 +09:00
Yan Zhulanow f615ed2f26 Revert ""Use destructuring declaration": fix it works correctly if variable name is shadowed"
This reverts commit d61158a1
2020-10-24 00:22:37 +09:00
Yan Zhulanow ab70cc35ea Revert "Add quick fix for 'JAVA_CLASS_ON_COMPANION'"
This reverts commit 15a615d6
2020-10-24 00:22:37 +09:00
Yan Zhulanow 6cc4d70b07 Revert "Minor: Remove hard-coded 'Companion' name"
This reverts commit 871ad2b9
2020-10-24 00:22:37 +09:00
Yan Zhulanow 19f518c037 Revert "IfThenToSafeAccessInspection: fix it works correctly for variable/operator call"
This reverts commit 5095caee
2020-10-24 00:22:36 +09:00
Yan Zhulanow 19896f9616 Revert "Minor: Use second pattern argument instead of explicit callee.text"
This reverts commit 55e36fa1
2020-10-24 00:22:36 +09:00
Yan Zhulanow 519f92599c Revert "Minor: Import DebuggerUtils"
This reverts commit 58f606e1
2020-10-24 00:22:36 +09:00
Igor Chevdar 9b2aa0951b [box-tests] Turned on tests on typeof for K/N 2020-10-23 18:27:10 +05:00
Igor Chevdar 9d1cb6a2c0 Turned off TypeOfChecker for K/N 2020-10-23 18:27:10 +05:00
Victor Petukhov 4f06162446 Get a callable reference expression to report an error on it properly, taking into account possible wrapping
^KT-42620 Fixed
2020-10-23 15:12:08 +03:00
Ilya Muradyan cb020fb9f4 Change repository adding logic
Now if the repo being added already exists, it is moved to the
end of the list, effectively lowering its priority.

Original issue: https://github.com/Kotlin/kotlin-jupyter/issues/107
2020-10-23 13:31:38 +03:00
Ilya Goncharov 7062bf5737 [JS_IR] Additional check on loop label to not persist name for labeled loop
^KT-42262 fixed
2020-10-23 13:16:03 +03:00
Igor Chevdar 1a9e516dc0 [ir-plugin] Referenced binary operators with the new API 2020-10-23 14:58:33 +05:00
Igor Chevdar 23d12a717e [box-tests] Added a test 2020-10-23 14:22:48 +05:00
Igor Chevdar 27aed0ccbc [IR] Inliner: erase non-reified parameters for casts
Fixes https://youtrack.jetbrains.com/issue/KT-31072
2020-10-23 14:22:09 +05:00
Kristoffer Andersen 27fb46712a [JVM+IR] Unify new debugger tests expectations
This commit unifies the expectation format between the stepping and
LVT tests in the new debugging test harness.

Furthermore, it introduces a compression of runs of locations without
linenumbers. These default to showing as bytecode offsets from
previous line number, which overspecifies the tests: the bytecodes
chosen should not be constrained by a debugging step test.
2020-10-23 11:19:58 +02:00
pyos e19ecdfb3d [Tests] Suspend Codegen Tests Improvements
This commit enables the execution of suspend box tests in a separate
test. It's a QoL improvement in the existing bb tests but, motivating
these changes, enables the new debugger stepping tests to step
coroutine code.
2020-10-23 11:19:58 +02:00
Kristoffer Andersen 3291f8455b [JVM+IR] Update straight-forward LVT tests 2020-10-23 11:19:58 +02:00
Kristoffer Andersen 2c9bf95227 [JVM+IR] New LVT debugging test harness improvements
This is the first step in a push to improve the test coverage of the
IR debugging experience. This commit improves on the sketch of local
variable table tests built on the new debugger stepping
infrastructure. As improvements on the existing
checkLocalVariableTableTest they:
 - don't overspecify codegen strategy: no hard requirements on slots.
 - test the observed lifespans of locals by stepping through code.

Ultimately this should enable us to bring over all existing tests for
improved coverage of both old and new JVM backends.

WIP list:
 - Gracefully handle absent LVT: treat as empty Add type of local and
 - type of value stored there to expectations Print values in local
 - slots if primitive or java.lang.String Enable specifying
 - expectations per backend Gracefully handle absent box methods
 - Gracefully handle null values in slots of reference type
 - Port a first LVT test
2020-10-23 11:19:58 +02:00
Ilya Goncharov 4479bf0933 [JS_IR] Enum constructor copy parameters with mapping by index
Previously mapping was by name, and there was clash in case of user
parameters named 'name' or 'ordinal'

^KT-39186 fixed
2020-10-23 11:42:43 +03:00
Vladimir Dolzhenko 2790bc1105 Split perf test json reports in a separate files/docs 2020-10-23 09:11:05 +02:00
Vladimir Dolzhenko d7a783e077 Add prefix for inner test classes 2020-10-23 09:11:05 +02:00
Yan Zhulanow 58f606e1f5 Minor: Import DebuggerUtils 2020-10-23 15:46:54 +09:00
Yan Zhulanow 55e36fa1ab Minor: Use second pattern argument instead of explicit callee.text 2020-10-23 15:46:54 +09:00
Toshiaki Kameyama 5095caee50 IfThenToSafeAccessInspection: fix it works correctly for variable/operator call
#KT-30513 Fixed
#KT-17071 Fixed
2020-10-23 15:46:54 +09:00
Yan Zhulanow 871ad2b909 Minor: Remove hard-coded 'Companion' name 2020-10-23 15:46:53 +09:00
Toshiaki Kameyama 15a615d63b Add quick fix for 'JAVA_CLASS_ON_COMPANION'
#KT-29264 Fixed
2020-10-23 15:46:53 +09:00
Toshiaki Kameyama d61158a176 "Use destructuring declaration": fix it works correctly if variable name is shadowed
#KT-30601 Fixed
#KT-20570 Fixed
2020-10-23 15:46:53 +09:00
Toshiaki Kameyama f4b9c4777f RemoveBracesIntention: add new line for long expression
#KT-30523 Fixed
2020-10-23 15:46:52 +09:00
Toshiaki Kameyama 731848849e Convert to range check: don't report it if recursive call will be created
#KT-39182 Fixed
2020-10-23 15:46:52 +09:00
Toshiaki Kameyama 03e725d5da "Add parameter to function" for TYPE_MISMATCH: fix it works correctly for extension function
#KT-39557
2020-10-23 15:46:52 +09:00
Yan Zhulanow 6515d53b94 Minor: update order in IntentionTestGenerated 2020-10-23 15:46:52 +09:00