Commit Graph

185 Commits

Author SHA1 Message Date
Jinseong Jeon b076bec07f FIR deserializer: signature-aware annotation loading for functions 2020-06-19 10:21:09 +03:00
Alexander Udalov 7d9fe55072 Regenerate tests 2020-05-29 15:15:43 +02:00
Dmitriy Novozhilov a604404bff [NI] Report warning if candidate was chosen using only @OverloadResolutionByLambdaReturnType 2020-05-29 09:36:33 +03:00
Mikhail Glukhikh 85760770a8 [FIR2IR] Initialize built-in symbols at start of conversion 2020-05-28 22:18:20 +03:00
Steven Schäfer dc0ef996b7 JVM IR: Implement the new inline class ABI 2020-05-28 18:00:35 +03:00
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +03:00
Dmitry Petrov e625bb375f Temporarily mute unsigned tests in JVM_IR and FIR 2020-05-20 07:19:30 +03:00
Mark Punzalan 89d706972c [FIR] Use vararg element type when generating argument mapping. 2020-05-19 15:41:29 +03:00
Mikhail Glukhikh e7e80be34a [FIR2IR] Populate overridden symbols even for !isOverride
Before this commit we considered !isOverride as a sign that
function / field / accessor has no overridden symbols.
However, it's false for deserialized, because isOverride
is always false there.

This commit fixes 68 BB tests but breaks 25 BB tests (not yet muted)
2020-05-14 13:40:36 +03:00
Alexander Udalov d2a691d157 Minor, ignore failing box tests for light analysis 2020-05-13 13:54:51 +02:00
Mark Punzalan b5b361bb09 Add tests for nullable loop variable in for-loop over unsigned progression. 2020-05-13 13:54:35 +02:00
Mark Punzalan eaddd02e9b Mute/unmute failing/passing unsigned progression tests for FIR. 2020-05-13 13:54:35 +02:00
Mark Punzalan 0e6af517d7 Generate tests for unsigned progressions using
GenerateSteppedRangesCodegenTestData.
2020-05-13 13:54:35 +02:00
Jinseong Jeon a084c5bf7d FIR2IR: populate overriddenSymbols for overriding properties 2020-04-30 12:25:48 +03:00
Jinseong Jeon 57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Mikhail Glukhikh 5c758af0a6 [FIR] Use ScopeSession from resolve transformer in FIR2IR 2020-04-09 15:22:55 +03:00
simon.ogorodnik bd826f38bc [FIR] Fix specificity comparision for unsigned integers 2020-04-07 16:24:58 +03:00
Juan Chen 882e6931d6 [FIR] Add backing fields to const properties during Fir2Ir translation 2020-04-06 16:41:57 +03:00
Juan Chen aba7706dec [FIR] fix test module set up (this fixes 193 BB tests)
Added creation and initialization of the test module and its dependencies.
When looking at the emptyProgression test,
I found that getProgressionLastElement was not found,
which should be resolved from the dependencies.
2020-03-26 10:30:47 +03:00
simon.ogorodnik 59393e06f0 [FIR-test] Mute tests with bad test-data 2020-03-24 18:58:19 +03:00
simon.ogorodnik f83c20065d [FIR-test] Unmute passing tests, mostly fir2ir 2020-03-24 18:58:19 +03:00
Mikhail Glukhikh a4c7619c89 [FIR2IR] Introduce & use FirBuiltInsPackageFragment
Without this commit, JVM name mapping logic in BE does not work for FIR,
because FIR cannot use old BuiltInsPackageFragmentImpl descriptor.
In this commit we add our own implementation thus fixing
a pack of FIR black box tests.
2020-03-24 10:37:53 +03:00
Mikhail Glukhikh ca22e05acd [FIR2IR] Support safe calls 2020-03-23 15:13:50 +03:00
Mikhail Glukhikh 0bf4cac601 [FIR2IR] Unmute additional black box test after rebase 2020-03-18 17:09:37 +03:00
Dmitry Petrov 6809f4439c Fix range-based 'for' loop with 'continue' in range bounds
1. Search for increment function in range element type, not in inferred
induction variable type
(which can be inappropriate, e.g., 'Nothing' in case of 'continue').

2. Handle nested loops with shared exit labels
(generated by JVM_IR for KT-37370 case).

KT-37370 KT-37373
2020-03-17 12:18:48 +03:00
Dmitry Petrov e175ff0d73 KT-36953 break/continue/return/throw have kotlinType Nothing 2020-03-10 16:56:48 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Dmitriy Novozhilov 4454a0681b [FIR] Get rid of copying function call in process of completion 2020-03-02 09:49:28 +03:00
Mikhail Glukhikh 883dd95e3c FIR: fix class / constructor type parameter duplication 2020-02-28 15:29:02 +03:00
Mikhail Glukhikh 2308e5bb7c FIR2IR: in case of use-site generic type use call from original class 2020-02-28 15:29:02 +03:00
Juan Chen 4f6fe1d0ca [FIR]: fix translation of top-level property accesses like array.indices
This commit addresses the following issues:

* accessors didn't take into account their property's receiver type,
which caused NoSuchMethod due to signature mismatch. Now the property's
receiver type is passed to Fir2Ir translation of accessors.

* property's parent was not class, e.g., kotlin.collections.indices.
Now the symbol table collects WrappedPropertyDescriptorWithContainerSource
besides WrappedFunctionDescriptorWithContainerSource, so that
facade classes for such properties can be generated before codegen.

* accessor's parent was not class. Now the containerSource of
the property descriptor is passed to accessor descriptor.
2020-02-25 12:13:42 +03:00
Juan Chen 9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +03:00
Mikhail Glukhikh 56c819f06e FIR2IR: add two-statements block with iterator + while for 'for' loops
Before this commit we had two statements blocks for 'for' loops:
range variable declaration + iterator variable declaration + while loop.
However, BE requires a bit different loop structure to make lowerings
properly so in this commit iterator declaration & while loop were
extracted to separate block.
2020-02-17 20:35:17 +03:00
Juan Chen 37abdb1732 [FIR2IR] Fix NoSuchMethod for Iterator::next (same issue with invoke) 2020-02-11 22:50:06 +03:00
Dmitry Petrov ee020ef290 KT-36336 @EnhancedNullability and null checks
Don't insert implicit null check on a value of @EnhancedNullability type
used where @EnhancedNullability type is expected.

This uncovers a bunch of other problems in FE and BE.
KT-36343 and KT-36347 are bugs in StrictJavaNullabilityAssertions
implementation which should most likely be fixed in next major language
version (with proper breaking change notice).
KT-36344 is a design problem which should be addressed after 1.4 issues
are resolved.
2020-02-05 11:15:41 +03:00
Mark Punzalan 3ee344b836 ForLoopsLowering: Fix issue with break/continue in loop over withIndex. 2020-01-31 10:37:03 +01:00
Alexander Udalov f48bdc1fcb Fix codegen box tests for language version 1.4
Since API version 1.4, NullPointerException is thrown for casts of null
to any type instead of TypeCastException.
2020-01-20 19:12:59 +01:00
Steven Schäfer 929fb5c82b Mute FIR tests containing broken function calls 2020-01-08 13:20:00 +01:00
Dmitry Petrov 0e4e5ac287 Update nullability assertion tests that use newer Java features 2019-12-31 11:14:52 +03:00
Juan Chen 3dc58bc995 [FIR2IR] Fix translating primitive array types
This commit fixes two issues in the existing implementation of translating primitive array types:

 * IrType.getArrayElementType throws an exception when the receiver is a primitive array type, because IR expects primitive array types use symbols defined in IrBuiltIns, but fir2ir translation doesn't;
 * IteratorNext.toCallable assumes all element types are boxed.

The first issue is fixed by changing the fir2ir type translation to use symbols in IrBuiltIns for primitive array types, and the second by not unboxing primitive types.
2019-12-27 15:32:18 +03:00
Dmitry Petrov 08454aa47e Minor: add reference to language design issue 2019-12-26 10:31:12 +03:00
Mark Punzalan 2dd8727baf [JVM IR] ForLoopsLowering: Keep IMPLICIT_NOTNULL type-casts in next()
and `componentN()` calls.

There were issues when we have iterables from Java where the element
type has "not null" type information.
2019-12-26 10:11:18 +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
Dmitriy Novozhilov b76c984b26 [FIR] Support IntegerLiteralTypes 2019-12-09 17:24:26 +03:00
Dmitry Petrov d3a5dcb601 KT-35004: keep track of KotlinType for 'when' subject 2019-11-21 10:48:14 +03:00
Mark Punzalan 7adffe0007 Handle withIndex() on Iterables (including progressions) and Sequences
in ForLoopsLowering.
2019-11-20 13:02:21 +01:00
Mikhail Glukhikh f633102b8c Unmute one of generated FIR black box codegen tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh f3d0a976b2 Disable recently added FIR black box tests 2019-11-19 11:00:10 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Mark Punzalan dc10d25661 Ensure ForLoopsLowering only handles the CharSequence.iterator()
extension function from the standard library (kotlin.text.iterator()).
2019-11-12 08:09:30 +01:00