Commit Graph

5973 Commits

Author SHA1 Message Date
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
pyos 651fd4ad9f FIR: load Java annotation defaults after binding the class symbol
as they can refer to the class itself.
2021-03-24 16:09:25 +03:00
Mikhail Glukhikh 47d2a914bc FIR: add bad test data changes related to not implemented checker 2021-03-24 16:07:26 +03:00
Victor Petukhov 4f1ed2f112 Don't generate tests on top-down completion of the builder inference for WASM 2021-03-24 15:57:48 +03:00
Victor Petukhov e0a8e9a664 Do updating calls for all nested builder inference sessions including at the same level 2021-03-24 15:57:47 +03:00
Victor Petukhov 80ac62864d Don't lose inference session in all the possible locations 2021-03-24 15:57:47 +03:00
Victor Petukhov 7a66e22bb2 Implement top-down completion for nested builder inference calls
^KT-42742 Fixed
2021-03-24 15:57:36 +03:00
Dmitriy Novozhilov e00e726bcb [FIR] Add test for KT-45584 2021-03-24 12:56:17 +03:00
Dmitriy Novozhilov f4afc2ef44 [FIR] Map dispatch receiver type of function in JvmMappedScope 2021-03-24 12:56:16 +03:00
Dmitriy Novozhilov 7dc3be3b9b [FIR2IR] Replace star projections with upper bounds for SAM conversion types 2021-03-24 12:56:15 +03:00
Dmitriy Novozhilov de03124f50 [FIR] Fix reporting EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR warning 2021-03-24 12:56:14 +03:00
Dmitry Petrov 4f250ed498 JVM_IR KT-45377 rewrite constants again after AddContinuationLowering 2021-03-23 16:05:24 +03:00
Alexander Udalov b5f9b1dfc0 JVM IR: support inline classes with private constructors from other modules
#KT-44723 Fixed
2021-03-22 21:57:07 +01:00
Alexander Udalov dac218dc39 Minor, regroup compileKotlinAgainstKotlin tests on inline classes 2021-03-22 21:57:04 +01:00
Ilmir Usmanov 3124a4ddae Minor. Update test data 2021-03-22 17:35:08 +01:00
scaventz 0dc5ed53f8 Provide sensible toString for getter/setter in reflection. 2021-03-22 11:21:54 +01:00
Dmitry Petrov 9e30ddd12e JVM_IR KT-45581 generate H_INVOKEINTERFACE for interface method handles 2021-03-19 18:57:21 +03:00
Dmitry Petrov 73d4fa65ea JVM_IR KT-45431 don't optimize out $$delegatedProperties in companion
Corresponding delegates are initialized in the host class, using
'$$delegatedProperties'.
TODO figure out proper code generation scheme for delegated properties
in companions (KT-45580)
2021-03-19 18:54:01 +03:00