Commit Graph

4146 Commits

Author SHA1 Message Date
Dmitriy Novozhilov c94dd2939e [NI] Add test for KT-32429
#KT-32429 Can't Reproduce
2019-12-20 11:33:06 +03:00
Ilya Chernikov 4e14d04926 [minor] fix testdata for compiler 1.4 2019-12-19 14:25:56 +01:00
Ilya Chernikov f38bb19fc6 [minor] Fix testdata for compiler 1.4 2019-12-19 14:01:01 +01:00
Mikhael Bogdanov 650cfeaaed Update inline tests to void PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR 2019-12-19 12:46:36 +01:00
Dmitry Petrov 09c3279cc7 PSI2IR: Infer smart cast on dispatch receiver of FAKE_OVERRIDE calls
NB here we have use derived class type with type arguments replaced
with star-projections. This emulates JVM erasure (to some degree),
but, unfortunately, that's best we can offer here at the moment.
2019-12-19 12:24:58 +03:00
Alexander Gorshenev ab79c3e0a0 Properly mute (and unmute) tests for unrelated backends 2019-12-18 19:29:56 +03:00
Alexander Gorshenev dc8240c24e Expect/actual support in klibs under -Xklib-mpp 2019-12-18 19:29:56 +03:00
Georgy Bronnikov 0d8036bb14 JVM_IR: do not generate main() when extension main is present
Extension methods with signature C.main() should not cause generation
of main(args: Array<String>).
2019-12-18 15:25:57 +03:00
Georgy Bronnikov 220ea72d65 JVM_IR: add coercion for index in ArrayGet intrinsic 2019-12-18 13:03:12 +03:00
Igor Chevdar cca3f13e48 Added multi-module test on inline functions 2019-12-18 12:45:41 +03:00
Alexander Udalov 7eda60d57e Minor, add more tests on signature-polymorphic calls
Add a test on null (since null is a special case in the
PolymorphicSignature spec), and a test on a call without assignment to a
variable
2019-12-17 18:44:19 +01:00
Alexander Udalov 64d40b4743 Support JVM polymorphic signature calls to methods with void return type
#KT-32026 Fixed
2019-12-17 18:39:05 +01:00
Georgy Bronnikov e92985458b JVM_IR: skip private declarations in imported classes 2019-12-17 15:53:29 +03:00
Svyatoslav Kuzmich f099277210 [JS IR] Unmute tests and add KJS_WITH_FULL_RUNTIME 2019-12-17 15:33:43 +03:00
Svyatoslav Kuzmich e32ec2a789 [JS IR BE] Support typeOf 2019-12-17 15:33:43 +03:00
Mikhael Bogdanov 03c2350e79 Keep original casts during reification to avoid VerifyError
#KT-26435 Fixed
2019-12-17 12:41:22 +01:00
Ilmir Usmanov b6de3c2fcc Disable tail-call optimization for suspend functions with Unit return type
if it overrides functions with another return type.
Otherwise, we cannot determine on call site that the function returns Unit
and cannot { POP, PUSH Unit } in order to avoid the situation when callee's
continuation resumes with non-unit result. The observed behavior is that
suspend function, which should return Unit, suddenly returns other value.
 #KT-35262: Fixed
2019-12-17 12:08:35 +01:00
Mads Ager 82f48cdd11 JVM_IR: Backwards compatible handling of default tailrec params.
Before 1.4 tailrec function default arguments were evaluated
right-to-left instead of left-to-right. This is controlled
by a compile-time flag. This change adds support for the
right-to-left evaluation order when that flag is not set.
2019-12-16 20:52:52 +01:00
Alexander Udalov f51a0048f6 Minor, rename test and avoid commented directive
Get rid of "_lv12" in the test name, since it's actually a test on the
modern compiler. Also, avoid the commented "IGNORE_BACKEND: JVM_IR"
directive in another test to make JVM IR test failures more greppable.
2019-12-16 17:38:11 +01:00
Anton Bannykh d6fcde7316 JS_IR: fix typecheck corner case
Consider `fun <E : I> foo(a: Any?) = a as? E`, where I is an interface.
This check used to fail, because the `a == null` was missing, and
the `isInterface` stdlib method crashes if the first argument
is null. This change adds the null check.

Also this change prettifies the instance check in case of type parameter
left operand.
2019-12-15 17:36:24 +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
Georgy Bronnikov 92c2cfa968 JVM_IR: handle property references at class level 2019-12-13 20:44:09 +03:00
Victor Petukhov 07269661b4 NI: Allow to resolve to functions with SAM conversion and passing array without spread as vararg (with warning)
^KT-35224 Fixed
2019-12-12 23:46:16 +03:00
Georgy Bronnikov bb301f8aca JVM_IR: fix wrong check in skipping captured vars 2019-12-12 15:38:18 +03:00
Mikhael Bogdanov 26032e4297 Split exception table on finally insertion before non-local return
in nested try blocks without finally

 #KT-31653 Fixed
2019-12-12 13:33:40 +01:00
Mikhael Bogdanov c335015c05 Generate proper exception table
Don't forget to split nested try blocks without finally block
 on generating finally blocks from outer ones.

 #KT-31923 InProgress
2019-12-12 13:33:39 +01: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
Alexander Udalov 025360edc4 JVM IR: lookup symbols by name in ProgressionHandlers in known classes only
Alternatively, we could improve the lookup utilities and their usages to
always find the exact override of a symbol from
Collection/Iterable/CharSequence/etc, but since we need to load the
original symbol anyway in cases when the loop subject's type is a type
parameter, we might as well simplify everything and always reference the
original symbol.

Also improve exception message and removed unused declarations in
IrBackendUtils.kt.
2019-12-12 14:55:47 +03:00
pyos 498b41b148 JVM_IR: do not do invokeinterface on Object methods
This works on HotSpot, but might confuse other VMs.
2019-12-11 15:09:37 +01:00
Ilmir Usmanov df0a86ea57 Add NOP as first instruction in coroutine's try blocks
#KT-35035 Fixed
2019-12-11 15:01:41 +01:00
Mark Punzalan 692a83f7bb [FIR] Add FirCheckNotNullCall converted to CHECK_NOT_NULL intrinsic
function call.
2019-12-11 16:54:15 +03:00
victor.petukhov a92f58b1ac Revert "NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed ^KT-32435 Fixed"
This reverts commit 09c2b92b
2019-12-11 15:32:46 +03:00
Victor Petukhov 09c2b92b1d NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed
^KT-32435 Fixed
2019-12-11 12:15:02 +03:00
pyos 13a2879b78 JVM_IR: generate more correct parameter metadata 2019-12-11 08:19:55 +01:00
Georgy Bronnikov 094de9fb5e IR: Do not capture variables from method calls in ClosureAnnotator
To call a method of a class, you never need to supply any values of
local variables (they would always be provided to the constructor).
2019-12-10 17:31:12 +03:00
Dmitriy Novozhilov b76c984b26 [FIR] Support IntegerLiteralTypes 2019-12-09 17:24:26 +03:00
Dmitry Petrov f6b99955f8 Update testData in bytecodeText (argument nullability assertions) 2019-12-06 11:03:07 +03:00
Dmitry Petrov d28743157a Mute testPlatformValueContains in JVM_IR 2019-12-06 11:03:07 +03:00
Dmitry Petrov c83f68151c Support @EnhancedNullability in psi2ir 2019-12-06 11:03:07 +03:00
Dmitry Petrov 26782d7216 Fix exception message checking
Looks like there's no big difference between "J.s() must not be null"
and "s() must not be null".
2019-12-06 11:03:07 +03:00
Dmitry Petrov 331347f9fe Mute tests for explicit 'equals' on boxed primitives 2019-12-06 11:03:06 +03:00
Dmitry Petrov 89e1941dfd Update testData for argument nullability assertion tests 2019-12-06 11:03:06 +03:00
Dmitry Petrov fc7783c7dd JVM_IR: JvmArgumentNullabilityAssertionsLowering 2019-12-06 11:03:06 +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
Alexander Udalov d84daa0a4b JVM IR: fix value argument offset in -Xjvm-default=compatibility mode 2019-12-03 18:39:43 +01:00
Alexander Udalov f869be6a71 JVM IR: do not mangle synthetic methods with inline class parameters
For example, synthetic `$annotations` methods for properties were
previously mangled to `$annotations-...`, which breaks annotation
loader, and fails an assert in ClassCodegen.generateMethod.
2019-12-03 11:34:55 +01:00
pyos 35c2573b33 PSI2IR: generate IrEnumConstructorCalls with correct return type
Normally, the fact that is was Unit was not visible as enum constructors
are lowered to normal class constructors anyway. The exception is when
the arguments are reordered, causing the incorrect return type to leak
into the block that holds temporary variables.
2019-12-03 11:54:41 +03:00
pyos 69033b7b15 JVM_IR: handle @JvmName on annotation getters 2019-12-03 10:53:49 +03:00
pyos ac7d9fa90d JVM_IR: implement -Xpolymorphic-signature 2019-12-03 08:31:46 +01:00
Mikhael Bogdanov b9dee4e93a Remove assertion on sorted ranges: it could be empty if lambda doesn't contain any linenumber
#KT-35101 Fixed
2019-12-02 12:08:36 +01:00