Mikhail Glukhikh
c5a81691fb
Partial code cleanup: can be private and some others applied
2017-08-01 17:08:56 +03:00
Toshiaki Kameyama
be0b01a1e6
Do not report "can be private" on effectively private / local elements
...
So #KT-18822 Fixed
2017-07-31 11:58:14 +03:00
Pavel V. Talanov
d7e62937b2
script.runtime 1.1.4: Remove new API from 'kotlin.script' package
...
Copy of new API is in 'kotlin.script.experimental' package
2017-07-30 17:38:10 +03:00
Pavel V. Talanov
9a004ceda2
script.runtime 1.1.4: Remove copy of ScriptContents class
...
This class is not new(experimental) API is not supposed to be moved
2017-07-30 17:17:54 +03:00
Pavel V. Talanov
ca06d38c5b
script.runtime 1.1.4: Copy new API to kotlin.script.experimental package
...
Minor: Move Environment type alias to resolvers_deprecated.kt file
2017-07-28 20:13:59 +03:00
Pavel V. Talanov
d59a72ea75
script.runtime 1.1.4: Undeprecate old API
2017-07-28 20:13:57 +03:00
Pavel V. Talanov
9e34437447
script.runtime: add 'kotlin-runtime' dependency
...
script.runtime is not built by JPS, this just affects highlighting
2017-07-28 20:13:54 +03:00
Mikhail Glukhikh
7fb78a0372
Code cleanup: replace chained null-checks with safe-calls
2017-07-26 15:18:22 +03:00
Dmitry Jemerov
f370d74609
Correctly detect stdlib in Gradle projects; move detection out of EDT
...
To detect whether a module has an stdlib in its dependencies, look at
source root modules and not at base module.
2017-07-24 19:53:52 +02:00
Mikhail Glukhikh
951e8cd91a
Code cleanup: unnecessary local variable applied
2017-07-21 18:58:48 +03:00
Alexander Udalov
5128b8a409
Add default implementation for Annotations.findAnnotation
2017-07-20 13:27:34 +03:00
Alexander Udalov
def3f73fdd
Use AnnotationDescriptor.fqName instead of type
...
Also use the annotationClass extension property instead of
TypeUtils.getClassDescriptor(annotation.type)
2017-07-20 13:26:13 +03:00
Alexander Udalov
541b9dab52
Introduce optimized BuiltInAnnotationDescriptor for built-in annotations
...
It's built on a FQ name and avoids resolution of the annotation class
descriptor as much as possible
2017-07-20 13:26:13 +03:00
Alexander Udalov
f39106f75c
Do not use parameter descriptors in AnnotationDescriptorImpl
2017-07-20 13:26:13 +03:00
Alexander Udalov
eb205f620c
Do not use parameter descriptors in most annotation implementations
...
Except AnnotationDescriptorImpl, which is refactored in the subsequent
commit.
Note that we no longer check the presence of parameters with the
corresponding names in the annotation class in
LazyJavaAnnotationDescriptor, this is why test data changed
2017-07-20 13:25:39 +03:00
Alexander Udalov
cc7ed2ba54
Change map key type in AnnotationDescriptor.getAllValueArguments
...
Turns out, only the parameter's name is needed at all usages of this
method. Such a map is both easier to use (no need to call
ValueParameterDescriptor.getName) and easier to construct (no need to
resolve annotation class, its constructor, its parameters). In this
commit, only usages have changed but the implementations are still using
the old logic, this is going to be refactored in subsequent commits
2017-07-20 13:25:39 +03:00
Alexander Udalov
41ea0e8ef8
Introduce AnnotationDescriptor.fqName
...
Could be used instead of ".annotationClass.fqName" to avoid the unneeded
resolution of the annotation class descriptor
2017-07-20 13:25:38 +03:00
Alexander Udalov
1d64b61a8f
J2K AnnotationDescriptor, refactor implementations
2017-07-20 13:25:38 +03:00
Alexander Udalov
7ec67505c5
Optimize Annotations.isEmpty in some implementations
2017-07-20 13:25:38 +03:00
Alexander Udalov
9ee4b39e1b
Provide default implementation for Annotations.findExternalAnnotation
2017-07-20 13:25:38 +03:00
Alexander Udalov
5636318eb4
Optimize DeserializedAnnotations in terms of memory traffic
...
Do not wrap every annotation object into an AnnotationWithTarget
2017-07-20 13:25:38 +03:00
Alexander Udalov
21197b53aa
Do not load annotations on value parameter if there are none
...
Also fix an error in the doc in descriptors.proto
2017-07-20 13:25:38 +03:00
Alexander Udalov
c197db9c69
Remove some unnecessary lazy computations in LazyJavaClassDescriptor
2017-07-20 13:25:38 +03:00
Denis Zharkov
90e894b171
Use known jvm binary class for package part if possible
2017-07-20 10:53:09 +03:00
Denis Zharkov
99a10d8d63
Minor. Rename compactIfPossible -> compact
...
As ArrayList can always be compacted
2017-07-20 10:53:09 +03:00
Denis Zharkov
f454858bbb
Optimize memory footprint for case of empty annotations in types
...
It seems that most of the simple types don't have any annotations,
so for that case it's worth removing the field from SimpleTypeImpl
Also introduce a NotNullSimpleType being used when replacing nullability
2017-07-20 10:53:09 +03:00
Denis Zharkov
f8a12a0ec3
Optimize JavaTypeResolver by avoiding using some language features
...
It's quite a hot point and using local functions with default
parameters seem to affect negatively to overall performance
(at least some of compiler benchmark have shown it)
2017-07-20 10:53:09 +03:00
Denis Zharkov
d7cee95d95
Call compactIfPossible where it's possible in BinaryJava*
...
It helps to avoid retaining a lot of redundant empty SmartList's
instances
2017-07-20 10:53:09 +03:00
Denis Zharkov
e2ce285ec3
Reduce memory footprint after functions substitution
...
Do not recreate new instances if descriptors' parts remain
effectively the same
2017-07-20 10:53:09 +03:00
Denis Zharkov
4a73fbb70a
Reduce memory footprint of TypeSubstitutor
...
Avoid creating new instances if types remain unchanged
2017-07-20 10:53:09 +03:00
Denis Zharkov
4385ce8828
Reduce memory footprint for basic case of flexible types
...
The case is when we have a simple type constructor
(not array nor collection) and type is not raw:
A<T1, >..A<T1>?
Actually these types are almost equal besides of nullability,
but we create and resolve two different simple types,
they have different arguments' lists, etc.
The idea is to add NullableSimpleType subclass with delegate
to another simple type
It should help a lot both with common cases and with corner ones:
flexibles types in spark for Function22 having exponential size
because of its flexibility
#KT-14375 Fixed
#KT-14323 Fixed
2017-07-20 10:53:09 +03:00
Denis Zharkov
59f2ba98a6
Avoid creating SimpleType instances for default type
2017-07-20 10:53:09 +03:00
Denis Zharkov
8576054788
Use SmartList instead of SmartSet for overridden descriptors
...
SmartSet was used because it was the only lightweight collection
available in core, but now there is org.jetbrains.kotlin.utils.SmartList
2017-07-20 10:53:09 +03:00
Denis Zharkov
c7e6f200da
Use SmartList for storing annotations in binary classes
...
Looks like in the most cases there are <= 1 annotations
in real declarations
2017-07-20 10:53:09 +03:00
Anton Bannykh
6ed7eaf546
JS tests: changes to kotlin.test + the way compiler tests are generated.
2017-07-19 12:24:09 +03:00
Alexander Udalov
d1603c4329
Minor, move deserializeToDescriptor to package kotlin.reflect.jvm.internal
...
To prevent binary-compatibility-validator from reporting it as a public
API; that happens because the signature is different after the
gradle-shadow-plugin is applied
2017-07-18 20:09:24 +03:00
Alexander Udalov
616d575fb6
Support reflection for local delegated properties
...
#KT-15222 Fixed
2017-07-14 15:13:12 +03:00
Stanislav Erokhin
ff8a57dc26
[NI] Implement New CommonSuperTypeCalculation
2017-07-14 12:43:05 +03:00
Stanislav Erokhin
53caa84db9
[NI] Add constrains even we try add constraint like TypeVariable <: CapturedType from subtyping.
...
If such captured type has lower type, then from TypeVariable <: lowerType => TypeVariable <: CapturedType.
2017-07-14 12:43:04 +03:00
Stanislav Erokhin
657c332a1f
[NI] Do not run "or" branches for constraint subtyping.
...
We should never do that, because otherwise we can get unexpected result.
Example for input constraint: C(in String) <: T.
If we run usual subtyping algorithm, then we get 2 constraints:
C(in String) <: T and T <: String.
Of course such system has contradiction.
2017-07-14 12:43:04 +03:00
Stanislav Erokhin
b4bf534d29
[NI] Capture from supertypes of type parameter.
...
This works by accident in OI, so this should be supported by new inference.
2017-07-14 12:43:03 +03:00
Stanislav Erokhin
b012681a53
[NI] New inference -- initial commit.
2017-07-14 12:43:02 +03:00
Dmitry Petrov
036090be91
Support intersection type in TypeUtils.contains(...)
2017-07-14 12:43:01 +03:00
Stanislav Erokhin
e8501c7d54
Add method replaceType for ReceiverValue.
...
This method will used for capturing from expressions before call resolution.
2017-07-14 12:43:01 +03:00
Mikhail Zarechenskiy
14890890b1
Minor, get rid of unchecked cast
2017-07-12 14:37:27 +03:00
Mikhail Zarechenskiy
ee173077c0
Simplify diagnostic when there are wrong number of type arguments
...
#KT-12767 Fixed
2017-07-12 14:37:27 +03:00
Dmitry Petrov
83ec8aa918
typealias expansion fixes
...
- Exception on dynamic type in typealias argument expansion
#KT-18858 Fixed Target versions 1.1.5
- Wrong report location for repeated annotations in typealias arguments
#KT-18940 Fixed Target versions 1.1.5
- Don't drop type annotations for dynamic type
#KT-18944 Fixed Target versions 1.1.5
2017-07-11 10:33:39 +03:00
Mikhail Glukhikh
dfe2c16bc7
More cleanup: lift return / assignment out
2017-07-10 12:59:58 +03:00
Pavel V. Talanov
bf09d91e80
script.runtime: restore old apis and mark as deprecated
...
Needed for compatibility (i.e. with old gradle kdsl versions)
2017-07-08 15:10:46 +03:00
Pavel V. Talanov
20be924bbb
script.runtime: update api
...
- Clean up some api inconsistencies
- Provide experimental async resolver to allow cleaner async updates of dependencies
2017-07-08 15:10:45 +03:00