Commit Graph

2893 Commits

Author SHA1 Message Date
Stanislav Erokhin 7332032bb6 Support sealed class inheritors in the same file
#KT-11573 Fixed
2016-05-19 16:22:40 +03:00
Denis Zharkov 46ac26147b Annotate with @UnsafeVariance relevant types in built-ins 2016-05-18 19:21:38 +03:00
Denis Zharkov 279ff0b561 Extract variance check algorithm into 'core' module 2016-05-18 19:21:38 +03:00
Denis Zharkov 9dc47d9a11 Move java/util/List.sort to MutableList 2016-05-16 15:38:13 +03:00
Denis Zharkov e90c92f8d3 Separate additional built-in members from JDK into three groups
- White list: can be used as common built-in declaration
- Black list: can be used only for overrides and super-calls-
- Not considered members: ones that is not in black or white list.
Such members can be used in any context, but they usages marked as deprecated

Third kind is needed to make possible use declarations added in future JDK versions.
Deprecation is necessary because they may get into black list in next Kotlin compiler version
2016-05-16 15:38:13 +03:00
Denis Zharkov 308ee93392 Minor. Rename field and clarify how it differs from similar one 2016-05-16 15:38:13 +03:00
Denis Zharkov ef940ab0df Add new 'HiddenInResolution' kind
It's used to hide additional built-ins members loaded from JDK
Such methods can be overridden and called only with 'super'-receiver
2016-05-16 15:38:13 +03:00
Denis Zharkov 1501a042e9 Add possibility to add annotations when building FunctionDescriptor copy
It's being used in next commits to add Deprecated annotation
to unknown additional built-ins members
2016-05-16 15:38:13 +03:00
Mikhael Bogdanov 5e933b7acd localVariableReferences.kt moved from reflection.jvm to runtime.jvm 2016-05-13 19:11:22 +03:00
Dotlin 4c223845b6 Delegated Properties: Code generation for local properties (JVM) 2016-05-13 19:11:19 +03:00
Dotlin fa523b9af4 Delegated Properties: Analysis adjustments for local delegated properties support 2016-05-13 19:11:18 +03:00
Mikhail Glukhikh 733f3e8025 Code cleanup: type parameters can have in / out variance 2016-05-13 17:57:02 +03:00
Zalim Bashorov 3a87049359 JS/RTTI. Fix build and tests 2016-05-05 17:24:23 +03:00
Alexey Tsvetkov d42cbde74d JS/RTTI: (minor) fixed typo 2016-05-05 17:24:17 +03:00
Alexander Udalov 17dacb1efa Revert "Minor, move SpecialNames.isSafeIdentifier check a little earlier"
This reverts commit a3055edda9.

It turns out, this re-introduces an AssertionError at ClassId.<init> ("Class
name must not be root") when LazyJavaPackageScope#getContributedClassifier is
called during SAM constructor resolution below in
LazyJavaPackageScope#computeNonDeclaredFunctions, which was overlooked at the
time the commit was pushed
2016-05-04 17:41:49 +03:00
Denis Zharkov c30c695a18 Use cache for custom ClassDescriptors
Otherwise new ones are being created for each request, and their member scope is recomputed
2016-05-04 14:58:05 +03:00
Denis Zharkov 594fa02a9c Optimize memory usage by LockBasedStorageManager inner classes
Change all inner classes to be 'static'
Use explicit reference to StorageManager instead of
implicit reference to outer class.

The main problem of inner classes here is that outer instance
is being captured at each inheritance level, so e.g. some lazy value impls
may store up to three duplicating references.
2016-05-04 14:58:05 +03:00
Alexander Udalov a3055edda9 Minor, move SpecialNames.isSafeIdentifier check a little earlier 2016-04-29 15:21:26 +03:00
Alexander Udalov d85884426e Minor optimization of lookup tracker records 2016-04-29 15:21:26 +03:00
Alexander Udalov 785877d1de Combine Java package scope and Kotlin scopes in JvmPackageScope
Use it in LazyJavaPackageFragment#scope instead of a weird lazy chained scope.
Also move lookup tracker records to it, to prevent them from being written in
each package scope individually (this was hurting performance)
2016-04-29 15:21:26 +03:00
Alexander Udalov 05af72dc7a Optimize class lookups in DeserializedPackageMemberScope
Do not try to load classes (and litter in ClassDeserializer#classes cache with
unsuccessful requests) which the deserialized scope knows nothing about. This
is possible because deserialized scopes have the full list of their class names
2016-04-29 15:21:26 +03:00
Denis Zharkov d259b91143 Add MutableMap.remove(K, V) as built-in declaration
Use PlatformDependent annotation to guarantee it's only be available for JDK8
Also adjust type-safe bridges and mutable collection stubs generation
2016-04-29 15:08:54 +03:00
Denis Zharkov 55c4f875c8 Use signatures instead of fq-names in special built-ins
It's necessary to distinguish overloads,
e.g. MutableMap.remove now has two versions
2016-04-29 15:08:54 +03:00
Valentin Kipyatkov b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Kirill Rakhman 2629d23576 Add quickfix to add 'toString' (#866)
Fixes #KT-12121
2016-04-28 12:15:39 +03:00
Mikhail Glukhikh 5a66ef2126 Core & compiler: unnecessary 'val's removed from constructors 2016-04-27 18:41:56 +03:00
Stanislav Erokhin 926da77abe Refactoring. Remove getSubstitution from KotlinType. 2016-04-27 14:13:59 +03:00
Stanislav Erokhin 5fe48313e9 Refactoring. Merge CustomSubstitutionCapability, CustomFlexibleRendering and RawTypeTag into RawTypeCapability. 2016-04-27 14:13:58 +03:00
Denis Zharkov fc25d70edc Expand JVM built-ins blacklist
Add Enum.getDeclaringClass, Enum.finalize and List.sort
2016-04-25 17:41:08 +03:00
Denis Zharkov 62f2bddda9 Add AdditionalBuiltInsMembersSignatureListsTest
This test checks that every signature listed within
JvmBuiltInsAdditionalClassPartsProvider corresponds to some real JDK member
2016-04-25 17:41:08 +03:00
Denis Zharkov 7d729a1fe0 Minor. Inline helper properties 2016-04-25 17:41:08 +03:00
Denis Zharkov 9bf2538e4c Introduce predefined enhancement info
It can be used to specify enhanced signature for standard JDK methods
without them be actually annotated

 #KT-9194 In Progress
 #KT-5175 In Progress
 #KT-10370 In Progress
 #KT-7127 In Progress
2016-04-25 17:41:08 +03:00
Denis Zharkov 3bda613317 Minor. Rename BuiltInClassesAreSerializableOnJvm -> JvmBuiltInsAdditionalClassPartsProvider 2016-04-25 17:41:08 +03:00
Denis Zharkov 2819c69bc1 Introduce BLACK_LIST_CONSTRUCTOR_SIGNATURES
To prevent loading senseless constructors to built-in classes from JDK
2016-04-25 17:41:08 +03:00
Denis Zharkov 1efed64014 Use JVM signatures instead of FQ-names for additional built-ins 2016-04-25 17:41:08 +03:00
Denis Zharkov 8cf29ea4f3 Extract JVM descriptors type mapping from backend to core
Also unbind it from ASM types
2016-04-25 17:41:08 +03:00
Denis Zharkov 12bbbb6ff1 Refactor Java resolver components
- Move components from LazyJavaResolverContext to JavaResolverComponents
- Drop LazyJavaClassResolver replacing it's usages with module resolver
(now enum entries from another module as annotation arguments are being resolved, see test)
2016-04-25 17:41:08 +03:00
Denis Zharkov bbbc910e02 Load additional built-in classes constructors from JDK
#KT-9194 In Progress
 #KT-5175 In Progress
 #KT-10370 In Progress
 #KT-7127 In Progress
2016-04-25 17:41:08 +03:00
Denis Zharkov 5bc5722051 Load additional JDK functions into built-ins member scope
#KT-5990 Fixed
 #KT-7127 Fixed
 #KT-10370 Fixed
2016-04-25 17:41:08 +03:00
Denis Zharkov 137847e0c9 Minor. Refactor DeserializedMemberScope.addNonDeclaredDescriptors 2016-04-25 17:41:08 +03:00
Denis Zharkov f104be16cf Minor. Keep substitution in CopyConfiguration instead of originalSubstitutor 2016-04-25 17:41:08 +03:00
Denis Zharkov e316ab2ee6 Refactor function descriptors copy mechanism
Pull up CopyBuilder to interface and inline some custom usages
2016-04-25 17:41:08 +03:00
Denis Zharkov 51a4b81d3e Minor. Rename AdditionalSupertypes -> AdditionalClassPartsProvider
And relevant methods
2016-04-25 17:41:08 +03:00
Denis Zharkov c918b3e1ae Minor. Replace type entries of BuiltInsPackageFragment with interface 2016-04-25 17:41:08 +03:00
Denis Zharkov 7fe5a9db8d Remove JavaToKotlinClassMap dependency on built-ins instance 2016-04-25 17:41:08 +03:00
Stanislav Erokhin f9130ae133 Do not force calculation of lower and upper bounds in java flexible type. 2016-04-25 15:28:49 +03:00
Stanislav Erokhin 45ac1d2cb5 Refactoring. Remove FlexibleTypeFactoryDeserializer. 2016-04-25 15:28:49 +03:00
Stanislav Erokhin a6a9caa3cd Minor. Remove Dynamicity. 2016-04-25 15:28:48 +03:00
Stanislav Erokhin ca74f0d86e Add assertion into DynamicTypeFactory about type range. 2016-04-25 15:28:48 +03:00
Stanislav Erokhin 8f32eeb663 Refactoring. Merge Specificity and NullAwareness into Flexibility. 2016-04-25 15:28:47 +03:00