Commit Graph

1676 Commits

Author SHA1 Message Date
Zalim Bashorov df4f43267b Provide location parameter in delegations 2015-07-21 22:27:26 +03:00
Zalim Bashorov 41449c107e Location.NOWHERE -> UsageLocation.NO_LOCATION 2015-07-21 22:27:25 +03:00
Zalim Bashorov e2e3520c3d Add location parameter to JetScope::getClassifier 2015-07-21 22:27:25 +03:00
Zalim Bashorov 0f92036353 Add location parameter to JetScope::getFunctions 2015-07-21 22:27:25 +03:00
Zalim Bashorov f79155df97 Add location parameter to JetScope::getProperties 2015-07-21 22:27:24 +03:00
Zalim Bashorov 2d2d510ef0 Introduce Location class to provide usage information in scopes 2015-07-21 22:27:24 +03:00
Stanislav Erokhin 47be8a7f06 Optimized equals method for TypeConstructor 2015-07-21 21:50:28 +03:00
Dmitry Petrov 6437a4bdc6 Support overload ambiguity resolution for callable references by expected type.
Resolve callable references taking into account expected callable types.

This affects call resolution procedure (resolve 'foo' in for 'foo(::bar)') similar to the approach used for function literals:

* During "shape arguments" phase of call resolution, callable references are resolved in independent context without expected type. If the callable reference is ambiguous, its shape type is a function placeholder type without parameter types and return type information. Otherwise, it is a reflection type for the resolved function or property. Upper-level call is resolved without taking into account ambiguous callable references.

* During "complete call" phase of call resolution, resolve callable reference arguments to actual descriptors (if possible), and update constraint system for the given call accordingly.

 #KT-6982 Fixed
 #KT-5780 Fixed
2015-07-21 18:33:15 +03:00
Dmitry Jemerov aa1f6f2252 code cleanup: core modules 2015-07-21 16:21:45 +02:00
Valentin Kipyatkov ace38ac57f Fixed completion of explicitly imported non-top level packages broken by optimization before 2015-07-21 16:00:10 +03:00
Valentin Kipyatkov 4cfe92f1e5 Renamed method 2015-07-21 16:00:10 +03:00
Valentin Kipyatkov e934d7166b DescriptorKindFilter: more correct filtering of kind mask from excludes 2015-07-21 16:00:09 +03:00
Mikhail Glukhikh 94a00540be Targeting / retention for a set of standard annotations, some inapplicable annotation checks replaced with target check, some fixed tests 2015-07-21 15:36:53 +03:00
Mikhail Glukhikh 9e7a67fabf Warning about java.lang.annotation.Target annotation usage 2015-07-21 15:20:37 +03:00
Mikhail Glukhikh 1309c1f95f Annotation mapper is introduced to map java annotation targets to kotlin targets + a set of new / fixed tests 2015-07-21 15:20:31 +03:00
Denis Zharkov 97af85da9c Change default upper bound of Java type parameters to Any!
#KT-7672 Fixed
2015-07-21 15:16:05 +03:00
Alexander Udalov 0e69ebb288 Improve stack traces of exceptions thrown by LockBasedStorageManager
Drop leading frames which only contain memoized functions' and lazy values'
invokes, so that the first frame corresponds to the meaningful place in the
code
2015-07-21 13:32:26 +03:00
Valentin Kipyatkov e0e7044032 Synthetic properties: fixed completion and inspection for generic class
+ fixed KT-8539 No completion of generic extension function for <*> type arguments

 #KT-8539 Fixed
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov 23cfe88b71 KT-8530 Synthetic properties doesn't work with smart casts
#KT-8530 Fixed
2015-07-21 08:32:50 +03:00
Ilya Ryzhenkov 84236992cb Replace Injected properties with constructor parameters when it doesn't cause cycles 2015-07-20 20:58:19 +03:00
Pavel V. Talanov aae8ccfd57 Refactor: AnnotationSerializer does not depend on bultins 2015-07-17 19:21:24 +03:00
Pavel V. Talanov a84da2bb0c Minor: move utilities closer to their only usage 2015-07-17 19:21:22 +03:00
Pavel V. Talanov f2016c8033 Minor: remove usage of KotlinBuiltins.getInstance() 2015-07-17 19:21:22 +03:00
Mikhail Glukhikh af5e7f58da Implementation of Kotlin's 'target' annotation mapping to Java's 'Target' annotation + tests 2015-07-17 12:05:27 +03:00
Ilya Gorbunov ecba29a08a Reword contract of Collection's removeAll and retainAll to emphasize that the criteria to remove or retain element is the containment in the specified collection.
Collection.remove(element): clarify docs.
2015-07-17 10:52:38 +03:00
Pavel V. Talanov a147497650 Minor: move all constant value implementation into one file 2015-07-16 18:38:52 +03:00
Alexander Udalov de94778846 Restore deprecated K*Function classes for compatibility
The code compiled with old compiler will work with the new runtime, but not
vice versa
2015-07-16 15:36:07 +03:00
Valentin Kipyatkov c1b2ea0b48 More elegant way to achieve the same + fixed KT-7746 Top level package name completion does not work inside class body
#KT-7746 Fixed
2015-07-16 14:03:37 +03:00
Valentin Kipyatkov d743924be9 Changed signatures 2015-07-16 13:49:21 +03:00
Valentin Kipyatkov 22e631dda3 Naming with "is" supported for synthetic extensions 2015-07-16 13:49:18 +03:00
Valentin Kipyatkov 434e3ab38b Moved utility functions for JetType from IDE to core 2015-07-16 13:49:14 +03:00
Valentin Kipyatkov 17442617bb Synthetic extensions suggested in completion 2015-07-16 13:49:13 +03:00
Valentin Kipyatkov c92b43c94b Added JetScope.getSyntheticExtensionProperties() 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 155f00578d Builtins are passed into builtins module
Fixes circular dependency
2015-07-15 21:09:59 +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
Pavel V. Talanov f97767e159 Drop ArrayValue redundant constructor parameter 2015-07-15 20:56:55 +03:00
Pavel V. Talanov ae88dd3f1f Convert compile constant classes to kotlin: prettify 2015-07-15 20:56:48 +03:00
Pavel V. Talanov 0369de86c7 Convert compile constant classes to kotlin: j2k 2015-07-15 20:56:41 +03:00
Pavel V. Talanov a6180611f4 Convert compile constant classes to kotlin: rename files 2015-07-15 19:44:18 +03:00
Pavel V. Talanov 44dffa7bbc Minor: remove a couple of usages of KotlinBuiltIns.getInstance() 2015-07-15 19:44:17 +03:00
Denis Zharkov e82adc9d90 Drop unused Approximation type capabilities 2015-07-15 10:01:15 +03:00
Denis Zharkov d19cb747be Emit not-null assertions for enhanced types 2015-07-15 10:01:14 +03:00
Denis Zharkov e23c7f457b Preserve type annotations on type parameter when substituting
Subsitute(@A T, T:@B String) = @B @A String

Nullability when loading Java:
Subsitute(@NotNull T, T:String) = @NotNull String
Subsitute(@NotNull T, T:String!) = @NotNull String
Subsitute(@NotNull T, T:String?) = @NotNull String

Subsitute(@Nullable T, T:String) = @Nullable String?
Subsitute(@Nullable T, T:String!) = @Nullable String?
Subsitute(@Nullable T, T:String?) = @Nullable String?
2015-07-15 10:01:14 +03:00
Alexander Udalov 2b541a560e Make function references compiled with old compiler work with new runtime 2015-07-14 21:23:59 +03:00
Mikhail Glukhikh 37b2e97e56 Rendering changed: "annotation class" is now just "class" (with kotlin.annotation.annotation if it's kotlin annotation).
A swarm of tests fixed accordingly.
2015-07-14 16:25:08 +03:00
Mikhail Glukhikh 609d696202 Annotations have now retention of "RUNTIME" by default. Java retention is generated as given by kotlin annotation. Annotation rendering changed.
Annotation arguments with default values are rendered as ... if renderDefaultAnnotationArguments is true.
Tests: java retention does not taken into account by Descriptor comparator.
Java retentinon changed to kotlin retention in some tests + one new test with java retention added.
More accurate tests for intentions in byte code (visibility controlled).
2015-07-14 16:25:01 +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