Commit Graph

49283 Commits

Author SHA1 Message Date
Toshiaki Kameyama 3e4d8eba76 Add braces: Remove new line between '}' and 'else' #KT-26839 Fixed 2018-09-25 11:08:49 +03:00
Alexey Tsvetkov de261df6f5 Use separate configuration for resolving native compiler plugin artifacts
Kotlin/JVM and Kotlin/JS use shaded compiler, but
Kotlin/Native uses non-shaded one.
Serialization plugin was configured to use either shaded or non-shaded
plugin version, because we used one configuration for resolving
compiler plugins.
This change introduces 'kotlinNativeCompilerPluginClasspath' configuration
for resolving Kotlin/Native compiler plugins.
2018-09-25 11:08:39 +03:00
Toshiaki Kameyama affa881421 "Redundant SAM constructor": Fix highlighting range #KT-27034 Fixed 2018-09-25 11:06:45 +03:00
Georgy Bronnikov 487f500f85 Revert "JVM_IR. Support compile time constants"
This reverts commit 055215c54f.
2018-09-25 05:24:48 +03:00
Georgy Bronnikov 055215c54f JVM_IR. Support compile time constants 2018-09-25 01:38:51 +03:00
Pavel V. Talanov 985934a40a Prefer kotlin JUnit config to any pattern based config
Specifically that means that Kotlin JUnit configurations will be created
    for JUnit classes and methods instead of AS pattern configurations
2018-09-24 18:29:04 +02:00
Pavel V. Talanov 71d640f3f8 Improve kotlin jvm run config producers for 181 and as32 branches
Drop KotlinJUnitRunConfigurationProducer, KotlinRunConfigurationProducer
    bunch files
Extract differences in behaviour to 'jvmMppUtils.kt'
Improve 'isConfigurationFromContext' checks for 181 and as32
    (this prevents duplicate configurations being created)
KotlinRunConfigurationProducer chooses corresponding jvm module
    for common code

 #KT-26886 Fixed
2018-09-24 18:08:06 +02:00
Pavel V. Talanov f34f306d90 IdeaModuleInfos: consider newMpp modules to always have relevant roots
Make sure implementing(ed)Descriptors always return a relevant module
    regardless of whether the module has physical directories configured
2018-09-24 18:08:06 +02:00
Vyacheslav Gerasimov 7eb8123d26 Add changelog for 1.2.71 2018-09-24 18:37:39 +03:00
Nikolay Krasko dda1673096 Don't choose navigation target only by index (KT-26004)
There might be situation when platform code has a declaration with
another signature and the same fqname, but navigating to common
declaration is expected.

 #KT-26004 Fixed
2018-09-24 18:26:34 +03:00
Svyatoslav Kuzmich b79dcbe8e6 [JS IR BE] Refactor equals and compareTo lowering 2018-09-24 18:21:57 +03:00
Yan Zhulanow 005955326f Pill: Exclude kotlin-main-kts module from JPS 2018-09-24 17:54:24 +03:00
Yan Zhulanow ff0b051a64 MPP: Rewrite work-around for JPS in a more safe way 2018-09-24 17:54:24 +03:00
Yan Zhulanow bc27cabb1a Call 'GradleProjectImportHandler's in MPP Gradle importer (KT-27006) 2018-09-24 17:54:23 +03:00
Nikolay Krasko bbd15db308 Remove old buildIterator import (KT-26679) 2018-09-24 15:57:06 +03:00
Mikhail Zarechenskiy 6a860dd042 Fix blackbox codegen tests that use coroutine inference
Note that previously we implicitly ignored JS_IR backend when directive
 COMMON_COROUTINES_TEST was enabled, see kotlin/generators/util/coroutines.kt#L57
2018-09-24 12:10:56 +03:00
Ilya Gorbunov 974837654e Remove workaround for complex default value in Array.copyInto
#KT-22818
2018-09-22 18:24:00 +03:00
Ilya Gorbunov a5f1ed9a5d Advance bootstrap to 1.3.20-dev-384 2018-09-22 18:23:52 +03:00
Alexey Tsvetkov cd2ff41ef5 Validate Gradle task properties on test run
By default `validateTaskProperties` is added only to `check` task's
dependencies, so doesn't run on our CI.
We can run `check` instead of `test` on CI, but since developers are
not used to it, I believe it's better to make `test` tasks depend on
`validateTaskProperties`
2018-09-22 00:10:45 +03:00
Natalia Selezneva a078526c4d Scratch tests: check that highlighting is enabled for scratch 2018-09-21 22:58:14 +03:00
Natalia Selezneva 8f8c431524 Fix Optimize import for scripts not under source roots
KT-17231 Fixed
KT-21981 Fixed
2018-09-21 22:58:14 +03:00
Natalia Selezneva eb597fbf22 Fix unused import inspection for scripts not under source roots (including build.gradle.kts and scratches)
KT-20040 Fixed
2018-09-21 22:58:14 +03:00
Natalia Selezneva 43027d0581 Check scriptDefinition expected location for scripts when use ProjectRootUtil.isInContent 2018-09-21 22:58:14 +03:00
Natalia Selezneva 074aa47dc0 Use ProjectRootUtil.isInContent instead of checking script expected location manually 2018-09-21 22:58:14 +03:00
Natalia Selezneva d3ee14c5d2 Check scriptDefinition expected location for scripts when use ProjectRootUtil.isInContent 2018-09-21 22:58:06 +03:00
Ivan Gavrilovic 2d425d4e0a Fix null checks in the flow 2018-09-21 20:23:44 +03:00
Ivan Gavrilovic bb53a1c3d2 Use new API from AGP to get JavaCompile task
New API for getting the JavaCompile task has been
added to AGP, and the old one is deprecated. It is
now returning TaskProvider<JavaCompile>, which allows
API users to avoid configuring tasks unnecessarily.

This commit does not change anything functionally, it
is only to avoid the warning message, as reporter in
https://issuetracker.google.com/116198439.
2018-09-21 20:23:44 +03:00
Ilya Gorbunov 358e64fdb0 Remove dead code for builtins uninvalidation in tests 2018-09-21 18:35:02 +03:00
Ilya Gorbunov 4423ef9087 Minor: remove unused template for Map.random() 2018-09-21 18:28:44 +03:00
Anton Bannykh 8e347f9f39 [JS IR BE] lateinit support
* Functions with IrExpressionBody are lowered to IrBlockBody
* Implemented throwUninitializedPropertyAccessException function
2018-09-21 18:20:11 +03:00
Anton Bannykh beaf6df8c5 [JS IR BE] support CharSequence and String methods 2018-09-21 18:16:03 +03:00
Alexander Udalov 3e90d367f2 Do not report experimental usage errors in import statements
#KT-25545 Fixed
2018-09-21 17:35:50 +03:00
Alexander Udalov 9d27771f86 Fix instance parameter type of inherited declaration in reflection
Both for callables obtained via reflection API (KClass.members etc) and
for callables obtained via ::-references, the instance parameter is now
the class which was used to construct the type at the left-hand side of
the reference, NOT the class where the callable is originally declared
as is known at compile-time. The reason is to reduce the difference in
behavior of KCallable.call vs FunctionN.invoke: the latter always
required the subclass instance for a fake override, and it's reasonable
that the former would require it as well.

Note that in Java reflection, behavior could differ in a similar case.
For a simple fake override, Class.getMethod would return the method
declared in the base class and that method will accept instances of the
base class in invoke. However, it's difficult to rely on this behavior
because if there's a bridge for a fake override in the derived class
(e.g. when overridden members have different signatures), the returned
Method object is accepting the derived class as the receiver. This just
confirms the fact that Java reflection operates on a different level of
abstraction, namely JVM methods in .class files, which is not applicable
to our use cases directly. Another reason not to replicate Java
reflection's behavior is the uncertainty as to which member is returned
in case there are several in the hierarchy for a given fake override:
see the "otherwise one of the methods is chosen arbitrarily" note in
javadoc on Class.getMethod.

 #KT-24170 Fixed
2018-09-21 17:32:43 +03:00
Alexander Udalov 3ca81b95c2 Use non-allowed actual defaults in backends to workaround compiler exception
It's difficult to fix KT-22818 until the IR comes along, so we're
providing a workaround where one can disable the
ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS error and provide default values
in the actual function, to avoid exception from the backend.

 #KT-22818
2018-09-21 17:30:05 +03:00
Ilya Chernikov 18b53f331a Fix proguarding of the main-kts 2018-09-21 15:12:53 +02:00
Simon Ogorodnik 68dfe9bf14 Fix missing NativeLibraryType
#KT-27009 fixed
2018-09-21 15:32:56 +03:00
Simon Ogorodnik 3aee3dfdd9 Remove JPS KotlinNativeConfigurator 2018-09-21 15:32:55 +03:00
Simon Ogorodnik 9a79254f7e Make possible to have no libraryDescription for 'Configure Kotlin' 2018-09-21 15:32:54 +03:00
Simon Ogorodnik faf09a2aac Add KotlinNativeGradleConfigurator to avoid 'Configure Kotlin' for K/N 2018-09-21 15:32:53 +03:00
Simon Ogorodnik cff648a505 Don't show 'Configure Kotlin' panel when module already configured 2018-09-21 15:32:53 +03:00
Roman Artemev a807397f65 [JS_IR] Add inlineBox tests 2018-09-21 14:02:53 +03:00
Alexander Podkhalyuzin aa56c50218 Fixed update copyright action with no package and imports
#KT-23864 Fixed
2018-09-21 12:56:11 +03:00
Dmitry Petrov d03237bebc Generate backing fields and initializers for external constants 2018-09-21 09:50:21 +03:00
Dmitry Petrov ec8bdff5c7 Working infrastructure for external dependencies testing
(not really, but at least something)
2018-09-21 09:50:21 +03:00
Dmitry Petrov 6022fb4ec3 Fix default impl for suspend fun
We have an extra parameter in the mapped signature, and don't care about
Kotlin types there (so far). Might be a better idea to obtain the actual
descriptor for a suspend function (with extra parameter), and pass
arguments accordingly.
2018-09-21 09:48:11 +03:00
Dmitry Petrov 0f898dc6dc Fix default interface generic extension fun call with inline class type
When we've determined that we are going to invoke an erased inline class
method ('static foo-impl(this, ...)' in inline class), keep track of it
so that the remaining type mapping logic proceeds correctly.

 #KT-26998 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00
Dmitry Petrov 95010de32e Minor: renaming 2018-09-21 09:48:11 +03:00
Dmitry Petrov 8d2b1950e6 Fix Kotlin default interface methods calls for inline classes
When mapping callable method signature for erased inline class methods,
use original function descriptor instead of super declaration
(otherwise it would map to a default interface method with mismatching
signature).

When generating delegates to Kotlin default interface methods, keep
track of the original Kotlin types for delegating method arguments and
interface method arguments.

'original' for value parameters of fake overrides points to the
overridden function value parameters instead of the value parameter of
the unsubstituted function. This causes inconsistent type mapping for
inline classes implementing generic interfaces with default methods.

 #KT-25295 Fixed Target versions 1.3.20
 #KT-26931 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00
Dmitry Petrov 8536ef5b43 Minor: reformat 2018-09-21 09:48:11 +03:00
Dmitry Petrov 947ea88d5e Refactor: pull up and extract method 2018-09-21 09:48:11 +03:00