Commit Graph

45 Commits

Author SHA1 Message Date
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +03:00
Denis Zharkov b691b13d8e FIR: Add separate local scopes for blocks 2020-05-15 16:04:44 +03:00
Alexander Udalov 91ef053fbc IR: keep local scope with counter maps across LDL invocations
Since LocalDeclarationsLowering is a BodyLoweringPass, local
functions inside one declaration are handled independently of local
functions in the other declaration. This can lead to name clashes, in
case a local function with the same name and signature is declared in
overloads in the same container, which results in a signature clash
error in JVM IR.

The issue became more common with the introduction of adapted function
references, where psi2ir generates a local adapter-function with a
predefined name, which can easily clash with another reference to the
same target in an overload. This led to a compilation error when
bootstrapping Kotlin with JVM IR, for example in GradleIRBuilder.kt
where there are a lot of references to the same function.
2020-05-08 14:33:34 +02:00
Mikhail Glukhikh d7460d47de [FIR] Generate dispatch & extension receivers for variable assignments 2020-04-03 17:21:21 +03:00
simon.ogorodnik 0acca52001 [FIR-Test] Unmute blackbox test 2020-03-24 18:58:18 +03:00
Mikhail Glukhikh 20c4a7b244 [FIR2IR] Introduce staged transformation (first step)
Now FE IR -> BE IR transformation is performed in multiple stages
controller by Fir2IrConverter. Stages are
 * files & classes registration
 * supertypes & type parameters handling
 * functions & properties signature generation
 * body generation

After each step we have guarantee (with exception of local classes &
type inference combination, and external symbols) that required symbols
(class/function/property/variable/type parameter)
are already bound to real declarations and have correct parents.

This commit also fixes incorrect parents for local classes
2020-03-13 12:18:02 +03:00
Georgy Bronnikov 1c527fc159 IR: avoid name clashes between raised local functions. 2020-01-21 12:50:55 +03:00
pyos 6e6f4d0503 IR: close over the set of captured type parameters 2020-01-16 16:37:40 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Mark Punzalan 1abdf0561a Generate synthetic functions for local functions with default values, by
re-ordering the lowering phases.

The changes in InterfaceLowering are necessary so that IrElements that
target the removed functions are re-targeted to the new functions in
DefaultImpls. This affects local functions in interface functions since
now LocalDeclarationsLowering comes before InterfaceLowering.
2019-07-01 13:24:08 +02:00
Roman Artemev 7f215d3f52 Update tests 2018-11-01 16:51:38 +03:00
Roman Artemev d1621b80cc Fake wrapped descriptors first working draft
get rid of descriptors in Bridge and Enum lowerings
Replace property accessors function type with IrSimpleFunction because they couldn't be constructors
get rid of descriptors in Callable reference lowering
refactored descriptor factory and inner class lowering
Add isReified property to IrTypeParameter declaration
keep getting rid of descriptors
Get rid of descriptors in Shared Variable Manager
LocalDeclarationLowering also uses no descriptors
Fix psi2ir
Fix nested classes names
Fix outer reference in inner classes
Fix name generator
get rid of descriptors in coroutines - something is working
Fix name generator
Fix unbound symbols in JVM BE
Rename DeclarationFactory members
2018-08-31 15:34:18 +03:00
Svyatoslav Kuzmich 392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Mikhael Bogdanov 494828f4cf Unmute jvm ir-tests 2018-08-15 10:26:28 +03:00
Mikhael Bogdanov a7d706f693 Unmute jvm ir-tests 2018-08-09 16:30:32 +03:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov 06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Roman Artemev c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Anton Bannykh 96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Roman Artemev 8bc80a9829 Fix secondary constructor lowering 2018-04-27 20:02:57 +03:00
Roman Artemev ed0c26ef07 Implement function literals in JS BE 2018-04-27 19:53:47 +03:00
Dmitry Petrov 7a156e4407 Give unique names to fields for captured local functions
When a local function is captured, corresponding field accesses are
later transformed by the inliner. It doesn't have enough information to
restore the original semantics completely, so it has to rely on field
names. Local functions can be overloaded or can have names matching
local variable names, in both cases we generated fields with the same
name for captured values.

Now, we use the same '$<local-class-number>' suffix for field names for
local functions as it is present in the corresponding local class name.
This allows to distinguish captured local functions from captured local
variables and between different overloads of a function with the same
name.

 #KT-19827 Fixed
 #KT-18639 Fixed
2017-10-30 15:19:13 +03:00
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00
Anton Bannykh 07bb7ef4d3 JS: extension lambdas translated same as local lambdas (KT-13312 fixed) 2017-01-23 20:09:36 +03:00
Alexey Andreev b5358122e2 JS: unmute shared box tests 2016-11-16 19:50:10 +03:00
Zalim Bashorov afe6ec92a4 Break infinity loop in the test 2016-11-09 21:41:12 +03:00
Zalim Bashorov 596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Alexander Udalov 06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00
Yan Zhulanow 3fa506fd45 "Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors 2016-01-26 17:21:44 +03:00
Yan Zhulanow 9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Dmitry Jemerov 7c20630272 diagnostics for deprecated syntax of function type parameter list 2015-10-06 16:20:47 +02:00
Stanislav Erokhin 3de0dff575 Migrate testdata to new lambda syntax 2015-04-07 13:08:53 +03:00
Stanislav Erokhin b152211096 Added init keyword to testdata 2015-04-07 13:08:51 +03:00
Michael Bogdanov 605c9f48b4 Added inline annotation check on local funs 2014-10-11 13:53:43 +04:00
Michael Bogdanov 4a078c1143 Temporary disable local fun inlining (it's not supported now) 2014-10-09 10:38:14 +04:00
Michael Bogdanov 15043b3c6d Fixes for KT-4991: Prefix/postfix expressions resolved to local extensions are not supported in codegen;
KT-4989: Verify error on local functions and extensions;
KT-4987: NegativeArraySizeException on local extension convention function on nullable Int

  #KT-4991 Fixed
  #KT-4989 Fixed
  #KT-4987 Fixed
2014-10-03 17:24:14 +04:00
Mikhael Bogdanov e2f3a589e7 KT-3308 Support local generic functions in codegen
#KT-3308 Can'tReproduce
2014-04-01 11:18:16 +04:00
Mikhael Bogdanov 0d239a3e0e Moving local fun callee generation to CallReceiver 2014-03-31 20:04:10 +04:00
Mikhael Bogdanov c7c1e33655 Move local fun callee generation to pushArgumentsWithCallReceiver.
Local fun callee generation via resolvedCall.resultingDescriptor not call
2014-03-31 20:03:43 +04:00
Alexander Udalov ea4daed0ac Use FqNameUnsafe instead of FqName in JVM intrinsics
#KT-4777 Fixed
2014-03-27 22:46:44 +04:00
Alexander Udalov 8b918ef1aa Add regression tests for obsolete issues
#KT-1291 Obsolete
 #KT-2895 Obsolete
 #KT-3060 Obsolete
 #KT-3298 Obsolete
 #KT-3613 Obsolete
 #KT-3862 Obsolete
2014-02-13 04:43:53 +04:00
Mikhael Bogdanov 604be8e0c1 KT-4119: Back-end (JVM) Internal error on code with local extensions
#KT-4119 Fixed
2013-10-24 17:24:45 +04:00
Mikhael Bogdanov fc1c3a2e23 KT-3978: Kotlin: [Internal Error] org.jetbrains.jet.codegen.CompilationException: Back-end (JVM) Internal error: null
#KT-3978 Fixed
2013-09-19 15:40:28 +04:00
Mikhael Bogdanov ad4eeb3f8a Properly capture local functions
Local functions in local classed wasn't captured properly
2013-03-27 15:57:27 +04:00