Commit Graph

36037 Commits

Author SHA1 Message Date
Dmitry Petrov bc069cd686 Lambda in position with suspend function expected type:
simple case - val initializer.
2016-12-15 23:57:44 +03:00
Dmitry Petrov 9dc458375a Build proper modifier list stubs for 'SuspendFunction$n<...>' types. 2016-12-15 23:57:43 +03:00
Dmitry Petrov cf4fb1eb25 Since '@A R.() -> T' is now parsed as '@A (R.() -> T)',
receiver type with modifiers or annotations should be surrounded in parentheses on rendering: '(@A R).() -> T'

This also fixes stub builder tests (which check that stubs are consistent with rendered descriptors).
2016-12-15 23:57:42 +03:00
Dmitry Petrov 6e1340da82 Introduce 'SuspendFunction$n<...>' types. 2016-12-15 23:57:41 +03:00
Dmitry Petrov a15d423db4 Support modifiers on types in parser
(required for 'suspend' on functional types).

TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.

Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.

Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.

In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
2016-12-15 23:57:41 +03:00
Denis Zharkov 6649f64e9f Support new coroutine convention in JVM backend 2016-12-15 23:57:40 +03:00
Denis Zharkov 5a6b4a3224 Fix compilation 2016-12-15 23:57:22 +03:00
Denis Zharkov 1ab003c029 Support another one coroutine convention in front-end
- There will be no `coroutine` keyword for builders
- They accept a special suspend function type instead
  (it's return type is straightforward, not Continuation<Unit>)
- Instances of these types may be run with special built-in functions
- These built-ins functions are parametrized
  with handleResult/handleException/interceptResume, so these operators
  become unnecessary (and controllers too)

NB: `@Suspend` annotation is subject to replace with the `suspend` modifier
on types
2016-12-15 23:32:11 +03:00
Denis Zharkov 66c2333eb5 Drop checks related to 'coroutine' modifier 2016-12-15 23:32:10 +03:00
Denis Zharkov b1d1128466 Minor. Move createFunctionType to core
As it will be used in the type mapper soon
2016-12-15 23:32:09 +03:00
Denis Zharkov 72401efb9f Update coroutine related runtime parts 2016-12-15 23:32:08 +03:00
Roman Elizarov 852a5ee064 New coroutine builder convention API 2016-12-15 23:32:07 +03:00
Dmitry Jemerov b4af532cf0 Remove "experimental" tag from JS features in the UI
#KT-15175 Fixed
2016-12-15 18:03:00 +01:00
Alexey Andreev 1bcb225afa JS: fix translation of invoke convention call when it is declared as extension member inside class. See KT-15073 2016-12-15 19:53:37 +03:00
Alexey Andreev 91aeeb20e8 JS: add test to prove that anonymous function that declares lambda is translated correctly. See KT-11589 2016-12-15 19:53:37 +03:00
Alexey Andreev c82f8213b0 JS: extract outer class reference as dispatchReceiver from ResolvedCall, to include it into UsageTracker mechanism. This allows to capture outer class of super class in local classes. See KT-13166 2016-12-15 19:05:34 +03:00
Alexey Andreev 87f4e53544 JS: when translating nested classes of local classes, capture closure variables via outermost local class. See KT-12566 2016-12-15 19:05:34 +03:00
Alexey Andreev b50bfaf071 JS: add test to prove that KT-14419 is not more reproducible. Add test to prove that extension delegate with extension getValue is translated correctly. 2016-12-15 19:05:33 +03:00
Alexey Andreev b21f906856 JS: add tests to prove that compiler does not optimize RTTI and safe calls based on type information. Remove corresponding optimization for !! operation. See KT-14033 2016-12-15 19:05:33 +03:00
Alexey Andreev e6501591fa JS: serialize type of local anonymous class as its denotable supertype. See KT-14888 2016-12-15 19:05:32 +03:00
Alexey Andreev b08afb0e93 JS: prohibit overriding external functions with optional parameters by non-external fake functions 2016-12-15 19:05:32 +03:00
Alexey Andreev e2dab5ab5c JS: prohibit overriding external functions with optional parameters by non-external functions. See KT-13889 2016-12-15 19:05:32 +03:00
Yan Zhulanow f3d001077b Move Maven subplugin test to kotlin-maven-plugin-test module 2016-12-15 18:36:17 +03:00
Anton Bannykh 1957ac347a JS: make enum valueOf() throw if not found. 2016-12-15 17:58:40 +03:00
Anton Bannykh e0c75f1fb8 JS: initialize enum 'name' and 'ordinal' properties before translating other property initializers. 2016-12-15 17:58:40 +03:00
Anton Bannykh addd24955b JS: support enumValues<E>() and enumValueOf<E>("name") intrinsics. 2016-12-15 17:58:40 +03:00
Alexey Tsvetkov c31f91c28a Introduce Gradle multiplatform plugin 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov d1156211a8 Make JS header/impl name clash checks independent of sources order
If an impl source was placed before a header in a sources list,
the JS_NAME_CLASH error would be reported.
2016-12-15 16:43:35 +03:00
Alexey Tsvetkov 34b740e2f7 Minor: add debug test util 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov 93fa27a195 Provide default output JS file in Kotlin Gradle plugin 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov 232b40eb36 Extract throwGradleExceptionIfError 2016-12-15 16:43:35 +03:00
Alexey Tsvetkov 5a846f94fc Rename: SourceRoots.ForJs->KotlinOnly 2016-12-15 16:43:35 +03:00
Mikhail Glukhikh 295360ad3e Navigation from header to implementation and vice versa #KT-15204 Fixed 2016-12-15 15:50:19 +03:00
Zalim Bashorov 2277239ab3 KJS: don't export declarations marked as external or annotated by native or library annotations 2016-12-15 14:49:31 +03:00
Zalim Bashorov b42fe06933 KJS: fix compiler crash when using inline function inside string template
#KT-12586 Fixed
2016-12-15 14:49:31 +03:00
Zalim Bashorov 8ccc00f3d4 KJS: deprecate enumerable annotation since it's no longer has any effect and rewrite test which checks enumerability of members 2016-12-15 14:49:31 +03:00
Nikolay Krasko d0d583e8ee Do indent adjustment on the fly only for the first element in the line (KT-15123)
Don't interfere spacing for dot in range operator.

 #KT-15123 Fixed
2016-12-15 14:33:18 +03:00
Nikolay Krasko ab04f900df Add name of script file to script module info 2016-12-15 14:33:16 +03:00
Nikolay Krasko 868495437c Filter out first dependency from module dependencies 2016-12-15 14:33:14 +03:00
Nikolay Krasko e359b9b6de Remove the code for idea 144 2016-12-15 14:33:13 +03:00
Nikolay Krasko 88b3d9ff3f Make sdk info and library info difference more clear in debugger 2016-12-15 14:33:11 +03:00
Ilya Gorbunov 9acfde7c5a Revert changes from daac46b since kotlin.Comparator now has lower priority than explicit star-import of java.util.* 2016-12-15 13:39:10 +03:00
Ilya Gorbunov 3bedbfae33 Move kotlin.comparisons.Comparator to kotlin package and remove the former from default imports. 2016-12-15 13:39:10 +03:00
Alexander Udalov 9218965821 Minor, add an enlightening comment to plugins/verify.groovy at Maven plugin tests 2016-12-15 13:07:22 +03:00
Alexander Udalov 954db037dc Minor, fix warning by adding a TODO 2016-12-15 12:12:07 +03:00
Alexander Udalov 90eb229036 Extract compiler-for-maven target in build.xml
To be used after "compiler-quick" to quickly test changes to the compiler in
the Maven build
2016-12-15 12:11:31 +03:00
Alexander Udalov afdeb3339f Run Make without error check before "Generate Tests"
This is needed to simplify merge conflict resolution in case when only
generated tests have conflicts
2016-12-15 11:46:18 +03:00
Alexander Udalov e50b102e89 Treat absence of version in SinceKotlinInfo as infinite version
This may be needed in the future to make some declarations erroneous for all
versions of compilers
2016-12-15 11:46:18 +03:00
Alexander Udalov ede60efda5 Support SinceKotlinInfo for deserialized classes 2016-12-15 11:46:18 +03:00
Alexander Udalov 6393ac5871 Check language version for deprecation via SinceKotlinInfo 2016-12-15 11:46:17 +03:00