Commit Graph

2274 Commits

Author SHA1 Message Date
Alexander Udalov 9607414cf1 IR: make allOverridden return Set instead of Sequence, move to IrUtils
This doesn't hurt performance, but improves stack traces, in particular
in JVM's BridgeLowering.
2020-08-14 21:55:37 +02:00
Georgy Bronnikov 18ae665d41 IR: make IrCall take IrSimpleFunctionSymbol 2020-08-12 16:31:31 +03:00
Alexander Udalov bcf1ee3907 Minor, fix test data for kotlinx.serialization bytecode text test 2020-08-11 15:14:06 +02:00
Pavel Kirpichenkov f431da2a66 Reapply "Introduce @FrontendInternals annotation""
This reverts commit 9ca4717d11.
^KT-39643 Fixed
2020-08-10 12:22:55 +03:00
Georgy Bronnikov 04d93dfbce IR: move containerSource from descriptor to IrFunction, IrProperty 2020-08-10 10:16:23 +03:00
Pavel Kirpichenkov 9ca4717d11 Revert "Introduce @FrontendInternals annotation"
Revert due to Mobile IDE Trunk IJ TC configuration
This reverts commits:
ffc3d8bdfc
c0e713980b

^KT-39643 In Progress
2020-08-07 12:10:03 +03:00
Mads Ager 7f2efabe6a [JVM_IR]: Improve stepping for when.
Additionally, use the line number of the class for default interface
dispatch methods.
2020-08-07 09:16:01 +02:00
Alexander Udalov e4cd7cdbcf IR: remove unused code, cleanup 2020-08-06 17:08:04 +02:00
Pavel Kirpichenkov ffc3d8bdfc Introduce @FrontendInternals annotation
#KT-39643
2020-08-05 21:44:47 +03:00
Dmitriy Novozhilov 644e9843f9 [FIR] Add initialization of calleeReference for FirAnnotationCall 2020-08-04 08:59:14 +03:00
Nick 7145caca40 [FIR] Refactor effective visibility calculation
Before this commit, we had effective visibility as a part of FIR status,
so it was integrated into the full pipeline. In this commit,
we introduced "effective visibility as a service" which is now used
only by exposed visibility checker. This allows us to make the thing
universal for all FIR nodes, including nodes for Java / deserialized.
2020-07-31 19:27:58 +03:00
Nicolay Mitropolsky c254651ed3 Uast: handling annotations on the property receiver (KT-40539) 2020-07-29 19:42:22 +03:00
Leonid Startsev 96d0b1c47a Update serialization runtime and fix test data
Revert "Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests"
2020-07-29 14:20:33 +03:00
Alexander Udalov 4892737cc9 Use IrFactory in kotlin-serialization-compiler 2020-07-28 19:04:44 +02:00
Alexander Udalov cce55f1609 IR: add module ir.tree.impl, move main IR implementation there 2020-07-28 19:04:44 +02:00
Alexander Udalov d1dc938a5d IR: use IrFactory in IR builders 2020-07-28 12:05:24 +02:00
Alexander Udalov db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Kevin Bierhoff fa8c6e7fb6 Uast: KT-40578: resolve Kotlin property writes to setters (#3597)
* KT-40578: resolve Kotlin property writes to setters

* limit to non-constructor properties

* Uast: `KotlinIDERenderLogTest.testConstructors` fix

Co-authored-by: Nicolay Mitropolsky <nicolay.mitropolsky@jetbrains.com>
2020-07-28 10:03:22 +03:00
Dmitry Petrov 89a0b3e944 Check class source in bytecode listing tests 2020-07-27 19:13:37 +03:00
Dmitry Petrov 0741781462 Compare inner class access flags in bytecode listing tests 2020-07-23 19:13:28 +03:00
Nicolay Mitropolsky f7031e65ba Uast: don't throw exception if can't get a receiver parameter for annotation (KT-40494) 2020-07-23 10:33:44 +03:00
Alexander Udalov d3a34a8898 Psi2Ir: somewhat simplify Psi2IrTranslator API
Inline some methods only used once, deduplicate usages, rearrange
parameters, etc.
2020-07-22 22:38:21 +02:00
Leonid Startsev e3f42721e9 Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests 2020-07-21 15:10:08 +03:00
Leonid Startsev df5f38fec8 Implement reading kx.serialization runtime metadata from jar manifest
That allows to check whether current compiler plugin can work with
a given runtime version. Implementation-Version can help to detect whether
runtime version is too low, and Require-Kotlin-Version detects whether
runtime version is too high.

Corresponding diagnostic for Require-Kotlin included.
Implement minimal runtime version check for kotlinx.serialization
plugin.

 #KT-40036 Fixed

Cache result from getVersionsForCurrentModule in BindingTrace.
Hide check in the IDE, because caching in trace does not work there.
2020-07-21 15:10:08 +03:00
Leonid Startsev 7db0bf8195 Add new serialization runtime packages
encoding and descriptors. Rename ContextSerializer to Contextual.
Unify getClassFrom*Package functions.
2020-07-21 15:02:06 +03:00
Dmitry Petrov 2e31f95554 Update testData 2020-07-20 20:04:32 +03:00
Georgy Bronnikov c901e82a55 IR: add IrSimpleFunction.isInfix 2020-07-18 11:03:33 +03:00
Ivan Gavrilovic 77ba9a1bbb KT-34604: Fix race condition in KAPT
KAPT was relying on clearing JarFileFactory to make sure
annotation processing does not hold onto annotation processing
classpath once done. Once KAPT switched to using Gradle workers, multiple
KAPT runs were sharing the same class loader ie. the same version
of JarFileFactory. Clearing the cache resulted in race condition,
as some runs were unable to load processors from jars.

This commit fixes this problem by avoiding the use of ServiceLoader
which was causing the issue. Jars would be added to the cache, but
they would never be removed. That's why JarFileFactory had to be
clearned manually. By loading the processor names manually (simply
exploring the classpath), no file handles leak.

Fixes https://youtrack.jetbrains.com/issue/KT-34604
Test: verified against the test project from the bug
2020-07-18 05:06:15 +09:00
Ivan Gavrilovic 111a2ece72 KAPT: Fix error reporting
When incremental analysis is unable to run, handle
failure gracefully. More info will be provided by
compiler diagnostics.

Fixes KT-36302
2020-07-18 05:06:15 +09:00
Nikolay Krasko cb513b9a70 202: Fix KotlinUastReferencesTest 2020-07-10 19:09:27 +03:00
Sergey Rostov 1f52c0e0d4 gradle.kts: improve service initializtion
- prevent analyzing .gradle.kts files until all services are loaded
- remove services caches where it is not required
- replace cached services with cache only during vfs events batch processing
- prevent services loading in actions updating
2020-07-10 17:47:10 +03:00
Alexander Udalov e674226a3b IR: do not use Ir*Impl elements where it's not necessary 2020-07-10 16:17:06 +02:00
Alexander Udalov dbad81473e IR: make IrMetadataSourceOwner.metadata mutable
To avoid casting to specific Ir*Impl elements at call sites.

Also inherit from IrMetadataSourceOwner only where it's needed: class,
file, function, property. Previously this field was always null and took
some space for things like value parameters, type parameters, etc.
2020-07-10 16:17:05 +02:00
Alexander Udalov ef94716af5 IR: remove deprecated constructor of IrFieldImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov 7f9ef5e11d IR: remove deprecated constructors of IrFunctionImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov fd83596c91 IR: remove deprecated constructor of IrTypeParameterImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov 0691595ed2 IR: remove deprecated constructor of IrValueParameterImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov d8a2b92098 IR: remove deprecated constructors of IrPropertyImpl 2020-07-09 18:51:02 +02:00
Dmitry Gridin 1c4d7c5772 Regenerate test data 2020-07-09 18:37:37 +07:00
Ilya Muradyan 2487f9369c Fix REPL completion for import directives 2020-07-09 13:19:04 +03:00
Leonid Startsev 340deb01dd Add 'Incorrect Transient' diagnostic
when users write @Transient, they get @kotlin.jvm.Transient, because it's always in auto-import.
This annotation does not work with @Serializable classes; @kotlinx.serialization.Transient should be used instead.

Add quickfix for 'incorrect transient' diagnostic:
'Import kotlinx.serialization.Transient'
2020-07-08 20:17:11 +03:00
Leonid Startsev 6ef597a4ee Split ContextualSerialization annotation in two 2020-07-08 20:15:56 +03:00
Leonid Startsev 80561ec125 Update kx.serialization dependency
so tests won't fail due to
'library was compiled with pre-release flag' error.

Update test data
2020-07-07 01:14:32 +03:00
Ilya Muradyan 1798542db7 Fix and enable embedded tests in scripting-ide-services 2020-07-03 12:21:45 +03:00
Ilya Muradyan e88bef4275 Fix jar-dependent test in scripting-ide-services 2020-07-03 12:21:45 +03:00
Alexander Udalov d4605f5816 IR: add type parameter to IrMemberAccessExpression and some subclasses
This is needed to get rid of the diamond hierarchy:

                 IrMemberAccessExpression
                 /                       \
                /                         \
IrFunctionAccessExpression     IrCallableReference
                \                      /
                 \                    /
                   IrFunctionReference

In the subsequent commit, IrFunctionReference no longer inherits from
IrFunctionAccessExpression; the more precise type of `val symbol:
IrFunctionSymbol` is now carried via the generic type argument.

This will help to refactor IR element hierarchy from interfaces to
classes, improving performance of visitors and transformers.
2020-07-01 13:03:56 +02:00
Nikolay Krasko 21fa2bf98c Switch to 201 platform 2020-06-30 19:53:18 +03:00
Mikhail Glukhikh d846a22e33 [FIR] Introduce & use FirTypeRef.coneType 2020-06-30 18:49:06 +03:00
Alexander Udalov b94a4d9fc3 Render more information on inner classes in bytecode listing tests 2020-06-29 17:33:39 +02:00
Leonid Startsev 6ea0c37e52 Update test data with new package name after 901d8f3e7a 2020-06-29 15:09:30 +03:00