Commit Graph

37833 Commits

Author SHA1 Message Date
Denis Zharkov 529b526763 Support parameter destructuring in suspend lambdas
#KT-16092 Fixed
2017-02-02 18:09:19 +03:00
Denis Zharkov 0878049f15 Support tailrec suspend functions in JVM backend
The main problem is that inside a state machine for a named suspend
function parameters of it's owner are available as a usual captured
closure parameters (i.e. through synthetic fields), while
TailRecursion codegen expects that parameters are straight local
variables.

So, the solution is just to define local var for each of real parameters
(all but the last continuation parameters) for tailrec functions.

 #KT-15759 Fixed
2017-02-02 18:09:19 +03:00
Denis Zharkov d7403ca185 Minor. Simplify ClosureCodegen.calculateConstructorParameters 2017-02-02 18:09:19 +03:00
Denis Zharkov a167539d2e Minor. Move recordField call into Closure.captureVariable 2017-02-02 18:09:19 +03:00
Mikhail Glukhikh 212f6e0432 Stub creation from cls fixed for suspend function types
(cherry picked from commit f49ef8e)
2017-02-02 17:54:06 +03:00
Stanislav Erokhin a4272caa8c Fix serialization for suspend function types.
Since now `suspend (Int) -> String` will be serialized as `(Int, Continuation<String>) -> Any?` + suspend flag.

Before this change such type serialized like this: Function2<Int, String> + suspend flag. And yes, type `Function2<Int, String>` isn't correct, because Function2 expect 3 type arguments.
We have special logic for this case and we deserialize such error-written types correctly.

(cherry picked from commit 3518cbe)
2017-02-02 16:48:59 +03:00
Stanislav Erokhin 382122470f Use LanguageVersionSettings from project instead of LanguageVersionSettingsImpl.DEFAULT for sdk and library resolver.
General effect will be the following:
- all member scopes for libraries and JDK will be constructed with -language-version/-api-version specified in project settings
- for modules with another (not like in project settings) -api-version or -language-version we will have not correct member scope -- for example we will see typealiases from such libraries.

#KT-15979 Fixed

(cherry picked from commit 0001865)
2017-02-02 16:47:53 +03:00
Dmitry Jemerov ac4be88627 Prevent duplicate addition of "org.jetbrains.kotlin" prefix when copying sources to Maven projects 2017-02-02 14:06:55 +01:00
Mikhail Glukhikh 4c2ae5e3dd Generate test support: error hints moved out of write action 2017-02-02 15:33:18 +03:00
Mikhail Glukhikh d8f0167d1f Let implement interface: create write action manually to avoid AWT events inside 2017-02-02 15:29:31 +03:00
Mikhail Glukhikh b839e522e9 Generate equals or hash code: do not run in write action to avoid AWT events inside 2017-02-02 15:29:30 +03:00
Mikhail Glukhikh a204e57877 Move file to package matching directory: run write action manually to avoid AWT events inside 2017-02-02 15:29:29 +03:00
Mikhail Glukhikh 72b8b85563 Create kotlin sub class: run write action manually to avoid AWT events inside 2017-02-02 15:29:27 +03:00
Mikhail Glukhikh 9664a066a4 Generate test support: ask everything before write action to avoid AWT events inside 2017-02-02 15:29:26 +03:00
Mikhail Glukhikh 70c5d8b9ad Create test intention: do not start in write action to avoid AWT events inside 2017-02-02 15:29:25 +03:00
Mikhail Glukhikh 07f06352d7 if-then --> safe access: run write action manually to avoid AWT events inside 2017-02-02 15:29:23 +03:00
Mikhail Glukhikh 834c3f5d62 if-then --> elvis: run write action manually to avoid AWT events inside 2017-02-02 15:29:22 +03:00
Dmitry Jemerov 9594147c55 Find Usages checks that the signature of the method a property usage resolves to matches the signature of the method being searched
#KT-15291 Fixed
2017-02-02 12:44:54 +01:00
Alexey Sedunov dbfe3370aa Kotlin Facet: Ignore invalid platform-specific compiler arguments 2017-02-02 13:40:11 +03:00
Mikhael Bogdanov 1e2b50332d Test data update 2017-02-02 09:39:03 +01:00
Mikhail Glukhikh 5f6d65cd44 Change log: last-shot issues for 1.1-Beta2 2017-02-01 21:06:51 +03:00
Mikhail Glukhikh a15454429d Change log: 1.1-RC --> 1.1-Beta2
(cherry picked from commit 7ee259d)
2017-02-01 21:01:21 +03:00
Dmitry Jemerov bc9c40883c Avoid repeated reading of file contents from disk while building stubs 2017-02-01 18:14:57 +01:00
Dmitry Jemerov 66f7382e3a Advance binary stub version due to coroutine metadata format changes 2017-02-01 18:10:50 +01:00
Mikhael Bogdanov a2c5c94ee6 Fix for KT-15868: NPE when comparing nullable doubles
#KT-15868 Fixed
2017-02-01 17:43:56 +01:00
Alexey Tsvetkov 79bea6710f Increment data container cache version
Reason: coroutines metadata format has been changed (since 1.1-beta-1)
2017-02-01 18:50:06 +03:00
Alexey Tsvetkov 1818289772 Avoid checking incremental caches versions if corresponding property is set 2017-02-01 18:50:06 +03:00
Alexey Tsvetkov 2eeb7e36b9 Refactoring: extract checking caches versions to function 2017-02-01 18:50:06 +03:00
Anton Bannykh 385a02ea55 Added forgotten kt8666.txt for LightAnalysisModeCodegenTestGenerated 2017-02-01 18:20:30 +03:00
Dmitry Petrov 7600f89f0b KT-15574 Can't instantiate Array through Type Alias
Array instatiation code should handle type alias constructors properly.

So far, we don't have constructors with type parameters
different from the type parameters of the resulting type,
so we can safely take type arguments of the underlying type.
2017-02-01 17:14:50 +03:00
Anton Bannykh f5a431490c JS: verified that String concatenation with large Long's is fixed (KT-8666) 2017-02-01 15:36:02 +03:00
Sergey Mashkov 20f9e67244 KT-16043 IDL: mark inline helper function as InlineOnly (generate) 2017-02-01 14:44:48 +03:00
Sergey Mashkov 4c2edd54a6 KT-16043 IDL: mark inline helper function as InlineOnly 2017-02-01 14:44:48 +03:00
Mikhail Glukhikh 5fbb3211de Minor change log fix
(cherry picked from commit ef519dc)
2017-02-01 14:42:09 +03:00
Natalia Ukhorskaya 68f722b337 Debugger: fix evaluate expression when breakpoint is set on function without body inside object
#KT-15855 Fixed
2017-02-01 14:31:35 +03:00
Dmitry Jemerov faac1c3156 When calculating import candidates, skip redundant deduplication performed by PsiShortNamesCacheImpl
#KT-16071 Fixed
2017-02-01 12:23:16 +01:00
Dmitry Jemerov 1d37c8cfea Calculate autoimport candidates in daemon thread when import fix is created, not in EDT 2017-02-01 12:23:16 +01:00
Denis Zharkov e9262b875b Implement makeNullableAsSpecified for TypeTemplate properly
This change fixes an SOE in isCastErased:
    @JvmStatic
    fun isCastErased(supertype: KotlinType, subtype: KotlinType, typeChecker: KotlinTypeChecker): Boolean {
        if (supertype.isMarkedNullable || subtype.isMarkedNullable) {
            return isCastErased(TypeUtils.makeNotNullable(supertype), TypeUtils.makeNotNullable(subtype), typeChecker)
        }

TypeUtils.makeNotNullable(TypeTemplate) should not return the same object
if isMarkedNullable returned true on the instance


 #KT-15516 Fixed
2017-02-01 11:51:15 +03:00
Mikhail Glukhikh dc57f97196 1.1-RC change log polishing 2017-01-31 19:01:03 +03:00
Ilya Gorbunov 3be8558a1a Edit 1.1-RC changelog regarding Standard Library and JS 2017-01-31 18:45:53 +03:00
Mikhail Glukhikh 8d48452c1a 1.1-RC: change log (final?) update 2017-01-31 17:31:03 +03:00
Alexey Tsvetkov c57dac159b Avoid having -d and -module set at the same time
#KT-14619 fixed
2017-01-31 16:53:34 +03:00
Alexey Tsvetkov 9b5129a0f3 Fix annotation processors outputting to classes dir with kapt 3
#KT-15915 fixed

 Annotation processor can access a classes directory provided by AP environment.
Previously kapt 3 was using kotlin-classes directory as a a classes directory.
However compileKotlin task does not expect this.
Also having multiple tasks with the same output dir is a bad practise in Gradle.

This change introduces a separate directory for classes generated by kapt 3.
Its output is copied to a resulting classes dir (just as a kotlin-classes dir).
2017-01-31 16:53:34 +03:00
Alexey Tsvetkov 34f04f3482 Fix downgrading from 1.1 to 1.0.x in Gradle
If @Input property is added in new plugin version
and this property has a new type (a class/enum which is not presented in previous plugin)
then downgrading leads to an exception,
because Gradle tries to deserialize the property value from its caches,
but the type of value does not exist.

Workaround: add new String property.
2017-01-31 16:53:34 +03:00
Alexey Tsvetkov 49d0f69227 Fix exception when Groovy lazy string (GString) is in freeCompilerArgs
#KT-15500 fixed

GString is an object that represents string literal like `"${project.name}"`
in Groovy. It is not an instance of string.
Groovy automatically converts GString to String when it is passed where String is expected.
However freeCompilerArgs is a List<String>, so type parameter info is lost at runtime.
When iterating freeCompilerArgs in Kotlin as a list of string, an exception
is thrown because GString cannot be casted to String (toString should be called instead).
2017-01-31 16:53:34 +03:00
Dmitry Jemerov fa6bfe932e More efficient implementation of containsFilesWithExactPackage() (don't materialize KtFile instances we don't actually need) 2017-01-31 14:44:28 +01:00
Dmitry Jemerov 62e1d49def Make sure that we don't have multiple coroutine status flags in the facet settings if one flag was set before parsing the command line options and another is specified through the command line options.
#KT-16075 Fixed
2017-01-31 14:32:09 +01:00
Alexander Udalov 464820458e JS: rename "-library-files" argument to "-libraries" and change separator
Use the system separator (':' or ';') instead of commas

 #KT-16083 Fixed
2017-01-31 16:26:35 +03:00
Dmitry Jemerov fd24031a69 Don't read file content to see if file is Kotlin-compiled if we have cached attribute but don't have complete data 2017-01-31 13:50:35 +01:00
Dmitry Jemerov ffa3cf0027 Don't show "Convert lambda to reference" for lambdas passed to suspend functions
#KT-16072 Fixed
2017-01-31 13:42:38 +01:00