Commit Graph

42 Commits

Author SHA1 Message Date
Nikolay Lunyak 13a7bb95b3 [FIR] Relax MULTIPLE_DEFAULTS_* to account for the K1 behavior
^KT-56442
^KT-36188
2023-08-28 10:57:40 +00:00
Nikolay Lunyak 3f1bf6112f [FIR] Report MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
Reporting it for `VIRTUAL_MEMBER_HIDDEN`
is ok, because `VIRTUAL_MEMBER_HIDDEN`
has always been an error, so we are
allowed to treat these as overrides
implicitly.

^KT-59408 Fixed
^KT-59419 Fixed
^KT-57076 Fixed
2023-08-28 10:57:40 +00:00
Nikolay Lunyak dc9ed5656e [FIR] Revert FirMultipleDefaultsInheritedFromSupertypesChecker
It's possible to write a fix that
would prevent false positives with
this checker, but the core
intuition behind it is invalid.

This checker assumes that it's
enough to only check direct
overriddens, while in reality
even simple `Source` override
functions are not allowed to
contain default values, so they
can't be used to make judgements
about them.

^KT-59408 Open
^KT-59408 Open

^KT-61095 Fixed
^KT-61165 Fixed
^KT-61029 Fixed
2023-08-17 13:55:19 +00:00
Nikolay Lunyak 61448531cb [FIR] Support MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
^KT-59408 Fixed
2023-08-04 11:20:39 +00:00
Svyatoslav Kuzmich d1c81eb6ba [Wasm] Support Wasm GC milestone 5 2022-05-20 12:22:43 +03:00
Svyatoslav Kuzmich 6eb81517a0 [Wasm] Unmute passed Wasm tests 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich c88cde2f8b [Wasm] DONT_TARGET_WASM_BACKEND => IGNORE_BACKEND in testdata 2021-10-02 06:14:35 +00:00
Igor Laevsky c526145a48 WASM: Disable bunch of tests which expose the same issue after switch to the wasm native strings 2021-08-04 16:23:37 +03:00
Mads Ager fae5b8da4b [JVM] Do not put the name of default lambda parameter in LVT.
If we do, the local variable table will not make sense. As as
example:

```
inline fun foo(getString: () -> String = { "OK" }) {
  println(getString())
}

inline fun bar() {
}

fun main() {
    bar()
    foo()
}
```

leads to the following bytecode:

```
  public static final void main();
    descriptor: ()V
    flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL
    Code:
      stack=2, locals=4, args_size=0
         0: iconst_0
         1: istore_0
         2: nop
         3: nop
         4: iconst_0
         5: istore_1
         6: nop
         7: ldc           #53                 // String OK
         9: astore_2
        10: iconst_0
        11: istore_3
        12: getstatic     #30                 // Field java/lang/System.out:Ljava/io/PrintStream;
        15: aload_2
        16: invokevirtual #36                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
        19: nop
        20: return
      LineNumberTable:
        line 9: 0
        line 13: 2
        line 10: 3
        line 14: 4
        line 15: 6
        line 16: 7
        line 17: 19
        line 11: 20
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            2       1     0 $i$f$bar   I
            6      14     1 $i$f$foo   I
            4      16     0 getString$iv   Lkotlin/jvm/functions/Function0;
```

The `getString$iv` local should not be there. It has been inlined away.
Leaving it in the local variable table leads to inconsistent locals
info. Local 0 contains an int but we declare a local of type
Function0.
2020-12-03 13:41:36 +01:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Mikhail Glukhikh c46fac3464 FirTypeIntersectionScope: support inherited default parameters 2020-07-15 13:36:28 +03:00
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 57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Mikhail Glukhikh 3d17ce05b5 [FIR] Introduce FirResolvedArgumentList with argument-parameter mapping
#KT-36345 Fixed
2020-03-11 22:08:59 +03:00
Mark Punzalan 79fef09bf5 [JVM IR] Add tests for KT-15971. 2020-03-11 14:33:31 +01:00
Mark Punzalan 2239b5ceab [JVM IR] Maintain KT-36188 bug compatibility between non-IR and IR
backends.
2020-03-11 14:33:31 +01:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh 8c155578f7 FIR2IR: generate both dispatch & extension receiver without 'else if' 2020-02-25 12:13:42 +03:00
Juan Chen 4c04ad2371 FIR: Add bindings for dispatch receiver parameters
Before this commit, such descriptors have null owners, which causes problems when the getter of the owner property is called.
2019-12-27 10:13:44 +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
Anton Bannykh 3a105debb3 [JS IR BE] fix default arguments lowering 2018-10-18 14:25:48 +03:00
Anton Bannykh ac1a97ad83 JS IR: unmute tests 2018-07-11 14:49:36 +03:00
Anton Bannykh 07b3b66fd9 JS IR: unmute tests 2018-07-10 13:34:19 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Anton Bannykh 6edf138460 JS IR: muted newly failing tests 2018-06-21 13:27:17 +03:00
Anton Bannykh 9039b75c25 JS IR: unmute tests 2018-06-21 13:27:17 +03:00
Anton Bannykh 96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Anton Bannykh 03e46ce0ca JS: more default arguments fixes (KT-24413, KT-21968 fixed)
MPP-related:
* inherited from interfaces
* inherited body from interface
* default arguments in an interface, implemented by a class delegate
* super call of a method with default argument

Also:
* inheritance from an interface and another interface descendant (KT-21968)
* inheritance through an intermediate interface
2018-05-28 15:27:21 +03:00
Yan Zhulanow 3fa506fd45 "Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors 2016-01-26 17:21:44 +03:00
Denis Zharkov ede4b61980 Add tests for obsolete issue
#KT-7412 Obsolete
2016-01-20 14:27:53 +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 4ca434da54 remove support for 'trait' keyword 2015-09-22 15:00:24 +02:00
Michael Bogdanov 5daf79d2de Tests for obsolete KT-5232: vfy error with default parameter in method of trait
#KT-5232 Obsolete
2015-05-15 18:06:52 +03:00
Dmitry Jemerov 4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Pavel V. Talanov 59f192ef90 Replace 'class object' with 'default object' in renderers and test data
Includes changes to decompiled text
Old syntax is used in builtins and project code for now
2015-03-06 19:36:54 +03:00
Denis Mekhanikov 1533c0e9f3 Support more than 32 default arguments
#KT-4675 Fixed
2014-08-20 20:47:34 +04:00
Andrey Breslav ab7d8a7734 Tests for abstract functions with default arguments 2014-01-23 17:59:18 +04:00
Alexander Udalov 723d5ef564 Fix default argument method calls
In some cases, calls of methods with default arguments were invoked via the
actual generated method, not via the "...$default" accessor
2013-09-03 22:26:05 +04:00
Andrey Breslav 2d2c44ca9d KT-2106 Mixed named and positional arguments should be allowed
#KT-2106 Fixed
2013-01-31 15:43:14 +04:00
Alexander Udalov 7ce62a5b64 Remove generated codegen tests, move all testData to box/
A single test file will be generated out of box/ directory
2013-01-28 18:20:21 +04:00