Commit Graph

28 Commits

Author SHA1 Message Date
Denis.Zharkov e4c851e3ce FIR2IR: Fix case of @JvmOverloads with subclass
Avoid generating synthetic overrides in subclass
It has been already working for PSI2IR because fake overrides there don't
inherit default values for parameters, while they do it in FIR
2021-02-20 10:59:22 +03:00
Jinseong Jeon 0d6e309372 FIR: construct type with actual type arguments during GetClassCall transformation 2020-06-04 10:13:37 +03:00
Mikhail Glukhikh f3e2dbf360 [FIR2IR] Add conversion of function annotations 2020-05-08 17:30:19 +03:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Denis Zharkov b8984d154b FIR: Do not copy type parameters from class to constructors
Use the same instances from class declaration instead

Otherwise, primary constructor value parameter types when used
in the class body are considered as different from types
based on the class type parameters

See the test genericConstructors.kt, before this commit
"id" call was reported in inapplicable
2019-12-05 13:08:51 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Georgy Bronnikov f3cae210f8 JVM_IR: handle type parameters in constructors for @JvmOverloads stubs 2019-10-15 14:55:18 +03:00
Georgy Bronnikov e38ff8753e JVM_IR: support type parameters in @JvmOverload functions 2019-10-02 16:19:06 +03:00
Alexander Udalov 4be0e00071 JVM IR: support multi-file classes
Without the `-Xmultifile-parts-inherit` mode for now.

This is implemented as follows: FileClassLowering collects information
about multifile parts and the corresponding facades, which a later
GenerateMultifileFacades phase uses to generate new IrFile instances and
add it to the module fragment that's being compiled.

Note that GenerateMultifileFacades is in the end of lowering phases
because delegates in the facade should be generated for all additional
functions generated by certain lowerings (default arguments,
JvmOverloads, etc.). If GenerateMultifileFacades was right after
FileClassLowering, they would still be generated, but we'd then process
them in lowerings mentioned above, which would result in duplicated
logic in the bytecode. There's a new bytecode text test which checks
that this doesn't happen for functions with default arguments.
2019-08-05 21:27:21 +02:00
Alexander Udalov f7fc5d2ffa Fix codegen for JvmOverloads with more than 32 parameters
Use DefaultCallArgs to handle mask list construction correctly

 #KT-31070 Fixed
2019-07-09 19:31:59 +02:00
pyos 6a21285aed JVM_IR: do not generate two nullary constructors
when the primary constructor with @JvmOverloads has default values for
all arguments.
2019-06-24 14:58:45 +02:00
Ting-Yuan Huang 74e8c7c1c5 JVM_IR: generate default constructor
Quoted from https://kotlinlang.org/docs/reference/classes.html

"On the JVM, if all of the parameters of the primary constructor have
 default values, the compiler will generate an additional parameterless
 constructor which will use the default values. This makes it easier to
 use Kotlin with libraries such as Jackson or JPA that create class
 instances through parameterless constructors."
2019-05-30 18:53:27 +02:00
Mikhael Bogdanov f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Mikhael Bogdanov a8a1bfca72 Specify JVM target backend for test with '// File: *.java' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov f36519d4f5 Specify JVM target backend for test with '.javaClass' usage 2018-12-21 16:09:05 +01:00
Mikhael Bogdanov 1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Mikhael Bogdanov 2884d728fd Mute/unmute jvm_ir tests 2018-08-01 12:29:24 +02:00
Georgy Bronnikov db19a6e150 Make @JvmOverloads work with JVM_IR 2018-07-19 18:36:37 +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
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
Denis Zharkov fcb4db0226 Remove redundant ACC_VARARGS on methods generated with @JvmOverloads
#KT-15424 Fixed
2017-02-10 16:05:15 +03:00
Dmitry Jemerov d3ccbe8172 Generate correct varargs flag for @JvmOverloads-generated methods
#KT-14186 Fixed
2016-11-18 11:04:59 +01:00
Dmitry Jemerov 16a133bf5c Generate default constructor also for private classes when all parameters have default values
#KT-14408 Fixed
2016-11-18 11:04:51 +01:00
Dmitry Jemerov 248185943c Handle @JvmOverloads on inner class constructors correctly
#KT-14678 Fixed
2016-11-18 11:04:49 +01:00
Zalim Bashorov 596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Alexander Udalov f8dfaf4599 Merge boxWithJava testData into box, delete BoxWithJava test 2016-03-09 10:25:38 +03:00
Alexander Udalov 06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00