Commit Graph

90 Commits

Author SHA1 Message Date
Jinseong Jeon 4a511c7721 FIR: extend arrayOf call transformation to other variants 2020-06-01 10:45:42 +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
Mikhail Glukhikh 7818baff1e [FIR2IR] Fix problem with double-generation of local class members 2020-05-26 11:50:33 +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
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
Mikhael Bogdanov 5ef37148ea Add flag for proper array convention with default args calls 2020-05-13 08:51:57 +02:00
Mikhail Bogdanov adc770b604 Process default arguments in array convention calls
#KT-16520 Fixed
2020-05-13 08:51:57 +02:00
Jinseong Jeon 57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Mikhail Glukhikh 1500131eb0 [FIR2IR] Re-use applyCallArguments for IrDelegatedConstructorCall 2020-04-13 17:09:05 +03:00
Mikhail Glukhikh 5c758af0a6 [FIR] Use ScopeSession from resolve transformer in FIR2IR 2020-04-09 15:22:55 +03:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Jinseong Jeon 078cf02c8a FIR: Provide dispatch receiver for 'field' according to property type 2020-03-30 16:57:53 +03:00
Mikhail Glukhikh 697006d782 [FIR2IR] Re-use receiver application logic in callable ref conversion 2020-03-30 16:23:10 +03:00
Jinseong Jeon de0c9a5c73 FIR: use dispatch receiver of the enclosing function if any. 2020-03-25 08:27:21 +03:00
Dmitry Petrov 1c24a97b9e KT-36972 Don't create proxies for companion @JvmStatic $default in host
When creating proxy functions in a host class for @JvmStatic members of
companion object, skip functions for default parameters handling.
2020-03-18 13:33:56 +03:00
Dmitriy Novozhilov 2b986194fb [FIR] Add desugaring of array assignments and resolve of it
#KT-37516 Fixed
2020-03-18 11:31:53 +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 1812b490a1 FIR: set anonymous object constructor return type properly 2020-03-11 16:01:57 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh 940567b8bd FIR2IR: set enum class modality properly for complex entries case 2020-03-04 16:55:33 +03:00
Kristoffer Andersen c1d350f8f3 [JVM IR] Added null-checks of handler for non-super $default calls 2020-02-26 16:28:27 +01:00
Mikhail Glukhikh 8c155578f7 FIR2IR: generate both dispatch & extension receiver without 'else if' 2020-02-25 12:13:42 +03:00
Mikhail Glukhikh 9017654b9d [FIR] Handle default parameters when checking callable reference type
#KT-36759 Fixed
2020-02-19 18:09:06 +03:00
Anton Bannykh 70a4c265de Add tests extracted from regressions 2020-02-06 21:03:41 +03:00
Steven Schäfer 8746d08dd5 JVM IR: Don't skip bridge generation for concrete fake overrides 2020-01-17 18:19:26 +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
Igor Chevdar 9e17140daf [JS_IR] Turned on passing JS_IR tests 2019-12-24 15:54:45 +03:00
Anton Bannykh 9a971172c9 JS: fix object expression constructor delegation to secondary constructors with default arguments (KT-30517 fixed) 2019-12-15 15:21:23 +03:00
pyos 57760e5873 FIR: set anonymous initializers' parents 2019-11-21 15:53:52 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Igor Chevdar f413da3e58 Turned off test for native
It fixes current JVM BE behavior but seems like this should've been a FE error.
2019-10-28 12:38:19 +03:00
Mads Ager 4b77db8979 Fix test to actually fail if expected exception is not thrown. 2019-10-21 15:05:32 +02:00
Georgy Bronnikov 1abdcf3f57 JVM_IR: support function references with default parameters 2019-10-11 13:30:30 +03:00
Mads Ager 92cf521e11 [IR] Deal with forward references in default argument lambdas.
Rely on the frontend weeding out cases that are not supported.

In psi2ir, introduce all the parameters before processing default
values.

Change the DefaultArgumentStubGenerator to generate code that
matches the behavior of the current backend.
2019-10-10 09:00:51 +02:00
Georgy Bronnikov ce6e2621cf Unmute working tests 2019-08-04 01:35:05 +03: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
Ting-Yuan Huang 0aee2d0568 Fix signature generation for calls to enum and inner class constructors
The synthesized arguments caused the size of default value mask off by
one when it is close to the boundary of Int.SIZE, which in turn
resulted in wrong signature at call sites.
2019-05-23 12:29:57 +02:00
Igor Chevdar c257af31f4 Added test 2019-01-31 18:19:41 +03:00
Svyatoslav Kuzmich c92a6f9ca2 [JS IR BE] Unmute inlineClasses tests 2019-01-16 12:11:28 +03:00
Alexander Udalov a9afee77d7 Add tests for obsolete codegen issues
#KT-8203 Obsolete
 #KT-15950 Obsolete
2019-01-08 20:43:46 +01:00
Mikhael Bogdanov 02d9c526e2 Proper resort variables on inlining lowered ir closures
Original problem is that lowered ir closures doesn't meet inliner expectations
 about captured variable position in inlining method.
 E.g.: Call 'foo(valueParam) { capturedParam }' to
  inline function 'foo' with declaration

      inline fun foo(valueParam: Foo, inlineParamWithCaptured: Bar.() ->) ....

 is reorganized through inlining to equivalent call foo(valueParam, capturedParam1, cp2 ...).
 But lowered closure for lambda parameter has totally different parameters order:

     fun loweredLambda$x(extensionReceiver, captured1, cp2..., valueParam1, vp2...)

 So before inlining lowered closure should be transformed to

     fun loweredLambda$x(extensionReceiver, valueParam1, vp2..., captured1, cp2..)

 #KT-28547 Fixed
2019-01-03 07:57:36 +01:00
Anton Bannykh 3a105debb3 [JS IR BE] fix default arguments lowering 2018-10-18 14:25:48 +03:00
Zalim Bashorov 8966e220f0 Update tests 2018-08-17 21:44:08 +03:00
Svyatoslav Kuzmich 392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Mikhael Bogdanov bbc5fa4705 Perform InnerClassLowerings after CallableReferenceLowering 2018-08-09 14:22:51 +03:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov 2884d728fd Mute/unmute jvm_ir tests 2018-08-01 12:29:24 +02:00
Anton Bannykh ac1a97ad83 JS IR: unmute tests 2018-07-11 14:49:36 +03:00