Commit Graph

60562 Commits

Author SHA1 Message Date
Pavel Kirpichenkov 4d11fac365 [NI] Add restored smart casts to spec tests
KT-35668 Fixed
2020-01-15 14:39:40 +03:00
Pavel Kirpichenkov 396b226462 [NI] Restore missing smart casts after another smart cast in call
Expression type serves as a part of a key for retrieving smart cast info.
Rewriting expression type with SmartCastManager leads to incorrect processing of following smartcasts for same expression, therefore it was removed.

KT-32507 Fixed
KT-32358 Fixed
2020-01-15 14:39:40 +03:00
Mikhail Glukhikh d3de2d419b FIR2IR: fix failing enum entry test 2020-01-15 14:30:15 +03:00
Dmitriy Novozhilov 88a1cb5a17 [NI] Use new type substitutor instead of old in completion of callable references
It's necessary because of new type substitutor is eager than odl, so
  if there is a substitution of type parameter deep inside type arguments
  then second substitutor wins against first

#KT-35896 Fixed
2020-01-15 14:01:25 +03:00
Dmitriy Novozhilov 3428a17759 [NI] Postpone calls with not enough information in builder inference 2020-01-15 14:01:25 +03:00
Mikhail Glukhikh f4b3e9b4b2 [FIR] Fix qualifier handling by FirQualifierNameResolver 2020-01-15 13:20:27 +03:00
Mikhail Glukhikh ae774a0ab9 [FIR] Add test for qualified access to base class member case 2020-01-15 13:20:26 +03:00
Mikhail Glukhikh c129714bf9 [FIR] Add test for inner class based qualifier case 2020-01-15 13:20:26 +03:00
Mikhail Glukhikh 33104a3ef8 [FIR] Add accidentally missed JvmMappedScope.processClassifiersByName 2020-01-15 13:20:26 +03:00
Igor Yakovlev fb56e14654 Fix UAST method NPE for incomplete method PSI
Fixed #KT-35871
2020-01-15 13:14:41 +03:00
Leonid Startsev 9bd966c123 Supply correct Native platform for module descriptor while compiling from CLI 2020-01-15 12:48:49 +03:00
Leonid Startsev f2026a49bb Support .decodeSequentially call on JVM and Native and remove READ_ALL handling from all platforms
Fix codegen test

Ignore JVM IR codegen test for a while since it requires updated kotlinx-serialization-runtime in classpath
2020-01-15 12:46:25 +03:00
Steven Schäfer cb98588202 Psi2Ir: Add an IrTextTest for enums with multiple constructors 2020-01-15 10:18:09 +01:00
Steven Schäfer 1b5109b6ee JVM IR: Refactor EnumClassLowering 2020-01-15 10:18:09 +01:00
Steven Schäfer b0e61ab470 JVM IR: Remove IrEnumValueOf intrinsic 2020-01-15 10:18:09 +01:00
Steven Schäfer f8779ddf9d Psi2Ir: Create instance initializer calls in enum class constructors 2020-01-15 10:18:09 +01:00
Steven Schäfer 83edc7fa73 IR: Remove unused argument from DeclarationFactor.getFieldForEnumEntry 2020-01-15 10:18:09 +01:00
Nicolay Mitropolsky ed57a53ad6 191: Uast: fix compilation for 191 2020-01-15 11:40:47 +03:00
Alexander Udalov b5afdc7553 Keep annotation FQ name in experimental API diagnostics
This fixes compilation of ExperimentalFixesFactory where this FQ name
is used to construct a correct quick fix instance.
2020-01-15 00:32:19 +01:00
Alexander Udalov 514bf3eec0 Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn 2020-01-14 21:04:44 +01:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov 9187a85aaf Rename UseExperimental->OptIn, Experimental->RequiresOptIn in quickfix and IDE tests 2020-01-14 21:04:43 +01:00
Alexander Udalov da077b5353 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in Gradle plugin 2020-01-14 21:04:42 +01:00
Alexander Udalov 8f94a2bb75 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs 2020-01-14 21:04:42 +01:00
Alexander Udalov 7742a3b697 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in compiler tests 2020-01-14 21:04:42 +01:00
Alexander Udalov b839b905b5 Rename Experimental/UseExperimental in compiler diagnostic messages
#KT-34647
2020-01-14 21:04:41 +01:00
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