Commit Graph

23587 Commits

Author SHA1 Message Date
Alexander Udalov 3f1533c35b Restore support for local class literals in annotation arguments
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead

 #KT-29891 Fixed
2019-02-25 19:22:09 +01:00
Alexey Tsvetkov f38ad0fe8a Fix inter-project IC with new MPP for JS/JVM targets
#KT-26275 Fixed
   #KT-29966 Fixed
2019-02-25 17:12:14 +03:00
Svyatoslav Kuzmich beb5f73a2b Remove duplicate tests from JS compiler test set. Merge chages to common compiler tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich 569187a751 [JS IR BE] Use Char boxing rules of current backend 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich de020ed58a [JS IR BE] Generate and export JS properties 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich fc5636b7c1 [JS IR BE] Fix: Don't generate built-in "Function" interface 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich 326cbcc218 [JS IR BE] Unmute tests 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich 1184c158e4 [JS IR BE] Support @JsName in bridges 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich e09a6f0007 [JS IR BE] Fix codegen for external companion objects 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich c4ffe36a21 [JS IR BE] Add CharSequence type check 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich 74c8f54fc8 [JS IR BE] Support cast to native interface 2019-02-25 15:09:25 +03:00
Yan Zhulanow e43fd713ef Fix new compiler tests (new receiver name mangling – $this$label) 2019-02-25 14:44:00 +03:00
Yan Zhulanow 28e4356e6e Restore original variable name mangling for captured/receiver $this
Design for the new one is still not finished.
2019-02-25 14:43:59 +03:00
Yan Zhulanow b9f76683dd Simplify 'suppressDiagnosticsInDebugMode'
In the new evaluator, suppressDiagnosticsInDebugMode is never set, and effectively the only check is that if a particular file is a KtCodeFragment.
2019-02-25 14:43:58 +03:00
Yan Zhulanow 24cdd3f857 Remove 'debugTypeInfo' key
The key became obsolete as the new evaluator doesn't use it anymore.
2019-02-25 14:43:57 +03:00
Yan Zhulanow 6a81c2e1e4 Minor: Extract 'this' local variable name in DefaultImpls 2019-02-25 14:43:57 +03:00
Yan Zhulanow 0657a3d399 New evaluator that doesn't depend on the 'extract function' refactoring (KT-28192, KT-25220, KT-25222, KT-21650) 2019-02-25 14:43:57 +03:00
Yan Zhulanow 3e849294f0 Extract the common part from bunched KtCodeFragment 2019-02-25 14:43:57 +03:00
Yan Zhulanow b4002accfb Extract label name calculation from 'recordCallLabelForLambdaArgument()' 2019-02-25 14:43:56 +03:00
Yan Zhulanow eaed6855ac Minor: Add proper nullability check in generateExtensionReceiver() 2019-02-25 14:43:56 +03:00
Yan Zhulanow d039e3b1c0 Hide synthetic variables for local functions and destructured lambda parameters (Kotlin variables) 2019-02-25 14:43:56 +03:00
Yan Zhulanow 488418d960 Change mangling for local functions 2019-02-25 14:43:56 +03:00
Yan Zhulanow aca3be12e9 Change illegal local variable mangling rules 2019-02-25 14:43:56 +03:00
Yan Zhulanow 47f0b68a8c Change mangling for destructured lambda parameters 2019-02-25 14:43:56 +03:00
Yan Zhulanow f6cc686095 Minor: Extract a const for continuation variable name 2019-02-25 14:43:55 +03:00
Yan Zhulanow 227a7e5609 Provide access to 'coroutineContext' inside suspend functions/lambdas (KT-24829) 2019-02-25 14:43:54 +03:00
Yan Zhulanow f6b2e673f7 Debugger: Display async stack trace elements for suspend callers (KT-28728) 2019-02-25 14:43:53 +03:00
Yan Zhulanow e8c066605b Do not drop analysis results for the code fragment context, allow to re-use it
Otherwise labels declared in the expression context become unresolved.
This is needed for the `this@label` expression evaluation support (KT-28134).
2019-02-25 14:43:53 +03:00
Yan Zhulanow ea462091c4 Support new convention for local variables name mangling: '$receiver' -> '$this$<label>' (KT-26913) 2019-02-25 14:43:53 +03:00
Yan Zhulanow b5f9149702 Minor: Get rid of some magic constants 2019-02-25 14:43:53 +03:00
Ilya Chernikov b1ab2ead61 Restore find script definition behaviour (mostly) and relevant comments broken with refactoring 2019-02-25 11:57:13 +01:00
Dmitry Savvinov 50d1c013fc Force-resolve body in contract computation under lock
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).

This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.

^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov 705ec503cf Minor optimization: don't put 'null' for ContractProvider in user data 2019-02-25 11:10:16 +03:00
Mikhail Zarechenskiy 617bed1bf1 Fix nested typealiases expansion and as a result fix serialization
Consider the following situation:
 ```
 class Inv<T>
 typealias A<K> = Inv<K>
 typealias B<V> = Inv<A<K>>

 fun <U> materialize(): B<U> = TODO()
 ```

 Type `B<U>` is expanding to `Inv<Inv<U>>` and for this type `B<U>` and
 `Inv<A<U>>` are abbreviated types, but due to a bug we forgot to make
 substitution for `Inv<A<U>>` and were getting abbreviated type
 `Inv<A<K>>` where `K` is a type parameter from the typealias declaration.

 This bug didn't affect subtyping anyhow but the incorrect type was
 serialized and caused problems during deserialization as there wasn't
 `K` in deserialization context.

 #KT-24964 Fixed
 #KT-20780 Fixed
 #KT-20065 Fixed
 #KT-28236 Fixed
 #KT-21775 Fixed
2019-02-25 00:28:45 +03:00
Georgy Bronnikov 67656a447a Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 3531f47bfb Remove descriptors from ToArrayLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov c3652a47c6 Remove descriptors from JvmStaticAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 28bab6510e Remove descriptors from JvmOverloadsAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov f61072873f remove descriptors from createInnerClassConstructorWithOuterThisParameter 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 72ea4cc3d7 Remove descriptors from BridgeLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov c9b8f58a10 Restore overriddenSymbols consistency in InterfaceDelegationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 68f9f4b3b5 Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov cb757f1cbc Remove descriptors from SyntheticAccessorLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 9078cb87e8 Remove descriptors from InitializersLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 5d7a736cb1 Remove desriptors from ObjectClassLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov 5f4b8dd0aa Remove descriptors from EnumClassLowering 2019-02-23 00:42:16 +03:00
Dmitry Petrov b792f3f12f KT-30020 expressions without resolved calls in augmented assignment LHS
Augmented assignment operator (e.g., '+=') can be resolved to simple
function call ('plusAssign'). In that case, augmented assignment LHS
can be an arbitrary expression, and may have no associated ResolvedCall.

For example:
    (a as MutableList<Int>) += 42

Note that it can happen only in case of augmented assignment operator
convention resolution, because all other forms of assignment-like
operator desugaring require some kind of 'store' operation
(property setter, 'set' operator for array element expression, etc),
and should resolve to some combination of calls.

In that case we simply generate LHS on 'load', and throw assertion on
'store'.
2019-02-22 17:45:27 +03:00
Ilmir Usmanov 1777849ff3 Generate correct linenumber for the debugger to see the return value
of suspend function.

 #KT-20322 Fixed
2019-02-22 17:37:32 +03:00
Ilmir Usmanov ec7315e6da Add $completion entry to suspend functions' LVT
#KT-28810 Fixed
2019-02-22 13:50:35 +03:00
Dmitriy Novozhilov 677987c85f Add diagnostics on annotations on super types. KT-23992 fixed 2019-02-22 10:28:21 +03:00