Commit Graph

60536 Commits

Author SHA1 Message Date
Alexander Udalov d547af00aa Fix NPE in ExperimentalUsageChecker in corner case
Since there's no nullability assertion, null could end up in this list
and cause NPE further at `reportNotAcceptedExperimentalities`. This
could happen if a declaration was annotated with WasExperimental, the
marker was annotated with the new RequiresOptIn, and API version 1.2 was
used.

No new tests are added because 1.2 is obsolete and WasExperimental is
internal.
2020-01-14 21:04:40 +01:00
Mads Ager ca05ff1791 JVM_IR: Fix bug in suspend function with many default arguments. 2020-01-14 20:48:44 +01:00
Mark Punzalan e46adbae29 [JVM IR] Fix checkLocalVariablesTableTest/parametersInSuspendLambda
for JVM IR.
2020-01-14 20:47:36 +01:00
pyos f73891af98 JVM_IR: actually forward the parameters to $suspendImpl 2020-01-14 20:46:48 +01:00
Nicolay Mitropolsky 54285d328f Uast: KotlinIDERenderLogTest for running UAST tests with ULC
In case of result difference the `-ide`-suffixed testdata is used.
Actually the difference in results is more likely to be a bug
but currently we are fixating at least some behaviour to protect from
 unexpected regressions in Ultra Light Classes.

`object Local` were removed because there is no local objects in actual
 Kotlin syntax
2020-01-14 19:48:40 +03:00
pyos 99eab5a058 IR: unify 3 copies of function body remapping
Also,

  1. remove some redundant copies;

  2. fix remapping of non-local returns in lambdas if the body is moved
     after LocalDeclarationsLowering (the lambda is no longer inside the
     body, but must still be visited)
2020-01-14 18:48:27 +03:00
Nikolay Krasko 4d1677be06 Invalidate PerModulePackageCache on content change in file without view provider (KT-35907)
Investigation was started because of flaky behaviour in
NewJavaToKotlinConverterSingleFileTestGenerated tests. Approximately 1
of 3 all tests executions caused failure in one of the tests.

Analyze showed that unlike the successful run, failure test was missing
PSI event with PerModulePackageCache index invalidation.

This was caused by null from FileManagerImpl.findCachedViewProvider()
and null from FileDocumentManagerImpl.getDocumentFromCache().
Both methods use weak references maps to operate:
FileManagerImpl.myVFileToViewProviderMap and
FileDocumentManagerImpl.myDocumentCache.

#KT-35907 Fixed
2020-01-14 18:11:37 +03:00
Vladimir Ilmov 092fb131e5 CodeConformanceTest @author mention in sources fixed 2020-01-14 16:06:44 +01:00
Svyatoslav Kuzmich 1333267983 [JS IR] Add serialization regressions tests 2020-01-14 18:00:29 +03:00
Svyatoslav Kuzmich fbf71be30c [JS IR BE] Support mode of linking multiple klibs without .kt files 2020-01-14 18:00:29 +03:00
Vladimir Ilmov 553128c3c9 Coroutine as35 compatibility patch also added to 191. 2020-01-14 15:55:51 +01:00
Denis Zharkov d6b01f1007 NI: In subtyping do not intersect arguments for non-covariant types
It partially reverts 7898922066
because it's not obvious that it's a safe operation
for invariant/contravariant types.

Also, there's a necessary fix in prepareReceiverRegardingCaptureTypes
to make types order stable
Otherwise test bareTypesWithStarProjections becomes flaky.

Also, the changes in bareTypesWithStarProjections.kt are also expected
because the type of the expression `coneSymbol` after the second "if" is
FirVariableSymbol<*> & FirPropertySymbol & AbstractFirBasedSymbol<*>
thus we fix D in the call `coneSymbol.phasedFir()` to FirVariableSymbol<*>
because it's the first type in the list
(see the next line after the last changed in AbstractTypeChecker)
2020-01-14 17:35:24 +03:00
Denis Zharkov 4202c9c1a4 NI: Fix regression for star-projections approximation
See the test added

^KT-35703 Fixed
2020-01-14 17:35:24 +03:00
Denis Zharkov 7255ee0a5b NI: Fix smart-cast related regression
See the test and the issue for the clarification
After the change 7898922066
the expected type for "a" in expression "foo(a)" is A<E & B<*>>
But we have the original type A<E> and smart-casted enriched type A<B<*>>
(non of them is a subtype of A<E & B<*>>)
and fail in checkTypeInternal when checking types in during completion

^KT-35844 Fixed
2020-01-14 17:35:24 +03:00
Dmitriy Novozhilov 02d9f258d1 [FIR-TEST] Mute failing blackbox test 2020-01-14 17:34:21 +03:00
Pavel Kirpichenkov 4a29de3716 [NI] discriminate Nothing for reified parameters
Related issues: KT-32836, KT-35728
2020-01-14 16:27:42 +03:00
Dmitry Petrov a16b21a7cc JVM: Don't generate accessors to companions in earlier language versions 2020-01-14 16:12:19 +03:00
Dmitry Petrov 6ad159bb01 JVM: Rewrite companion object accessor generation
Old version handled only private companions correctly.
Some situations require multiple companion object accessors
(including accessors for protected companion objects from supertypes)
to be generated in the corresponding class.
2020-01-14 16:12:18 +03:00
Alexander Udalov 04a6f4d92b JVM IR: minor, use chars from JvmSimpleNameBacktickChecker in ClassCodegen 2020-01-14 13:54:12 +01:00
Mark Punzalan be228d594c [JVM IR] Ensure class names are valid for JVM.
The JVM IR backend was producing class names with "<no name provided>"
for unnamed functions (i.e., `fun(...) {}`). This produces class files
with names invalid in Windows. This change adds validation of names
using the same set of invalid characters used in the frontend, which
should ensure class file names are valid.
2020-01-14 13:54:12 +01:00
Georgy Bronnikov 049bb54ea6 IR: use map in remapTypeParameters
In LocalDeclarationLowering, the moved local function does not
necessarily receive a continuous chunk of type parameters that it captures.
2020-01-14 15:16:54 +03:00
Kristoffer Andersen 0abdd0cb7b [JVM IR] Refactor InterfaceDelegationPhase
Rename and refactor interface delegation phase. It didn't actually do
what was said on the box. It should be more in line with the
intentions of the phase now.
2020-01-14 13:10:24 +01:00
Alexander Udalov a5ff88f897 IR: implement some missing features in wrapped descriptors for JVM IR
Wrapped descriptors are still used in reporting of the "conflicting JVM
signatures" diagnostic in the JVM IR backend, and TODOs in
implementations prevent that diagnostic from being shown, obscuring even
the place where the error happens.
2020-01-14 12:49:57 +01:00
Mikhail Zarechenskiy 6fe61c9056 [NI] Fix ambiguity when there are no applicable candidates
#KT-35064 Fixed
2020-01-14 14:30:01 +03:00
Vladimir Dolzhenko 8d3e4a2965 IAE: RangeMarkerImpl.<init>
#EA-141884 Fixed
2020-01-14 12:15:26 +01:00
Vladimir Dolzhenko 83c3763096 Access index under runReadActionInSmartMode in ProbablyContractedCallableNamesImpl
#EA-219476 Fixed
2020-01-14 12:15:14 +01:00
Vladimir Dolzhenko d176a26cdb Improve investigation info in KtDotQualifiedExpression
Relates to #EA-212081
2020-01-14 12:15:04 +01:00
Vladimir Dolzhenko 19164781f4 Access index under runReadActionInSmartMode in KotlinRuntimeLibraryUtil
#EA-220414 Fixed
2020-01-14 12:14:55 +01:00
Vladimir Dolzhenko b2b90bd495 Edit kdoc reference in Introducing import alias
#KT-35837 Fixed
2020-01-14 12:14:46 +01:00
Vladimir Dolzhenko f5545b3740 Handle kdoc case for Introduce import alias inspection
#EA-210889 Fixed
2020-01-14 12:14:36 +01:00
Vladimir Dolzhenko ffc6786f06 Module info has to be read under readAction in KotlinConfigurationCheckerComponent
#EA-209610 Fixed
2020-01-14 12:14:28 +01:00
Vladimir Dolzhenko 3260e41111 Improve investigation info in PackageCodegenImpl
Relates to #EA-218779
2020-01-14 12:14:19 +01:00
Vladimir Dolzhenko a63123b556 Handle \r line endings in plaintext j2k
#KT-35831 #EA-209568 Fixed
2020-01-14 12:14:05 +01:00
Vladimir Dolzhenko dc6adc805a Handle java ctor case for Introduce import alias inspection
#KT-35824 #EA-218654 Fixed
2020-01-14 12:13:51 +01:00
Vladimir Dolzhenko be65eed801 Add more investigation info to diagnoseUnknownModuleInfo
Relates to #EA-220276
2020-01-14 12:13:38 +01:00
Vladimir Dolzhenko 2f953f5049 Add disposable to document listener in ScratchEditorSyncHighlighter
#EA-220382 Fixed
2020-01-14 12:13:27 +01:00
Vladimir Dolzhenko 6da24deec5 Fix renaming class according to a file name when file name has no name (but extension)
#EA-219715 Fixed
2020-01-14 12:12:58 +01:00
Vladimir Dolzhenko 4425bb8fa1 Commit documents before createResourceReference in KotlinAndroidAddStringResource
#EA-127016 Fixed
2020-01-14 12:11:56 +01:00
Vladimir Dolzhenko d644c0125a Add more investigation info to getFilesForElements
Relates to #EA-209630
2020-01-14 12:11:32 +01:00
Vladimir Dolzhenko 93ce4c003f Module info has to be read under readAction in scriptDefinitionsFromDependencies
#EA-220355 Fixed
2020-01-14 12:11:21 +01:00
Vladimir Dolzhenko aefad5cf5e Module info has to be read under readAction in KotlinNativeABICompatibilityChecker
#EA-220356 Fixed
2020-01-14 12:11:10 +01:00
Vladimir Ilmov e340651e47 CoroutineAsyncStackTraceProvider stack corruption fix 2020-01-14 11:49:09 +01:00
Dmitriy Novozhilov 9367c6a762 [NI] Use infered delegate expression type if there is no resolved call in trace
#KT-35707 Fixed
2020-01-14 12:18:24 +03:00
Dmitriy Novozhilov 605ef647e6 Regenerate tests 2020-01-14 12:18:23 +03:00
Vladimir Ilmov cac4a991f5 coroutine debugger toolbar added 2020-01-14 10:14:56 +01:00
Vladimir Ilmov e570450c59 coroutine debugger logic moved to jvm-debugger-coroutine module 2020-01-14 10:14:56 +01:00
Vladimir Ilmov b1b0817336 [coroutine][debugger] implementation basing on X-* approach
XCoroutine view added for direct comparison with Coroutines
2020-01-14 10:14:56 +01:00
Vladimir Ilmov 61c5ef61cc [coroutine][debugger] refactoring being done
X-view approach added for review, thread groups added
2020-01-14 10:14:55 +01:00
Kirill Shmakov 7f0437da68 Update AS version to 4.0 Canary 8 2020-01-14 11:32:55 +03:00
Ilya Gorbunov 0764a065e8 Rewrite UnderMigration and MigrationStatus in Java
to remove dependency on kotlin-stdlib.

#KT-33141
2020-01-13 23:30:32 +03:00