Commit Graph

2248 Commits

Author SHA1 Message Date
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
Vladimir Dolzhenko ab20b3e083 Add InterruptedException handler to CancellableSimpleLock
#EA-220650 Fixed
2020-06-29 08:47:53 +00:00
Leonid Startsev 901d8f3e7a Rename several core entities as a part of kx.serialization abi change 2020-06-26 20:31:23 +03:00
Leonid Startsev 5208bbcd21 Support new ContextSerializer signature 2020-06-26 20:31:22 +03:00
Dmitry Petrov 2137a4b1e5 JVM, JVM_IR: no nullability annotations on private and synthetic methods
NB it looks like it doesn't cover all cases, e.g., some synthetic
methods generated for suspend functions.
2020-06-26 18:51:35 +03:00
Dmitry Petrov 9468670980 Minor: update testData with nullability annotations 2020-06-26 15:17:23 +03:00
Dmitry Petrov 3f266aafb4 JVM: no nullability annotations on private and synthetic fields 2020-06-25 22:31:12 +03:00
Natalia Selezneva bcd3921bae Fix freeze during loading script configurations through legacy scripting API
Do not wrap the whole configuration loading process into readAction
^KT-39771 Fixed
2020-06-23 16:04:24 +03:00
Dmitry Petrov e9231b5624 JVM: Generate object and companion object INSTANCE fields as @NotNull 2020-06-22 16:28:00 +03:00
Mikhail Bogdanov 58183b774d Fix test data 2020-06-19 15:07:36 +02:00
Ilya Chernikov d5ffc7416d Clean-up and improve sam-with-receiver test with scripts 2020-06-19 14:08:19 +02:00
Ilya Chernikov cd1bf563cd Add error reporting on the options parsing errors in scripting
also report standard parsing warnings
also fix language version test, since it is not possible anymore
  to use version 1.0
2020-06-19 13:20:58 +02:00
Mathias Quintero f0bc52222d Fix annotation construction with array literals
Turns out the issue happens to be that ArrayValue uses a list of values which needs to be translated to an array of the percise type before it is used by callBy

This also addresses handling of arguments after a vararg in an annotation
2020-06-19 13:20:57 +02:00
Efeturi Money 8cb4f59114 Explicitly handle array annotation args in scripting pre-processing
#KT-35411 fixed
2020-06-19 13:20:57 +02:00
Ilya Muradyan 743abea690 Don't create default importing scopes for REPL snippets
Default scopes should be created only once, for the first snippet.
All following snippets should not create new default importing scopes.
#KT-35651 fixed
2020-06-19 13:03:25 +02:00
Ilya Muradyan 53b31a20ca Refactor REPL IDE services testing configuration and add new tests 2020-06-19 13:03:24 +02:00
Ilya Muradyan 94de114894 Support selective filtering of implicits for extensions resolution in REPL 2020-06-19 13:03:23 +02:00
Mikhail Bogdanov 929bb0e8d1 Move common logic from CodegenTestCase to KotlinBaseTest 2020-06-19 11:57:36 +02:00
Yan Zhulanow 559561ca6b Add missing intellij-core dependency for sam-with-receiver tests 2020-06-18 19:01:44 +09:00
Ilya Muradyan 8c2baf0704 Add missing definitelyDoesNotContainName methods 2020-06-18 09:51:16 +02:00
Mikhail Glukhikh 175e94c0aa Revert kotlinx-serialization-compiler-plugin OptIn dependency 2020-06-16 19:17:18 +03:00
Mikhail Glukhikh ab5cb13dae Rename: DescriptorBasedIr -> ObsoleteDescriptorBasedAPI 2020-06-16 19:17:14 +03:00
Mikhail Glukhikh cbbb497edf Make descriptor-based API in ir:tree more granular 2020-06-16 19:17:12 +03:00
Mikhail Glukhikh 1c2fbb61fe [IR] Introduce & use declaration-based SymbolTable.withReferenceScope 2020-06-16 19:17:04 +03:00
Ilya Chernikov 74c697af92 Fix SamWithReceiver tests for scripts, add tests...
that use new script definition and ability to load
annotations from script definition
2020-06-16 17:11:33 +02:00
Ilya Chernikov 8fb41e4562 Process compiler plugins and options in scripting compiler
#KT-37766 fixed
2020-06-16 17:11:33 +02:00
Vyacheslav Gerasimov b4df4e5525 Build: Fix variant resolution ambiguity 2020-06-14 20:31:27 +03:00