Commit Graph

4681 Commits

Author SHA1 Message Date
Mikhail Bogdanov a150e7b6e5 Don't forget about extension parameter in methodSignatureMapping.kt 2020-06-19 11:57:36 +02:00
Denis Zharkov 429b2a9705 FIR: Optimize deserialized annotations loading 2020-06-19 10:21:09 +03:00
Ilya Muradyan 8c2baf0704 Add missing definitelyDoesNotContainName methods 2020-06-18 09:51:16 +02:00
Ilya Muradyan 573c60ed6b Add missing recordLookup implementations 2020-06-18 09:51:16 +02:00
Alexander Udalov 117aae8a6b Use experimental javaType in full reflect where it's not supported yet
#KT-22936 Fixed
 #KT-34344 Fixed
2020-06-17 18:33:08 +02:00
Alexander Udalov 9e37b62f62 Support KType.javaType in stdlib
#KT-32241 Fixed
2020-06-17 18:33:08 +02:00
Victor Petukhov c0f4ee7dc9 Revert "Add missing definitelyDoesNotContainName methods"
This reverts commit b74692e9
2020-06-17 13:16:16 +03:00
Dmitriy Novozhilov d7ee168dff [FIR] Create error candidate for completion instead of simple error reference 2020-06-15 15:32:25 +03:00
Ilya Gorbunov 535534cf66 Allow shadowing member addSuppressed with extension
#KT-38777
2020-06-15 14:41:48 +03:00
Ilya Chernikov d528d24f83 Optimize AllUnderImportScope 2020-06-11 16:16:15 +02:00
Ilya Chernikov 484d026d2f Optimize resolution scope queries from the synthetic scopes
now required descriptors are queried in advance and passed to the
methods, to avoid multiple same name queries in a row
2020-06-11 16:16:15 +02:00
Ilya Chernikov a0efd1e323 Optimize scopes handling inside ChainedMemberScope 2020-06-11 16:16:15 +02:00
Ilya Chernikov bf97323301 Optimize data handling inside scopes 2020-06-11 16:16:14 +02:00
Ilya Chernikov c720fa5793 Optimize LazyScopeAdapter internals 2020-06-11 16:16:14 +02:00
Ilya Muradyan b74692e96b Add missing definitelyDoesNotContainName methods
Some implementations of definitelyDoesNotContainName method were
missing that led to performance problems during symbols resolution
using TowerResolver.

Relates to KT-39139.
2020-06-11 16:16:13 +02:00
Alexander Udalov 6e67e1e78d Replace appendln with appendLine in project 2020-06-11 13:01:30 +02:00
Ilya Kirillov 418903e9ef FIR IDE: Make KtReference class descriptors frontend independent
* The new idea-frontend-independent module created
* Moved KtReference and it inheritors to that module & implement them in idea-analysis module by using descriptors frontend
2020-06-09 16:19:12 +03:00
Alexander Udalov fc1217ba07 Generate delegates to DefaultImpls in fun interface wrappers
#KT-37436 Fixed
2020-06-09 11:44:31 +02:00
Vladimir Dolzhenko 9319c4c96e DryRun mode for GenerateTests is added
Relates to #KTI-17
2020-06-08 19:05:10 +00:00
Mikhail Zarechenskiy 71cbe97688 Introduce Unit-conversions for simple arguments 2020-06-05 13:24:20 +03:00
Mark Punzalan 802beb49a6 Use TypeSubstitutor to get the substituted underlying type for inline
classes, instead of MemberScope.

The primary motivation was to fix issues around type-mapping for inline
classes in FIR, which uses wrapped descriptors that have empty
MemberScopes.
2020-06-04 17:03:55 +03:00
Dmitry Petrov 202bbdf8dd Forward compatibility hacks for Result.{success, failure}
Don't mangled functions annotated with @JvmName.
Annotate 'Result.success' and 'Result.failure' with @JvmName and
@Suppress("INAPPLICABLE_JVM_NAME").
NB this would require bootstrap.
2020-06-04 12:16:27 +03:00
Abduqodiri Qurbonzoda e3fb74b656 Promote KClass.cast/safeCast, KAnnotatedElement.hasAnnotation() to stable 2020-06-03 23:50:48 +03:00
Georgy Bronnikov 80afe42d17 JVM_IR: implement getJvmNameIfSpecial in MethodSignatureMapper 2020-06-03 22:42:02 +03:00
Pavel Kirpichenkov 7fff8f82e2 Changes after review
- Replace leaking ModuleResolverTracker with use of ModuleDescriptor.Capabilies
- Provide API for retrieving ResolverForProject from ResolutionFacade
- Update names
2020-06-03 20:58:07 +03:00
Pavel Kirpichenkov db1210fc67 Introduce components for library-to-source resolution in IDE
#KT-24309 In progress
2020-06-03 20:58:07 +03:00
Denis Zharkov 4d484dd971 FIR: Support java array in type argument
^KT-37321 Fixed
2020-06-03 10:43:37 +03:00
Toshiaki Kameyama 098469eb85 Implement members: implement functions in the same order as within Java interface
#KT-31760 Fixed
2020-06-01 21:42:04 +09:00
Mikhail Zarechenskiy 01de789c76 Add compatibility warning for SAM conversions on Kotlin functions 2020-06-01 10:19:32 +03:00
Mikhail Zarechenskiy 0ab9b3639b Approximate types for lambda literals before serialization 2020-05-31 17:38:18 +03:00
Alexander Gorshenev ee1ea15684 Adapted descriptor fake override construction from OverridingUtil.java to IR as IrOverridingUtil.kt 2020-05-31 06:00:32 +03:00
Vyacheslav Gerasimov d612c130e8 Build: Fix jpsStandalone dependency in core.descriptors.runtime 2020-05-29 17:29:27 +03:00
Dmitriy Novozhilov 865ddac07a [NI] Add feature for choosing candidate by lambda return type 2020-05-29 09:36:31 +03:00
Dmitry Petrov 94509bdb4e KT-39228 Fix inliner when latest 1.4 compiler used with 1.3 stdlib
Since 1.4.0-dev-8774, we mangle functions returning inline class values,
including functions with return type 'kotlin.Result'. This causes
incompatibility when 1.4 compiler is used with 1.3 (or just some
pre-1.4.0-dev-8774) standard library.

Also, write "message from the future" on functions returning inline
class values indicating that they can be used since compiler version 1.4
(otherwise 1.3 compiler using 1.4 stdlib would fail to find some
@InlineOnly functions such as 'Result.success' and 'Result.failure').
2020-05-29 00:53:00 +03:00
Alexander Udalov 1f1790d60e Do not rely on descriptors in KParameterImpl.equals/hashCode
For the same reason as in the previous commit: descriptors are cached
via weak references in moduleByClassLoader.kt and can be
garbage-collected at any point. So different instances of KParameterImpl
representing the same parameter may store different instances of
descriptors.
2020-05-28 14:17:37 +02:00
Alexander Udalov 55f384cb04 Do not rely on descriptors in KTypeParameterImpl.equals/hashCode
Descriptors are cached via weak references in moduleByClassLoader.kt and
can be garbage-collected at any point. So relying on identity of
descriptors in KTypeParameterImpl is dangerous because the same type
parameter can be represented by different descriptors. For example, the
test equalsOnFunctionParameters.kt was flaky before this change because
of this issue, and that could be reproduced by running it a few hundred
times in the same process.

Instead, use the type parameter's container (which is either KClass or
KCallable) and name, in equals/hashCode. KClass and KCallable already
have equals/hashCode independent of descriptors, so this works in case
the descriptor is invalidated.
2020-05-28 14:17:37 +02:00
Alexander Udalov d25f9dee62 Minor, remove temporary workarounds for JPS build 2020-05-28 14:17:36 +02:00
Alexander Udalov 4520e02bae Support fun interfaces in kotlinx-metadata
#KT-37421 Fixed
2020-05-27 23:29:12 +02:00
Yan Zhulanow ef698a5747 Fix "PSI/index mismatch" in case of @ParameterName on non-functional types (KT-34524) 2020-05-27 02:38:41 +09:00
Sergey Rostov cf4ad1908b Fix lastIndexOfOrNull 2020-05-26 19:22:05 +03:00
pyos 76c34a07b2 JVM: use 1 as a synthetic line number for @InlineOnly lambdas
The source path already marks it as synthetic.
2020-05-25 20:03:56 +02:00
Mikhail Zarechenskiy 2cee82a348 [NI] Resolve receiver of provideDelegate independently
#KT-38259 Fixed
2020-05-25 16:06:55 +03:00
Dmitry Petrov de4ebe4395 Prohibit @JvnName on functions mangled because of return type 2020-05-20 07:19:29 +03:00
Victor Petukhov eff5f3a242 NI: do type checking for anonymous functions not inside a call
^KT-38890 Fixed
^KT-38439 Fixed
2020-05-19 16:29:14 +03:00
Victor Petukhov 73dec25eb1 NI: intersect DFI types before capturing
^KT-37887 Fixed
2020-05-14 19:54:59 +03:00
Alexander Udalov 82551e91a4 Add KClass.isFun modifier to reflection
#KT-38881 Fixed
2020-05-14 14:05:51 +02:00
Alexander Udalov 0ce16b9d8c Support non-reified type parameters in typeOf in JVM and JVM_IR
#KT-30279 Fixed
2020-05-13 10:04:28 +02:00
Sergey Rostov 4daac14008 Revert due to massive flaky tests 2020-05-12 23:01:01 +03:00
Alexander Udalov 012ffa2993 Support new scheme of compilation of OptionalExpectation annotations
Instead of generating these annotation classes as package-private on
JVM, serialize their metadata to the .kotlin_module file, and load it
when compiling dependent multiplatform modules.

The problem with generating them as package-private was that
kotlin-stdlib for JVM would end up declaring symbols from other
platforms, which would include some annotations from package
kotlin.native. But using that package is discouraged by some tools
because it has a Java keyword in its name. In particular, jlink refused
to work with such artifact altogether (KT-21266).

 #KT-38652 Fixed
2020-05-12 19:28:57 +02:00
Sergey Rostov fc59e28610 Fix lastIndexOfOrNull 2020-05-12 16:20:47 +03:00