Commit Graph

32798 Commits

Author SHA1 Message Date
Mikhail Glukhikh a2b68f65be Suppress CAST_NEVER_SUCCEEDS removed from standard library code
(cherry picked from commit 7d9aa04)
2016-07-27 10:51:41 +03:00
Mikhail Glukhikh b88282c0fc Suppress CAST_NEVER_SUCCEEDS removed from source code
(cherry picked from commit d448a92)
2016-07-27 10:51:30 +03:00
Mikhail Glukhikh a902c4901a CAST_NEVER_SUCCEED: replace subtyping check with subclassing check #KT-13206 Fixed
(cherry picked from commit 5fc797a)
2016-07-27 10:51:13 +03:00
Mikhail Glukhikh 17c824f7f2 KT-13170 related: correct handling of inspection parameters in additional checker
(cherry picked from commit 47fd990)
2016-07-27 10:50:58 +03:00
Mikhail Glukhikh ff2f49fa8f Has platform type inspection: do not report by default on Kotlin types with platform arguments #KT-13170 Fixed
Also #KT-12820 Obsolete
(cherry picked from commit 0589b48)
2016-07-27 10:50:45 +03:00
Mikhail Glukhikh 8600e7348c Can be val inspection: local functions are taken into account #KT-13151 Fixed
(cherry picked from commit 57eb4c1)
2016-07-27 10:50:31 +03:00
Alexander Udalov 0380b6cd88 Never resolve modality of members to SEALED 2016-07-26 21:16:15 +03:00
Alexander Udalov b72293883d Fix algorithm of determining modality for fake overrides
Previously we inferred "open" if there was at least one open member in the
hierarchy. However, that's not correct when that member is overridden by
another member in the hierarchy which is abstract. This led to incorrect code
being accepted by the front-end, and an exception during the bridge generation

 #KT-12467 Fixed
2016-07-26 21:16:15 +03:00
Nikolay Krasko 84a83e5dc2 Minor: remove !! 2016-07-26 17:17:06 +03:00
Nikolay Krasko bdc3192acb Don't store analyze result longer than ModuleResolverProvider valid time
For synthetic files there might be file modifications without PsiModificationTracker.MODIFICATION_COUNT increment.
2016-07-26 17:17:06 +03:00
Nikolay Krasko db89c3fc3f Refactoring: extract ResolutionFacadeImpl to separate file 2016-07-26 17:17:06 +03:00
Nikolay Krasko 57f3a86686 Debug string for project resolution facade 2016-07-26 17:17:06 +03:00
Nikolay Krasko 3c8e35fa3a Remove psi modification tracker from pooled threads (EA-86038, KT-13163)
IDEA 163 explicitly forbids such tricks with exceptions.

 #KT-13163 Fixed
2016-07-26 17:17:06 +03:00
Michael Bogdanov 9b9abb2e10 Fix for KT-13182: Regression: compiler internal error at inline
#KT-13182 Fixed
2016-07-26 16:16:37 +03:00
Michael Bogdanov 99cdc41ab6 Fix for KT-13133: Incorrect InnerClasses attribute value for anonymous object copied from an inline function
#KT-13133 Fixed
2016-07-26 16:16:36 +03:00
Alexander Udalov 91e486d020 Fix KCallable#name intrinsic for bound references
Do not skip generation of the left-hand side because it may produce side
effects

 #KT-12995 Fixed
2016-07-26 13:48:20 +03:00
Alexander Udalov 0ea885ce58 Move tests on KClass.java* to box/classLiteral/java
Also replace WITH_REFLECT to WITH_RUNTIME to test that these cases correctly
work without reflection in the classpath
2016-07-26 13:48:19 +03:00
Alexander Udalov 70e01fac18 Fix class literals of objects in super constructor calls
In an expression such as "Obj::class" where Obj is an object, it's fine to
consider Obj either an expression or a type and generate either
Obj.INSTANCE.getClass() or Obj.class correspondingly. However,
the former fails in the object's super constructor call because the INSTANCE
field is not yet initialized. Thus, we force generation of Obj.class in case
when Obj is an object.

Note that this has been reproduced in our project, see
KotlinMetadataVersionIndex
2016-07-26 13:47:34 +03:00
Alexander Udalov 495ed13fce Implement codegen for bound class reference expressions
- Inline the usage of ExpressionCodegen#generateClassLiteralReference into
  ClosureCodegen, simplify
- Support DoubleColonLHS.Expression in generateClassLiteralReference
- Substantially simplify KClass.java intrinsic by reusing
  generateClassLiteralReference

 #KT-13075 Fixed
 #KT-12995 In Progress
2016-07-26 13:47:33 +03:00
Alexander Udalov 28dc5d788c Minor, make JavaClassProperty intrinsic a singleton 2016-07-26 13:47:32 +03:00
Nikolay Krasko a0226f3fd8 Run SafeDeleteFix without run action to avoid "Refactorings should not be started inside write action" (KT-13207)
#KT-13207 Fixed
2016-07-26 13:38:24 +03:00
Nikolay Krasko 6ea5171f60 Add "Studio" as version separator (KT-13184)
#KT-13184 Fixed
2016-07-26 13:38:24 +03:00
Pavel V. Talanov 8a9de2a00f Show all Kotlin annotations when browsing hierarchy of "java.lang.Annotation" 2016-07-26 11:42:09 +03:00
Pavel V. Talanov 84dae76bd9 Index enum classes as if they have "Enum" in supertypes
#KT-13057 Fixed
2016-07-26 11:42:08 +03:00
Pavel V. Talanov 8f006bd4aa Add test for KT-13057 with infrastructure 2016-07-26 11:42:08 +03:00
Alexey Andreev 05dd039151 KT-12275 Add JS optimization that transforms the following code
```
do {
    X
    if (B) break;
} while (A)
```

to

```
do {
    X
} while (!B && A)
```

Add inversion that takes boolean expression and applies negation to it, simplifying if possible (like !!a => a).
2016-07-25 18:46:46 +03:00
Alexey Andreev b3d29adad9 KT-12275 Add JS optimization that transforms the following code
```
do {
    guard: {
        // do something
        break guard;
        // do something
    }
} while (condition)
```

to

```
do {
    // do something
    continue;
    // do something
} while (condition)
```
2016-07-25 18:32:10 +03:00
Alexey Andreev 1a61115148 KT-12275 Preserve evaluation order when do..while loop with extractable condition contains continue statement 2016-07-25 18:32:08 +03:00
Alexander Udalov 3ef3bb8251 Minor, add comment, remove warning suppression 2016-07-25 15:55:31 +03:00
Alexander Udalov d945c33d5e Move some members from OverrideResolver to OverridingUtil 2016-07-25 15:55:31 +03:00
Alexander Udalov aaf618e035 Minor, inline HashSetUtil#symmetricDifference 2016-07-25 15:55:31 +03:00
Alexander Udalov 475fb6e8a7 Simplify OverrideResolver#filterOverrides
- move source vs binary equivalent call filtering hack to
  ResolutionResultsHandler (see c4778bfe5a for
  the original commit introducing this behavior)
- rewrite the algorithm so that it doesn't need noDuplicates in the beginning:
  modulo the hack above whish is only needed in ResolutionResultsHandler,
  descriptor equivalence is checked anyway in OverrideResolver#overrides
2016-07-25 15:55:31 +03:00
Alexander Udalov a6faab834d Move OverrideResolver#generateOverridesInAClass to CollectionStubMethodGenerator
Also simplify substantially
2016-07-25 15:55:31 +03:00
Alexander Udalov bbd1e889a6 Use kotlin.Function1 instead of intellij Function in OverrideResolver 2016-07-25 15:55:31 +03:00
Alexander Udalov 191f532675 Remove OverrideResolver#filterOutOverriding, simplify the only usage 2016-07-25 15:55:31 +03:00
Alexander Udalov 5d04fa3c2f Remove unreachable code in ResolutionResultsHandler 2016-07-25 15:55:31 +03:00
Alexander Udalov 89c5799155 Move utilities used in IDE from OverrideResolver to descriptorUtils.kt 2016-07-25 15:55:31 +03:00
Alexander Udalov 24c383a009 Remove unnecessary loop from OverrideResolver#filterOverrides
It was not needed because overridability in both ways is already checked in
DescriptorEquivalenceForOverrides, which is called in
OverrideResolver#overrides
2016-07-25 15:55:31 +03:00
Alexey Tsvetkov 517e457f06 Update changelog 2016-07-25 15:54:39 +03:00
Denis Zharkov becb1f1f95 Make stack values for assignment-like operations lazy
As well as for other kinds of expressions

Within attached test they were generated twice in case of last expression of coroutine block,
because coroutine related codegen part is built upon assumption that all expressions should be generated lazily

Also add a test about unary postfix increment/decrement

 #KT-13156 Fixed
2016-07-25 13:56:43 +03:00
Alexey Sedunov 0a8490a068 Introduce Type Alias: Suggest initial name based on extracted type 2016-07-25 12:44:30 +03:00
Alexey Sedunov 0769d47f4b Introduce Type Alias: Support type constructor extraction 2016-07-25 12:44:28 +03:00
Alexey Sedunov b5828a5fa1 Refactoring: Allow multiple ElementKinds when choosing element to refactor 2016-07-25 12:44:26 +03:00
Alexey Sedunov 09d36291de Misc: Update function/type alias signature preview upon changing checkbox state 2016-07-25 12:44:24 +03:00
Mikhail Glukhikh 30b0875b26 Merge pull request #906 from cypressious/make_val_private
Quickfix "Make primary constructor parameter a val" makes the val private now #KT-13187 Fixed
2016-07-25 09:46:42 +03:00
Mikhail Glukhikh 299097d112 KT-10903 Lambda to callable reference: use named arguments if needed, lift restriction about parameter default values
(cherry picked from commit 5232af5)
2016-07-25 09:40:34 +03:00
Dmitry Jemerov a979c7e1d7 ugly fix for failing tests. without the string template, KotlinFilePathReferenceContributor injects a file reference into the string literal, and an unrelated intention (AddAnnotationIntention) tries to resolve it. resolving the reference caches the default contexts in FIleReferenceSet, which caches the order entries of a module in an OrderRootsCache. this creates VirtualFilePointers which are for some reason not disposed properly. 2016-07-23 21:18:26 +02:00
Kirill Rakhman ce80f94830 Quickfix "Make primary constructor parameter a val" makes the val private now
Fixes #KT-13187
2016-07-23 14:32:25 +02:00
Yoshinori Isogai 8aaf28e240 KT-12887 Extend selection should select call's invoked expression (#904)
#KT-12887 fixed
2016-07-22 21:23:42 +03:00
Alexander Udalov 83000c50ff Remove quotes around visibility in invisible member diagnostic 2016-07-22 18:13:41 +03:00