Stanislav Erokhin
e014fb7181
Added coroutine import to back-end test.
2016-12-15 23:57:52 +03:00
Stanislav Erokhin
0132f3eea7
Remove kotlin.coroutine package from default imports.
2016-12-15 23:57:51 +03:00
Stanislav Erokhin
7d1b883171
Replace @Suspend to suspend in box tests.
2016-12-15 23:57:50 +03:00
Stanislav Erokhin
90586a5a22
Minor. Add some new test cases for suspend function type inside suspend function type.
2016-12-15 23:57:49 +03:00
Stanislav Erokhin
2671826ed1
Fix front-end test data: replace @Suspend -> suspend.
2016-12-15 23:57:49 +03:00
Dmitry Petrov
6d73e13798
Generic type arguments inference for lambdas as suspend functions.
2016-12-15 23:57:46 +03:00
Dmitry Petrov
bf987cff5f
Tests for basic SuspendFunction-related restrictions (already implemented within type system)
2016-12-15 23:57:45 +03:00
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
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
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
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
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
Anton Bannykh
1957ac347a
JS: make enum valueOf() throw if not found.
2016-12-15 17:58:40 +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
Alexander Udalov
212240a008
Collect all deprecations, do not stop on the first found one
...
#KT-15245 In Progress
2016-12-15 11:46:17 +03:00
Stanislav Erokhin
3600b51d90
Minor. fix test data.
2016-12-14 23:59:38 +03:00
Stanislav Erokhin
457918a6dd
Changed name resolution for dynamic extension. Added annotation DynamicExtension.
2016-12-14 21:36:26 +03:00
Mikhail Zarechenskiy
5b5d09b6b2
Fix test data: rename 'mod' to 'rem'
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
5a829809d9
Add operator 'rem' as extension to BigInteger
...
#KT-14650 Fixed
Note that after this change behaviour of '%' on BigInteger is changed,
now it works like a proper remainder
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
e83568bcf3
Update test data after adding operator rem to builtIns
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
e67543e08e
Revert "Update test data as operator 'mod' became deprecated"
...
This reverts commit 040f4e90ce .
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
42d867b3bf
Support number conversion for binary 'rem' operator
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
62ac91a121
Add operator 'rem' to builtIns
...
Also deprecate operator 'mod'
2016-12-14 15:29:00 +03:00
Mikhael Bogdanov
268d55104c
Don't generate delegation to java default methods
...
#KT-15226 Fixed
2016-12-14 11:20:04 +01:00
Stanislav Erokhin
653d589f98
FIx tests after renaming platform to header.
2016-12-13 23:08:47 +03:00
Alexander Udalov
d0fa9bac75
Introduce '-Xskip-runtime-version-check' command line option
2016-12-13 21:09:00 +03:00
Stanislav Erokhin
59efedf610
Rename platform to header.
2016-12-13 18:00:00 +03:00
Mikhael Bogdanov
dc5c3a478c
Always use default 1.6 build target unless of 'jvm-target' option
2016-12-13 14:51:27 +01:00
Alexey Andreev
d9cf15a665
JS: deparenthesize LHS of assignment before choosing appropriate AccessTranslator. Fix KT-15169
2016-12-13 14:05:25 +03:00
Alexey Andreev
9dc16f0564
JS: prohibit runtime annotations on external declarations. Warn about runtime annotation in remaining cases. See KT-13895
2016-12-13 13:58:41 +03:00
Stanislav Erokhin
dbe8edda5f
Remove propertyDelegate and fix unused parameter checker for provideDelegate.
2016-12-12 23:14:09 +03:00
Stanislav Erokhin
9dc9fb578f
Rename toDelegateFor to provideDelegate.
2016-12-12 23:14:07 +03:00
Alexey Andreev
a01fac9d10
JS: support toDelegateFor in JS backend (see KT-15163)
2016-12-12 23:14:05 +03:00
Mikhael Bogdanov
937a933150
Support local 'toDelegatedFor' properties
2016-12-12 23:14:02 +03:00
Mikhael Bogdanov
c5e14a2059
Some new tests for 'toDelegateFor'
2016-12-12 23:14:01 +03:00
Dmitry Petrov
97d5bbf1c2
toDelegateFor: JVM BE implementation
2016-12-12 23:13:59 +03:00
Dmitry Petrov
e2b6d2d849
Drop 'propertyDelegated' convention (without additional deprecation ceremony).
2016-12-12 23:13:58 +03:00
Dmitry Petrov
5ddf8e60e6
Use delegate initializer expression resolution scope for 'toDelegateFor' resolution.
2016-12-12 23:13:57 +03:00
Dmitry Petrov
a6bc7271ae
operator toDelegateFor: add front-end test for local delegate property
2016-12-12 23:13:56 +03:00
Dmitry Petrov
2ee31916c7
'createDelegate' operator renamed to 'toDelegateFor'
2016-12-12 23:13:55 +03:00
Dmitry Petrov
e2ba288323
'createDelegate' operator convention:
...
- resolution & inference
- additional diagnostic for language feature support
2016-12-12 23:13:54 +03:00