Commit Graph

2822 Commits

Author SHA1 Message Date
Steven Schäfer dc568426bd Parcelize: Allow IgnoredOnParcel annotations on object properties 2021-09-18 00:26:16 +02:00
Steven Schäfer ae27be16eb AsmLikeInstructionListingTest: Print owner for FieldInsnNode 2021-09-18 00:25:58 +02:00
Alexander Udalov 5d6ca27c93 JVM IR: introduce CodegenFactory.convertToIr
The steps of psi2ir and JVM backend need to be separated in the API
because in case of cyclic module dependencies (which are allowed in JPS)
psi2ir should be run first on all sources, and then JVM backend on each
module separately. `CodegenFactory.convertToIr` does nothing in the old
backend.

Also, move the ignoreErrors to GenerationState for simplicity.
2021-09-17 17:39:48 +02:00
Dmitriy Novozhilov 5c2a3bb78e [FIR] Move duplicating names and classIds to StandardClassIds 2021-09-15 17:11:29 +03:00
Alexander Udalov 5df316a129 Minor, rename module backend.jvm:backend.jvm.entrypoint -> backend.jvm.entrypoint 2021-09-14 22:29:13 +02:00
Alexander Udalov eee8b033a6 JVM IR: minimize usages of jvmPhases outside backend.jvm 2021-09-14 22:29:12 +02:00
Yigit Boyar 95f990adab Support line location information in KAPT for top level declarations
This CL fixes a bug in KAPT's MAP_DIAGNOSTIC_LOCATIONS flag where the
location mapping for top level elements didn't work.

I also needed to changes the Kapt3IntegrationTest to copy input files,
otherwise, it cannot map file paths since the mock project has no root
location.

Cleanup tmp folders in KAPT tests, update Kapt3IT test for new lines.

^KT-47934 Fixed
Test: KotlinKapt3IntegrationTests#testErrorLocationMapping
2021-09-14 10:48:37 +02:00
Dmitriy Novozhilov 5769d42248 [FIR] Fix all usages of annotations due to new FirAnnotation hierarchy 2021-09-13 13:53:12 +03:00
Dmitriy Novozhilov 2e7564a21e [FIR] Properly create FirAnnotation and FirAnnotationCall in all places 2021-09-13 13:53:12 +03:00
Dmitriy Novozhilov 4b662a42a1 [FIR] Rename FirAnnotationCall to FirAnnotation 2021-09-13 13:53:09 +03:00
Mikhail Glukhikh 3febabe977 Use OPT_IN instead of EXPERIMENTAL in diagnostic names 2021-09-10 16:29:13 +03:00
Ivan Kochurkin 2baed77598 [FIR] Add JVM_SYNTHETIC_ON_DELEGATE diagnostic
Extract JVM names to common JvmNames
2021-09-10 00:49:03 +03:00
Nikolay Lunyak c2e5583780 [FIR] Add support for JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION diagnostic 2021-09-09 20:18:49 +03:00
Dmitriy Novozhilov 0260bf8767 [FE] Move diagnostic parameter renderers to common module 2021-09-09 17:20:20 +03:00
Nikolay Krasko 47a660e479 Fix publication for jvm-abi-gen
Effectively solved by rearranging order of lines - runtimeJar() should
be used after publish(). Otherwise, jar task is not registered as
dependency for publication, and publication misses the main jar.

 #KTI-637 Fixed
2021-09-08 22:28:53 +03:00
Svyatoslav Scherbina 9e50f40586 Use SYNTHETIC_OFFSET for constructors generated by noarg IR plugin
This should fix debug information on Native.
2021-09-06 07:32:01 +00:00
Dmitry Petrov bcafece28e Minor: update testData 2021-09-03 15:54:19 +03:00
Mikhail Glukhikh ed035d99ab Migrate -Xopt-in to -opt-in in Gradle Kotlin scripts 2021-09-03 15:40:47 +03:00
Sergey.Shanshin 36484abb50 Fix call of serializer for parametrized sealed and abstract classes
Fixes Kotlin/kotlinx.serialization#1646
2021-09-03 06:03:39 +00:00
Dmitriy Novozhilov d46e2dd749 Fix OVERRIDE_DEPRECATION warnings in project code 2021-09-02 15:04:07 +03:00
Leonid Startsev 3102e9f614 Support properties from other modules in 'declaresDefaultValue'
Add box test using new test infra
Move serialization tests to misc compiler tests

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1602
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1481
2021-08-31 20:36:25 +00:00
Steven Schäfer b2e6e075ab Parcelize: Fix diagnostics for parcelable value classes 2021-08-31 02:48:03 +02:00
Steven Schäfer 9fd777cb7d Parcelize: Add support for unsigned types on the IR backend 2021-08-27 21:28:31 +02:00
Steven Schäfer 34a200bf09 Parcelize: Refactor AndroidSymbols 2021-08-27 21:28:31 +02:00
Steven Schäfer 2f7bc8ca79 Parcelize: Add tests for parcelable value classes 2021-08-27 21:26:46 +02:00
Steven Schäfer a743669bc9 Parcelize: Fix type signatures in parcelable creator objects
These objects are visible from annotation processors and should not
refer to the type parameters of enclosing parcelable classes.
2021-08-27 21:26:46 +02:00
Steven Schäfer 0bbb36e765 Parcelize: Add tests for obsolete issues 2021-08-27 21:26:46 +02:00
Ilya Chernikov 4243bafd1d Scripting: implement correct disposal of REPL state on finalization
#KT-47927 fixed
2021-08-24 21:39:38 +03:00
Ilya Chernikov a45e31720c Make state of the default REPL compiler explicit and replaceable
restores proper object hierarchy in case the legacy REPL infrastructure
2021-08-24 21:39:37 +03:00
Ilya Chernikov e60e80f19a Scripting: improve reporting on cyclic dependency
#KT-48177 fixed
the issue is in fact fixed by the previous commit (report error
on duplicated import) by normalizing import path before processing,
but here we're making error reporting nicer for the case.
2021-08-24 21:39:33 +03:00
Steven Schäfer fc6c2c9631 jvm-abi-gen: Reformat files and add comments 2021-08-23 18:25:33 +02:00
Steven Schäfer 023db4f376 jvm-abi-gen: Use the configured MessageCollector to write ABI jars 2021-08-23 18:25:33 +02:00
Steven Schäfer 6d518c8e57 JVM IR: Mark annotation implementation classes as anonymous
And add tests to ensure that annotation implementation classes are
handled correctly in jvm-abi-gen.
2021-08-23 18:25:33 +02:00
Steven Schäfer 19660f11a7 jvm-abi-gen: Remove WhenMapping classes from ABI if possible 2021-08-23 18:25:33 +02:00
Steven Schäfer ec4d7b2bb6 jvm-abi-gen: Add tests for uses of private Kotlin classes from Java 2021-08-23 18:25:33 +02:00
Steven Schäfer 6756420725 jvm-abi-gen: Add tests for KT-40133 and KT-40340 2021-08-23 18:25:33 +02:00
Steven Schäfer 5059513106 jvm-abi-gen: Strip inline functions in private classes
Inline functions in private classes can only be accessed from Java and
we do not need to preserve their bodies for the abi.
2021-08-23 18:25:33 +02:00
Steven Schäfer 3ffe495346 jvm-abi-gen: Mark all anonymous objects in inline function scope as public
Anonymous objects inside of a private inline function nested in a public
inline function can still escape.
2021-08-23 18:25:33 +02:00
Steven Schäfer d94817cfb6 jvm-abi-gen: Don't strip nested classes from the Kotlin Metadata 2021-08-23 18:25:33 +02:00
Steven Schäfer 4a59af3b8b jvm-abi-gen: Update metadata version if needed 2021-08-23 18:25:33 +02:00
Steven Schäfer c156613141 jvm-abi-gen: always keep annotation classes 2021-08-23 18:25:33 +02:00
Steven Schäfer 8efb955ab5 JVM: Add more tests to jvm-abi-gen 2021-08-23 18:25:33 +02:00
Steven Schäfer d08990ebb4 JVM: New single-pass implementation for jvm-abi-gen 2021-08-23 18:25:33 +02:00
Steven Schäfer de9d2919a8 JVM Metadata: Add a bit to mark anonymous objects in inline functions
Anonymous objects in the scope of an inline functions are copied to
all call-sites. This makes them part of the public ABI of a Kotlin
library.

We introduce a flag to mark all classes in the scope of an inline
function. When compiling with assertions enabled, we check that
this flag is set whenever we inline an anonymous object from another
module.
2021-08-23 18:25:33 +02:00
Ilya Muradyan 41e2deb751 Revert "[minor] Add the test confirming the wrong behavior of KT-48355"
This reverts commit d9c0b9ad5a.
2021-08-23 11:11:52 +03:00
Ilya Muradyan d9c0b9ad5a [minor] Add the test confirming the wrong behavior of KT-48355 2021-08-22 03:28:36 +03:00
Alexander Udalov b1bce6a29e JVM IR: fix noarg plugin for sealed class with existing noarg ctor
#KT-48111 Fixed
2021-08-18 20:57:19 +02:00
Jinseong Jeon 5819959cce Consolidate arrayOf call names 2021-08-18 16:04:36 +03:00
pyos 49c412b022 JVM_IR: implement view caching in kotlin-android-extensions
#KT-47733 Fixed
2021-08-17 13:46:26 +03:00
Ilmir Usmanov 486c6b3c15 Remove obsolete experimental coroutines support
in compiler.
2021-08-13 22:31:30 +02:00