Commit Graph

248 Commits

Author SHA1 Message Date
Mads Ager 8852323a76 [PSI2IR] Do not generate property reference setter if inaccessible.
Fixes KT-45064.
2021-02-23 19:33:49 +01:00
Dmitry Petrov b1ab64e854 JVM_IR KT-44483 argument adaptation is already done in PSI2IR 2021-02-15 19:41:39 +03:00
Mikhail Glukhikh fa0f967c83 FIR2IR: support adapted references for constructors 2021-02-15 17:08:13 +03:00
Mikhail Glukhikh 8bab208322 FIR2IR: use information about callable reference adaptation from resolve 2021-02-15 17:08:08 +03:00
Alexander Udalov 401f0ac583 Use TARGET_BACKEND instead of DONT_TARGET_EXACT_BACKEND in box against Java tests
"// TARGET_BACKEND: JVM" more clearly says that the test is
JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all
other backends.
2021-02-11 13:50:08 +01:00
Alexander Udalov 73aa465ee9 Add tests for issues fixed in JVM IR
Note that KT-30696 is fixed only in the single-module case, and KT-42012
is not fixed fully (see KT-44855).

 #KT-30041
 #KT-30629
 #KT-30696
 #KT-30933
 #KT-32351
 #KT-32749
 #KT-38849
 #KT-42012
 #KT-42990
 #KT-44234
 #KT-44529
 #KT-44631
 #KT-44647
2021-02-10 21:42:10 +01:00
Dmitriy Novozhilov 606ae45f5f [Test] Replace remaining KOTLIN_CONFIGURATION_FLAGS directives with specific ones 2021-02-10 13:02:06 +03:00
Dmitriy Novozhilov 29b96aa15d [Test] Properly merge box against java testdata into codegen/box
Previous commit about it was 3199ce03 and it was completely wrong
2021-02-04 10:53:50 +03:00
Svyatoslav Kuzmich b6ad1584c9 [Wasm] Improve interface method dispatch
- Use typed Wasm tables for each interface method to avoid runtime
  function type check

- Use linear search by implemented interface rather than by individual
  virtual function signature
2020-12-30 19:29:10 +03:00
Dmitry Petrov 3f7a776fb8 JVM box tests for KT-21092 2020-12-23 21:50:07 +03:00
Dmitry Petrov 9f908cdf7c JVM box tests for KT-16752 2020-12-23 21:50:05 +03:00
Dmitry Petrov 632f5af442 Minor: kt21014.kt - add JVM_TARGET 1.8 2020-12-23 11:25:36 +03:00
Dmitry Petrov 3ae8521f12 Minor: drop kt21014.kt (SIGSEGV on HotSpot 6.0_45-b06) 2020-12-22 19:56:54 +03:00
Dmitry Petrov 443cd0fc2c Tests for issues fixed in JVM_IR 2020-12-22 16:07:06 +03:00
Dmitry Petrov ee1e05fedd KT-42151 fix type arguments in local class constructor reference types 2020-11-26 18:40:49 +03:00
Jinseong Jeon 463d53ee5c FIR: handle reference to property with invisible setter 2020-11-20 10:48:13 +03:00
Denis Zharkov 14305d1eba FIR: Simplify callable references resolution
Also that fixes some bugs
2020-11-16 15:50:39 +03:00
Denis Zharkov d4c7d4fc7c FIR: Fix callable references resolution with stub receivers
Use stubReceiver as a receiver for fake calls

See issues KT-43358 KT-43359 KT-43378
2020-11-16 15:50:39 +03:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Jinseong Jeon 5f64d6ec76 FIR2IR: add support for callable reference to Java field
#KT-42656 Fixed
2020-10-15 08:47:46 +03:00
Jinseong Jeon 65545a10c4 FIR: reproduce KT-42656 2020-10-15 08:47:46 +03:00
Alexander Udalov 2f003bdcb5 Minor, add regression test
#KT-42527
2020-10-07 21:31:43 +02:00
pyos a6d5c02d9b JVM_IR: add a transformChildren call to PropertyReferenceLowering
#KT-42354 Fixed
2020-10-06 17:06:34 +02:00
Denis Zharkov 3dfbd36f15 FIR: Unmute passing blackbox tests 2020-10-01 17:49:02 +03:00
Jinseong Jeon b4ac2f5b55 FIR serializer: special handling of Continuation 2020-09-30 12:21:57 +03:00
pyos 0e8a664c9b JVM_IR: fix bound suspend-converted references
Note: inlining of adapted callable references is still suboptimal.

 #KT-42021 Fixed
2020-09-29 19:49:46 +02:00
Roman Artemev 6670e4b21d [JS IR] Fix callable reference to generic constructor
- add tests
 - fix KT-42025
2020-09-24 12:50:47 +03:00
Ilmir Usmanov 9ecf5dc9af Support is/as operations on suspend callable reference conversion 2020-09-17 16:14:04 +02:00
Jinseong Jeon 72dea05854 FIR2IR: approximate type argument if reified 2020-09-17 09:43:46 +03:00
Dmitriy Novozhilov 7f692be11e [FIR] Properly detect callable reference type according conversions 2020-09-11 12:13:33 +03:00
Jinseong Jeon 04af6846a7 FIR2IR: handle more vararg spreads for adapted callable references 2020-08-31 14:31:58 +03:00
Igor Chevdar 527de030fc [box-tests] Turned on some tests for K/N 2020-08-31 12:01:31 +05:00
Dmitriy Novozhilov b21a0213df [NI] Get rid of FE 1.0 types in AbstractTypeApproximator 2020-08-28 10:59:51 +03:00
Jinseong Jeon 553ae68c96 FIR2IR: convert adapted callable reference with vararg 2020-08-26 14:26:19 +03:00
Jinseong Jeon 1b6c4329d2 FIR2IR: handle unbound reference with adapted arguments 2020-08-18 21:53:07 +03:00
Jinseong Jeon 7ef1c74bbf FIR2IR: apply adapted reference conversion to coercion-to-unit 2020-08-05 17:07:27 +03:00
Jinseong Jeon 0e54f98b79 FIR: support adapted callable reference with vararg 2020-08-03 16:37:36 +03:00
Jinseong Jeon bff36e0199 FIR2IR: convert annotations on FirTypeRef 2020-07-30 11:25:36 +03:00
Jinseong Jeon 5a3367e09c FIR: initial support of suspend conversion for function reference 2020-07-28 13:37:05 +03:00
Jinseong Jeon 4e14f9500f FIR: account for vararg when creating KFunction type for callable reference 2020-07-20 09:39:34 +03:00
Mikhail Zarechenskiy c2c139ef4f Fix adaptation for references with default values after varargs
After vararg argument it's possible to pass values only by name, so
 here we modulate this behavior

 #KT-37721 Fixed
2020-06-26 14:03:48 +03:00
Ilya Gorbunov 2fe222e8e7 Add SKIP_DCE_DRIVEN directive in JS-IR tests
Otherwise they fail with a compiler exception:
"An operation is not implemented: SAM conversion"
2020-06-17 19:45:15 +03:00
Mikhail Zarechenskiy 718f23b34f Compatibility warning for references to companion via name (KT-13934) 2020-06-05 13:24:18 +03:00
simon.ogorodnik 8afbb4542b [FIR2IR] Fix check if interface is SAM 2020-05-29 21:10:56 +03:00
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 e1e149a062 FIR: Support coercion-to-unit semantics for callable references 2020-05-18 11:17:45 +03:00
Anton Bannykh 86b5c63891 JS IR: fix origin for callable references with bound reciever
In case of IrFunctionReference with type SuspendFunction (no K!) there
was a misalignment between the base class (Any) and the
origin (LAMBDA..). As a result the SuspendFunctionLowering was
getting confused and produced hanging code.
2020-05-14 14:33:12 +03:00
Anton Bannykh bdca4b45bd JS: inliner supports extra argument caused by suspend conversions 2020-05-14 14:33:12 +03:00
Mikhail Glukhikh e7e80be34a [FIR2IR] Populate overridden symbols even for !isOverride
Before this commit we considered !isOverride as a sign that
function / field / accessor has no overridden symbols.
However, it's false for deserialized, because isOverride
is always false there.

This commit fixes 68 BB tests but breaks 25 BB tests (not yet muted)
2020-05-14 13:40:36 +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