Commit Graph

33603 Commits

Author SHA1 Message Date
Alexey Tsvetkov 3f2f79ef59 Update changelog for 1.0.4 2016-09-09 18:19:01 +03:00
Alexey Andreev 70c5f05f6e JS: fix compile-time failure when inheriting one local class from another local class 2016-09-09 17:52:42 +03:00
Denis Zharkov fc5217f7fc Fix signature clash problems caused by special built-ins
Do not treat members with already changed signature as a reason
to create a hidden copy

See tests for clarification:
- There are `charAt` method in B that has different name in Kotlin - `get`,
  i.e. relevant descriptor has initialSignatureDescriptor != null
- When collecting methods from supertypes, `charAt` from A is also get
  transformed to `get`
- So it has effectively the same signature as B.get (already declared)
- If by an accident B.get had been declared with Kotlin signature
  we would have add A.charAt (after transformation) with special flag:
  HiddenToOvercomeSignatureClash (hides it from resolution)
- But here B.charAt was artificially changed to `get`, so no signature clash
  actually happened

 #KT-13730 Fixed
2016-09-09 16:33:32 +03:00
Denis Zharkov aee2509bf2 Minor. Replace lambdas with callable references in LazyJavaClassMemberScope 2016-09-09 16:33:32 +03:00
Simon Ogorodnik 2b63bcaa19 Correct diagnostics and quick-fix for T::class with non-reified type parameter #KT-9590 fixed 2016-09-09 16:14:11 +03:00
Mikhail Glukhikh 998399bcd8 Change to star projection no longer applied for functional types #KT-13715 Fixed
Also EA-87648 Fixed
2016-09-09 15:00:02 +03:00
Mikhail Glukhikh 23132ad519 Convert lambda to reference intention: apply shorten references to callable reference only, not to the whole argument list 2016-09-09 14:59:57 +03:00
Mikhail Glukhikh 06b7881776 Refactoring: add braces to when entry intention is integrated into general add braces intention 2016-09-09 14:59:52 +03:00
Mikhail Glukhikh cbc7f72f15 Minor: remove braces is now applicable for the whole loop or when entry 2016-09-09 14:59:47 +03:00
Mikhail Glukhikh cf2839eb9a Refactoring: remove braces from when entry intention is integrated into general remove braces intention 2016-09-09 14:59:42 +03:00
Mikhail Glukhikh 7f955fd260 Convert lambda to reference has now INFO severity 2016-09-09 14:59:37 +03:00
Alexey Andreev b91ed1e02a KT-13544: support typealiases in JS backend 2016-09-09 14:38:11 +03:00
Alexey Andreev 7510b7f080 JS: fix tests that don't fail due to lack of support of strict mode (multiValInIntFor, multiValInIntRangeFor). 2016-09-09 13:59:53 +03:00
Alexey Andreev 16af7d667f KT-12868: if a property initializer is a complex expression that emits additional statements, emit these statements directly before assignment to the property, not at the beginning of constructor 2016-09-09 13:54:03 +03:00
Alexey Andreev 80361bf2fb KT-13583: allow local classes to capture members of outer classes 2016-09-09 13:07:08 +03:00
Denis Zharkov a29faf3f2d Minor. Rename MemberIndex -> DeclaredMemberIndex
Also replace super-calls with explicit calls to declaredMemberIndex().getMethods
2016-09-09 10:27:35 +03:00
Denis Zharkov a30cb4ead6 Minor. Drop unused getNonDeclaredTypeAliasNames
Also cleanup type aliases related code in DeserializedMemberScope
2016-09-09 10:27:35 +03:00
Denis Zharkov 276bf950cf Write inner classes for annotation descriptors within the given class file
It's necessary for proper recovering of classId by plain string JVM descriptor when loading annotations
See FileBasedKotlinClass.convertAnnotationVisitor

Related tests are already exist in loadJava, but they stopped working
after the recent changes:
nested classes are not found anymore by name with '$' symbol
2016-09-09 10:27:35 +03:00
Denis Zharkov 44f5df00fe Do not return nested/local classes as a part of package fragment
#KT-13757 Fixed
2016-09-09 10:27:35 +03:00
Denis Zharkov 4bf61db9f9 Optimize class names computation in Java package for CLI
Use known class names' set if it exists
2016-09-09 10:27:35 +03:00
Denis Zharkov 5a2851308f Optimize computation of member names in Java scopes
Effectively all custom logic was moved from MemberIndex to JavaScope classes,
and as member names are being cached there, so it prevents repeating supertypes
traversal (see getAllMemberNames extension)
2016-09-09 10:27:35 +03:00
Denis Zharkov cc0f2e87d4 Optimize java scope members computation for non-existing names
Do not use memoized function if member with given name is not contained in the scope

There are a lot of queries with names of non-existent functions, that leads to many
effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once
2016-09-09 10:27:35 +03:00
Denis Zharkov e428ea8dd5 Minor. Refine return type Collection -> Set 2016-09-09 10:27:35 +03:00
Denis Zharkov 02d7cf9614 Minor. Rename get*Names -> compute*Names
To indicate that repeating calls to them may require additional computations

Also change second parameter to be nullable, this will be necessary in the next commits
2016-09-09 10:27:35 +03:00
Denis Zharkov 81682f0497 Optimize JvmBuiltinsSettings.getFunctionsNames 2016-09-09 10:27:35 +03:00
Denis Zharkov 2fb5b0e248 Simplify allDesciptors computation
Do not split descriptors into declared/non-declared groups

It should not be important as order of non-declared members' appearance
does not affect stub building, deserialization and other order-sensitive
stuff
2016-09-09 10:27:35 +03:00
Denis Zharkov f0ba09ae40 Optimize deserialized scope members computation for non-existing names
Do not use memoized function if member with given name is not contained in the scope

There are a lot of queries with names of non-existent functions, that
leads to many effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once

Also drop unused 'location' parameter
2016-09-09 10:27:35 +03:00
Denis Zharkov b1edb01dd4 Introduce getFunctionNames and getVariableNames into MemberScope
Also provide some basic implementation

The main purpose of these methods is optimization.
Most of the member scopes store mapping from names to descriptors
MemoizedFunction<Name, Collection<Descriptor>>

While there are 10 functions in class in average, there are a lot of
queries with names of non-existent functions, that leads to many
effectively redundant Map nodes in MemoizedFunction and also cause
additional computation that is worth to compute at once
2016-09-09 10:27:35 +03:00
Denis Zharkov 8ee5f3de8f Minor. Use ArrayList instead of LinkedHashSet
Looks like there's no duplicates anyway
2016-09-09 10:27:35 +03:00
Denis Zharkov e89c53d49f Minor. Extract common pattern in DeserializedMemberScope 2016-09-09 10:27:35 +03:00
Denis Zharkov f50d0b63f0 Minor. Simplify type aliases computation
computeNonDeclaredTypeAliases is always empty
2016-09-09 10:27:35 +03:00
Denis Zharkov 2251e3b1e9 Minor. Replace explicit lazy calculation call with delegation convention 2016-09-09 10:27:35 +03:00
Denis Zharkov a0a0d9b554 Get rid of DeserializedMemberScope.ProtoKey class
Only 'name' property matters, 'isExtension' is only needed for sorting
when computing all descriptors (can be replaced with additional sort)
2016-09-09 10:27:35 +03:00
Denis Zharkov 257417bc4a Minor. Lower type aliase declarations priority
There are several reasons for doing this:
- See org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope.computeDescriptors,
  classifiers are being deserialized in the last turn, so it's necessary to preserve consistent order
- Their priority should be close to classes
2016-09-09 10:27:35 +03:00
Nikolay Krasko 5d65951938 Make removing artifacts work with rri branches 2016-09-08 21:46:41 +03:00
Mikhail Glukhikh 8b6cec6ba2 Test fix: typeFromJavaFlexibleRecursive 2016-09-08 18:54:57 +03:00
shiraji 9d768e2375 Add quickfix for FINAL_UPPER_BOUND: inline type parameter #KT-13773 Fixed 2016-09-08 17:48:01 +03:00
Nikolay Krasko 28d187ca1a More tests for ChangeVisibilityModifierIntention
(cherry picked from commit e7cdba7)
2016-09-08 17:32:40 +03:00
Nikolay Krasko 1e9db3c23e Restrict default applicability range for intentions to enclosing block
(cherry picked from commit bf2aade)
2016-09-08 17:32:38 +03:00
Nikolay Krasko 37492fcc78 Make KtLambdaExpression lazy parsable element
(cherry picked from commit 533fca1)
2016-09-08 17:32:37 +03:00
Valentin Kipyatkov 1d24fc3a7b Refactored to ensure use of correct options 2016-09-08 16:11:12 +03:00
Valentin Kipyatkov 32e4a033db Fixed use of options 2016-09-08 16:11:11 +03:00
Valentin Kipyatkov fc27212456 Shorten references to use analyze() for multiple elements 2016-09-08 16:11:11 +03:00
Valentin Kipyatkov 6efb3ac009 Added TODO 2016-09-08 16:11:11 +03:00
Valentin Kipyatkov 215b870946 Added TODO 2016-09-08 16:11:10 +03:00
Valentin Kipyatkov dd6b5ab5a7 Used analyze to multiple elements for copy/paste 2016-09-08 16:11:10 +03:00
Valentin Kipyatkov 5a5a6d47b3 Minor 2016-09-08 16:11:09 +03:00
Valentin Kipyatkov bcfa31de2b Implemented ability to analyze to multiple elements at once 2016-09-08 16:11:09 +03:00
Valentin Kipyatkov 36c2b01047 KT-13675 Ctrl-W: cannot select type argument in return type
#KT-13675 Fixed
2016-09-07 20:02:50 +03:00
Valentin Kipyatkov 73828d1411 Renamed file 2016-09-07 19:04:49 +03:00