Commit Graph

58520 Commits

Author SHA1 Message Date
Alexander Udalov 95be7171bc JVM IR: fix "null" as the first entry in MappedEnumWhenLowering
If "null" was the first entry in an optimizable "when" over enum,
mapRuntimeEnumEntry was called before mapConstEnumEntry, and the
$WhenMappings field was not created. Now both mapConstEnumEntry and
mapRuntimeEnumEntry create this field on the first access
2019-10-23 11:03:22 +02:00
Efeturi Money 35d7bb4a26 Add support for @CompilerOptions annotation for supplying compiler
options from scripts.

#KT-34274 fixed
2019-10-23 11:37:28 +03:00
pyos 8c6916af52 JVM_IR inliner fixes: remove code that does nothing
other than randomly throw assertion errors on inline calls in synthetic
functions, which have no line number attached.

`lazySourceMapper.callSiteMarker` is set in `InlineCodegen.inlineCall`;
`IrSourceCompilerForInline.doCreateMethodNodeFromSource` does not need
to touch it.
2019-10-22 19:29:42 +03:00
Toshiaki Kameyama 60f4ed914a "Add parameter to function" quick fix: apply for TYPE_MISMATCH error
#KT-8478 Fixed
2019-10-22 21:22:33 +07:00
Pavel Kirpichenkov 636f5da883 [Minor] Inline and drop reduntant isCallableReflectionType property 2019-10-22 14:51:04 +03:00
Pavel Kirpichenkov 02fc921eed Report diagnostics about callable reference resolution ambiguity
Found diagnostics were not reported before.
#KT-32862 In Progress
2019-10-22 13:50:59 +03:00
Pavel Kirpichenkov 138d558f6a Fix compiler exception during resolution of ambiguous callable references
Function return type can't and should not be used during overload resolution of callable references.
Since it can be DeferredType, its substitution in CS caused exception.
2019-10-22 13:20:27 +03:00
Mads Ager 8b97819c04 [JVM_IR] Support suspend functions that can be overriden.
The challenge for overridable suspend functions is that the calling
the state machine method to resume after suspension would be
virtually dispatced to the wrong method. To avoid that a static
suspend implementation method is generated which becomes the
state machine method used to resume.
2019-10-22 12:48:21 +03:00
Dmitry Petrov eebb071ae9 KT-34509 Properly unwrap callable reference descriptor
NB there's a problem with callable references to SAM constructors,
see also KT-16789
2019-10-22 12:30:15 +03:00
Dmitry Petrov 7dde503697 KT-34500 Use correct loop parameter type in ForInArrayLoopGenerator 2019-10-22 12:23:59 +03:00
Toshiaki Kameyama bdc04547cc "Redundant qualifier name": fix false positive with inner class as constructor parameter for outer
#KT-33123 Fixed
2019-10-22 13:44:10 +07:00
Igor Yakovlev bc66834c3c Fix UL classes descriptors leaks
UL classes built upon descriptors and UL support classes are saving a descriptors.
This could lead to descriptors leakage so we have to eliminate any fields with descriptor references.

Fixed #KT-34337
2019-10-21 22:04:49 +03:00
Andrey Uskov b01014982f Disable new MPP kapt paths importing test in IDEA 183 2019-10-21 21:38:52 +03:00
Andrey Uskov 0188a0923e Update Kotlin plugin in KaptImportingTests
#KT-34033 Fixed
2019-10-21 21:38:49 +03:00
Andrey Uskov 40bb48e19b Fix actualisation of common source sets when HMPP is disabled
#KT-34256 Fixed
#KT-34402 Fixed
2019-10-21 21:38:45 +03:00
pyos 847e287bd6 JVM_IR: add $assertionsDisabled when an inlined function uses it
NOTE: jvmCrossinlineLambdaDeclarationSite.kt is muted because the
inliner does not remap references to an anonymous object's parent
class after regenerating it. Unlike the JVM backend, JVM_IR uses the
top level named class' assertion status for all inner classes. (The
test used to pass because the lambda in `inline fun call` read the
`$assertionsDisabled` field of `CrossinlineLambdaContainer`, which
was not reloaded after changing the assertion status of package `test`.)
2019-10-21 21:05:18 +03:00
Leonid Startsev e89aabbba1 Provide a diagnostic when @Serializable annotation is missing on enum.
It is required when enum members contain some special annotations which should be recorded in descriptor.
Due to some recursive/lazy resolve problems, compiler plugin frontend can't infer @Serializable on enum automatically, therefore, we ask a user to explicitly provide it.

Also fix ir tests
2019-10-21 19:48:29 +03:00
Leonid Startsev 3c9a02e271 Associate serializers added via @UseSerializers by argument class, not type
Use class instead of type because MyType<T> and MyType<Int> are different types, therefore map lookup was failing.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/533
2019-10-21 19:48:27 +03:00
Leonid Startsev 855a867893 Support sealed, generic and abstract polymorphic inheritors in sealed class serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev 1ebc65b8e4 Sealed classes serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev 72f8f2b7b5 Custom-serializable enums for IR 2019-10-21 19:48:24 +03:00
Leonid Startsev bd8133e02c Custom-serializable enums for JS 2019-10-21 19:48:24 +03:00
Leonid Startsev e76ab06029 Custom-serializable enums for JVM 2019-10-21 19:48:23 +03:00
Leonid Startsev e9e7d1479a Remove redundant additional check for @Polymorphic annotation 2019-10-21 19:48:23 +03:00
Leonid Startsev 8a90b82e9b Object serialization for JVM, JS and Native 2019-10-21 19:48:22 +03:00
Toshiaki Kameyama 449c406e24 Redundant visibility modifier: do not report for public modifier that overrides protected setter visibility
#KT-33580 Fixed
2019-10-21 23:45:09 +07:00
Toshiaki Kameyama e8effe6727 Replace with safe call: do not add redundant elvis operator
#KT-34432 Fixed
2019-10-21 23:28:19 +07:00
Vladimir Dolzhenko fa0398ffd3 Fix readAccess in ScriptExtraImportsProviderExtension on checking isScript
#EA-214435 Fixed
2019-10-21 17:18:24 +02:00
Vladimir Dolzhenko 34e941f26f Render unresolved types in a presentable way in refactorings
#KT-34459 Fixed
2019-10-21 17:18:24 +02:00
Vladimir Dolzhenko 7ecaef377f Fix readAccess in KtFileClassProviderImpl on checking isScript
#EA-214283 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko 30229da95a Don't render pure error types in OverrideMemberChooserObject
#KT-34379 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko 148a6bd54d Fix read action in 'searchReferences'
#EA-209421 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko 96198a1cd3 Report no parent KtNamedDeclaration for declaration instead of NPE in BindingContextUtils.getEnclosingDescriptor
#EA-210816 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko 46a083cd1e Fix readAccess in ResolveSession.java on checking is a local declaration
#EA-213627 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko 78527abad9 Fix readAccess in TargetPlatformDetector.java on checking is file a script
#EA-211576 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko 15997bf635 Save change script configuration within a transaction
#EA-214281 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko 625dbfa699 Fix readAccess in getModuleInfo.kt on obtaining script
#EA-211576 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko ba01678abb Fix readAccess in IDELightClassGenerationSupport on obtaining script
#EA-211576 Fixed
2019-10-21 17:18:05 +02:00
Vladimir Dolzhenko 10ea8abc2b Wrap file.declarations with runReadAction
#EA-209932 Fixed
2019-10-21 17:18:04 +02:00
Alexander Gorshenev 597e760fab Broght back a condition lost during a refactoring 2019-10-21 17:41:56 +03:00
Roman Artemev 2cde7f2402 [KLIB] Fix explicitlyExported mode
- Refactor deserialization pipeline
 - Fix K/N test
2019-10-21 17:41:56 +03:00
Roman Artemev 43e855150c [KLIB] Correctly restore top level property order during deserialization - Add test - Fix KT-34273 2019-10-21 17:41:56 +03:00
Roman Artemev aecd08e562 [Psi2Ir] Fix IrText test generation 2019-10-21 17:41:55 +03:00
Ilya Goncharov 6ddc05a5a8 [Gradle, JS] Fix for wildcard npm dependency version
#KT-34460 fixed
2019-10-21 17:37:07 +03:00
Ilya Goncharov e17b9097df [Gradle, JS] Add test on success installation of duplicated dependencies 2019-10-21 17:29:47 +03:00
Ilya Goncharov bdd6186a07 [Gradle, JS] Resolve devDependencies and dependencies modules clash 2019-10-21 17:29:46 +03:00
Ilya Goncharov fa647680d3 [Gradle, JS] Update npm dependencies
- Karma - provide possibility to check exit code
- Webpack - bug fixes
- Mocha - bug fixes
2019-10-21 17:28:49 +03:00
Ilya Goncharov 2cf79b7502 Check Karma exit code with disabled failOnFailingTestSuite
https://github.com/karma-runner/karma/pull/3116
2019-10-21 17:28:49 +03:00
Denis Zharkov d902a5f304 Temporary disable assertion in bridges generation
^KT-34431 Fixed
^KT-34507 Open
2019-10-21 17:24:15 +03:00
Kristoffer Andersen 28b6913a25 JVM IR: Support parameterless main methods
This commit:

- introduces tests explicating what is and isn't considered a
  proper main method on the JVM backends.
- implements support for parameterless main methods on the JVM IR
  backend
- See KT-34338 for more tests.
2019-10-21 15:08:34 +02:00