Commit Graph

29877 Commits

Author SHA1 Message Date
Dmitriy Novozhilov e7869bd9d4 [NI] Analyse lambda in factory pattern resolution in independent context 2020-05-29 09:36:32 +03:00
Ilya Gorbunov a0c7bece93 Overload resolution by lambda return type
Make compiler recognize new annotation enabling this feature.

Change overload selection algorithm to consider all overloads
with that annotation, not just the first one.

#KT-38480
#KT-11265
2020-05-29 09:36:32 +03:00
Dmitriy Novozhilov 1c32c62a87 [NI] Choose annotated candidate if call still ambiguous
#KT-11265
2020-05-29 09:36:31 +03:00
Dmitriy Novozhilov 8c524769b1 [NI] Add required FactoryPattern annotation for factory pattern resolve
#KT-11265
2020-05-29 09:36:31 +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 a270ee094c Language feature for new inline class mangling rules (since 1.4) 2020-05-29 00:53:01 +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
Mikhail Glukhikh ffdab473e2 IR symbols: enhance exception messages / toString() a bit 2020-05-28 22:59:13 +03:00
Mikhail Glukhikh b6cdcc8d50 [FIR2IR] Mute 2 failing BB tests 2020-05-28 22:51:20 +03:00
Mikhail Glukhikh 19f1a3de1a [FIR2IR] Populate overridden symbols also with public symbol inheritors 2020-05-28 22:19:21 +03:00
Mikhail Glukhikh 85760770a8 [FIR2IR] Initialize built-in symbols at start of conversion 2020-05-28 22:18:20 +03:00
Mikhail Glukhikh cd24745f1f [FIR2IR] Add primitive signature composer & use it for external classes 2020-05-28 22:18:13 +03:00
Mikhail Glukhikh 048e7a7075 [FIR] Add forgotten FirJvmBackendClassResolver to CLI 2020-05-28 22:18:05 +03:00
Steven Schäfer dc0ef996b7 JVM IR: Implement the new inline class ABI 2020-05-28 18:00:35 +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
Victor Petukhov e72f7d9a1d NI: return optimization for adding constraints in ConstraintInjector.kt 2020-05-28 14:58:15 +03:00
anastasiia.spaseeva 6c1efbe812 [Spec tests] Update spec testData 2020-05-28 14:23:11 +03:00
Mikhail Glukhikh 25b1059f74 Cleanup: ExpectDependencyGenerator 2020-05-28 14:03:01 +03:00
Mikhail Glukhikh c9f2876368 [PSI2IR] Drop unnecessary forcing of type alias RHS referencing 2020-05-28 14:03:01 +03:00
Mikhail Glukhikh cef23a284f [PSI2IR] Use returnTarget.symbol directly in generateReturnExpression 2020-05-28 14:03:00 +03:00
Mikhail Glukhikh 8e8bb9bf08 [IR] Simplify class parent fetching in PrimitiveCompanionLowering 2020-05-28 14:03:00 +03:00
Mikhail Glukhikh 487a698e49 [IR] Add IrSymbolBase.toString() implementation 2020-05-28 14:02:59 +03:00
Mikhail Glukhikh 07b1bd9d99 IrTypeUtils: take name directly from IrDeclaration 2020-05-28 14:02:59 +03:00
Mikhail Glukhikh 4b47eb359a IR linked: introduce IrElement.isExpectMember instead of descriptor use 2020-05-28 14:02:58 +03:00
Mikhail Glukhikh 7c7f87e729 [IR] Replace some usages of KotlinType to IrType 2020-05-28 14:02:58 +03:00
Mikhail Glukhikh 2d842d061e IrSourceCompilerForInline: get ownerKind without descriptor 2020-05-28 14:02:57 +03:00
Mikhail Glukhikh a631c24e8c [IR] Drop unused 'withDescriptors' dumper 2020-05-28 14:02:57 +03:00
Mikhail Glukhikh 4944fc78b2 [IR] Require bound symbols in classFqNameEquals 2020-05-28 14:02:56 +03:00
Mikhail Glukhikh cacf5f5a4a [IR] Read isExpect directly from IrDeclaration without using descriptor 2020-05-28 14:02:56 +03:00
Mikhail Glukhikh 934b040152 [IR] Read isSuspend directly from IrFunction without using descriptor 2020-05-28 14:02:55 +03:00
Mikhail Glukhikh 8a15edf5e6 [IR] Extract IrDeclaration(Access).psiElement extension 2020-05-28 14:02:55 +03:00
Mikhail Glukhikh 6b3c390fa7 [FIR2IR] Use IrSymbols directly instead of referencing via SymbolTable 2020-05-28 14:02:54 +03:00
Mikhail Glukhikh 90e6d5bea7 [FIR2IR] Read modality directly from IrFunction without using descriptor 2020-05-28 14:02:54 +03:00
Mikhail Glukhikh 724101cdd2 [IR] Get rid of minor symbol.descriptor usages 2020-05-28 14:02:53 +03:00
Mikhail Glukhikh bf66929b5b Extract IrClass.syntheticAccessorToSuperSuffix() 2020-05-28 14:02:53 +03:00
Mikhail Glukhikh 66da676b9e [IR] Extract IrCallableReference.referencedName 2020-05-28 14:02:52 +03:00
Mikhail Glukhikh 79fd24f734 IrBuilder: get typeParametersCount from IR owner, not from descriptor 2020-05-28 14:02:52 +03:00
Alexander Udalov d115a1ff9c Minor, fix some warnings such as "unused main argument" in generators 2020-05-27 23:29:21 +02:00
Alexander Udalov 4520e02bae Support fun interfaces in kotlinx-metadata
#KT-37421 Fixed
2020-05-27 23:29:12 +02:00
Steven Schäfer 86cd039526 JVM IR: Use original descriptors for lambdas in JvmDeclarationOrigin 2020-05-27 20:21:42 +03:00
Vyacheslav Gerasimov af2dce0549 as41: Build against AS 4.1 C10 2020-05-27 18:46:57 +03:00
Victor Petukhov cadc5ad587 NI: remove deprecated TODO about doing investigation around producing unwanted Any? during incorporation (KT-39154) 2020-05-27 16:52:55 +03:00
Victor Petukhov 0bed055fca NI: small refactoring around TypeCheckerContext and adding new possible constraints 2020-05-27 16:39:31 +03:00
Victor Petukhov d7f52e8b67 NI: do explicit incorporation of type of fixing type variable into other constraints
^KT-37380 Fixed
2020-05-27 15:44:03 +03:00
Ilya Chernikov dec8eb7899 Revert renaming scripting plugin jar:
it conflicts with the compilation on daemon, so transistion should
be planned accordingly, and now it is not a good time for it.
The most important part of the renaming remains intact.

Partially reverts commit "Rename scripting libs and plugin - invert embeddable suffix"
2020-05-27 13:15:50 +02:00
Jinseong Jeon 18953c4717 FIR: transform resolved arrayOf call inside annotation to FirArrayOfCall 2020-05-27 11:38:34 +03:00
Jinseong Jeon 265d066878 FIR2IR: minor refactor to share IrVarargElement creation. 2020-05-27 11:38:32 +03:00
Jinseong Jeon ff509bdcd3 FIR2IR: fix inverted types for array/element in arrayOf call. 2020-05-27 11:38:32 +03:00
Jinseong Jeon b93868c30b IR: migrate IrType utils about array element type. 2020-05-27 11:38:32 +03:00