Commit Graph

110 Commits

Author SHA1 Message Date
Dmitriy Novozhilov af5a635f85 [Test] Ignore error diagnostics from FIR in some BB tests 2021-01-12 18:35:39 +03:00
Mikhail Glukhikh 776c4ba6ca Add test for KT-25489 (to reproduce, turn UL classes OFF) 2020-12-25 14:06:16 +03:00
Jinseong Jeon dea01125d6 FIR deserializer: keep SourceElement for more precise Fir2IrLazyClass's source 2020-12-18 12:17:23 +03:00
pyos 5efe774dba FIR: remap Java meta-annotations to Kotlin equivalents
This is a direct port of JavaAnnotationMapper from the old frontend.
2020-12-10 20:52:43 +03:00
pyos 50ae360ff9 FIR2IR: fix the way annotations are moved to fields
1. When an annotation has multiple targets, the priority goes like this:
    constructor parameter (if applicable) -> property -> backing field.

 2. The argument to `kotlin.annotation.Target` is a vararg, so that
    should be handled as well.

 3. `AnnotationTarget.VALUE_PARAMETER` allows receivers, constructor
    parameters, and setter parameters, while `AnnotationTarget.FIELD` allows
    both backing fields and delegates.

Known issue: java.lang.annotation.Target is not remapped to the Kotlin
equivalent, so things are still broken for pure Java annotations.
2020-11-30 20:29:18 +03:00
Svyatoslav Kuzmich f9503efb74 [JS IR] Make WITH_RUNTIME imply KJS_WITH_FULL_RUNTIME
There is a lot of intersection between these
2020-11-25 21:22:39 +03:00
Victor Petukhov 04846ca47a Rework checking constraints by presented OnlyInputTypes annotation in accordance with changed incorporation mechanism 2020-11-25 11:15:23 +03:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Denis Zharkov 7b48625b58 FIR: Remove FirCallableSymbol::overriddenSymbol 2020-11-06 14:44:27 +03:00
Alexander Udalov e399b4cd12 JVM IR: minor, sort ElementType fields as in the old backend
In the old backend, targets are generated in the order of their
declaration in the ElementType enum, see AnnotationCodegen.java:306
(EnumSet guarantees such iteration ordering).

This has no effect other than reducing non-essential differences when
comparing ABI of JVM vs JVM_IR.
2020-10-12 21:38:09 +02:00
Jinseong Jeon 01d852c006 FIR: carry annotations on delegated property accessors 2020-09-29 11:35:19 +03:00
Jinseong Jeon f3db113a82 FIR2IR: use @Target to put annotations on either property or backing field 2020-09-25 14:45:49 +03:00
Dmitry Petrov cd37301ea2 Minor: TARGET_BACKEND=JVM in JVM-specific tests 2020-09-23 18:14:21 +03:00
Dmitriy Novozhilov 40a9bb6eac [FIR] Assume nullable types as good types for ILT approximation
#KT-41982 Fixed
2020-09-23 14:05:10 +03:00
Mikhael Bogdanov 7d4a734791 Fix nullability of typePath parameter
#KT-41484 Fixed
2020-09-22 15:37:02 +02:00
Mikhail Glukhikh 8379b3794a [FIR2IR] Return fallback mode for annotation resolved placeholder 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov 721b9b4d8c [FIR] Resolve annotations as calls 2020-08-04 08:59:14 +03:00
Jinseong Jeon bff36e0199 FIR2IR: convert annotations on FirTypeRef 2020-07-30 11:25:36 +03:00
Dmitry Petrov 4fdccb3b35 JVM_IR: don't generate repeated ElementType values in @Target 2020-07-28 18:19:20 +03:00
Jinseong Jeon 628b8b56b7 FIR2IR: convert annotations on type aliases 2020-07-20 09:40:52 +03:00
Jinseong Jeon 13ef97e51e FIR2IR: set proper visibility of backing fields with @JvmField 2020-07-17 12:42:11 +03:00
Jinseong Jeon f3475fd098 FIR2IR: store and convert annotations on enum entry 2020-07-17 09:48:45 +03:00
Jinseong Jeon 50f1f8f0eb FIR: consider more functional types during SAM resolution 2020-07-16 12:56:18 +03:00
Jinseong Jeon 5c4f978073 FIR: transform arrayOf call with empty arguments 2020-07-15 13:36:30 +03:00
Jinseong Jeon 5600eefea5 FIR: add support for varargs in annotation calls 2020-07-15 13:36:30 +03:00
Ivan Kylchik 27c52f54ca Remove IGNORE_FIR from tests that are passing after constant folding 2020-06-24 16:12:59 +03:00
Mikhail Glukhikh 0622be14a5 [FIR2IR] Introduce creation of Fir2Ir lazy classes 2020-06-23 19:06:07 +03:00
Jinseong Jeon ab2a2b3a87 FIR2IR: eager conversion of annotations in Library class and members 2020-06-11 10:57:51 +03:00
Jinseong Jeon 4a511c7721 FIR: extend arrayOf call transformation to other variants 2020-06-01 10:45:42 +03:00
Jinseong Jeon 18953c4717 FIR: transform resolved arrayOf call inside annotation to FirArrayOfCall 2020-05-27 11:38:34 +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
Mikhail Zarechenskiy 8bdc4d34f7 [NI] Commonize type-conversions (SAM/Suspend)
- Allow participating subtypes of functional types in conversions
 - Fix several subtle inconsistencies
 - Place logic about conversions at one place

 Now conversions operations have two stages: before usual subtyping
 check and after one. This is needed to support conversions of
 subtypes (of functional types, for example). First, the compiler
 checks if it possible to resolve an argument without conversion and
 only then it tries to perform conversion.
 Note that it'd be incorrect to perform conversion eagerly as it can
 change resolve (Runnable & () -> Unit <: KRunnable), plus we can't
 guess whether conversion is needed at all as it's important not to
 look into supertypes if resolution doesn't actually needed it

 #KT-36448 Fixed
 #KT-37574 Fixed
 #KT-38604 Fixed
2020-05-20 15:30:14 +03:00
Jinseong Jeon 615636ed55 FIR2IR: apply SAM conversion to arguments of functional type. 2020-05-15 15:08:43 +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
Jinseong Jeon 931ba4892a FIR2IR: split property annotations according to use-site targets. 2020-05-14 09:41:11 +03:00
Mikhail Glukhikh b271b6d7a8 [FIR2IR] Add conversion of value parameter annotations 2020-05-08 17:30:28 +03:00
Mikhail Glukhikh f3e2dbf360 [FIR2IR] Add conversion of function annotations 2020-05-08 17:30:19 +03:00
Mikhail Bogdanov dda2f53993 Support JVM 8 target on Android 2020-04-15 15:25:02 +02:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Jinseong Jeon ff104f4037 [FIR2IR] Set proper visibility of backing fields 2020-03-31 13:12:36 +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 8231377f6b FIR2IR: convert qualifiers inside getClass properly 2020-03-11 16:01:57 +03:00
Dmitriy Novozhilov 296ee2da4a [FIR] Support @LowPriorityInOverloadResolution annotation 2020-03-02 09:49:28 +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 Zarechenskiy abc5eb4740 [NI-MIGRATE-BAD] Update problematic/questionable tests
These tests are going to be reviewed in more detail before 1.4
2020-02-13 11:15:59 +03:00
Alexander Udalov d5987fd7f3 Minor, move wrongAnnotationArgumentInCtor.kt to CLI tests
The fact that this was a codegen box test was probably an abuse of the
testing infrastructure. It was never meant to pass, since it checks
presence of an error, and diagnostic tests aren't enough since they
might not check the full compiler execution.
2020-02-12 17:36:08 +01:00
Alexander Udalov 19b516cbf4 JVM IR: do not erase static fields in annotation classes 2020-02-04 11:43:24 +01:00
Alexander Udalov 00de5dae32 JVM IR: copy property instead of field in MoveOrCopyCompanionObjectFieldsLowering
This way we're making sure that the copied field has some associated
property, where we can get the value of isConst flag from. That flag is
later used in StaticInitializersLowering to determine whether we need to
erase initializer of a field. The tests are unmuted because now the
initializer is correctly _not_ erased. (They were passing before
switching master to 1.4 because without
NoConstantValueAttributeForNonConstVals, we treated all static fields
with primitive/string values as const, and never erased initializers
because of that.)
2020-02-04 11:43:24 +01:00
Alexander Udalov 9f25fdcedc Minor, skip mustBeDocumented.kt for JDK 6 codegen tests
Class.getDeclaredAnnotation is not available before JDK 8
2020-01-31 09:36:17 +01:00