Commit Graph

3152 Commits

Author SHA1 Message Date
Alexander Udalov c3b97e0668 Simplify function hierarchy in reflection
Get rid of all classes except kotlin.reflect.KFunction, which will be used to
represent all kinds of simple functions.

Lots of changes to test data are related to the fact that KFunction is not an
extension function (as opposed to KMemberFunction and KExtensionFunction who
were) and so a member or an extension function reference now requires all
arguments be passed to it in the parentheses, including receivers. This is
probably temporary until we support calling any function both as a free
function and as an extension. In JS, functions and extension functions are not
interchangeable, so tests on this behavior are removed until this is supported
2015-07-10 20:10:08 +03:00
Alexander Udalov ab297a4da0 Generate reflection info to classes for function references
The information includes the owner (class, package, script, or null for local
functions) and the JVM signature -- this information will be used by reflection
to locate the symbol
2015-07-10 20:10:07 +03:00
Svetlana Isakova a714de783f Converted CallResolverUtil to kotlin 2015-07-10 15:05:08 +03:00
Denis Zharkov 76648878e0 Ignore type parameters in value arguments while comparing SAM adapters
#KT-8388 Fixed
2015-07-10 08:46:27 +03:00
Denis Zharkov 0a19fb7df2 Make project compilable after types enhancement 2015-07-09 16:36:46 +03:00
Denis Zharkov fd43799c6e Use original descriptor when working with errors in KotlinSignature
Otherwise enhanced version are treated differently
2015-07-09 16:36:43 +03:00
Denis Zharkov 0375e45936 Change reporting policy for NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS
If lower bound of flexible is nullable treat it like Kotlin nullable type
Anyway appropriate errors are reported outside JavaNullabilityWarningsChecker
2015-07-09 16:36:42 +03:00
Denis Zharkov c769748cb0 Move type enhacement parts to separate package in runtime
It's needed to enhace types when loading descriptors via reflection.
Also get rid of `enhanceSignatures` method in ExternalSignatureResolver as enhancement does not use external signature at all
2015-07-09 16:32:25 +03:00
Andrey Breslav c6b91b0f81 Java type annotations supported in LazyJavaTypeResolver 2015-07-09 16:32:25 +03:00
Andrey Breslav 31f4ff749c Type annotations supported in Java elements
Reflection-related implementations are pending
2015-07-09 16:32:25 +03:00
Andrey Breslav 694af022c8 Type Enhancement for Java fields and constructors supported as well 2015-07-09 16:32:25 +03:00
Andrey Breslav 8c78739983 Proper enhancement for type parameters 2015-07-09 16:32:25 +03:00
Andrey Breslav 04aee291b9 Proper treatment of return types 2015-07-09 16:32:25 +03:00
Andrey Breslav a8b5698145 Proper enhancement for SAM adapters 2015-07-09 16:32:25 +03:00
Andrey Breslav 9644eeb047 Propagating annotations into type arguments 2015-07-09 16:32:24 +03:00
Andrey Breslav 4248654f5f Signature enhancement: most basic version implemented 2015-07-09 16:32:24 +03:00
Andrey Breslav f376b2ba70 Stub infrastructure for enhancing platform signatures 2015-07-09 16:32:24 +03:00
Andrey Breslav 991f0fcf2e Type enhancement and qualifier extraction 2015-07-09 16:32:24 +03:00
Andrey Breslav d140e83386 Minor. Methods renamed to reflect tha fact that they handle more types than just collections 2015-07-09 16:32:24 +03:00
Yan Zhulanow 9c8ea54946 Use KotlinJvmCheckerProvider to check @publicField 2015-07-07 16:35:24 +03:00
Alexander Udalov 0bad4e0137 Make KotlinJvmCheckerProvider non-singleton, pass module to it 2015-07-06 16:19:53 +03:00
Alexander Udalov 48a8f53551 Fix ClassCastException in SamAdapterOverridabilityCondition
This was happening on the upcoming hierarchy of property getters and setters in
kotlin.reflect. No test added because it's not so easy to come up with a small
example, and because the fix itself is rather trivial
2015-07-03 15:32:20 +03:00
Alexander Udalov cd847b7cb9 Minor, make JavaMethod#getReturnType non-null
PsiMethod#getReturnType only returns null for constructors, and JavaMethod is
not created for constructors (JavaConstructor is)
2015-07-03 15:32:17 +03:00
Stanislav Erokhin d830729ddb change creation of performance counters 2015-07-02 16:32:44 +03:00
Pavel V. Talanov 15a4782a0c Move CompilationCanceledStatus and related utils to "util" module
It should not be in "frontend" since "jps bare plugin" artifact does not include "frontend" module
2015-07-01 21:21:35 +03:00
Pavel V. Talanov b173f96505 Refactor: Remove ScopeProvider, introduce FileScopeProviderImpl
Rename NoFileScopeProvider -> FileScopeProvider.ThrowException, ScopeProvider.AdditionalScopeProvider -> FileScopeProvider.AdditionalScopes
2015-06-30 16:12:23 +03:00
Nikolay Krasko 8bea21a847 Introduce BodyResolveCache for storing resolve function body task in IDE 2015-06-30 13:54:42 +03:00
Michael Nedzelsky c462d23a0e add support for cancel compilation from IDE
#KT-8158 Fixed
2015-06-29 16:41:16 +03:00
Pavel V. Talanov 65c6adfaa4 Drop "injector-generator" module, tests and existing generated injectors
Move GeneratorsFileUtil to "generators" module
Drop "Generate Injectors" run configuration
2015-06-26 15:21:43 +03:00
Pavel V. Talanov df529f1a4b Convert usages of existing generated injectors to dynamic injectors
Rewrite RuntimeModuleData to use hand-written code as we do not pack container module into runtime
This change introduces some overhead (up to 10% for the tests I ran) in some scenarios in IDE, that should be addressed later
2015-06-26 15:21:41 +03:00
Evgeny Gerashchenko 23eab73507 Added extra logging in incremental cache and Kotlin Builder. 2015-06-24 18:01:51 +03:00
Mikhail Glukhikh 5fabb962ae Private constructors are now accessed via synthetic constructor with DEFAULT_CONSTRUCTOR_MARKER as an additional argument #KT-6299 Fixed
A set of tests provided. Some external tests fixed accordingly.
Companion object creation changed accordingly.
Derived classes now can use base class with the private constructor.
Refactoring of AccessorForFunctionDescriptor.
2015-06-24 12:30:11 +03:00
Mikhail Glukhikh 83ce674a37 Warning message changed #KT-8143 Fixed 2015-06-24 12:30:08 +03:00
Pavel V. Talanov 96199ecc1f Refactor AnalyzerFacade: move module.initialize() outside of createResolverForModule() 2015-06-23 15:19:22 +03:00
Denis Zharkov eb7114bd53 Add 'constructor' keyword in whole project where needed 2015-06-12 09:55:15 +03:00
Denis Zharkov da254ab1a0 Drop support of java.lang.Class as annotation parameter
Also drop some related diagnostics and testData
2015-06-12 09:55:12 +03:00
Denis Zharkov 200dee2761 Replace deprecated annotations in whole project 2015-06-12 09:23:32 +03:00
Yan Zhulanow f1b6bd5914 kapt: Stop compiler gracefully 2015-06-11 14:53:45 +03:00
Yan Zhulanow 571c9073fa Add AnalyzeCompletedHandlerExtension 2015-06-11 14:50:32 +03:00
Alexander Udalov 64b60718e3 Finish off old deprecated function/extension function classes
This reverts commit d14e5b8a72.
2015-06-10 14:41:57 +03:00
Alexander Udalov d4c18b3d55 Drop PsiBasedMethodSignatureChecker 2015-06-10 14:41:56 +03:00
Evgeny Gerashchenko c48378260e Path hash code is case-agnostic. This is to avoid changing it if e.g. path to project is reconfigured from C:\Work to c:\work 2015-06-09 20:03:21 +03:00
Dmitry Jemerov a321e8eef5 performance counters infrastructure 2015-06-04 10:20:19 +02:00
Natalia Ukhorskaya 7b63dd987c Workaround for bug in Android Plugin: it generates LightFields for files starting from '.' (ex. .DS_Store file)
#KT-6625 Fixed
2015-06-03 16:36:57 +03:00
Valentin Kipyatkov aefe0dd192 Changed highlighting range and attributes of useless elvis operator 2015-06-02 14:35:19 +03:00
Alexander Udalov 4f77b44ac3 Minor, move constant to the proper place 2015-06-01 19:23:08 +03:00
Alexander Udalov d14e5b8a72 Restore and deprecate Function{n}/ExtensionFunction{n} classes for easier migration
Users' Java code will not break in common cases (when passing functions to
Kotlin), and deprecation warnings will be reported.

Provide an inspection with a quick fix which allows to replace deprecated
function class usages to the new classes. Include this fix to the "code
cleanup" action
2015-05-28 01:20:05 +03:00
Denis Zharkov 53e9234ea9 Add quickfix for replacing positioned arguments in Java annotation 2015-05-27 17:41:27 +03:00
Valentin Kipyatkov 281acb860e Loading of annotation class arguments from compiled classes 2015-05-27 16:15:50 +03:00
Dmitry Jemerov 1188e57597 rename @overloads annotation to @jvmOverloads 2015-05-27 12:23:08 +02:00