Commit Graph

8267 Commits

Author SHA1 Message Date
Mikhail Glukhikh 966e2442c6 Add tests for KT-52745 2022-06-21 07:39:03 +00:00
Mikhail Glukhikh 6a3be0d8ac Add test for KT-52338 (fixed together with KT-49507) 2022-06-17 13:45:57 +00:00
Jinseong Jeon a2da690afd Test: add java source files as JavaSourceRoot
so that those can be properly populated in SingleJavaRootsIndex
2022-06-16 22:14:17 +02:00
Mikhail Glukhikh fa914f20a4 Use nearest Java super qualifier for fields in IR converter
Related to KT-49507
2022-06-16 06:51:34 +00:00
Mikhail Glukhikh b0a6508d4b Handle Java base class field read properly in IR converters
For FE 1.0, we just change super qualifier symbol to
base class, if it's possible.
For FIR, we introduce using of super qualifier symbols for
field accesses and repeat FE 1.0 behavior here.

#KT-49507 Fixed
2022-06-16 06:51:33 +00:00
pyos 63b0708ed5 FIR CFG: join/unify data flow from postponed lambdas at each level
For example:

    foo(
        // `if` joins A & B
        if (condition)
            run { ... } // A
        else
            run { ... }, // B
        run { ... } // C
    ) // `foo` unifies `A & B` and `C`, so if it is not resolved itself,
      // further `if`s, `when`s, safe calls outside it, etc. continue
      // building the correct type predicate until the next completed
      // call.

^KT-44512 Fixed
2022-06-15 20:05:49 +00:00
Steven Schäfer 194a1d1c6a JVM IR: Start fake variables for default lambdas after initialization
KT-52702
2022-06-15 16:49:22 +02:00
pyos a1f0c6208c Add a test from KT-51950 2022-06-13 11:58:15 +02:00
Pavel Mikhailovskii bcd8a28d4c KT-47823 IR.JVM Fix handling of for loop ranges with inline types and break/continue/return 2022-06-10 18:42:28 +00:00
Pavel Mikhailovskii ecb3cc193c KT-51883 Don't use "-" in generated unique lifted declaration names 2022-06-10 18:36:04 +00:00
pyos 27c51f5f88 JVM_IR: skip SAM lambdas when computing enclosing method of objects
This is what Java 15+ does, and it permits accessing captured type
parameters via reflection. The alternative is to emit generic signatures
on the lambda methods, but that was disabled and I have no clue why.

^KT-52417 Fixed
2022-06-08 23:59:58 +02:00
Pavel Mikhailovskii f81d47bad6 KT-46797 Generate generic signatures for suspendImpl 2022-06-08 16:15:08 +02:00
Steven Schäfer dbb6144ab0 JVM IR: Avoid boxing in generic floating point equality (KT-48635) 2022-06-08 15:38:06 +02:00
Dmitriy Novozhilov 5d0655247f [NoArg] Add implementation of plugin for FIR 2022-06-07 14:12:18 +00:00
Pavel Mikhailovskii 65b2cee913 KT-23397 Optimize out field for property delegate when it's safe (JVM) 2022-06-07 10:46:01 +00:00
Ilya Gorbunov e14ac2a062 Test kotlin-repeatable annotations on Android
(except for type-use annotations)
2022-06-04 10:39:37 +00:00
Ilmir Usmanov f922684169 Minor. Add regression test
#KT-52561 Fixed
2022-06-02 13:26:24 +00:00
Denis.Zharkov c1904004c4 FIR: Fix case when smartcast receiver is used for call to private method
^KT-54432 Fixed
2022-06-01 16:02:30 +00:00
Pavel Mikhailovskii 3b5179686e KT-52592 Fix NPE from KProperty.getExtensionDelegate on property delegated to another property; make $delegate methods private 2022-06-01 14:02:28 +00:00
Victor Petukhov 96d1f89836 [BE] Support until operator in back-ends 2022-05-31 08:42:56 +00:00
Pavel Mikhailovskii 2ceccec2b8 KT-52551 Create a static initialization section in case of delegation to a property reference from a file class 2022-05-30 14:16:18 +00:00
Ivan Kochurkin feb3f41108 [FIR] Fix resolve inside lambda
The lambda is passed to extension function with type parameters
that defined inside this lambda

^KT-52197
^KT-52190 Fixed
2022-05-29 23:41:25 +03:00
Ivan Kochurkin ad7c213ab2 [FIR] Initialize type for annotation arguments during deserialization
Get rid of IrErrorTypeImpl creating in FIR2IR
2022-05-29 23:41:23 +03:00
Ivan Kochurkin 0ef043b074 [FIR2IR] Consider property init value from nested class, ^KT-52057 Fixed 2022-05-29 23:41:23 +03:00
Victor Petukhov 0199c76c06 [FE 1.0] Check callable reference return type safety during resolution
^KT-51844
^KT-52503 Fixed
2022-05-27 13:56:34 +00:00
Victor Petukhov 51551998c7 Revert "[FE 1.0] Take care callable reference candidates with recursive candidate return type"
This reverts commit d04beaa8bb49c99ceb993f3f7b32169c393b39f4.
2022-05-27 13:56:33 +00:00
Victor Petukhov b411eb36e8 [FE 1.0] Take care standalone lambdas during updating types in the builder inference
^KT-50520 Fixed
2022-05-27 13:56:32 +00:00
Pavel Kunyavskiy 2dac366dbc [K/N] Temporary disable privateSuperType test for native
^KT-52498
2022-05-24 21:15:25 +00:00
Mikhail Glukhikh 7c89f0188a FIR: resolve conflicts around SAM calls properly 2022-05-24 12:29:27 +00:00
Dmitriy Novozhilov c777ecd470 [JS] Unmute tests due to fixed KT-52339 2022-05-23 12:04:37 +00:00
Dmitriy Novozhilov d66748d011 [FIR] Extract expect actual matching into separate phase 2022-05-20 13:33:04 +00:00
Svyatoslav Kuzmich d1c81eb6ba [Wasm] Support Wasm GC milestone 5 2022-05-20 12:22:43 +03:00
Georgy Bronnikov 7605494f2b Fir2Ir: provide fake file-level signatures for toplevel privates
We need to supply signatures for private declarations even when their
containing file is not known. In situations where the FirDeclaration in
question is already known (i.e. where we are never going to serach for
the declaation based on that signature), FirDeclaration itself is
sufficient as a key.
2022-05-19 12:02:44 +02:00
Georgy Bronnikov 3a4b8962f9 Fir2Ir: simplify getCachedIrTypeParameter
I could not figure out the reason for the special case in that function.
Tests do not show anything useful.
2022-05-19 12:02:44 +02:00
Georgy Bronnikov 49576e0cbb Fir2Ir: handle nested class references in type parameter bounds 2022-05-19 12:02:44 +02:00
Georgy Bronnikov 12533a383e JVM_IR: mute tests for compiling against Klib
The tests fail currently because Klibs are generated by the JS backend,
and signatures differ between JVM and JS (on JVM, return types are
included in mangles for simple functions).
This leads to linkage errors.
Once signatures are reworked and harmonized between backends, the tests
will repair themselves.
2022-05-19 12:02:44 +02:00
Georgy Bronnikov 39bba7973c Fir2Ir: create file level signatures where appropriate
This is godugly code, where a flag for file level signatures is passsed
around.
An alternative would be not to create file level signatures for toplevel
private clases, since those still need unique names, at least on JVM.
But that would break binary compatibility.
Signatures are due for overhaul anyway. Hopefully this code can be
reverted at that point.
2022-05-19 12:02:43 +02:00
Georgy Bronnikov 9d4ab09b41 FIR: mute test
Getters for synthetic Java properties are generated as substituted
declarations, which leads to wrong bytecode.
2022-05-19 12:02:43 +02:00
Georgy Bronnikov 109bdb9572 Adjust tests for FirSerializeCompileKotlinAgainstKotlin 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 5605463ecf Introduce IGNORE_BACKEND_FIR_MULTI_MODULE directive 2022-05-19 12:02:43 +02:00
Ivan Kylchik 20d0a531df Add new tests to check evaluation of intrinsic сonsts 2022-05-18 21:20:02 +03:00
Ivan Kylchik dca22d745a Drop excessive lowerings that are replaced by ConstEvaluationLowering 2022-05-18 21:20:02 +03:00
Ivan Kylchik 44cf64a00c Convert const values in ranges without explicit cast 2022-05-18 21:20:01 +03:00
Ivan Kylchik 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03:00
Anastasia.Shadrina 292c0c4383 [FE] KT-51234 Check subtyping between context receivers 2022-05-17 15:27:27 +00:00
Anastasia.Shadrina a3fa2dc9bf [Tests] Fix contextualInlineCall.kt to avoid subtyping relation error 2022-05-17 15:27:27 +00:00
Anastasia.Shadrina d857142514 KT-51243 Fix parameterized contextual lambda
^KT-51243 Fixed
2022-05-17 15:27:26 +00:00
Steven Schäfer 90d09dce2c JVM IR: Mangle overridden symbols in non-inline functions (KT-52394) 2022-05-17 12:13:29 +00:00
pyos 513ef575ce JVM: correctly merge typed null values
1. merge(null of type A, null of type B) = null of unknown type;
2. merge(null of type A, something of type B) = merge(unknown null, B).

^KT-52311 Fixed
2022-05-17 11:58:06 +00:00
Steven Schäfer 0da23198e6 JVM_IR: Add null-checks in SAM wrapper constructors (KT-50108) 2022-05-14 02:01:44 +02:00