Commit Graph

168 Commits

Author SHA1 Message Date
Dmitry Petrov bbeb65905e KT-30780 Fix erased inline class context in class context hierarchy
In SourceCompilerForInline we could enter ERASED_INLINE_CLASS context
from containing declaration context. That broke codegen context
hierarchy invariants assumed in accessor generation.
2019-04-05 17:27:04 +03:00
Dmitry Petrov e1fdf0aa43 KT-29959 fix IR generation for 'd.m = e' 2019-02-19 09:59:42 +03:00
Dmitry Petrov 740d5ec468 Mute some tests in JS_IR after adding basic dynamic expressions support 2019-02-14 16:03:11 +03:00
Svyatoslav Kuzmich 75328f26ea [JS IR BE] Add missing KJS_WITH_FULL_RUNTIME to some tests
+ ranges test generator
2019-01-27 01:14:51 +03:00
Mikhael Bogdanov f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Alexander Udalov 38fd2b9ed6 Fix reflection-related codegen tests on JDK 9+
In JDK 9, Class.simpleName changed behavior for local/anonymous Kotlin
classes (see KT-23072), this is why we now check for both variants of
the name in tests. Also, the format of annotation arguments changed a
little, where float parameters no longer have the trailing "f", and
class literals are rendered with ".class" at the end
2019-01-25 10:14:25 +01:00
Svyatoslav Kuzmich aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich c92a6f9ca2 [JS IR BE] Unmute inlineClasses tests 2019-01-16 12:11:28 +03:00
Dmitry Petrov 61ebe6a9aa Minor: add non-intrinsified cases for javaObjectType/javaPrimitiveType 2018-12-25 13:23:48 +03:00
Dmitry Petrov a4897641d4 Minor: mute some tests in JS/JS_IR 2018-12-24 16:10:35 +03:00
Dmitry Petrov 6768ae02c3 Support inline classes in javaObjectType/javaPrimitiveType
#KT-28290 Fixed Target versions 1.3.30
2018-12-24 16:10:31 +03:00
Dmitry Petrov 2f6c4a0472 Use original method signature to call accessor for hidden constructor
#KT-28855 Fixed Target versions 1.3.30
2018-12-24 16:09:44 +03:00
Mikhail Zarechenskiy e509649132 Fix mapping of platform inline class types
For the inline class:
 ```
 inline class IC(val x: Int)
 ```

 Type (IC..IC?) should be mapped to the wrapper `IC`
 because it can hold object and also because it does so for primitives

 #KT-28983 Fixed
2018-12-24 12:32:22 +03:00
Mikhael Bogdanov 3e6f8db975 Specify JVM target backend for test with 'import kotlin.reflect.jvm' 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov a8a1bfca72 Specify JVM target backend for test with '// File: *.java' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov 1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Mikhail Zarechenskiy c924a6efe8 Fix unbound class literals for inline classes
#KT-28361 Fixed
2018-12-18 11:35:36 +03:00
Dmitry Petrov 8ede477f99 KT-28585 Fix boxing for values of captured vars of inline class type 2018-12-10 14:57:09 +03:00
Dmitry Petrov 45035d3e11 KT-28405 Fix toString for inline classes with underlying arrays 2018-12-10 14:57:09 +03:00
Mikhail Zarechenskiy b48614df47 Add test for class literals on inline classes
#KT-28361 Obsolete
2018-11-22 18:10:41 +03:00
Dmitry Petrov 90da274eaa KT-28054: Treat inline class constructor accessors specially 2018-11-19 09:42:03 +03:00
Mikhail Zarechenskiy 3a93cab3b6 Mark JVM specific test with TARGET_BACKEND directive
This is needed to avoid test failing for Kotlin/Native
2018-11-17 22:55:18 +03:00
Mikhail Zarechenskiy 090d3327c0 Use wrapper class of an inline one as a result for javaClass
#KT-28185 Fixed
 #KT-28246 Open
2018-11-16 00:55:01 +03:00
Mikhail Zarechenskiy 35fb3ba096 Fix CCE when unboxed inline class receiver is passed to inline function
Initial problem is started in `capturedBoundReferenceReceiver` method
 where we assume that bound receiver is captured for usual call.

 Note that if method is inline then we don't pass actual name reference
 receiver, but pass special CAPTURED_RECEIVER_FIELD, which is then
 is used to find special instructions during inline and fold several
 instructions in `foldFieldAccessChainIfNeeded`.

 As a result, we got unboxed reference receiver for inline call, which
 caused CCE and to fix it we should box receiver one more time during
 inline

 #KT-28188 Fixed
2018-11-14 11:21:04 +03:00
Mikhail Zarechenskiy 79159947a5 Coerce last value of delegated expression for inline classes
Note that this commit doesn't fix case when some inline class over
 `Any` is returned from a lambda, it'll be fixed further as part of the
 #KT-27586

 #KT-27737 Fixed
2018-11-12 14:21:24 +03:00
Mikhail Zarechenskiy 20ff74a726 Fix mapping for inline classes when JvmSuppressWildcards mode is using
#KT-28097 Fixed
2018-11-12 09:36:05 +03:00
Svyatoslav Kuzmich 5ea7673950 [JS IR BE] Mute inline class tests 2018-11-08 15:00:32 +03:00
Svyatoslav Kuzmich 43b4b6eaae Add more specific fail messages in inline class box tests 2018-11-08 15:00:31 +03:00
Georgy Bronnikov c20f93ddbf Mute failing test 2018-11-07 19:09:15 +03:00
Dmitry Petrov ac7cc0c08e KT-27706: Dispatch receiver type for constructor accessor is Object 2018-11-07 18:17:29 +03:00
Dmitry Petrov ea4afdaebe KT-27705: Use proper types for captured outer class instance
Call typeMapper only if we have an inline class.
2018-11-07 18:17:29 +03:00
Pavel Punegov 4d5b00d3e3 Ignore test in native: uses Array.fill 2018-10-26 11:33:14 +03:00
Pavel Punegov 0bdbcbc662 Ignore the test that uses JVM functions and String constructor 2018-10-18 16:08:38 +03:00
Anton Bannykh 3a105debb3 [JS IR BE] fix default arguments lowering 2018-10-18 14:25:48 +03:00
Dmitry Petrov b13d270d77 Test: reference to constructor with inline class parameters 2018-10-17 16:38:22 +03:00
Dmitry Petrov 0af2a0dc19 Tests: references to private/internal primary val of inline class 2018-10-17 16:38:22 +03:00
Dmitry Petrov 3dc4d01adc Tests for callable references and inline classes 2018-10-17 16:38:22 +03:00
Pavel Punegov 8ea8acc7f7 Set target backend to JVM for tests that have @JvmStatic annotations 2018-10-15 19:25:03 +03:00
Pavel Punegov d9a8a00069 Make tests that use jvm-annotations be targeted to jvm backend 2018-10-15 19:25:02 +03:00
Dmitry Petrov b6be72bb11 Add more tests for inline classes
#KT-27416
 #KT-27513
2018-10-15 12:21:14 +03:00
Dmitry Petrov 0fd68d29f4 Support @JvmStatic in inline class companion object
#KT-27107
2018-10-15 12:21:14 +03:00
Dmitry Petrov 5304754e88 Generate specialized 'toString' for inline classes when possible
#KT-25613
2018-10-15 12:21:14 +03:00
Dmitry Petrov f68ce4b35b Support default parameter values for inline class constructors and funs
#KT-26908
 #KT-26554

Move default parameter value tests to separate directory
2018-10-15 12:21:14 +03:00
Dmitry Petrov 8ce1d09f8a Fix inline class coercion in default parameter values
#KT-27358
2018-10-15 12:21:14 +03:00
Svyatoslav Kuzmich 4c38d55f21 [JS IR BE] Unmute tests 2018-10-15 00:03:45 +03:00
Mikhail Zarechenskiy b7d7d1eb01 Fix inline class type coercion in == with generic call
#KT-27393 Fixed
2018-10-12 12:50:49 +03:00
Mikhail Zarechenskiy 0201694f84 Propagate KotlinType into create method for coroutines
#KT-27526 Fixed
2018-10-12 12:50:47 +03:00
Mikhail Zarechenskiy a8abd8cceb Fix boxing/unboxing for generic functions on index expressions
Unsubstituted type should be used for coercion to box value of
 inline class type if it's needed. For the substituted value it's not
 known if it was a generic parameter or not.

 #KT-27502 Fixed
2018-10-12 11:58:56 +03:00
Pavel Punegov dd1c9fa9f0 Native: Ignore tests that use reflection not implemented in native 2018-10-10 19:01:35 +03:00
Pavel Punegov 82b59c5044 Native: Ignore tests that use jvm or full reflect 2018-10-10 19:00:50 +03:00