Commit Graph

22801 Commits

Author SHA1 Message Date
Natalia Ukhorskaya c77d448832 Fix EA-68813: readAccess in JetPositionManager 2015-05-27 10:20:10 +03:00
Natalia Ukhorskaya 0fbcfddf4a Gradle: debug message prefix added 2015-05-27 10:20:09 +03:00
Denis Zharkov cab2328b64 Do not insert type parameters when replacing javaClass with T::class
Type parameters are invalid for class literal unless class is `Array`
2015-05-27 08:24:57 +03:00
Denis Zharkov eb80764d21 Introduce forceResolveLazyTypes into TypeResolutionContext
The main reason is to force type resolution when resolving
type arguments in class literal as annotation value argument:

@Ann(Array<String>::class) class Ann

`String` left unresolved unless this commit is applied.

Note, that currently forced calculations used only when bare types are allowed
as it's true for class literals resolution and currenlty it's enough.
2015-05-27 08:24:42 +03:00
Alexander Udalov f9556e584d Minor, suppress code conformance test for generated sources 2015-05-27 01:44:19 +03:00
Alexander Udalov 6ae7ed1cc4 Add some new tests on functions and extension functions 2015-05-27 01:44:19 +03:00
Alexander Udalov fae2d0231c Fix test data, restore incorrectly deleted import
It was mistakenly deleted in 738a84e and 48b18f1
2015-05-27 01:44:18 +03:00
Ilya Gorbunov 9c5844cf45 Restore mapping between PsiFiles and VirtualFiles, otherwise built-ins psi elements will become invalid in next test. 2015-05-27 00:58:46 +03:00
Ilya Gorbunov 84ca26719d Deprecate meaningless or vague-defined operations with Char operands.
Change expected test output.
2015-05-27 00:58:35 +03:00
Ilya Gorbunov c6abf75856 Do not generate primitive type definition for Char, place it in a file beside. 2015-05-27 00:58:24 +03:00
Ilya Gorbunov 5f319e69d8 Restore String.split(String, Int) overload and make it deprecated. 2015-05-27 00:36:30 +03:00
Ilya Gorbunov 1566ea83c7 Rename conflicting repeat function with the same behavior from js tests. 2015-05-26 23:23:39 +03:00
Ilya Gorbunov 310666a617 Deprecate times method taking integer and function. Provide top-level repeat method instead.
#KT-7074 Fixed.
2015-05-26 23:23:37 +03:00
Ilya Gorbunov 45c82f2844 map(): Take into account size of collection being transformed when allocating ArrayList.
#KT-7832 Fixed.
2015-05-26 23:23:36 +03:00
Ilya Gorbunov c9afb407f1 Provide isNotEmpty() extension function for Maps. 2015-05-26 23:23:34 +03:00
Ilya Gorbunov 01a0348685 Remove deprecated size property usage from generated code. 2015-05-26 23:23:32 +03:00
Alexey Sedunov 58ef7f2691 Extraction Engine: Suggest both bounds for nullability-flexible types without nullability annotations. Do not omit return type if inferred one is flexible
#KT-6837 Fixed
2015-05-26 22:42:46 +03:00
Alexey Sedunov 72205540d6 Extract Function: Show possible types for receiver in Extract Function/Introduce Lambda Parameter dialogs
#KT-7578 Fixed
2015-05-26 22:42:43 +03:00
Alexey Sedunov cb9b1019b2 Function <-> Property Intention: Fix conversion of recursive functions/property accessors
#KT-7823 Fixed
2015-05-26 19:29:09 +03:00
Alexey Sedunov 5afc6235cc Move: Do not update package directives in files that don't belong to source root
#KT-7824 Fixed
2015-05-26 19:29:08 +03:00
Alexey Sedunov 6a1ae8b911 Minor: Code cleanup 2015-05-26 19:29:07 +03:00
Alexey Sedunov cc351e55b0 Create from usage: Use type predicates provided by control-flow analysis to suggest more precise types
#KT-7742 Fixed
2015-05-26 19:29:06 +03:00
Alexey Sedunov c757701a87 Refactoring: Extract function getContainingPseudocode() 2015-05-26 19:29:05 +03:00
Alexey Sedunov b6ea2d4fd4 Control-Flow: Compute type predicates for arguments of unresolved calls 2015-05-26 19:29:04 +03:00
Alexey Sedunov 036e2c585b Refactoring: Introduce getReferenceTargets() function 2015-05-26 19:28:11 +03:00
Alexey Sedunov 640f07969a Refactoring: Extract createUnresolvedCall() functions 2015-05-26 19:28:10 +03:00
Alexey Sedunov 3d3b5591e1 Control-Flow: Improve debug text of ReadValueInstruction 2015-05-26 19:28:09 +03:00
Alexey Sedunov 868329e3cb Control-Flow: Fix pseudocode generation for combined get/set and invoke conventions
#KT-4462 Fixed
 #KT-4681 Fixed
2015-05-26 19:28:07 +03:00
Alexander Udalov fa29e75add Minor, move top level function to companion object
Package 'org.jetbrains.kotlin.idea.quickfix' already contains top level
functions in module 'idea-analysis' and top level functions in another module
cause compilation errors because of package facade class clash
2015-05-26 18:52:48 +03:00
Alexander Udalov 48b18f18d3 Restore explicit imports of Kotlin function types in Java
This is a follow-up to 738a84e259 and
d4965a4f3e. Optimize imports in all files
affected in those commits, drop temporary _.kt
2015-05-26 18:46:27 +03:00
Dmitry Jemerov 58e4ff0502 Add quickfixes for unnecessary casts and nullability operations to cleanup inspection. Rewrite two quickfixes from Java to Kotlin. Add inspection description. Use marker interface for identifying quickfixes applicable for code cleanup. 2015-05-26 14:41:23 +02:00
Dmitry Jemerov e2dbfebf32 add more quickfixes to cleanup action 2015-05-26 14:41:21 +02:00
Dmitry Jemerov 6e7ea662c8 "Code Cleanup" action to migrate all instances of deprecated syntax to new one 2015-05-26 14:41:21 +02:00
Mikhail Glukhikh 4570872bfd Postfix expression code generation fixed as per KT-7561.
A set of tests for KT-7561 on codegen side, including exotic inc() functions().
 #KT-7561 Fixed.
2015-05-26 15:20:37 +03:00
Mikhail Glukhikh 5723c2a077 Front-end fix: result type corrected for increment / decrement expressions. Smart cast allowed on a postfix increment result. See KT-7561.
Now result type is receiver type for postfix increment, or increment result type for prefix increment.
A set of relevant tests.
2015-05-26 15:20:25 +03:00
Alexander Udalov ea6d0b464d Report error when free function is called as extension 2015-05-26 15:05:04 +03:00
Svetlana Isakova 14c2690447 Distinguish between no declared arguments and an empty argument list
in a function literal
If there are no arguments, any number of them might be expected
2015-05-26 15:05:03 +03:00
Svetlana Isakova d9568ef88c Added special type constructor for function/ extension function
that stores an information about declared argument types
2015-05-26 15:05:02 +03:00
Alexander Udalov 79ee91c048 Download and build intellij-markdown when ABI version changes 2015-05-26 15:05:02 +03:00
Alexander Udalov 9ba6d91e2e Prepare JVM runtime for support of reflection on functions
Introduce abstract class FunctionReference, which is supposed to be a
superclass for all anonymous classes generated for function references. Each
anonymous subclass will have statically-generated symbol info, which will be
used by reflection to locate the symbol
2015-05-26 15:05:01 +03:00
Alexander Udalov 9aeae7ddc6 Extract FunctionReferenceGenerationStrategy to top level 2015-05-26 15:05:00 +03:00
Alexander Udalov d0bb06dbb0 Rename helper method in KotlinDebuggerTestBase
Now that functions and extension functions conform to each other, this method
began to conflict with the synthesized SAM-adapter from the super class (which
also can't be overridden by design)
2015-05-26 15:05:00 +03:00
Alexander Udalov 4d00077ffb Delete assertion on receiver presence in 'invoke'
#KT-6541 Fixed
 #KT-7383 Fixed
2015-05-26 15:04:59 +03:00
Alexander Udalov 34c6af0039 Advance stub and JVM ABI versions due to function type reform 2015-05-26 15:04:58 +03:00
Alexander Udalov 7f0b5029eb Refactor KotlinBuiltIns#isFunctionType/isExtensionFunctionType 2015-05-26 15:04:58 +03:00
Alexander Udalov 6a0a703539 Delete numbered ExtensionFunction classes and generation logic 2015-05-26 15:04:57 +03:00
Alexander Udalov 2186ce5e8d Degrade CFG test on values of extension function type
Apparently type annotations ('kotlin.extension' in particular) are lost
somewhere in control-flow values processor at the moment, so types may not be
as precise as they were when functions and extension functions had different
classifiers.

This test presumably only affects IDE functionality like 'Extract Method' in a
way that it will suggest a slightly incorrect function type for the parameter
of an extracted method. An issue is to be reported and fixed later upon demand
2015-05-26 15:04:56 +03:00
Alexander Udalov 49004a8b8e Conform functions to extension functions and vice versa
#KT-5989 Fixed
2015-05-26 15:04:56 +03:00
Alexander Udalov b08bd3bc67 Update FunctionImpl hack in Evaluate Expression and test data
Lambdas now have an additional superclass besides FunctionImpl: Lambda, which
should also be changed to inherit from MagicAccessorImpl
2015-05-26 15:04:55 +03:00
Alexander Udalov 4141e0a8df Introduce fictitious numbered Function class descriptors 2015-05-26 15:04:54 +03:00