Commit Graph

71 Commits

Author SHA1 Message Date
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
Mikhael Bogdanov 10900e0d90 JVM_IR. Don't copy synthetic method for property annotations if @JvmStatic presented 2020-01-30 12:31:38 +01:00
Alexander Udalov 186a456e01 JVM IR: fix condition in Documented annotation generation 2020-01-30 00:06:03 +01:00
Mikhael Bogdanov 6c07dbf351 JVM_IR. Support type annotations 2020-01-29 16:59:55 +01:00
Alexander Udalov 26f435eb90 JVM IR: mute tests which fail after advancing language to 1.4 2020-01-17 12:07:30 +01:00
Mikhael Bogdanov 52ac8d788d Minor. Convert test 2020-01-09 14:00:13 +01:00
Mikhael Bogdanov 2ed0cb2a89 Support type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Alexander Udalov fde9b21a40 Fix syntheticMethodForProperty.kt for JDK 9+ and Android tests 2020-01-09 11:34:51 +01:00
Alexander Udalov cc0b231b3b Convert SyntheticMethodForAnnotatedPropertyGenTest to a box test 2019-12-30 16:30:50 +01:00
pyos 59f2aa7add JVM_IR: remove constructors of nested annotations 2019-12-23 13:59:42 +01:00
Georgy Bronnikov 119a3f1306 JVM_IR: do not generate accessors to lateinit private properties 2019-11-19 16:30:04 +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
Alexander Udalov cdb7703947 JVM IR: fix VerifyError on annotated annotation properties
The problem was that we tried to generate an `$annotations` method for a
property declared in an annotation class. That method is final and has a
body, which is not allowed in annotation classes. Now we're generating
this method in the separate `$DefaultImpls` class as for properties in
interfaces.

Note that the added test still doesn't find any annotations because the
proper support is needed in reflection (KT-22463). Currently it only
checks that no VerifyError happens.
2019-11-18 18:58:41 +01:00
pyos 1bc48c3df9 IR: copy annotations when making lateinit fields nullable 2019-11-18 18:35:15 +01:00
Kristoffer Andersen 52dc469657 JVM IR: Generate synthetic methods for type aliases with annotations 2019-09-24 12:21:42 +02:00
Alexander Udalov c69997491f JVM IR: generate file annotations on file facade classes 2019-09-18 14:05:28 +02:00
Mads Ager 6c7a904663 Psi2Ir: Mark accessors with no bodies as default accessors.
They are currently marked as defined even when they get a
default implementation. That makes it hard to figure out
if the accessor should be removed when introducing a backing
field in the JVM_IR backend.
2019-08-28 19:25:13 +02:00
Steven Schäfer efb938a7c8 (Un)mute tests 2019-07-31 11:18:44 +02:00
Mads Ager 0c586ef5c1 JVM_IR: Maintain annotations in SAM conversion.
Copy method and parameter annotations to the generated SAM
implementation method.
2019-06-05 08:21:59 +02:00
Ting-Yuan Huang 75646f97a4 MoveCompanionObjectFields: copy constants into interfaces
Fields having const attribute in companion objects are observable in
Java and should be copied to outer interfaces.
2019-05-20 08:43:00 +02:00
Mads Ager 34cf5a19df JVM_IR: Support @JvmSynthetic annotations. 2019-05-16 17:07:22 +03:00
Mads Ager e8fbd42f7c JVM_IR: Support access flag jvm annotations on fields and methods. 2019-05-13 08:34:52 +02:00
pyos b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
Steven Schäfer 29b7da7c49 Implement support for KClass fields in annotation classes. 2019-03-26 11:54:16 +01:00
Georgy Bronnikov 451cda79de Rewrite AnnotationCodegen for IR, removing descriptors 2019-03-23 19:04:36 +03:00
pyos 8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
Alexander Udalov c357967c2c JVM IR: generate Kotlin metadata
Introduce MetadataSource as a way to store the original descriptor for
any element (before any lowerings) and maintain it until the end of the
codegen where it's used in generating the metadata. Note that JVM
signatures written to the metadata are formed from the _resulting_
generated elements, not by mapping the original descriptors.

Some corner cases are not supported yet, namely properties declared in
companion objects, synthetic methods for property annotations,
JvmPackageName, etc.

 #KT-29119 Fixed
2019-02-19 16:37:47 +01:00
Mads Ager e9ec8e2cee JVM_IR: Do not generate annotations on $default methods. 2019-02-19 13:23:42 +01:00
Mikhael Bogdanov 19d2bac2f8 Temporary disable test in IR 2019-02-19 13:05:05 +01:00
Mikhael Bogdanov 3b57ceeafe Don't generate annotations on $default methods
#KT-29965 Fixed
2019-02-19 10:51:37 +01:00
Mikhael Bogdanov f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Mikhael Bogdanov f4e532e449 Specify JVM target backend for test with '@JvmXXX' annotations 2018-12-21 16:09:07 +01:00
Mikhael Bogdanov 3ef06c1e44 Specify JVM target backend for test with 'import java...' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov f36519d4f5 Specify JVM target backend for test with '.javaClass' usage 2018-12-21 16:09:05 +01:00
Mikhael Bogdanov 1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Mikhael Bogdanov a4206a543a Skip test on JDK 6 2018-10-22 16:32:55 +02:00
Mikhael Bogdanov ac8e1a0124 Move JVM8 box test to common 2018-10-22 16:32:52 +02:00
Georgy Bronnikov bbac1d802f JVM_IR. Support annotation classes with JvmField fields 2018-10-17 21:15:28 +03:00
Alexander Udalov ab3f8db743 Consider property accessor non-default if it has annotations
Otherwise we're not trying to load annotations on the parameter of the
property setter in MemberDeserializer.loadProperty.

Note that after this commit, we could now also assume that if
getter/setter is default, it has no annotations, and thus use
Annotations.EMPTY for default getter/setter in loadProperty. However,
this would cause reflection to work incorrectly on classes compiled by
an older Kotlin compiler, so we'll still try to load annotations on
default accessors for an indefinite time.

 #KT-25499 Fixed
2018-09-07 11:49:42 +03:00