Commit Graph

2877 Commits

Author SHA1 Message Date
Valentin Kipyatkov f5e7483d19 Renames 2015-07-16 13:49:21 +03:00
Valentin Kipyatkov 28e9fbf9b8 Correct synthetic extensions for methods like "getURL" 2015-07-16 13:49:18 +03:00
Valentin Kipyatkov 22e631dda3 Naming with "is" supported for synthetic extensions 2015-07-16 13:49:18 +03:00
Valentin Kipyatkov 42678bc79a Minor optimization 2015-07-16 13:49:17 +03:00
Valentin Kipyatkov 962bef6584 Moved methods 2015-07-16 13:49:17 +03:00
Valentin Kipyatkov a08fe96a8b Renamed methods 2015-07-16 13:49:16 +03:00
Valentin Kipyatkov 63614c5892 Initial implementation of renaming extension property usages on getter or setter rename 2015-07-16 13:49:16 +03:00
Valentin Kipyatkov 13f0d3ca23 Initial implementation of usage search for get/set methods in form of synthetic extension 2015-07-16 13:49:16 +03:00
Valentin Kipyatkov 2ec6f50402 Set method should not accept vararg 2015-07-16 13:49:15 +03:00
Valentin Kipyatkov 82f1eafa0b No synthetic properties of type Unit 2015-07-16 13:49:15 +03:00
Valentin Kipyatkov a014f5c8db No synthetic properties with incorrect names 2015-07-16 13:49:15 +03:00
Valentin Kipyatkov 9b3cbc6f25 Fixed completion for safe call 2015-07-16 13:49:14 +03:00
Valentin Kipyatkov 48b163758f Fixed caching 2015-07-16 13:49:14 +03:00
Valentin Kipyatkov 8bde9b098a Code refactoring 2015-07-16 13:49:13 +03:00
Valentin Kipyatkov 17442617bb Synthetic extensions suggested in completion 2015-07-16 13:49:13 +03:00
Valentin Kipyatkov 2e351f3e4d Initial implementation of synthetic extensions resolve 2015-07-16 13:49:13 +03:00
Pavel V. Talanov c313887641 Split CompileTimeConstant into two entities
1. ConstantValue
	* just holds some value and its type
	* implementations for concrete constants
2. CompileTimeConstant
	* is only produced by ConstantExpressionEvaluator
	* has additional flags (canBeUsedInAnnotation etc)
	* has two implementations TypedCompileTimeConstant containing a constant value
		and IntegerValueConstant which does not have exact type
	* can be converted to ConstantValue

Adjustt usages to use ConstantValue if flags are not needed
Add tests for some uncovered cases
2015-07-16 02:28:05 +03:00
Pavel V. Talanov 5dc5d77e60 Inject builtins in constants 2015-07-15 21:09:52 +03:00
Pavel V. Talanov ea1a85e78c Introduce CompileTimeConstantFactory 2015-07-15 21:09:40 +03:00
Pavel V. Talanov b0a4520710 Refactor compile constants to reduce boolean parameter hell 2015-07-15 20:57:02 +03:00
Denis Zharkov d19cb747be Emit not-null assertions for enhanced types 2015-07-15 10:01:14 +03:00
Mikhail Glukhikh 5126f01452 kotlin.annotation package with annotations "target" and "annotation" and enums AnnotationTarget and AnnotationRetention introduced.
Targets for existing built-in annotations.
Access to annotation package from packageFragmentProvider.
Documentation for all classes in the package.
2015-07-14 16:24:45 +03:00
Alexander Udalov 636b63a8c5 Make "reflection not found" a warning, provide a quick fix
Reporting the warning on each "::", as ReflectionNotFoundInspection did, is not
correct anymore, because for example name/get/set on properties works perfectly
without kotlin-reflect.jar in the classpath. So instead we report the warning
on calls to functions from reflection interfaces. This is not perfect either
because it's wrong in projects with custom implementations of reflection
interfaces, but this case is so rare that the users can suppress the warning
there anyway

 #KT-7176 Fixed
2015-07-10 20:10:11 +03:00
Alexander Udalov 048a9b686e Generate separate anonymous class for each property reference
Each property reference obtained by the '::' operator now causes back-end to
generate an anonymous subclass of the corresponding KProperty class, with the
customized behavior. This fixes a number of issues:

- get/set/name of property references now works without kotlin-reflect.jar in
  the classpath
- get/set/name methods are now overridden with statically-generated property
  access instead of the default KPropertyImpl's behavior of using Java
  reflection, which should be a lot faster
- references to private/protected properties now work without the need to set
  'accessible' flag, because corresponding synthetic accessors are generated at
  compile-time near the target property

 #KT-6870 Fixed
 #KT-6873 Fixed
 #KT-7033 Fixed
2015-07-10 20:10:09 +03:00
Alexander Udalov 30794060a9 Simplify property hierarchy in reflection
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their
mutable analogs, depending on the number of receivers a property takes
2015-07-10 20:10:09 +03:00
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