Commit Graph

1654 Commits

Author SHA1 Message Date
Alexey Andreev c814a9d1d2 KT-2752: fix support of typealiases 2016-10-08 19:25:52 +03:00
Alexey Andreev 6f7e7d8504 KT-2752: fixes after code review 2016-10-08 19:25:49 +03:00
Alexey Andreev aa5d15cff7 KT-2752: minor fixes after code review 2016-10-08 19:25:43 +03:00
Denis Zharkov e05e0ec921 Optimize method count for collection stubs
Do not generate stubs if they're already present in superclasses

 #KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Alexander Udalov 7070b88ea4 Move PlatformToKotlinClassMap out from ModuleParameters
Configure it in the same way as other platform-specific components instead,
simplify some code
2016-10-06 14:40:20 +03:00
Alexey Sedunov ba1ee99e97 Navigation: Filter out candidate declarations coming from the wrong library
#KT-13726 In Progress
2016-10-05 11:32:36 +03:00
Valentin Kipyatkov af0b027952 All operator usages are searched with new searcher 2016-10-04 19:34:58 +03:00
Valentin Kipyatkov ee64a1a2b7 Quick search of equals operator usages 2016-10-04 19:34:57 +03:00
Denis Zharkov a4978c794f Fix accidental overrides computation
Consider the whole overridden tree instead of only direct overridden

 #KT-14146 Fixed
2016-10-04 16:47:10 +03:00
Alexander Udalov 0ed9897b03 Minor refactorings related to PackagePartProvider and implementations
- Document what exactly should findPackageParts return
- Make EMPTY a named object instead of a val in the companion
- Do not use JvmPackagePartProvider in tests where Empty works fine
- Add a couple default values to arguments of setupResolverForProject
2016-10-02 21:03:34 +03:00
Denis Zharkov bb1b8cca20 Fix AssertionError in CodegenUtil.getDelegates
Change getAllOverriddenDescriptors contracti, now it returns
original (not substituted) descriptors without any duplicates.

First of all it's necessary in CodegenUtil.getDelegates to avoid
duplicates (see assertion there), but also it's convenient for all
other usages of this method

 #KT-8154 Fixed
2016-09-28 11:40:35 +03:00
Pavel V. Talanov 827b56e277 Navigation to binaries: support navigation to type alias constructors
#KT-13479 Fixed
2016-09-26 18:34:19 +03:00
Pavel V. Talanov 8f5725345f ModuleDescriptor: invert "friends" relation
Fixes memory leak caused by modules storing their friends (which can be potentially recreated many times)
2016-09-22 18:20:43 +03:00
Denis Zharkov 5381c06936 Improve 1.0-compatibility mode for JDK dependent members
Just reporting error by call checker may be too restrictive
in case there are some extensions that can be used successfully

Solution is to annotate additional members with
@Deprecated(level=Error) + @kotlin.internal.LowPriorityInOverloadResolution
2016-09-22 15:40:37 +03:00
Dmitry Petrov 07198cf86d SAM constructors for type aliases. 2016-09-22 10:38:34 +03:00
Denis Zharkov 1b391123e6 Implement for/iter postfix templates
#KT-4710 In Progress
2016-09-20 15:26:47 +03:00
Dmitry Petrov dac9d8b845 Additional checks for type alias constructors. 2016-09-20 10:55:36 +03:00
Dmitry Petrov 796d11c860 ClassDescriptor is now a super-interface for ClassConstructorDescriptor and TypeAliasConstructorDescriptor. 2016-09-20 10:55:36 +03:00
Valentin Kipyatkov 7d214c6e58 KT-13689 Typealias constructor usage counts as original type usage for optimize imports
#KT-13689 Fixed
(cherry picked from commit bde7e2b)
2016-09-20 10:55:36 +03:00
Dmitry Petrov b31ab729de Containing declaration for TypeAliasConstructorDescriptor
is a corresponding TypeAliasDescriptor.
2016-09-20 10:55:36 +03:00
Denis Zharkov e975d32196 Implement resolution of desctructuring declarations in lambdas
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov 7ca84649d7 Fix implicit type arguments resolution for inner classes
When resolving arguments on inner classifier, one can omit the arguments
for outer class 'Outer' if they are present implicitly in the scope:
- One of the supertypes of current class is Outer
- One of the outer classes or one of their supertypes is Outer

Relevant arguments are obtained from the first type found by
the algorithm above

Note that before this commit implicit arguments were only been searched
in containing classes

 #KT-11123 Fixed
2016-09-15 10:33:19 +03:00
Denis Zharkov 15c0901a72 Minor. Add covariant override for TypeParameterDescriptor.original 2016-09-15 10:33:19 +03:00
Dmitry Petrov dae4521c68 KT-13822 Exception in the compiler for start-projection of a type alias
Use ClassifierWithTypeParameters in StarProjectionImpl.
2016-09-13 15:09:47 +03:00
Alexander Udalov 90eafe0d71 Fix reflective access on overridden generic property reference
Generation of callable reference's signature in codegen should use the same
mechanism for obtaining the signature as the runtime in RuntimeTypeMapper,
namely DescriptorUtils.unwrapFakeOverride(...).original

 #KT-13700 Fixed
2016-09-12 10:39:21 +03:00
Yan Zhulanow 975364b2ed Kapt: Provide SourceRetentionAnnotationHandler for incremental compilation.
Collect annotations with the "SOURCE" retention.
(cherry picked from commit 6ef66e7)
2016-09-10 17:36:15 +03:00
Denis Zharkov b1edb01dd4 Introduce getFunctionNames and getVariableNames into MemberScope
Also provide some basic implementation

The main purpose of these methods is optimization.
Most of the member scopes store mapping from names to descriptors
MemoizedFunction<Name, Collection<Descriptor>>

While there are 10 functions in class in average, there are a lot of
queries with names of non-existent functions, that leads to many
effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once
2016-09-09 10:27:35 +03:00
Denis Zharkov 257417bc4a Minor. Lower type aliase declarations priority
There are several reasons for doing this:
- See org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope.computeDescriptors,
  classifiers are being deserialized in the last turn, so it's necessary to preserve consistent order
- Their priority should be close to classes
2016-09-09 10:27:35 +03:00
Valentin Kipyatkov efac7a11b3 Do not include "operator" and "infix" into completion item text for override 2016-09-07 18:10:11 +03:00
Denis Zharkov 86c1dbe7b5 Fix decompilation of types based on local classifiers
If deserializing a type with arguments based on a local class for
decompiler, then just return Any type (without arguments).

Previously Any constructor was used with serialized arguments, that lead
to exception

Note that in case of deserialization for compiler nothing changes about
local-classes-based types (LocalClassifierResolverImpl is just inlined)

 #KT-13408 Fixed
2016-09-05 17:54:36 +03:00
Alexander Udalov 8fb5858dae Fix occasional NPE from reflection initialization
This could happen when a .jar containing Kotlin stdlib and reflection classes
was launched with 'java -jar'
2016-09-05 16:44:54 +03:00
Stanislav Erokhin 8d2d5ea211 Minor refactoring in NewKotlinTypeChecker 2016-09-01 18:00:18 +03:00
Stanislav Erokhin ea2d95fa79 Minor. Change predicate type from KotlinType to UnwrappedType. 2016-09-01 18:00:17 +03:00
Alexey Sedunov c244baf087 Misc: Improve IDE rendering of type aliases 2016-08-31 11:28:02 +03:00
Alexander Udalov 26156b137f Micro optimizations to type rendering in DescriptorRendererImpl
Do not create StringBuilder instances when the resulting String will be
appended to some other StringBuilder anyway. This, and a couple of micro
FqNameUnsafe-related optimizations, helps reduce memory traffic in Kotlin
reflection when rendering is involved (toString() is called on reflective
objects)
2016-08-26 15:17:02 +03:00
Stanislav Erokhin b695f5edd9 Refactoring. Some simplifications in OverloadingConflictResolver. 2016-08-24 11:10:34 +03:00
Ilya Gorbunov afe1b7eab1 Allow to exclude specific types from packages imported by default. 2016-08-17 12:40:50 +03:00
Valentin Kipyatkov 12b1a99a6a Initial implementation of loop-to-call-chain intention 2016-08-16 17:37:55 +03:00
Alexander Udalov 18887f8bec Rename CompanionObjectMapping.hasMappingToObject -> isMappedIntrinsicCompanionObject 2016-08-15 19:41:47 +03:00
Alexander Udalov 611899e9d3 Minor, make CompanionObjectMapping a singleton 2016-08-15 19:41:47 +03:00
Mikhail Glukhikh 6cf90cfc4e Fix for SOE in VarianceChecker #KT-13401 Fixed 2016-08-11 13:04:58 +03:00
Alexey Sedunov 1b546d18ff Override/Implement Members: Do not expand type aliases in the generated members. Retain abbreviated types during flexible type approximation
#KT-13244 Fixed
2016-08-10 11:45:36 +03:00
Alexey Sedunov 59a714ca5c Presentation: Render function signature in RefactoringDescriptionLocation
#KT-12943 Fixed
2016-08-10 11:45:29 +03:00
Stanislav Erokhin aa91b5a1b0 KT-13264 IAE: Argument for @NotNull parameter 'errorClass' createErrorTypeConstructorWithCustomDebugName must not be null
#KT-13264 Fixed
2016-07-29 17:53:12 +03:00
Alexander Udalov b72293883d Fix algorithm of determining modality for fake overrides
Previously we inferred "open" if there was at least one open member in the
hierarchy. However, that's not correct when that member is overridden by
another member in the hierarchy which is abstract. This led to incorrect code
being accepted by the front-end, and an exception during the bridge generation

 #KT-12467 Fixed
2016-07-26 21:16:15 +03:00
Alexander Udalov 3ef3bb8251 Minor, add comment, remove warning suppression 2016-07-25 15:55:31 +03:00
Alexander Udalov d945c33d5e Move some members from OverrideResolver to OverridingUtil 2016-07-25 15:55:31 +03:00
Alexander Udalov 9be219b69c Check presence of dispatch receiver parameter in modifier checks
Also fix typo in "inapplicable infix" diagnostic message
2016-07-22 18:13:39 +03:00
Stanislav Erokhin 6556cde329 Introduce new type checker. 2016-07-21 16:07:16 +03:00
Stanislav Erokhin d4d98c87ee Minor. fixed equals for TypeProjection.
Note: unclear where this equals is used.
2016-07-21 16:07:15 +03:00