Commit Graph

5990 Commits

Author SHA1 Message Date
Dmitry Petrov f59b49db68 JVM_IR KT-45967 generate accessor for argument of indy intrinsic
TODO handle inaccessible constructors gracefully
2021-04-12 17:36:24 +03:00
Dmitry Petrov 162363a324 JVM: CHECK_BYTECODE_TEST directive + use it in INVOKEDYNAMIC tests 2021-04-12 16:43:15 +03:00
Victor Petukhov 73a2838555 Do substitution captured type's super types as well
^KT-45982 Fixed
2021-04-12 14:00:40 +03:00
Victor Petukhov e8275d2527 Complete old inference's callable references properly, by updating descriptor, resolved call and recorded expression's type
^KT-45721 Fixed
^KT-44994 Fixed
2021-04-12 14:00:38 +03:00
Alexander Udalov ea22f4b681 IR: check absence of extension receiver in isMethodOfAny
Otherwise extension methods named toString/equals/hashCode were
generated incorrectly on JVM IR, which could result in
AbstractMethodError at runtime.

 #KT-45963 Fixed
2021-04-11 13:54:13 +02:00
Ilmir Usmanov bce92d824a Minor. Add tests to check returning Result from functions
Mainly, that virtual functions, returning Result, are mangled.
 #KT-45855
2021-04-09 22:09:03 +03:00
Mads Ager b27a109a1e [JVM] Fix shrinking of local range for dead variables.
Coroutine transform would occasionally *extend* the range of a
local instead of shrinking it (if the next suspension point
is after the end point for the local). That leads to the local
variable table having a local that covers code where it is not
defined. That is invalid and leads to D8 removing the locals
table from the code.
2021-04-09 19:06:13 +03:00
Mikhail Glukhikh 254e41b70d FIR: apply bad test data changes related to ABSTRACT_*_NOT_IMPLEMENTED 2021-04-09 14:52:41 +03:00
Denis.Zharkov 403406f92d Ignore not-null assertion test related to T!! on JVM_IR
^KT-45935 Related
2021-04-09 13:06:39 +03:00
Denis.Zharkov bd05ef19de Add blackbox test for definitely-not-null types
^KT-26245 Fixed
2021-04-09 13:06:32 +03:00
Dmitry Petrov ed88aa43a4 JVM_IR KT-45868 look for parent for delegating lambda in scope stack 2021-04-08 23:49:59 +03:00
Dmitry Petrov c2a5b0b6e2 JVM_IR KT-45920 don't add special bridge if it clashes with known method 2021-04-08 23:48:39 +03:00
Ilya Goncharov 5955faecec [IR] Ignore WASM and FIR for tests
^KT-45866 fixed
2021-04-07 18:13:07 +03:00
Ilya Goncharov b82c9225c8 [IR] Fix copying of default argument from expect to actual with type parameter
^KT-45866 fixed
2021-04-07 18:13:06 +03:00
Abduqodiri Qurbonzoda b0f1ddc91e Advance max/min(By/With) deprecation level to ERROR 2021-04-07 07:49:23 +03:00
Abduqodiri Qurbonzoda d28d0a6321 Advance String(CharArray) deprecation level to ERROR in Common and JS 2021-04-07 00:23:29 +03:00
Abduqodiri Qurbonzoda 968099fbec Advance deprecation level of FP to lesser than Int types to ERROR #KT-30360 2021-04-07 00:23:20 +03:00
Dmitriy Novozhilov 22cbb8720a [FIR] Fix computing labels of anonymous functions (not lambdas) 2021-04-06 12:30:38 +03:00
Dmitriy Novozhilov 5ebd24eac5 [FIR] Save inline status of lambda after resolution 2021-04-06 12:30:34 +03:00
Dmitry Petrov 120eba8d3d Minor: add tests for KT-45893 2021-04-05 17:50:43 +03:00
Mikhail Glukhikh caeb0b43be FIR: introduce JvmPlatformOverloadsConflictResolver
The added here JvmPlatformOverloadsConflictResolver prefers Java field
to property in case of conflicts.
2021-04-05 15:54:49 +03:00
Dmitry Petrov eefb6e94a9 Minor: update tests to pass on Android 2021-04-02 10:53:30 +03:00
Dmitry Petrov 19fb7ebfd5 JVM_IR fix local class names for files with @JvmPackageName 2021-04-02 00:08:55 +03:00
Alexander Udalov ce0c0ad2e3 JVM IR: get rid of toIrBasedKotlinType in MethodSignatureMapper
Commonize (in terms of TypeSystemCommonBackendContext implementations
for KotlinType/IrType) code that computes optimal TypeMappingMode to
apply to different positions where inline class types can be present.
2021-04-01 20:17:45 +02:00
Jinseong Jeon b4a5eec5f4 Raw FIR: correct loop target for break/continue in do-while loop condition
As shown in KT-44412 (or KT-45319 or KT-17728):
```
fun test5() {
    var i = 0
    Outer@while (true) {
        ++i
        var j = 0
        Inner@do {
            ++j
        } while (if (j >= 3) false else break) // break@Inner
        if (i == 3) break
    }
}
```

To properly set the loop target for `break` in do-while loop condition,
the loop target for that do-while loop should be ready before parsing
the loop condition.

Previously, Raw FIR loop building configures loop target after visiting
loop conditions. This commit splits the configuration and lets the
builders prepare the loop target for do-while loop only.
2021-04-01 20:07:50 +03:00
Denis.Zharkov 5cbfb172a4 Ignore new FIR box test on android 2021-04-01 14:52:05 +03:00
Denis.Zharkov d685e2aac7 FIR2IR: Fix inheritance case from built-in interface with default methods 2021-04-01 12:11:37 +03:00
Ilmir Usmanov 786999bcfe Minor. Add regression tests
#KT-44143
2021-04-01 00:51:08 +03:00
Ilya Goncharov 47f1a8a0bb [IR] Make IrTypeOperatorCall copyable
^KT-45655 fixed
2021-03-31 20:14:52 +03:00
Dmitry Petrov 9bf7f3af04 JVM_IR KT-45697 reference classes from sources before IR generation 2021-03-31 16:40:49 +03:00
Denis.Zharkov fa65081878 Revert "FIR2IR: minimize scope processing in fake override generation"
This reverts commit 9934cfbb00.

See the tests added: Subclass may have private same-name method that
should not be a reason to avoid generating fake overrides
2021-03-31 15:57:03 +03:00
Denis.Zharkov 4d3825a824 FIR: Serialize members originated from delegation 2021-03-31 15:57:03 +03:00
Denis.Zharkov a130b110f1 FIR2IR: Fix incorrect conversion of adapted callable references with receiver 2021-03-31 15:57:02 +03:00
Denis.Zharkov 1f074326bf FIR: Fix Java scope in case of accessor with getter signature from supertype
^KT-45584 Fixed
2021-03-31 15:57:02 +03:00
Alexander Udalov 1f7cef6f13 Minor, add a bit more tests for KT-12063 2021-03-31 00:08:52 +02:00
pyos a518a9407d JVM_IR: remap calls to protected @JvmStatic in companions
Protected functions on unrelated classes cannot be called from outside
the current package, so in general, we can only call the static proxy,
not the original companion method.

This has an ABI compatibility implication in that removing `@JvmStatic`
from a protected companion method will require recompiling Kotlin use
sites (of course, this is already source- and binary-incompatible from
Java perspective).

 #KT-12063 Fixed
2021-03-31 00:08:40 +02:00
pyos 85aa6383ad JVM_IR: cast bound property receivers to original type
Because the receiver type is used for determining where to put
accessors, and the type of fake overrides' receivers is the same as for
the original declaration, casting to the type of the parameter leads to
assertion errors.

 #KT-44658 Fixed
2021-03-30 23:09:28 +02:00
Shagen Ogandzhanian e0e2715864 [js] Fix constant folding for unsigned aithmetic in IR
this resolves KT-44138
2021-03-30 16:53:12 +02:00
Dmitriy Novozhilov d0a148074f [FIR2IR] Fix generating body for for-loop 2021-03-30 12:28:15 +03:00
Dmitry Petrov 466e7b60b0 JVM_IR fix receiver type for fake overrides 2021-03-29 19:04:42 +03:00
Victor Petukhov cc1cb463b2 Remove NonStrictOnlyInputTypesChecks LF and introduce opposite – StrictOnlyInputTypesChecks, set default as strict 2021-03-29 16:17:30 +03:00
Victor Petukhov b60056f11e Turn only input type warning to error
^KT-45482 Fixed
2021-03-29 16:17:22 +03:00
Dmitriy Novozhilov 6592407492 [Test] Fix jdk target for BB test 2021-03-29 12:42:54 +03:00
Dmitriy Novozhilov a9399535fb [FIR2IR] Change receiver of field of base class in derived class in property reference 2021-03-29 11:14:52 +03:00
Dmitriy Novozhilov 38ab37d7eb [FIR2IR] Properly handle callable references to static functions 2021-03-29 11:14:52 +03:00
Alexander Udalov c17b6c59f8 JVM IR: add isInlineClassType, use it instead of isInlined 2021-03-26 18:57:01 +01:00
Ilmir Usmanov 5e6f52009f JVM IR: IC coroutines: return boxed type from suspend function if
the function overrides function, returning type argument
 #KT-45451 Fixed
2021-03-25 16:21:55 +01:00
Ilya Chernikov 51a1cec08b FIR: Reimplement conflicts checker to detect conflicts in different files
also pass correct ScopeSession to checkers
fixes some IC tests
2021-03-24 21:24:19 +01:00
Ilya Chernikov 6cc39788fd FIR: Fix main fn mangling (without proper detection)
proper main function detector has to be implemented in addition
to that
2021-03-24 21:24:18 +01:00
Mads Ager 41f5ac393a Update D8 used for dexing tests to version 2.1.96. 2021-03-24 20:16:15 +01:00