Commit Graph

21 Commits

Author SHA1 Message Date
pyos e6d923f65c FIR: rename HIDDEN to INVISIBLE_REFERENCE
Some of them should be INVISIBLE_MEMBER though
2021-04-21 16:18:21 +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
Dmitriy Novozhilov af5a635f85 [Test] Ignore error diagnostics from FIR in some BB tests 2021-01-12 18:35:39 +03:00
Jinseong Jeon 49307e243c FIR deserializer: load annotations on default accessors 2020-10-07 09:46:40 +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
Juan Chen 7249d2f889 [FIR] Fix translation of invokes & add return expressions for lambdas
* fixed NoSuchMethod caused by mismatched signatures of the "invoke" method generated for lambda arguments
* added test cases in invoke.kt for KFunction and anonymous functions
* added a transformer to wrap the last expression in the bodies of lambdas with return
2020-02-06 12:44:14 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Alexander Udalov 9772de0088 JVM IR: generate kotlin.Metadata.packageName value for JvmPackageName files
Support this for single file facades as well as for multi-file classes,
similar to code in
MultifileClassCodegen.writeKotlinMultifileFacadeAnnotationIfNeeded.
Extend the test on this attribute to also cover multi-file classes.
2019-11-12 19:13:03 +01:00
Alexander Udalov a7b984bcbf JVM IR: fix generation of generic multi-file delegates 2019-09-19 22:23:16 +02:00
Alexander Udalov aea9642ea0 JVM IR: implement MethodSignatureMapper.mapToCallableMethod directly
Instead of calling enormously complicated
KotlinTypeMapper.mapToCallableMethod, where most of special cases are
handled in the IR backend via lowerings.
2019-08-27 19:27:46 +02:00
Alexander Udalov 59fda8d7ce Support JvmPackageName with JvmMultifileClass
This is an internal feature of our standard library needed to compile
new API for unsigned types
2019-03-06 15:34:23 +01:00
Alexander Udalov 5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Alexander Udalov f63cf9d506 Use JvmName on kotlin.Metadata parameters to improve public API
#KT-26359 Fixed
2018-09-12 14:37:11 +03:00
Dmitry Savvinov 23c945b002 Remove specific language version in testMetadataField
- Why we bother? Because this test tries to read @Metadata via
reflection, and in 1.3 @Metadata has @Since("1.3") annotation. Thus,
with version fixed to 1.2, this test fails with UNRESOLVED_REFERENCE

- Why it is correct? Because initially this directive was used to enable
'LanguageFeature.JvmPackageName' (we didn't have infrastructure for
enabling particulare feature at that moment). So, now we could change it
to the '!LANGUAGE:+JvmPackageName', but it is actually redundant,
because master is already >= 1.2
2018-08-30 16:24:34 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Alexander Udalov 5f775497e2 Add Kotlin package FQ name to kotlin.Metadata
It might differ from the JVM package FQ name if the JvmPackageName
annotation is used. This will be useful for faster indexing in the IDE
and for reflection
2017-10-13 16:23:07 +02:00
Alexander Udalov 7f8634d9ef Revert "Temporarily remove JvmPackageName and tests, but keep the implementation"
This reverts commit 9ae6feb2c5.
2017-10-11 19:20:24 +03:00
Alexander Udalov 9ae6feb2c5 Temporarily remove JvmPackageName and tests, but keep the implementation
This is needed because we want the compiler code to stay as much the
same in master and in 1.2 as possible
2017-09-13 23:23:36 +03:00
Alexander Udalov 70ae1596fb Support JvmPackageName annotation in binary format
The main changes are in jvm_package_table.proto and ModuleMapping.kt.
With JvmPackageName, package parts can now have a JVM package name that
differs from their Kotlin name. So, in addition to the old package parts
which were stored as short names + short name of multifile facade (we
can't change this because of compatibility with old compilers), we now
store separately those package parts, which have a different JVM package
name. The format is optimized to avoid storing any package name more
than once as a string.

Another notable change is in KotlinCliJavaFileManagerImpl, where we now
load .kotlin_module files when determining whether or not a package
exists. Before this change, no PsiPackage (and thus, no JavaPackage and
eventually, no LazyJavaPackageFragment) was created unless there was at
least one file in the corresponding directory. Now we also create
packages if they are "mapped" to other JVM packages, i.e. if all package
parts in them have been annotated with JvmPackageName.

Most of the other changes are refactorings to allow internal names of
package parts/multifile classes where previously there were only short
names.
2017-09-13 22:59:03 +03:00
Alexander Udalov d07b628e0c Support JvmPackageName annotation in JVM back-end
This annotation is currently internal because we only commit to its
support for our own libraries. It will be used to change JVM package
names of declarations in JDK-specific stdlib additions (now called
kotlin-stdlib-jre7/8), both to preserve source compatibility of the old
Kotlin code and to solve the split package problem (KT-19258)
2017-09-13 22:59:03 +03:00