Commit Graph

30 Commits

Author SHA1 Message Date
Dmitry Petrov 2f82c5b6af JVM: Fix default parameter values handling
When we generate call for 'foo', we make decision about invoking
a 'foo$default' too late, after the call arguments are generated.
If 'foo' was an override, and base class (interface) was generic,
'foo' in base class could have a different Kotlin and JVM
signature, so the arguments we generated could be generated wrong
(primitive or inline class values instead of boxes, see KT-38680).
Also, we always selected first base class in supertypes list,
which caused KT-15971.

Look into resolved call and see if we should actually call
'foo$default' instead of 'foo' when determining actual callable.

Overrides can't introduce default parameter values, and
override-equivalent inherited methods with default parameters
is an error in a child class. Thus, if we are calling a class
member function with a default parameters, there should be one
and only one overridden function that has default parameter values
and overrides nothing.
2020-05-20 07:19:29 +03:00
Jinseong Jeon eac9af521e [FIR2IR] differentiate external Java stub origin from external stub 2020-05-08 17:45:39 +03:00
Mikhail Glukhikh 19d0d42b9e Mute three failing FIR black box tests 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh 0f0e5e603d [FIR2IR] Use IR built-in types, their symbols & constructors directly 2020-03-18 17:09:36 +03:00
Steven Schäfer 07737f8fc6 JVM IR: Fix BridgeLowering 2020-02-07 18:44:50 +03:00
Kristoffer Andersen 61e6d346aa [JVM IR] Interface Delegation by Property should use existing field
When a property backed by a final field is the delegate for interface
implementation by delegation, the backend should reuse the backing
field rather than introduce a new, extraneous `$$delegate_n` field.
2020-01-30 14:42:24 +03:00
Mads Ager e327b174a2 IR: Use name \$\$delegate_n for the field for interface delegation.
Without this change, these fields could have names such as
`<no name provided>$SuperClass$delegate` for something like
`object SuperClass by I { }`.
2020-01-27 15:28:27 +03:00
Alexander Udalov 5f367278c1 Psi2ir: support generic properties in class delegation
Since property accessor descriptors (unlike corresponding IR elements)
do not have type parameters, we need to take them from the corresponding
property to ensure the correct IR for delegated property accessors.
2019-12-12 15:02:32 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Georgy Bronnikov ce6e2621cf Unmute working tests 2019-08-04 01:35:05 +03:00
Mikhael Bogdanov 1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Alexander Udalov 5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Mikhael Bogdanov a4206a543a Skip test on JDK 6 2018-10-22 16:32:55 +02:00
Mikhael Bogdanov 5b8acd69e3 Mute JVM IR tests 2018-10-22 16:32:53 +02:00
Mikhael Bogdanov ac8e1a0124 Move JVM8 box test to common 2018-10-22 16:32:52 +02:00
Anton Bannykh 3a105debb3 [JS IR BE] fix default arguments lowering 2018-10-18 14:25:48 +03:00
Mikhael Bogdanov 06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Zalim Bashorov 3f0b31dc23 Speed up JS IR BE tests compiling the common parts (runtime + test common utils) once (on demand) and sharing the result between tests
It's a temporary hack until we implement IR based library format.
It relies on the fact that currently, IR BE generates stable (enough) names.​
2018-07-13 23:42:41 +03:00
Anton Bannykh d042038045 JS IR: mute tests with language version 1.0
Long.rem declaration doesn't compile
2018-07-12 14:18:34 +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
Alexey Andreev 24c0a1e7ce Fix translation of delegated functions with default params in JS BE
See KT-17285
2017-05-29 15:30:28 +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
Mikhail Zarechenskiy d573962259 Add test for class delegation with private constructor
#KT-16583 Obsolete
2017-03-02 18:34:59 +03:00
Mikhail Zarechenskiy e2dcec62d3 Fix access to top-level declarations inside anonymous initializer
#KT-16583 Fixed
2017-03-02 18:34:51 +03:00
Mikhael Bogdanov b88a9025e0 Don't check DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE when compiling to 1.0 2017-01-13 18:01:05 +01:00
Zalim Bashorov 596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Denis Zharkov bb1b8cca20 Fix AssertionError in CodegenUtil.getDelegates
Change getAllOverriddenDescriptors contracti, now it returns
original (not substituted) descriptors without any duplicates.

First of all it's necessary in CodegenUtil.getDelegates to avoid
duplicates (see assertion there), but also it's convenient for all
other usages of this method

 #KT-8154 Fixed
2016-09-28 11:40:35 +03:00
Michael Bogdanov 7325baa06a Fix for KT-13374: CompilationException: Inline function call with anonymous object implementing an interface by delegation
#KT-13374 Fixed
2016-08-16 10:47:01 +03:00
Alexander Udalov bab127ad33 Remove some legacy codegen tests, move some to generated 2016-03-09 10:25:38 +03:00