Commit Graph

40131 Commits

Author SHA1 Message Date
Simon Ogorodnik bc5872dd8f Add completion benchmark to check completion speed 2017-07-17 16:03:02 +03:00
Nikolay Krasko dfef1f4921 Add reference equality shortcut for equals() in light members 2017-07-17 14:50:59 +03:00
Nikolay Krasko 44ed903303 Implement equivalence of light members by origin when possible
Previous implementation worked through equality that used equality
of method stubs (see LightMemberOriginForCompiledMethod). But method
stubs for compiled element can be recreated when caches are outdated,
including weak reference cleaning (see ClsJavaStubByVirtualFileCache).

This could cause misbehave of find usages when java reference has an
outdated version of light element in resolution cache.
2017-07-17 14:50:59 +03:00
Toshiaki Kameyama fda097fc3b Correct "before" sample in description for intention Convert to enum class #KT-18722 Fixed (#1196) 2017-07-17 13:03:15 +02:00
Dmitry Jemerov 6baa8614e6 Fix JS tests in AbstractConfigureKotlinTest 2017-07-17 12:09:11 +02:00
Dmitry Jemerov 2c2b64d44a AbstractConfigureKotlinTest: J2K 2017-07-17 12:09:10 +02:00
Dmitry Jemerov 4198a5c3ec AbstractConfigureKotlinTest: rename to .kt 2017-07-17 12:09:09 +02:00
Dmitry Jemerov 0e6c9a96c7 Specify library kind when configuring library in tests 2017-07-17 12:09:04 +02:00
Dmitry Jemerov 060b8e0025 ConfigLibraryUtil: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 921db30c90 ConfigLibraryUtil: rename to .kt 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 0fa09adf17 Provide library kind for common libraries; get rid of autodetection 2017-07-17 11:58:57 +02:00
Dmitry Jemerov c7e85ea28f Better encapsulate JS library detection 2017-07-17 11:58:57 +02:00
Dmitry Jemerov b8d453eec3 Set library kind when importing projects from Maven 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 608f5892f9 Set library kind when importing projects from Gradle 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 902fe1f5ce Implement explicit library kind for JS libraries, don't autodetect 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 1367e6f303 Get library versions directly, not through LibraryPresentationProvider 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 2d1ac69986 JSLibraryStdDescription: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 5f3366d60b JSLibraryStdDescription: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov c185730846 KotlinJsModuleConfigurator: J2K 2017-07-17 11:58:57 +02:00
Dmitry Jemerov ffb3e2fcbc KotlinJsModuleConfigurator: rename to .kt 2017-07-17 11:58:57 +02:00
Dmitry Jemerov 1f6788ac31 Fix CodeConformanceTest on Windows 2017-07-17 11:57:03 +02:00
Nikolay Krasko b3e9dfcea9 Minor: fix weak warnings and formatting in KotlinReferencesSearcher.kt 2017-07-17 12:25:06 +03:00
Nikolay Krasko d93e0adc4f Do not wrap to light elements if Kotlin search is requested (KT-19054)
#KT-19054 Fixed
2017-07-17 12:25:06 +03:00
Dmitry Petrov 8c7352e668 Generate constant "" for effectively empty string 2017-07-17 09:18:41 +03:00
Knize 389c7d03b7 KT-6676 Show enum ordinal in quickdoc (#1165)
KT-6676: Show enum ordinal in quickdoc

 #KT-6676 fixed
2017-07-14 22:28:16 +03:00
Simon Ogorodnik cc8933c82b KT-17074: Make completion respect DslMarker's
#KT-17074 fixed
2017-07-14 21:06:43 +03:00
Alexander Udalov 3c04ca4397 Update KotlinVersion.CURRENT to 1.1.5 2017-07-14 21:03:06 +03:00
Alexander Udalov 2611c7de7e Restore anonymous classes for local delegate metadatas in inline functions
The problem is that now that the local delegated property metadata is in
the $$delegatedProperties array of the containing class, the access to
it from code calling an inline function with a local delegated property
is illegal.

Currently it seems to be a lot of work to support this rather rare case
properly (see the comment in ExpressionCodegen.getVariableMetadataValue)
so we postpone it and return the old behavior of using the anonymous
KProperty subclass for metadata
2017-07-14 15:13:12 +03:00
Alexander Udalov 616d575fb6 Support reflection for local delegated properties
#KT-15222 Fixed
2017-07-14 15:13:12 +03:00
Alexander Udalov c444c4d10b Ignore $$delegatedProperties in light analysis mode tests
For tests with local delegated properties, this field is generated in
the full mode, but is not generated in the lite mode because local
variables are not analyzed properly in the lite mode
2017-07-14 15:04:05 +03:00
Alexander Udalov db27a885f1 Rework property metadata generation for local delegated properties
Instead of generating an anonymous class for each delegated local
variable, store metadatas in the $$delegatedProperties array of the
containing class, as is done for member properties
2017-07-14 15:04:05 +03:00
Alexander Udalov 9344f7f42f Remove unused and obsolete code in JVM backend 2017-07-14 15:04:05 +03:00
Alexander Udalov 728de91140 Refactor generation of metadata for delegated properties
In CodegenAnnotatingVisitor, store all delegated properties whose
metadata should be generated in each class (identified by ASM Type).
Use the stored information later, both in the $$delegatedProperties
array generation and in the access to it from property's accessor
methods, instead of an heuristical indexOfDelegatedProperty()
2017-07-14 15:04:04 +03:00
Alexander Udalov b97589b33e Remove CodegenBinding.LOCAL_VARIABLE_DELEGATE
Calculate this value at call sites explicitly instead
2017-07-14 15:04:04 +03:00
Alexander Udalov 66ea288be7 Minor, extract fakeDescriptorsForReferences.kt 2017-07-14 15:04:04 +03:00
Stanislav Erokhin 9e98c11114 [NI] Minor. Change return type substitute function to not null 2017-07-14 12:43:09 +03:00
Stanislav Erokhin 2602216039 [NI] Use NewTypeSubstitutor when create descriptor with fresh variables. 2017-07-14 12:43:09 +03:00
Stanislav Erokhin 652676dc71 [NI] Introduce transactions for constraint system.
This will be used for callable reference resolution.
2017-07-14 12:43:09 +03:00
Stanislav Erokhin cb494c46d7 [NI] Add initial constraint to IncorporationConstraintPosition 2017-07-14 12:43:08 +03:00
Stanislav Erokhin c767545d4c Minor. Remove unused CandidateWithBoundDispatchReceiver#copy 2017-07-14 12:43:08 +03:00
Stanislav Erokhin ac06060260 [NI] Minor. Drop unused CommonSupertypeCalculator 2017-07-14 12:43:08 +03:00
Stanislav Erokhin 0404fbc092 [NI] Minor. Rename LambdaAnalyzer to KotlinResolutionCallbacks 2017-07-14 12:43:08 +03:00
Dmitry Petrov 178e3e2c98 [NI] Update argument types on call completion using nested calls resolution 2017-07-14 12:43:07 +03:00
Dmitry Petrov 4448637727 [NI] Support calling abstract class constructor in delegating call 2017-07-14 12:43:07 +03:00
Dmitry Petrov 549e8ba668 [NI] Use ALWAYS_SUITABLE_RECEIVER when no receiver is available
(as in "old" resolution & inference)

This fixes issues with Java static members access.
2017-07-14 12:43:07 +03:00
Dmitry Petrov 2bdeef7970 [NI] Postprocess lambda result expressions on call completion
Should update type to denotable, e.g.,
IntegerValueType(x) to proper numeric type.

TODO extract common code into some ValueArgumentPostprocessor
2017-07-14 12:43:07 +03:00
Dmitry Petrov 1d6ed4ef8e [NI] Update lambda result types.
When completing calls, update return types for functional descriptors
for lambdas using type inference results.

Add toString to some Call subclasses (for debugging purposes).
2017-07-14 12:43:06 +03:00
Dmitry Petrov 2bf252afe6 [NI] Introduce lambda result dependency edges
Given a lambda result type R_L with constraint R_L <: T,
for each constituent type variable V in T with variance matching
approximation direction for V, consider a dependency edge V -> R
(lambda-result-dependency).

E.g., given a constraint:
    R <: Out<V>
where V is approximated down (to sub-type).
After R is fixed, we obtain constraint
    Out<T> <: Out<V>
which is incorporated as
    T <: V
which is a relevant constraint for V.
2017-07-14 12:43:06 +03:00
Dmitry Petrov 13e8720ddc [NI] Keep track of fresh type variables created for particular call candidate
Otherwise we can't obtain inferred type arguments for the call,
which is required for reification.
2017-07-14 12:43:06 +03:00
Dmitry Petrov eb7e9196b5 [NI] Fix some argument mapping problems
1. Value arguments for the resolved call are indexed with resulting
descriptor value parameters (which can be substituted).

2. Simple argument can be a single vararg element if the corresponding
value parameter is a vararg parameter.

3. Resulting descriptor should be approximated to super-type.
This doesn't affect type inference, but the JVM BE expects types with
proper classifiers.
2017-07-14 12:43:06 +03:00