Commit Graph

32827 Commits

Author SHA1 Message Date
Nikolay Krasko 033efbda41 Refactoring: move KtLightField interface to file with light elements 2016-07-28 18:00:46 +03:00
Pavel V. Talanov 0b4c6bd889 Drop PsiCodegenPredictor 2016-07-28 18:00:45 +03:00
Dmitry Petrov a08e70879f KT-13161 java static methods call not working for typealias
Introduce special qualifier for type aliases with member scope
containing static class members only.
2016-07-28 17:38:36 +03:00
Nikolay Krasko 5a5cd0e760 Refactoring: extract DebuggerClassNameProvider 2016-07-28 15:33:43 +03:00
Nikolay Krasko 50e196dfb9 Minor: invert if, clean up 2016-07-28 15:33:43 +03:00
Nikolay Krasko 097288d15f Refactoring: fix weak warning about unnecessary escaped dot 2016-07-28 15:33:43 +03:00
Nikolay Krasko e7ee0d1c5e Refactoring: extract pattern to variable and add language injection 2016-07-28 15:33:43 +03:00
Nikolay Krasko 071285fad7 Refactoring: additional changes in smap functions and KotlinExceptionFilter 2016-07-28 15:33:43 +03:00
Nikolay Krasko f71e24403f Refactoring: working with smap methods 2016-07-28 15:33:43 +03:00
Nikolay Krasko fcf0b7a66c Refactoring: extract functions working with smap to separate file 2016-07-28 15:33:43 +03:00
Mikhail Glukhikh 6e391854a0 Data flow values refactoring: removed DataFlowValue.kind.isStable, renamed DataFlowValue.isPredictable -> DataFlowValue.isStable 2016-07-28 15:14:48 +03:00
Denis Zharkov 915e36cb02 Add Map.getOrDefault method as PlatformDependent declaration with refined signature
- First parameter should have type of K instead of Any
- Special bridge should return second parameter if a key has wrong type
- Special bridge may throw an exception if defaultValue has wrong type

 #KT-13209 Fixed
2016-07-27 18:46:13 +03:00
Denis Zharkov 169acf2f31 Refine method's contract and rename it
Basically what's it checked before is that
receiver is a valid override of raw version of builtinWithErasedParameters

While we need to check that method has the same JVM descriptor as builtinWithErasedParameters,
but it's not a valid override of latter

It's important for 'getOrDefault(Object k, V value)' ('getOrDefault(K k, V value)' in Kotlin):
'getOrDefault(Object k, V value)' is not override of 'getOrDefault(Object k, Object value)',
that leads to incorrect loading of former method (like it's not an override of declaration in Map)
2016-07-27 18:46:13 +03:00
Denis Zharkov 15b94bb8df Minor. Move method closer to it's usage and simplify it 2016-07-27 18:46:13 +03:00
Denis Zharkov f2cb86c3f6 Minor. Fix testData 2016-07-27 18:46:13 +03:00
Alexey Andreev efb5a9eca6 KT-13160: when decomposing assignment with lhs like array[index], extract array instead of supporting only qualifier.name` 2016-07-27 18:28:28 +03:00
Mikhail Glukhikh 4f7d8e34b0 Data flow values: initializers for local variables are now stored as "bound values" with inherited nullability #KT-6840 Fixed 2016-07-27 16:24:50 +03:00
Mikhail Glukhikh 7090abddcd Data flow values: variable-based are no more compared with taking kind into account 2016-07-27 16:24:46 +03:00
Mikhail Glukhikh f96b9ddbf5 Minor: unused imports in IdentifierInfo 2016-07-27 16:24:41 +03:00
Mikhail Glukhikh e515d7f773 Data flow analysis: unnecessary assignment removed (related to complex expressions) 2016-07-27 16:24:36 +03:00
Mikhail Glukhikh 1c9f08e986 Data flow values: STABLE_COMPLEX_EXPRESSION kind is removed, no use cases exist for them 2016-07-27 16:24:32 +03:00
Mikhail Glukhikh c7af3f7865 Data flow values: more accurate handling of postfix ++ and -- 2016-07-27 16:24:27 +03:00
Mikhail Glukhikh 7c66f632ca Receiver smart casts: additional test for a?.b() when b is invokable property 2016-07-27 16:24:23 +03:00
Mikhail Glukhikh 692623cb55 Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X) 2016-07-27 16:24:18 +03:00
Dmitry Petrov 26c8bc87fd KT-13241 Indices optimization leads to VerifyError with smart cast receiver
Use expected receiver type from the corresponding extension function.
2016-07-27 13:21:22 +03:00
Stanislav Erokhin f3be1b8f1f Add assertion for variable as function call with explicit type parameters. 2016-07-27 13:17:15 +03:00
Mikhail Glukhikh b56e84d47f Cast never succeeds: special 'Nothing' / 'Nothing?' case
(cherry picked from commit 63435b4)
2016-07-27 10:52:13 +03:00
Mikhail Glukhikh bf4231d65a Standard library regenerated
(cherry picked from commit 68af26c)
2016-07-27 10:52:01 +03:00
Mikhail Glukhikh 94029393cb kotlin-stdlib-gen: UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS
(cherry picked from commit feab6f3)
2016-07-27 10:51:51 +03:00
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