Compare commits

...

6904 Commits

Author SHA1 Message Date
Anton Bannykh
495dca504d wip 2016-11-17 19:51:31 +03:00
Anton Bannykh
0dc9121a91 JS property accessors inlining (KT-13456) 2016-11-17 15:25:29 +03:00
Nikolay Krasko
56ef09c09c Fix null pointer in evaluate expression (EA-87276) 2016-11-17 14:57:34 +03:00
Dmitry Petrov
0205a122f4 Treat nested mock type aliases as inner (same as for mock classes). 2016-11-17 14:42:32 +03:00
Alexey Andreev
f4011ecb3d JS: regenerate tests 2016-11-17 14:41:17 +03:00
Nikolay Krasko
6f95667f54 Better diagnostic for inlined line under dex on step over 2016-11-17 13:47:27 +03:00
Nikolay Krasko
2817e1a5f1 Avoid failure on first() call 2016-11-17 13:47:23 +03:00
Nikolay Krasko
a13e878c9b Pre-count line numbers
(cherry picked from commit 5412723e023768d308190f43edd5378476ad35c4)
2016-11-17 13:47:21 +03:00
Nikolay Krasko
0032818ec6 Step over locations after return in dex debug when no return position found by locations 2016-11-17 13:47:20 +03:00
Nikolay Krasko
a2652832e3 Step over locations after return in dex debug 2016-11-17 13:47:18 +03:00
Nikolay Krasko
f07b5eaea1 Refactorings: clean smapUtil, moves, renames 2016-11-17 13:47:17 +03:00
Nikolay Krasko
1c955a64f3 Cache debug information from bytecode in Android debug 2016-11-17 13:47:15 +03:00
Nikolay Krasko
78c76a2ca4 Allow to place breakpoints in inline functions defined in android tests 2016-11-17 13:47:13 +03:00
Nikolay Krasko
ae2e857843 Refactoring: remove lambda parameter from readClassFile() 2016-11-17 13:47:11 +03:00
Nikolay Krasko
623ee316c0 Fix step over for inlined functions in Android Studio (KT-14374)
#KT-14374 Fixed
2016-11-17 13:47:10 +03:00
Nikolay Krasko
f87779bfb0 Fail if it was impossible to delete cache directory
For example it can be caused by open handler to file on Windows.
2016-11-17 13:47:08 +03:00
Alexey Andreev
f2d7b1a5fd JS: unmute shared box tests 2016-11-17 13:29:26 +03:00
Anton Bannykh
5b078fb236 JS: augmented assignments and increments (KT-14810) fixed 2016-11-17 13:21:49 +03:00
Alexey Andreev
d2fdc7ffc0 JS: when both clauses of if become empty during optimization, remove if entirely. Make condition and then clause of JsIf non-nullable. Fix #KT-13912 2016-11-17 12:20:37 +03:00
Alexey Andreev
b5358122e2 JS: unmute shared box tests 2016-11-16 19:50:10 +03:00
Alexey Andreev
e2dc7ba37e JS: coroutines: fixes after code review 2016-11-16 19:29:39 +03:00
Alexey Andreev
43525abda3 JS: don't treat return, break and continue as split points when possible 2016-11-16 19:29:38 +03:00
Alexey Andreev
14729b0f0e JS: fix exception handling in coroutines when initializing via resumeWithException 2016-11-16 19:29:38 +03:00
Alexey Andreev
bb61fb0a91 JS: refactor coroutine transformer 2016-11-16 19:29:37 +03:00
Alexey Andreev
d41d09ffc4 JS: add metadata for generated continuation classes to properly implement RTTI 2016-11-16 19:29:37 +03:00
Alexey Andreev
6860b2c057 JS: prevent generation of excessive updates of state fields 2016-11-16 19:29:36 +03:00
Alexey Andreev
4c0eb8fc31 JS: prevent generation of excessive this.$result statements in coroutines 2016-11-16 19:29:36 +03:00
Alexey Andreev
2d315c3df8 JS: coroutines: fix translation of try/finally block without catch 2016-11-16 19:29:35 +03:00
Alexey Andreev
0015f7518e JS: improve dead code elimination to handle switch case bodies 2016-11-16 19:29:35 +03:00
Alexey Andreev
22aea1cf12 JS: fix translation of return statement surrounded by finally block. Temporarily suppress corresponding test case for JVM backend 2016-11-16 19:29:34 +03:00
Alexey Andreev
eae0ceed86 JS: add coroutines tests 2016-11-16 19:29:34 +03:00
Alexey Andreev
2cc299fb40 JS: refactor coroutines to support inlining of suspend functions 2016-11-16 19:29:34 +03:00
Alexey Andreev
e56d735723 JS: refactor how last argument to suspend call is substituted 2016-11-16 19:29:33 +03:00
Alexey Andreev
050a1e782e JS: fix translation of call to suspend function with optional parameters 2016-11-16 19:29:33 +03:00
Alexey Andreev
3e436d42bf JS: allow to call non-suspend controller functions from coroutine lambda 2016-11-16 19:29:32 +03:00
Alexey Andreev
e7f044be92 JS: enable coroutine tests that don't enter infinite loop anymore 2016-11-16 19:29:32 +03:00
Alexey Andreev
d5a808dff6 JS: implementing try/finally in coroutines 2016-11-16 19:29:31 +03:00
Alexey Andreev
23bddac4fe JS: fix translation of catch blocks so that all references to exception variable are referentially equivalent to each other 2016-11-16 19:29:31 +03:00
Alexey Andreev
674e5df7f1 JS: make coroutine tests cross-platform 2016-11-16 19:29:30 +03:00
Alexey Andreev
c5999e8375 JS: prototyping coroutines 2016-11-16 19:29:27 +03:00
Alexander Udalov
be8b1b7dfd Exclude org.jetbrains.kotlin.container.** from proguard
To mitigate #KT-14824
2016-11-16 19:07:03 +03:00
Ilya Gorbunov
4769ed5f79 Fix imports in tests: do not use java.util.* stuff 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
ae903e9ce7 QuickDocNavigationTest: use stdlib members instead of JDK ones. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
8f3e6f38ed Select runtime with directive in test data file instead of test name in PsiChecker tests 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
d103657e07 Fix JS completion tests: remove unneeded imports, take care about type aliases looking different in completion. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
e787930673 Fix completion handler tests: use tail specifier to select one of multiple completion variants (eg 'kotlin.collections.ArrayList' vs 'java.util.ArrayList').
Replace aliased types imported by default with something else.
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
a62cda8365 Replace types that are imported by default via typealiases such as java.util.ArrayList with something else as it conflicts now with kotlin.collections.ArrayList and has to imported explicitly. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
b7e2649b91 Tests: ArrayList is now available by default, so change the type being imported.
Improve test to ensure it's found before removing import directive.
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
daac46bce5 Fix rendering in test output after introducing type aliases for the types used in those tests. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
ed3c54dbd0 Include new type aliases into mock runtime. 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
b556adf8db Move/alias Appendable and StringBuilder to kotlin.text
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
5c2fe13a89 Refer to java.util.Arrays fully-qualified in generated code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
fae5c88f22 Remove java.util references from the common code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov
63535393e7 Move Comparator to kotlin.comparisons and make it imported by default.
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov
090bd76ac9 Introduce type aliases for jvm collections in kotlin.collections
#KT-2084
2016-11-16 18:47:42 +03:00
Stanislav Erokhin
3d7d6e4204 Fix EA-86841 and EA-79267.
(cherry picked from commit fcf9bfd)
2016-11-16 18:13:05 +03:00
Vyacheslav Gerasimov
c6d668e243 Fixed "should not analyze element" problem with destructuring declarations in uast 2016-11-16 18:05:31 +03:00
Vyacheslav Gerasimov
55f14ba8c0 Fixed method parameter default value processing in uast 2016-11-16 18:05:22 +03:00
Vyacheslav Gerasimov
d90ec3e777 Fixed KotlinLintTestGenerated.testJavaPerformance + refactoring
Moved android lint tests from uast-kotlin to idea-android
2016-11-16 18:05:09 +03:00
Alexander Udalov
3d75b78dc5 Use IOUtil instead of DataOutput for readUTF/writeUTF in file based index
It uses less space and also may be a little bit faster
2016-11-16 16:30:34 +03:00
Natalia Ukhorskaya
0fb5a18a26 Debugger: refactor smart step into to use descriptors instead of psi elements (KT-13485)
#KT-13485 Fixed
2016-11-16 15:20:00 +03:00
Dmitry Petrov
f7203da2d6 Type inference SHOULD NOT work for type alias constructor in supertypes list
(same as for classes: type arguments should be provided explicitly).
2016-11-16 14:11:14 +03:00
Dmitry Petrov
cd8b5dcb00 Constructors for inner type aliases: add a failing test (no way to invoke such constructor at the moment). 2016-11-16 14:11:14 +03:00
Dmitry Petrov
718e8ebf9e Inner type aliases.
Type alias is considered "inner" if it captures outer class type parameters (implicitly or explicitly).
2016-11-16 14:11:14 +03:00
Mikhael Bogdanov
63fed20249 Fix VerifyError on android with 'inv' operation on Byte and Short 2016-11-16 09:42:26 +01:00
Dmitry Jemerov
5b44343d15 Fix compilation: add required transitive dependency 2016-11-15 22:05:35 +01:00
Zalim Bashorov
eda8749b91 Mute without checks all diagnostic tests for tailrec since it's not supported in JS yet and it takes too much time when muted with checks 2016-11-15 22:11:09 +03:00
Zalim Bashorov
bde9f99d7c Unmute already worked tests and regenerate tests 2016-11-15 22:11:09 +03:00
Zalim Bashorov
8c3d2872c3 Generate right code to check that muted test is failed 2016-11-15 22:11:09 +03:00
Dmitry Jemerov
cc6722ad78 fix build script 2016-11-15 16:49:47 +01:00
Dmitry Jemerov
3d3c3b9ebb add Gradle wrapper to project 2016-11-15 16:42:57 +01:00
Dmitry Jemerov
b7ff16757a Allow to specify path to upload plugins from 2016-11-15 16:25:18 +01:00
Dmitry Jemerov
bc4d7b2a6e Remove cyclic dependency between idea-maven and idea modules: move constants for stdlib IDs to shared code 2016-11-15 15:33:20 +01:00
Anton Bannykh
b185715aeb Removed reified to fix the bootstrap. The @library annotation prevents from making the function inline. 2016-11-15 16:50:58 +03:00
Ilya Gorbunov
09072f6cdc Remove toInt() conversion as it's hardly required.
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov
8de67d039b Expose maximum version component value as a constant, increase it to 255.
Add tests for KotlinVersion, document remaining parts of API.
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov
5f7d779370 Introduce KotlinVersion API
#KT-14789
2016-11-15 16:38:52 +03:00
Mikhail Zarechenskiy
7103624308 Do not force resolve from type constructor
In case of creating context for something like 'class Foo(f: Bar)'
there is no need in resolving supertypes/annotations of Bar type
2016-11-15 14:57:50 +03:00
Dmitry Jemerov
53cb559440 Fix exception on databinding-generated classes in AS 2.3 (https://ea.jetbrains.com/browser/ea_reports/1261189) 2016-11-15 12:47:45 +01:00
Anton Bannykh
334ae72957 Moved checking that reified is used in inlines only to the main frontend (KT-12695, KT-13697 fixed) 2016-11-15 13:44:48 +03:00
Alexey Andreev
08f0636d39 JS: fix AMD emulation in Maven tests 2016-11-15 12:28:33 +03:00
Alexander Udalov
eedad9194e Drop KParameter.isNoinline, KParameter.isCrossinline
There seems to be no valuable use cases for them at the moment
2016-11-15 11:01:17 +03:00
Alexander Udalov
7e82d139cf Drop KFunction.isTailrec
The fate of this modifier seems unclear, and there doesn't seem to be any
valuable use cases for it in reflection
2016-11-15 11:01:16 +03:00
Denis Zharkov
5e73dc4a4c Minor. Invert 'notLocal' boolean value parameter
- Mainly to avoid double negations (!notLocal)
- Also swap last parameters (to allow use of named arguments)
2016-11-15 09:30:13 +03:00
Denis Zharkov
b5a6cbd188 Adjust "Remove explicit type" intention to properties with getters
#KT-14794 Fixed
2016-11-15 09:30:13 +03:00
Denis Zharkov
e25c4b96ad Add test for specify type explicitly when it can be inferred from getter
#KT-14794 In Progress
2016-11-15 09:30:13 +03:00
Denis Zharkov
6fca46a452 Allow inferring property type from its getter
#KT-550 Fixed
2016-11-15 09:30:13 +03:00
Denis Zharkov
51a5bf9f7e Minor. Drop redundant parameters of 'inferReturnTypeFromExpressionBody'
Both storageManager and expressionTypingServices must be the same instances
inside the resolution session and can be obtained from the DescriptorResolver fields
2016-11-15 09:30:13 +03:00
Denis Zharkov
77c524de33 Minor. Remove redundant if
'inType' var is guaranteed to be not-null
2016-11-15 09:30:13 +03:00
Denis Zharkov
96fa04569a Minor. Simplify variable type resolution 2016-11-15 09:30:13 +03:00
Denis Zharkov
e21ecbe702 Minor. Split method VariableTypeResolver.process
It looks much natural to differ type resolution and setting
compile time initializer to descriptor
2016-11-15 09:30:13 +03:00
Nikolay Krasko
bce023c8ad Make patch of obfuscated field in ThreadTracker more stable 2016-11-14 21:25:50 +03:00
Dmitry Jemerov
7beee33f05 Read bundled runtime version from build.txt in 'kotlinc' directory, not from plugin version 2016-11-14 18:51:36 +01:00
Ilya Gorbunov
e1cf89a956 Remove also Long/Char mixing binary operation intrinsics 2016-11-14 20:40:32 +03:00
Ilya Gorbunov
61e83a4db5 Remove obsolete range-related intrinsics from JS translator. 2016-11-14 20:40:32 +03:00
Mikhail Glukhikh
b850d71e17 Replace single line let: application on IDEA + front-end modules 2016-11-14 18:47:23 +03:00
Mikhail Glukhikh
09ae1f1a5d False positive removed in replace single line let intention #KT-14791 Fixed 2016-11-14 18:47:18 +03:00
Mikhael Bogdanov
61da8be260 Generate parameters metadata for java 8 reflection 2016-11-14 14:27:08 +01:00
Mikhael Bogdanov
7721aa189f Update proguard to 5.3 version 2016-11-14 14:27:08 +01:00
Dmitry Jemerov
3f7b9745b4 Fix race condition with synthetic files facade calculation in Upsource (UP-8046) 2016-11-14 12:56:34 +01:00
Ilya Gorbunov
b96deac09c Annotate TYPEALIAS annotation target being available since Kotlin 1.1 2016-11-14 01:04:31 +03:00
Alexey Tsvetkov
f381f1e699 Revert default value for "main" parameter for Gradle JS plugin to "call"
#KT-14724 fixed
2016-11-11 21:25:05 +03:00
Dmitry Jemerov
ab0af43a6a Update proguard file for compatibility with new Snappy version in IDEA 162-SNAPSHOT 2016-11-11 18:15:29 +01:00
Dmitry Jemerov
978b70e50b Add test for KT-14751 2016-11-11 18:15:24 +01:00
Dmitry Jemerov
13a17b8bd7 Use 162.SNAPSHOT builds for IDEA to pick up fix for IDEA-162379 2016-11-11 18:14:54 +01:00
Alexander Udalov
0b6ad3bc07 Use target platform configured in facet in module analysis 2016-11-11 19:00:12 +03:00
Alexander Udalov
26a6ce9a31 Rename JVMPlatform and JSPlatform and make them nested in TargetPlatformKind
To avoid confusion with JvmPlatform and JsPlatform from frontend.java and
js.frontend respectively
2016-11-11 19:00:12 +03:00
Alexander Udalov
d0f31a2bc2 Minor, rename targetPlatformKindKind -> targetPlatformKind 2016-11-11 19:00:11 +03:00
Alexander Udalov
1ce8ed907c Use TargetPlatformDetector.getPlatform instead of ProjectStructureUtil.isJsKotlinModule
The reason for this is to make the choice of the platform more explicit now
that there are more platforms than just JVM and JS (default platform, and also
possibly native in the future)
2016-11-11 19:00:10 +03:00
Alexander Udalov
0d4bd2a673 Use OperatorNameConventions constants instead of hardcoded literals 2016-11-11 19:00:09 +03:00
Alexander Udalov
61767bb0ea Minor, annotate visibility constants with NotNull
To avoid nullability warnings on ClassDescriptor#getVisibility and
implementations
2016-11-11 19:00:08 +03:00
Alexander Udalov
65882579bc Minor, add toString() for debug 2016-11-11 19:00:08 +03:00
Alexander Udalov
9e9c548ca3 Minor, print more debug info on serializing error annotation 2016-11-11 19:00:07 +03:00
Valentin Kipyatkov
0ef5f662ad KT-14732 Slow typing, copy-pasting, highlighting in Kotlin files due to auto-import suggestion calculation in EDT
#KT-14732 Fixed
2016-11-11 16:45:14 +03:00
Dmitry Jemerov
3d3a202601 KotlinWithGradleConfigurator: cleanup after J2K 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
47c80a1ad1 KotlinWithGradleConfigurator: J2K 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
11c9dff97a KotlinWithGradleConfigurator: rename to .kt 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
3d01e92dd6 use DOM instead of MavenProjectsManager to detect whether Kotlin is configured (KT-9275) 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
ebbf8888bb Change KotlinProjectConfigurator API to return module status as a single enum instead of two distinct boolean values 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
d8c7f2ffdb KotlinProjectConfigurator: J2K 2016-11-11 14:39:18 +01:00
Dmitry Jemerov
7d442f9ca2 KotlinProjectConfigurator: rename to .kt 2016-11-11 14:39:18 +01:00
Alexey Andreev
f2c392d4e7 JS: minor fix after rebase 2016-11-11 16:26:41 +03:00
Alexey Andreev
6649e0cb82 JS: remove intrinsics for progressions 2016-11-11 16:26:40 +03:00
Alexey Andreev
dcb95eb9f0 JS: refactor range and progression related intrinsics 2016-11-11 16:26:40 +03:00
Alexey Andreev
5ef8879aae JS: fixes after code review 2016-11-11 16:26:39 +03:00
Alexey Andreev
a72ea64142 JS: fix translation of lambdas in public inline functions; fix AMD emulation for Ant test 2016-11-11 16:26:39 +03:00
Alexey Andreev
6791ed7bf3 JS: fix obsolete tests 2016-11-11 16:26:38 +03:00
Alexey Andreev
a452260da6 JS: simplify merging kotlin.js 2016-11-11 16:26:38 +03:00
Alexey Andreev
ac4bfc645e JS: refactor translation of callable references to top-level properties 2016-11-11 16:26:38 +03:00
Alexey Andreev
0252fe57af JS: refactor flat declaration generator. Add more tests on inter-module dependencies 2016-11-11 16:26:37 +03:00
Alexey Andreev
cc38bd3146 JS: refactor code that exports local declaration from current module 2016-11-11 16:26:37 +03:00
Alexey Andreev
f244bbaae3 JS: change how declarations are exported from modules. Change how parts of kotlin.js merged 2016-11-11 16:26:36 +03:00
Alexey Andreev
3d9beb15da JS: fix translation of !! operation 2016-11-11 16:26:36 +03:00
Alexey Andreev
cacd917350 JS: fix translation of extension properties 2016-11-11 16:26:36 +03:00
Alexey Andreev
0f87703c87 JS: rewrite code that copies interface members with implementation to subtypes 2016-11-11 16:26:35 +03:00
Alexey Andreev
8eca8efae5 JS: fix some bugs:
1. Fix translation of FQN in inline lambdas
2. Fix StringBuilder.length
3. Workaround order of declaration of names for imported declarations
2016-11-11 16:26:35 +03:00
Alexey Andreev
fd158a6922 JS: refactor Dart AST 2016-11-11 16:26:34 +03:00
Alexey Andreev
bec1e526a1 JS: fix generation of bridge methods for non-abstract methods inherited from interfaces 2016-11-11 16:26:34 +03:00
Alexey Andreev
bb57eaef96 JS: fix some minor issues in new flat translator 2016-11-11 16:26:34 +03:00
Alexey Andreev
06476402a2 JS: support enums in flat JS structure 2016-11-11 16:26:33 +03:00
Alexey Andreev
54925e7f83 JS: remove test for reserved words 2016-11-11 16:26:33 +03:00
Alexey Andreev
38a3f4af80 JS: fix Kotlin.isType for case of traits 2016-11-11 16:26:32 +03:00
Alexey Andreev
20396b0e5f JS: fix inlining in a new flat JS generator 2016-11-11 16:26:32 +03:00
Alexey Andreev
e13d34e08d JS: rewrite stdlib to compile with new flat structure 2016-11-11 16:26:31 +03:00
Alexey Andreev
f9a392fdec JS: introduce new flat JS declaration structure 2016-11-11 16:26:31 +03:00
Zalim Bashorov
f1ae9949fe Regenerate tests 2016-11-11 15:49:09 +03:00
Dmitry Petrov
b429f7bc86 KT-14581 Make FixStackAnalyzer tolerant to uninitialized values 2016-11-11 13:30:15 +03:00
Alexey Andreev
71ef8c4f89 JS: fix exception in JS front-end when checking JsName that was resolved with errors 2016-11-11 11:11:19 +03:00
Ilya Chernikov
d2ba25e758 Fix script util test 2016-11-10 23:37:09 +01:00
Dmitry Petrov
6876f0e4d2 Support type aliases as bare types after 'is/as'. 2016-11-10 18:33:50 +03:00
Mikhael Bogdanov
21f2febf82 Fix for KT-13557: VerifyError with delegated local variable used in object expression
#KT-13557 Fixed
2016-11-10 15:12:16 +01:00
Dmitry Jemerov
e68dcdcc1e Fix companion object definition in the grammar (KT-8566) 2016-11-10 13:40:57 +01:00
Dmitry Jemerov
2c989b5671 Fix enumEntries definition in grammar (KT-14261) 2016-11-10 13:40:49 +01:00
Dmitry Jemerov
a0b6b3c248 Fix labelDefinition link in grammar (KT-14262) 2016-11-10 13:40:31 +01:00
Dmitry Petrov
37eedc3703 Hack: do not add trivial constraints (t <: Any?) for constituent types,
otherwise nested calls handling logic in old inference wouldn't work for type alias constructors.
2016-11-10 14:54:11 +03:00
Dmitry Petrov
549ae59562 Inference for type alias constructor type arguments: better error reporting. 2016-11-10 14:54:11 +03:00
Dmitry Petrov
94d7bd7a6b KT-14641: Nested type alias reference via an instance is an error. 2016-11-10 14:54:11 +03:00
shiraji
a662d777e8 Implement "Remove redundant '.let' call" binary operator support #KT-14396 Fixed 2016-11-10 14:26:14 +03:00
Mikhail Glukhikh
ce72337ebd Effective visibility is now considered private for invisible fake #KT-14469 Fixed 2016-11-10 13:42:58 +03:00
Zalim Bashorov
afa58599ec Specify target backend as JVM for SAM tests; mute other failed tests and regenerate tests. 2016-11-10 13:27:54 +03:00
Denis Zharkov
24819a079b Change resolution scope for componentX in lambda parameters
Component-functions are resolved in the same scope as the first statement of the lambda, but lambda receiver was not available

 #KT-14692 Fixed
2016-11-10 10:33:42 +03:00
Mikhail Zarechenskiy
6656bf835f Perform resolve of constructor parameters during partial constructor resove
#KT-13354 Fixed
2016-11-09 23:00:25 +03:00
Zalim Bashorov
41bd276814 Mute some new tests for JS and regenerate tests 2016-11-09 21:51:33 +03:00
Zalim Bashorov
4c8f5e4540 Regenerate ultimate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
6db0eec6cc Regenerate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
5500f80d0b Support ignoring by target backend for single generated classes 2016-11-09 21:41:12 +03:00
Zalim Bashorov
af4ec9815b Add ability to ignore test for backend w/o checks
It used for the tests from this commit becouse they was failing during setup.
2016-11-09 21:41:12 +03:00
Zalim Bashorov
a27572af49 Fix failed tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
1dedb38481 Regenerate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
8e480e275b Ignore files with incompatible target when check that all test are presented 2016-11-09 21:41:12 +03:00
Zalim Bashorov
0ecb13b150 Move TargetBackend to tests-common module 2016-11-09 21:41:12 +03:00
Zalim Bashorov
a1730f98ba Don't generate test when target backend is not suitable 2016-11-09 21:41:12 +03:00
Zalim Bashorov
f382f938c7 Fail when ignored test success in generated tests
#KT-14618 Fixed
2016-11-09 21:41:12 +03:00
Zalim Bashorov
afe6ec92a4 Break infinity loop in the test 2016-11-09 21:41:12 +03:00
Zalim Bashorov
584798d3cd Regenerate tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
ee129bebb6 Automatically mute failed generated tests from compiler/testData/codegen/box/ranges 2016-11-09 21:41:12 +03:00
Zalim Bashorov
596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Zalim Bashorov
a35a1f6f5a KJS: run all codegen/box tests 2016-11-09 21:41:12 +03:00
Denis Zharkov
55508afb8c Make initial continuation able to be resumed with exception
#KT-14719 Fixed
2016-11-09 16:26:32 +03:00
Denis Zharkov
ae70a60a0a Validate label value of coroutine in case of no suspension points
#KT-14718 Fixed
2016-11-09 16:26:32 +03:00
Dmitry Jemerov
46b91365ba Script for uploading the Kotlin plugin to plugins.jetbrains.com 2016-11-09 13:57:40 +01:00
Ilya Chernikov
6e96d192bf Move incremental components to compller util to reduce dependencies of compiler interface modules 2016-11-09 11:09:32 +01:00
Denis Zharkov
da5c81448b Add CoroutineImpl to rendered public API 2016-11-09 12:25:31 +03:00
Denis Zharkov
50a5c08603 Optimize visibility for controller field in CoroutineImpl
While it's impossible to declare a property with protected field and public
getter we split these entities

- `_controller` field is used inside coroutines
- `controller` getter is used for accesing controller from noinline lambdas
 (also it can be used to obtain controller from continuation by explicit cast)
2016-11-09 12:25:31 +03:00
Denis Zharkov
020bab1d7c Minor. Get rid of possible exception when no runtime in class-path
This change is made under the assumption that some version of built-in
classes will always be available through `module.builtIns.getBuiltInClassByFqName`
2016-11-09 12:25:31 +03:00
Denis Zharkov
bd5c08f598 Make fields for storing lambda parameters non-final
Because they get assigned within `invoke` call that contradicts with JVM spec
where it's told that they must not be assigned outside of constructors
2016-11-09 12:25:31 +03:00
Denis Zharkov
e54b466010 Make fields representing variables in coroutines non-volatile
#KT-14636 Fixed
2016-11-09 12:25:31 +03:00
Denis Zharkov
7e49db8768 Introduce CoroutineImpl as a common super class for coroutines
The main benefit are class-files sizes for them
(not repeating the same declaration for each coroutine)
Also it helped to simplify coroutine codegen code a little

Note that controller/label field become non-volatile (see KT-14636)

 #KT-14636 In Progress
2016-11-09 12:25:31 +03:00
Denis Zharkov
fc9605b94e Minor. Drop unused property in GenerationState 2016-11-09 12:25:31 +03:00
Dmitry Petrov
03d8aa272b Infer type arguments of type alias constructors. 2016-11-09 10:48:07 +03:00
Valentin Kipyatkov
9b55ad82a0 KT-14370 Completion inserts fully qualified name for any Java interface with single abstract method (SAM-interface)
#KT-14370 Fixed
2016-11-08 19:14:41 +03:00
Valentin Kipyatkov
b8981ec546 Minor 2016-11-08 19:14:41 +03:00
Valentin Kipyatkov
869b177823 Introduced KtExpression.analyzeAsReplacement() utility 2016-11-08 19:14:40 +03:00
Valentin Kipyatkov
e850446f17 Introduced BindingContext.DATA_FLOW_INFO_BEFORE 2016-11-08 19:14:40 +03:00
Mikhail Zarechenskiy
3df5efb236 Introduce language feature: underscores in numeric literals
#KT-2964 Fixed
2016-11-08 19:04:53 +03:00
Mikhail Zarechenskiy
a77290e572 Lexer: support underscores in numeric literals 2016-11-08 18:46:51 +03:00
Mikhail Zarechenskiy
c956428d96 Update JFlex to 1.7.0
Previous patched version (1.4.3) from Itellij was dropped. As we are using skeleton from Intellij, we should update our jflex version accordingly
2016-11-08 18:46:51 +03:00
Ilya Gorbunov
8feaaf4df0 Allow to annotate generated API with SinceKotlin and annotate new array functions. 2016-11-08 18:08:59 +03:00
Ilya Gorbunov
dceec89572 JS: Array.toString is const, Array.contentToString is shallow, Array.contentDeepToString is deep and self-reference aware
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov
f3da656d6e contentEquals, contentHashCode, contentToString: Add js implementation and tests
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov
a868eecb1a Introduce contentEquals/HashCode/ToString for Arrays. Different methods for deep equals/hashCode/toString rather than overloads with a parameter, because most of the time it would be constant, and make these methods inline-only.
Make `contentEquals` infix function.
Add docs.
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov
ab2facf030 Remove special source generation for js stdlib, use same template, rename generated file. 2016-11-08 17:23:45 +03:00
Valentin Kipyatkov
8cd35f67fd More correct implementation of addImportingScopes 2016-11-08 12:51:34 +03:00
Valentin Kipyatkov
109ec11d51 Changes after rebase on master 2016-11-08 12:46:46 +03:00
Valentin Kipyatkov
4915b049c4 Extracted methods 2016-11-08 12:46:46 +03:00
Valentin Kipyatkov
85e1e53354 Checking for unsupported return's 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
779ed32a4b Renames + merged all back into module idea 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
e5748f7a86 Renames 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
4c4c85e37a Supported unit return type functions 2016-11-08 12:46:45 +03:00
Valentin Kipyatkov
152e77bad3 Added comment 2016-11-08 12:46:44 +03:00
Valentin Kipyatkov
553bb6281b Extracted method 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
a42be4f60f Refactoring 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
6168e50e7d Other way of handling post-insertion actions 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
08c6a21ac1 Handling safe calls of multi-statement function 2016-11-08 12:46:43 +03:00
Valentin Kipyatkov
330d3a255a introduceValue() always adds statement before except for safe call case 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
8f9f2027f2 Adding block to control structure when needed 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
a4aa9bab8d Very basic version of inline function for block body 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
66c815968b Refactoring 2016-11-08 12:46:42 +03:00
Valentin Kipyatkov
3b97a3feb1 Supported case when explicit function type is used 2016-11-08 12:46:41 +03:00
Valentin Kipyatkov
9490d1bb1c Reused code of analyzeInContext 2016-11-08 12:46:41 +03:00
Valentin Kipyatkov
129b4b507f Made not data class 2016-11-08 12:46:41 +03:00
Valentin Kipyatkov
7df3c577f5 Refactored ConstructedExpressionWrapper into ConstructedExpressionHolder merging it with CallKindHandler 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
ca28d02300 Minor 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
1e9ce5b10f Moved nested classes out 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
dc04263aeb Minor 2016-11-08 12:46:40 +03:00
Valentin Kipyatkov
0932e178e2 Made private 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
57411b4d5e Supported inline function for expression body case 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
67e5ed802f More correct 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
7324ae145e Refactoring 2016-11-08 12:46:39 +03:00
Valentin Kipyatkov
f2b32f6d90 Minor refactoring 2016-11-08 12:45:29 +03:00
Valentin Kipyatkov
02f4b883f9 One more code refactoring 2016-11-08 12:45:28 +03:00
Valentin Kipyatkov
29175e96e9 Code refactoring 2016-11-08 12:45:28 +03:00
Alexander Udalov
8c65379711 Support injecting custom module into KotlinBuiltIns
Provide a command-line option to load built-ins from the module and its
dependencies instead of looking for them in kotlin-compiler.jar; built-ins must
be found this way, or an error will be reported (or, most likely at this
moment, an exception will be thrown).

Note that this does not affect whether built-ins (loaded from one place or the
other) are added to the _dependencies_ of the module, this is controlled by
another option. The option added in this commit only makes the KotlinBuiltIns
instance which is used via ModuleDescriptor throughout the compiler front-end
(and also injected in a bunch of places) a sort of "helper" which always goes
to that same module to find descriptors for built-in classes
2016-11-08 12:14:24 +03:00
Alexander Udalov
7898e2447d Minor, rename JVMConfigurationKeys.ADD_BUILT_INS_TO_DEPENDENCIES 2016-11-08 12:14:24 +03:00
Alexander Udalov
5cd9e11f44 Refactor initialization of JvmBuiltIns instance
Use lazy val instead of lateinit var + implicit dependency on the code in
KotlinBuiltIns constructor
2016-11-08 12:14:23 +03:00
Alexander Udalov
5adb22ed65 Do not evaluate anything eagerly in KotlinBuiltIns constructor 2016-11-08 12:14:23 +03:00
Simon Ogorodnik
2be4800307 Fix for KT-14604 J2K Yet another floating point with exponent format 2016-11-08 12:04:05 +03:00
Simon Ogorodnik
7e82dd9adc Fix for KT-14585 J2K, ConvertJavaCopyPasteProcessor shows a dialog under write action 2016-11-08 12:04:04 +03:00
Ilya Gorbunov
61ef26614d Fixup after merge (temporary until collection typealiases are introduced in stdlib) 2016-11-08 03:56:39 +03:00
Ilya Gorbunov
a067888fed Provide no-op members in JS ArrayList to work with capacity.
#KT-14637
2016-11-07 21:58:43 +03:00
Ilya Gorbunov
fbcf7c146b Remove JavaPackage from common completion tests, move to java-specific tests 2016-11-07 21:39:42 +03:00
Ilya Gorbunov
6656d10c67 Fix tests: do not refer to removed things. 2016-11-07 21:39:41 +03:00
Ilya Gorbunov
660dc94f7c Move Closeable to its usage, move internal Serializable to kotlin package in JS, introduce internal typealias in kotlin.io in JVM. 2016-11-07 21:39:36 +03:00
Ilya Gorbunov
a895702730 Remove js classes that should not be there 2016-11-07 21:35:27 +03:00
Alexey Sedunov
2ff8e922f0 Create from Usage: Add test for KT-14500 2016-11-07 20:03:37 +03:00
Alexey Sedunov
a414843f54 Control-Flow Analysis: Use PSI to generate pseudocode if nested resolved call is confused with outer one (e.g. a {} when invoke() is missing)
#KT-14500 Fixed
2016-11-07 20:03:36 +03:00
Alexey Sedunov
e8b5387384 Create from Usage: Support array access expressions/binary expressions with type mismatch errors
#KT-14501 Fixed
2016-11-07 20:03:35 +03:00
Alexey Sedunov
0159ddbc49 Control-Flow Analysis: Do not skip pseudocode for value arguments if they are matched with errors 2016-11-07 20:03:34 +03:00
Alexey Sedunov
df38c70278 Quick Fixes: Replace strong references to PSI elements with smart pointers
#KT-14552 Fixed
2016-11-07 20:03:33 +03:00
Alexey Sedunov
8ceeff0211 Change Signature: Use new signature when looking for redeclaration conflicts
#KT-14583 Fixed
2016-11-07 20:03:32 +03:00
Alexey Sedunov
f4e8242a22 Convert Property to Function Intention: Search occurrences using progress dialog
#KT-14569 Fixed
2016-11-07 20:03:31 +03:00
Alexey Sedunov
30d08c989d Kotlin Facet: Use facet configuration to provide language version for IDE analyzer 2016-11-07 20:03:30 +03:00
Alexey Sedunov
6dd950cd5a Kotlin Facet: Use facet configuration in JPS build 2016-11-07 20:03:29 +03:00
Alexey Sedunov
d0de9dd43c Kotlin Facet: Get rid of copy constructors for compiler arguments/settings and use reflection-based copying instead 2016-11-07 20:03:29 +03:00
Alexey Sedunov
a2948a624f Kotlin Facet: Reuse JvmTarget and LanguageVersion in facet configuration 2016-11-07 20:03:28 +03:00
Alexey Sedunov
b6de7d3503 Convert to Kotlin: Compiler arguments/settings JPS serializers 2016-11-07 20:03:27 +03:00
Alexey Sedunov
9e4fcf9731 Convert to Kotlin: Compiler arguments/settings JPS serializers (rename to .kt) 2016-11-07 20:03:26 +03:00
Alexey Sedunov
b88573e6a8 Convert to Kotlin: JpsKotlinCompilerSettings.java 2016-11-07 20:03:25 +03:00
Alexey Sedunov
7cb2f04d24 Convert to Kotlin: JpsKotlinCompilerSettings.java (rename to .kt) 2016-11-07 20:03:24 +03:00
Alexey Sedunov
a6dbdbd3e5 Refactoring: Move facet configuration classes to idea-jps-common module 2016-11-07 20:03:23 +03:00
Alexey Sedunov
68e293baac Kotlin Facet: Validate dialog on language/API version change 2016-11-07 20:03:23 +03:00
Valentin Kipyatkov
3d5d2d8258 KT-14376 ClassCastException from object with vals
#KT-14376 Fixed
2016-11-07 18:31:04 +03:00
Valentin Kipyatkov
3fb64f4fa6 Fixed completion list sorting so that "shouldCompleteTopLevelCallablesFromIndex" not be first when typing "st" 2016-11-07 18:28:24 +03:00
Valentin Kipyatkov
eefa409a1d Fixed "Offset ... is not registered" exceptions when running under IDEA 2016.3 2016-11-07 18:28:24 +03:00
Valentin Kipyatkov
0af142edb3 KT-14410 Autopopup completion is triggered in string literals for packages
#KT-14410 Fixed
2016-11-07 18:28:24 +03:00
Valentin Kipyatkov
a2ebf07a93 KT-14386 Smart completion: add "<parameter name> = true/false" choices
#KT-14386 Fixed
2016-11-07 18:28:23 +03:00
Dmitry Jemerov
54f28cab45 allow to pass compiler version number externally 2016-11-07 14:33:59 +01:00
Anton Bannykh
283d16b7f4 Updated example test path in the test.html (used to debug JS box tests) to match the current state. 2016-11-07 15:32:26 +03:00
Mikhail Glukhikh
a6d17132b3 Build fix: forgotten inspection descriptions was added for new inspections 2016-11-07 14:55:36 +03:00
Alexander Udalov
3db459c1d8 JS: drop Collections.reverse and java.util.Collections altogether 2016-11-07 12:27:54 +03:00
Alexander Udalov
e8fecea871 JS: drop Collections.max 2016-11-07 12:27:52 +03:00
Alexander Udalov
316fbd820b JS: drop Collections.sort 2016-11-07 12:27:13 +03:00
Alexander Udalov
30a7790dca Minimize references to java.util.Collections in stdlib sources
Only three usages are left in platform-independent code: in reverse, sort and
sortWith for mutable lists
2016-11-07 12:20:14 +03:00
Alexander Udalov
b52f67132e Fix some warnings in JS-specific stdlib sources 2016-11-07 12:20:14 +03:00
Alexander Udalov
52511845fc Minor reformat in JS libraries + remove commented out code 2016-11-07 12:20:14 +03:00
Ilya Gorbunov
766a28c5f8 Update builtin deserialization tests. 2016-11-04 04:36:02 +03:00
Ilya Gorbunov
1a471d7f6b Annotate new enum-related API with SinceKotlin. 2016-11-04 04:18:51 +03:00
Ilya Gorbunov
11bb10e7f7 Annotate new DslMarker annotation with SinceKotlin 2016-11-03 22:34:59 +03:00
Denis Zharkov
77e2b12566 Add kotlin.DslMarker to binary public API 2016-11-03 17:55:41 +03:00
Vyacheslav Gerasimov
2a0557f742 Added missing KtLambdaArgument to UElement conversion in KotlinUastLanguagePlugin
#KT-14470 Fixed
2016-11-03 17:21:39 +03:00
Vyacheslav Gerasimov
9534934f43 Implemented kotlin quick fix provider for create android resource quick fixes
#KT-10465 Fixed
#KT-12880 Fixed
2016-11-03 17:21:28 +03:00
Vyacheslav Gerasimov
29b9521596 Android lint check for api requirements for classes in catch clause (KT-13243)
Added test for #KT-14047, #KT-13243 Fixed, #KT-14047 Fixed
2016-11-03 17:21:17 +03:00
Vyacheslav Gerasimov
387d5ffd73 Added call to ImportFilter in import quickfix (KT-14439)
#KT-14439 Fixed
2016-11-03 17:20:57 +03:00
Michael Bogdanov
fd6d4c352c Special enum function support; Fix for KT-10569: Cannot iterate over values of an enum class when it is used as a generic parameter
#KT-10569 Fixed
2016-11-03 14:27:13 +03:00
Valentin Kipyatkov
6a3597fa0f Minor changes on code review 2016-11-02 19:25:28 +03:00
Valentin Kipyatkov
6d3dd5d9b7 More uses of partial body resolve 2016-11-02 19:25:28 +03:00
Valentin Kipyatkov
68174470c3 Add BodyResolveMode parameter to resolveToDescriptor() 2016-11-02 19:25:27 +03:00
Valentin Kipyatkov
a10272b236 Optimization: do not use resolveToDescriptor() which uses full body resolve 2016-11-02 19:25:26 +03:00
Valentin Kipyatkov
c0d89e67a9 Do not resolve all bodies of anonymous objects and local classes in partial body resolve 2016-11-02 19:25:25 +03:00
Valentin Kipyatkov
23c22984e8 Optimization: look for callables at first when prefix starts uppercase and the opposite otherwise 2016-11-02 19:25:25 +03:00
Valentin Kipyatkov
dbaaee7d0b Refactoring: step 1 2016-11-02 19:25:24 +03:00
Valentin Kipyatkov
6c3d2c62b4 Minor 2016-11-02 19:25:23 +03:00
Valentin Kipyatkov
9f1cdde20b Better modifier order 2016-11-02 19:25:22 +03:00
Valentin Kipyatkov
f6a73e756e Refactoring 2016-11-02 19:25:22 +03:00
Valentin Kipyatkov
6c17fa7736 Performance optimization for completion after "ge", "se", etc 2016-11-02 19:25:21 +03:00
Valentin Kipyatkov
2b2ef5a349 Performance optimization: do not invoke DescriptorToSourceUtilsIde.getAnyDeclaration() on creating LookupElement - do it lazily
#KT-14606 In Progress
2016-11-02 19:24:46 +03:00
Denis Zharkov
8aefc0db7c Do not suggest "Rename to _" quick-fix for parameter of named function
#KT-14586 Fixed
2016-11-02 15:38:03 +03:00
Yan Zhulanow
951868f590 Explicitly filter out classes found by DataBindingClassFinder and DataBindingComponentClassFinder for scope without sources (KT-12402)
This change is temporary, and it should be reverted when the original problem in DataBinding IDE support is fixed.
2016-11-01 19:36:33 +03:00
Yan Zhulanow
4188ef6e53 Fix conformance test 2016-11-01 19:36:32 +03:00
Yan Zhulanow
7338980d00 Lint: Add several checkCancelled() checks to UElementVisitor 2016-11-01 19:36:32 +03:00
Yan Zhulanow
65cea7e92c Lint: Use IntellijApiDetector in IDE 2016-11-01 19:36:32 +03:00
Yan Zhulanow
6ff29f473b Uast: Migrate to UAnnotation 2016-11-01 19:36:32 +03:00
Yan Zhulanow
fee54d9b86 Lint: Remove SdkWrapper and AnroidModelFacade (was needed in Android Studio 1.5) 2016-11-01 19:36:31 +03:00
Yan Zhulanow
7404b91cb3 Lint: Fix diagnostic tests 2016-11-01 19:36:31 +03:00
Yan Zhulanow
565ca0f7a3 Lint: Fix compilation errors after replacing diagnostics 2016-11-01 19:36:31 +03:00
Vyacheslav Gerasimov
2be9a083ad Lint: Android Lint diagnostics fixes 2016-11-01 19:36:31 +03:00
Yan Zhulanow
c2ddd943f9 Lint: Update diagnostics because of the new Uast. Also, these diagnostics are from AS 2.2. 2016-11-01 19:36:31 +03:00
Yan Zhulanow
4c4d6a4ad4 Temporary remove outdated Uast tests 2016-11-01 19:36:30 +03:00
Yan Zhulanow
d5d491e6b2 Lint: Update Uast implementation (the new version is without declaration level) 2016-11-01 19:36:30 +03:00
Denis Zharkov
6491d3fbac Do not report DSL scope violation error when language-version is 1.0
#KT-11551 Fixed
2016-11-01 15:58:14 +03:00
Denis Zharkov
7553d3f72b Intoduce and support DslMarker annotation
#KT-11551 In Progress
2016-11-01 15:58:14 +03:00
Denis Zharkov
b8e8206c4f Minor. Remove redundant parameter
LexicalWritableScope.implicitReceiver is always null for all constructor's usages
2016-11-01 15:58:14 +03:00
Kirill Rakhman
8a73a1da2c Implement Intention + Inspection to remove empty secondary constructor body #KT-14326 Fixed 2016-11-01 14:11:28 +03:00
Kirill Rakhman
495dd3641c Add Inspection to remove empty primary constructor #KT-14521 Fixed 2016-11-01 14:11:14 +03:00
Kirill Rakhman
ba7f60040a clean up psi package 2016-11-01 14:11:07 +03:00
Kirill Rakhman
e10d10c49e Add quick fix to remove single lambda parameter if it's unused #KT-14593 Fixed 2016-11-01 14:11:02 +03:00
Anton Bannykh
2fb7b01320 Fix capturing variables declared via destructuring (#KT-14535 fixed). 2016-11-01 14:00:24 +03:00
Anton Bannykh
bb4d8f9223 Cleaned up AliasingContext.java 2016-11-01 13:55:09 +03:00
Ilya Gorbunov
49ea0f5984 Relax generic variance in Array.flatten 2016-10-31 22:05:38 +03:00
Ilya Gorbunov
adaad58cc7 Add required builtins when building tests. Either as reference to kotlin-runtime, or resort to those from the compiler with the -Xadd-compiler-builtins argument. 2016-10-31 22:03:16 +03:00
Ilya Ryzhenkov
f79116a6d8 Optimize reflection by using Class.getName instead of Class.getCanonicalName 2016-10-31 20:17:33 +03:00
shiraji
e7575599eb Correct handling of "Redundant if" for negation case #KT-14575 Fixed 2016-10-31 12:35:00 +03:00
shiraji
62f81e795c Redundant calls of conversion methods: do not suggest for flexible receiver types #KT-14570 Fixed 2016-10-31 12:24:43 +03:00
Alexander Udalov
f9a48857f5 Add IR sources to kotlin-compiler-sources.jar 2016-10-31 11:27:04 +03:00
Vyacheslav Gerasimov
2f859f6996 fix KotlinAndroidAddStringResource: correct generic extension function processing + minor refactoring 2016-10-30 22:56:37 +03:00
Alexey Tsvetkov
2ffb0abb59 Fix caches closing/flushing when IC builds non-incrementally 2016-10-28 23:55:03 +03:00
Dmitry Jemerov
91f76ada04 build fix: don't use API not available in IDEA 161 2016-10-28 21:16:29 +02:00
Ilya Gorbunov
ed2a218ec2 Add new bitwise operations to constant evaluator map. #KT-13554 2016-10-28 20:50:13 +03:00
Dmitry Petrov
ed60674d13 KT-14498: Properly check variance in expanded types. 2016-10-28 18:02:15 +03:00
Alexey Tsvetkov
49bf1e5917 Fix forcing java to compile if kotlin classes are compiled 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
fa6ed71fbd Fix running gradle tests on windows 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
2c1699bc89 Minor: remove js-library dependency from jvm module 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
7642314780 Always flush caches 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
fc1af746c6 Gradle IC: treat companion object change as class signature change 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
f01a956a8b Gradle IC: fix converting class to package facade 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
151cf7d073 Gradle IC: support multifile classes 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
f25d948b3f Gradle IC should fail if duplicating class is added
#KT-14554 fixed
2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
67b3d54b37 In case of IC failure rebuild all files since last build
Before this change only files from last iteration were rebuilt.
It is correct and optimal, but there are many diffs with JPS/Gradle
logs.
2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
7c16d086aa Groundwork for using IC without Gradle 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
7c1ebba57a Minor: do not print index in parametrized test name 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
6191fd87ec Minor: shorten references after move 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
68a7d88673 Refactoring: reorder IncrementalJvmCompilerRunner constructor parameters 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
3fabe6e4a7 Minor: update copyright in Gradle plugin 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
4a48c30f02 Cleanup: optimize imports in Gradle plugin 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
4ea9216672 Minor: replace File::isFile with File::exists 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
b0411de5c6 Minor: make Rebuild object 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
417f4f821b Minor: remove duplicated logger utils 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
368e48780e Refactoring: move IC classes into separate package 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
3bcd6e9a93 Refactoring: do not pass properties as parameters 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
c283515922 Refactoring: pass classpath and destination in K2JVMCompilerArguments 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
90dbf6c5fc Refactoring: delegate IC files management to IncrementalJvmCompilerRunner 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
d569651099 Refactoring: split GradleMessageCollector and remove Gradle Logger from IncrementalJvmCompilerRunner 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
78c115523c Refactoring: move all IC logic to IncrementalJvmCompilerRunner 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
0d1c803f71 Rebuild on cache corrupted exception
#KT-14055 fixed
2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
fafde1e948 Refactoring: introduce IncReporter to report IC progress 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
e32c19ce4e Refactoring: extract calculateSourcesToCompile 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
388dd9c2a6 Refactoring: return removed dirty files from calculateSourcesToCompile 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
b4c17dabf4 Refactoring: introduce class ChangedFiles 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
e9d4d85af2 Refactoring: extract parts of IC 2016-10-28 17:58:10 +03:00
Alexey Tsvetkov
26373d4952 Refactoring: pass incremental compilation state explicitly 2016-10-28 17:58:10 +03:00
Dmitry Jemerov
35130e7e5f Don't calculate property name if we aren't going to search for property accessors in Kotlin sources (KT-14508) 2016-10-28 16:47:35 +02:00
Dmitry Jemerov
127db98bbc Fix Kotlin definitions search for classes which can only be used in a local search scope (KT-13753) 2016-10-28 16:47:35 +02:00
Dmitry Jemerov
e93f6e97cb KotlinDefinitionsSearcher: cleanup after J2K 2016-10-28 16:47:34 +02:00
Dmitry Jemerov
2fc601832c KotlinDefinitionsSearcher: J2K 2016-10-28 16:47:34 +02:00
Dmitry Jemerov
4281c13c28 KotlinDefinitionsSearcher: rename to .kt 2016-10-28 16:47:33 +02:00
Dmitry Jemerov
237504c3c7 Classes with no parent are top-level (EA-90570 - assert: KtPsiUtil.getOutermostClassOrObject) 2016-10-28 16:47:33 +02:00
Dmitry Jemerov
395bdf47e6 Use correct FQ name for running inner classes (KT-14153) 2016-10-28 16:47:27 +02:00
Dmitry Jemerov
f783ba7573 Exclude local variables from file structure grouping (KT-14363) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
5d6f1cf3fa Fix handling of underscores in Markdown links (KT-14452) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
25c7dccd3b Don't consider function names as candidates for "Show expression type" (KT-14384) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
4246fcf256 "Show expression type" no longer shows elements which enclose the element at caret (KT-14436) 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
57680ae003 Don't show literals in "show expression type" popup 2016-10-28 16:40:27 +02:00
Dmitry Jemerov
e6c05c3a19 Don't show type for reference expressions inside KtCallableReference (KT-14530) 2016-10-28 16:40:27 +02:00
Mikhail Glukhikh
4f82958309 If then to elvis: do not report inspection if not used as expression
(cherry picked from commit 2adcb27)
2016-10-28 17:21:12 +03:00
Mikhail Glukhikh
d1554217d3 Minor: if then to elvis
(cherry picked from commit 7703994)
2016-10-28 17:20:59 +03:00
Dmitry Jemerov
be13aa0a3b Separate targets for writing compiler version and plugin version to template files 2016-10-28 15:14:08 +02:00
Vyacheslav Gerasimov
3ce1703ced Extract string resource intention action for android (KT-11715)
#KT-11715 Fixed
2016-10-28 15:30:22 +03:00
Mikhail Glukhikh
53ea5a2dbb Minor refactoring: if then to elvis 2016-10-28 15:00:55 +03:00
Mikhail Glukhikh
f3c25c728e If then to elvis: no more allowed for if expressions with Unit result 2016-10-28 15:00:50 +03:00
Mikhail Glukhikh
8edd33ee92 If then to elvis: applied in IDEA, front-end & J2K modules 2016-10-28 15:00:21 +03:00
Mikhail Glukhikh
e7cef79709 If then to elvis: now not applicable for is with type unrelated to original #KT-14520 Fixed 2016-10-28 15:00:09 +03:00
Mikhail Glukhikh
87d265dc1b If then to elvis: now not applicable for is with nullable type #KT-14545 Fixed 2016-10-28 15:00:04 +03:00
Mikhail Glukhikh
89e908dab5 If then to elvis: now not applicable for calls with nullable result #KT-14542 Fixed 2016-10-28 14:59:58 +03:00
Mikhail Glukhikh
f390b9159a Minor refactoring: if then to elvis 2016-10-28 14:59:53 +03:00
Mikhail Glukhikh
7b316f72dc Lambda to reference: correct handling of named arguments using resolved call #KT-14550 Fixed 2016-10-28 14:59:48 +03:00
Mikhail Glukhikh
7d242c5c77 Minor: surround with null check: partial analysis 2016-10-28 14:59:42 +03:00
Valentin Kipyatkov
046c55a7ac Caching for PARTIAL_FOR_COMPLETION resolve too (because it's used not only in completion) 2016-10-28 09:47:27 +03:00
Valentin Kipyatkov
13ca110430 Refactoring 2016-10-28 09:47:26 +03:00
Valentin Kipyatkov
0fbbf1a340 Performance fix for postfix completion: 1. Don't use PARTIAL_FOR_COMPLETION resolve mode 2. Attempt to use resolve in physical file instead of synthetic one 2016-10-28 09:42:47 +03:00
Valentin Kipyatkov
8c99b0e64c Performance fix for Import Member 2016-10-28 09:42:47 +03:00
Nikolay Krasko
d9ef8aa96f Do nothing for disposed projects 2016-10-27 23:36:54 +02:00
Ilya Chernikov
2e03a6f1fd Add script dependencies modification tracker, some optimizations 2016-10-27 23:36:54 +02:00
Simon Ogorodnik
3382ab3d9c Fix for KT-14141: Go to Symbol shows Kotlin extensions from Java's point of view 2016-10-27 20:38:05 +03:00
Simon Ogorodnik
0462a3d3b6 Workaround KT-14531, Partial fix for KT-13600, KT-11620 J2K: Invalid conversion context on plain text pasting
For detailed info see KT-14531
2016-10-27 20:02:27 +03:00
Simon Ogorodnik
f8b7ce1011 Fix for KT-13695, KT-13159 J2K: Invalid conversion context setup for plain text pastes
Extending, Implementing, imports from paste target file previously not implemented
2016-10-27 20:02:26 +03:00
Simon Ogorodnik
b802ca0af5 Fix for non-resolving of KtReference, which getTargetDescriptors returning multiple descriptors to same element 2016-10-27 20:02:25 +03:00
Simon Ogorodnik
7c8fdc42b4 Fix for KT-12892 J2K: Wrong placing of comments when constructor converted to primary constructor & init 2016-10-27 20:02:24 +03:00
Simon Ogorodnik
b51f5c5bd9 Fix for KT-14248 J2K: Invalid constructor formatting after conversion
Caused by `\n\n long mLong = 0;` leading line breaks
2016-10-27 20:02:23 +03:00
Simon Ogorodnik
f1c371143c Fix for KT-5312 J2K: Correct bit operations priority after conversion
Now `PolyadicExpression` breaks down to BinaryExpression`s
2016-10-27 20:02:23 +03:00
Simon Ogorodnik
1069257e95 Fix for KT-5410 J2K: someObject + "someString" should be converted to someObject.toString() + "someString"
Otherwise `+` operator will not resolve
2016-10-27 20:02:21 +03:00
Simon Ogorodnik
0cebcc9f3c Fix for KT-12677. J2K: Invalid SAM constructor redundancy detection
Now all J2kPostProcessing's executing in fixed order, dependent on it index in J2kPostProcessingRegistrar._processings
2016-10-27 20:02:20 +03:00
shiraji
0b57d8eb49 Do not use "Remove redundant '.let' call" when receiver is used #KT-14390 Fixed 2016-10-27 19:10:14 +03:00
Anton Bannykh
6a1b0b9cbc withNonLocalReturn.kt was disabled for a wrong reason; reported the actual issue and fixed the comment 2016-10-27 17:27:03 +03:00
Michael Bogdanov
fd2655fd4a Bridge support 2016-10-27 16:43:02 +03:00
Michael Bogdanov
7989a0ff25 Use original descriptor on delegating to DefaultImpls 2016-10-27 16:43:01 +03:00
Michael Bogdanov
4cbc5cc958 Remove variables from frame on block leaving 2016-10-27 16:43:00 +03:00
Michael Bogdanov
afe0b8a0b6 Switch to general codegen in 'Bytecode tool window' 2016-10-27 16:41:15 +03:00
Mikhail Glukhikh
2130164d9b EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT is now reported on property if accessor is external #KT-9297 Fixed
Also fixes EA-89227
2016-10-27 16:25:43 +03:00
Nikolay Krasko
e053b77ede Test for "Code folding doesn't work in kotlin lambdas after some declatation" (KT-14411)
Fixed in previous commit

 #KT-14411 Fixed
2016-10-27 14:26:12 +03:00
Nikolay Krasko
08d628537c Assign trailing and preceding whitespaces to lambda block until the last comment in parser 2016-10-27 14:26:10 +03:00
Nikolay Krasko
0261385681 Report file name for getDefaultPlatform() information 2016-10-27 14:26:07 +03:00
Anton Bannykh
7ee3baa020 Replaced when appropriate 'TARGET_BACKEND: JVM' -> 'IGNORE_BACKEND: JS'. Enabled some succesfully working decompiledText tests. 2016-10-27 14:17:25 +03:00
Anton Bannykh
dc151c1d84 Implemented specifying specific ignored backend (e.g. '// IGNORE_BACKEND: JS' instead of '// TARGET_BACKEND: JVM') 2016-10-27 14:17:25 +03:00
Dmitry Jemerov
38a448ebbd use a non-deprecated API 2016-10-27 12:50:39 +02:00
Michael Bogdanov
0910f166a5 Make default methods for inlineOnly and reified functions package private 2016-10-27 11:03:35 +03:00
Alexander Udalov
455fef90c0 Fix codefen test case by adding stdlib 2016-10-27 10:44:33 +03:00
Ilya Gorbunov
a6783534f0 Add required *.kotlin_builtins to classpath for stdlib tests 2016-10-26 21:41:54 +03:00
Alexander Udalov
c49c019250 Add option to restore fallback to compiler built-ins + resurrect Maven build 2016-10-26 19:02:31 +03:00
Anton Bannykh
a3566174d6 Support destructuring in lambda parameters (KT-14422) and skipping some components in a destructuring declaration (KT-14507). 2016-10-26 18:29:13 +03:00
Ilya Gorbunov
1c7196a1fb Allow to reference internal API in stdlib tests 2016-10-26 17:47:15 +03:00
Ilya Gorbunov
8d76617094 Merge ReversedViews tests in one file as they can all run now in JS.
Make SynchronizedLazyValTest jvm-only.
2016-10-26 17:47:15 +03:00
Ilya Gorbunov
badbcd08de Annotate explicitly stdlib tests, which must be excluded from JS stdlib tests with @JvmVersion, do not use file naming convention, use preprocessor instead. 2016-10-26 17:47:15 +03:00
Ilya Gorbunov
baccac30fb Annotate explicitly stdlib sources, which must be excluded from JS stdlib with @JvmVersion, do not use file naming convention. 2016-10-26 17:47:15 +03:00
Ilya Gorbunov
98f7c61333 Reuse JVM box tests for binary operations in JS, excluding those that can't pass now. 2016-10-26 16:36:09 +03:00
Ilya Gorbunov
19922135fd JS: Add intrinsics for bitwise ops. #KT-13554 2016-10-26 16:36:07 +03:00
Ilya Gorbunov
62fb47d137 Introduce bitwise operations and/or/xor/inv for Byte and Short. #KT-13554
Annotate new bitwise operations with SinceKotlin.
2016-10-26 16:35:46 +03:00
Alexander Udalov
7f86ce0a20 Introduce fallback option to add built-ins in position manager test
In AbstractPositionManagerTest, built-ins could no longer be resolved because
JvmIDEVirtualFileFinder is used in IDE tests (even when the compilation is
called through JvmResolveUtil/GenerationUtils as in compiler tests), which is
not yet able to locate .kotlin_builtins files
2016-10-26 16:31:09 +03:00
Alexander Udalov
e0989caf46 Load built-ins from module dependencies in JVM compiler
Introduce a new method KotlinClassFinder#findBuiltInsData, which is only
implemented correctly in the JvmCliVirtualFileFinder because it's only used in
the compiler code at the moment.

Introduce JvmBuiltInsPackageFragmentProvider, the purpose of which is to look
for .kotlin_builtins files in the classpath and provide definitions of
built-ins from those files.

Also exclude script.runtime from compilation because, as other excluded
modules, it has no dependency on the stdlib and is no longer compilable from
the IDE now, because it cannot resolve built-ins from anywhere
2016-10-26 16:31:09 +03:00
Alexander Udalov
0b59c71340 Add mock runtime to KotlinJpsBuildTest test cases
To prevent test failures once the JVM compiler stops loading definitions of
built-in declarations from itself and starts to rely on their presence in the
library, that the compiled source code depends on
2016-10-26 16:31:07 +03:00
Alexander Udalov
88add3e06d Get rid of some KotlinBuiltIns#getBuiltInsModule usages
There will be no separate module for built-ins soon, they will be resolved as
normal dependencies
2016-10-26 16:31:06 +03:00
Alexander Udalov
484b0e36fb Add KotlinBuiltIns#isBuiltIn, use it instead of other utilities 2016-10-26 16:31:05 +03:00
Alexander Udalov
4effe42f1d Use JvmResolveUtil#createContainer in KotlinOverloadTest and KotlinOverridingTest 2016-10-26 16:31:05 +03:00
Alexander Udalov
8a5c8da757 Simplify module configuration and built-ins dependency in some tests
- In tests on built-ins with no sources, just call
  JvmResolve.analyze(environment) and inspect the resulting module
- In AbstractLocalClassProtoTest, create container via
  TDAForJVM.createContainer
- Inline single module container creation into AbstractDiagnosticsTest
2016-10-26 16:31:04 +03:00
Alexander Udalov
2b34d62848 Extract superclass from FunctionClassScope and CloneableClassScope 2016-10-26 16:31:03 +03:00
Alexey Sedunov
416569c2d2 Introduce Type Parameter: Disable shortcut (to avoid interference with IntelliJ API Watcher plugin) 2016-10-26 15:03:45 +03:00
Alexey Sedunov
dc9c988287 Kotlin Facet: Fix serialization/deserialization 2016-10-26 15:03:44 +03:00
Alexey Sedunov
3fcdda2805 Kotlin Facet: Refactor TargetPlatform to sealed class. Move settings-related classes to top level 2016-10-26 15:03:43 +03:00
Alexey Sedunov
ea13456bba Kotlin Facet: Add compiler settings to facet configuration 2016-10-26 15:03:42 +03:00
Alexey Sedunov
03f4d9f574 Kotlin Facet: Add extension point for compiler/stdlib version info with implementations for Maven and Gradle project models 2016-10-26 15:03:42 +03:00
Alexey Sedunov
e0285b9955 Kotlin Facet: Extract VersionInfo class and getVersionInfo() utility function 2016-10-26 15:03:41 +03:00
Alexey Sedunov
37286d5b06 Kotlin Facet: Add API version setting 2016-10-26 15:03:40 +03:00
Alexey Sedunov
2326e3ed12 Kotlin Facet: Add custom settings and configuration extension point 2016-10-26 15:03:39 +03:00
mglukhikh
73b24f2b20 Build fix: "If then to elvis" inspection test 2016-10-26 14:15:07 +03:00
Michael Bogdanov
eaf9c2e8b0 Fix for KT-13890: IllegalAccessError when invoking protected method with default arguments
#KT-13890 Fixed
2016-10-26 12:13:20 +03:00
Michael Bogdanov
1e59161e8f Fix for KT-14201: UnsupportedOperationException: Don't know how to generate outer expression for anonymous object with invoke and non-trivial closure
#KT-14201 Fixed
2016-10-26 12:13:19 +03:00
Nikolay Krasko
e41cddd870 Allow to select single word on double click in one line doc comment (KT-14327)
(cherry picked from commit 184d39a)

 #KT-14327 Fixed
2016-10-25 18:18:07 +03:00
Mikhail Glukhikh
ba0e36cdb1 (1.1 only) Var can be val: correct handling of delegated local variables #KT-14409 Fixed 2016-10-25 17:57:40 +03:00
Mikhail Glukhikh
66f3e266d9 Var can be val: correct handling of initialization in lambda #KT-14065 Fixed 2016-10-25 17:57:36 +03:00
Mikhail Glukhikh
fd9e59ac7b Surround with null check for unsafe things: find first parent statement to surround (which is not used as expression) #KT-13958 Fixed 2016-10-25 17:57:32 +03:00
Mikhail Glukhikh
e56a10aa41 "Surround with null check" is now a high-priority action 2016-10-25 17:57:29 +03:00
Mikhail Glukhikh
35d104782e Minor: primary constructor to secondary: do not specify independent property type explicitly 2016-10-25 17:57:25 +03:00
Mikhail Glukhikh
a74f010e0f Primary constructor to secondary: always try to build constructor body #KT-14475 Fixed 2016-10-25 17:57:21 +03:00
Mikhail Glukhikh
d6eee65d72 Object literal to lambda: more precise shorten references #KT-14289 Fixed 2016-10-25 17:57:17 +03:00
Mikhail Glukhikh
dc76f2a62f Lambda to reference: check potential reference arguments by descriptors and not by names #KT-14420 Fixed 2016-10-25 17:57:13 +03:00
Mikhail Glukhikh
97b45569fc Lambda to reference: not-null types are now preferred for platform type receivers #KT-14394 Fixed 2016-10-25 17:57:09 +03:00
Mikhail Glukhikh
a901de5112 KT-14084 related : replaceFirstReceiver now replaces ALL calls to safe calls if necessary
Fixes relevant "replace let" and "if to elvis" cases
2016-10-25 17:57:06 +03:00
Mikhail Glukhikh
2117b30b76 If expression to elvis now handles call chains #KT-14084 Fixed 2016-10-25 17:57:02 +03:00
Alexander Udalov
1cfb8f2aef Use OverridingUtil#overrides instead of CodegenUtil#doesOverride
This may be more correct in case of complex cross-module inheritance, where
overridability should be detected by structural equality of signatures instead
of referential equality of constructed descriptors (no test added because it's
not so easy to come up with an example)
2016-10-25 15:42:34 +03:00
Alexander Udalov
4e7542b07d Filter out non-builtin package fragments from module when needed
In subsequent commits, a JVM module will be able to have up to two package
fragments for a given package FQ name. For example, for package "kotlin" in
kotlin-runtime.jar there will be a LazyJavaPackageFragment with binary
(Kotlin+Java) dependencies, and a BuiltInsPackageFragment for built-ins
metadata (which is loaded from kotlin/kotlin.kotlin_builtins)
2016-10-25 15:42:33 +03:00
Alexander Udalov
9ce211fe87 Use FQ names instead of descriptor equality in RangeCodegenUtil
This is safer in cases when descriptors for the same declaration can come from
different package fragment providers
2016-10-25 15:42:33 +03:00
Alexander Udalov
ccd480236a Add mock JDK and mock runtime to light class tests 2016-10-25 15:42:33 +03:00
Alexander Udalov
035d6156a7 Drop Cloneable in JS, synthesize it at compile-time on JVM
Use the same approach that is used for creating function type classes
(Function{0,1,...}) + add Cloneable to supertypes of Array and primitive arrays

 #KT-5537 Fixed
2016-10-25 15:42:33 +03:00
Alexander Udalov
0f4b10d37d Add JavaToKotlinClassMap#isJavaPlatformClass
Use it instead of mapPlatformClass where we only need to check emptiness
because mapPlatformClass requires built-ins and it's not always easy to come up
with the correct instance of built-ins.

In KotlinEvaluationBuilder, use the nullable function
findClassAcrossModuleDependencies instead of mapPlatformClass which uses the
throwing resolveClassByFqName. This is necessary because DefaultBuiltIns, which
are used there, are not always able to find classes mapped by a _Java_ to
Kotlin class map. (The correct solution would be not to use DefaultBuiltIns at
all, instead obtaining the correct instance of built-ins, which are almost
certainly going to be JvmBuiltIns, from the project configuration.)
2016-10-25 15:42:32 +03:00
Alexander Udalov
2f81d48f5e Use ClassId instead of FqName in JavaToKotlinClassMap
Extract mapJavaToKotlin which returns ClassId and needs no KotlinBuiltIns
instance
2016-10-25 15:42:32 +03:00
Alexander Udalov
0e9f29fdba Make ClassDescriptor#classId nullable
Local classes or anonymous objects do not have a class id. Use "!!" almost
everywhere to make assertion explicit
2016-10-25 15:42:32 +03:00
Alexander Udalov
17e54b6d2d Add ClassDescriptorFactory#getAllContributedClassesIfPossible
Currently a no-op, will be used soon to make Cloneable a synthesized class,
visible in scope's getContributedDescriptors()
2016-10-25 15:42:32 +03:00
Alexander Udalov
c0147860bd Allow multiple ClassDescriptorFactory instances in deserialization 2016-10-25 15:42:32 +03:00
Nikolay Krasko
cdabef51ed Add nullability to receiver type 2016-10-25 13:30:38 +03:00
Nikolay Krasko
22999fe67d Set hasValueArguments in KotlinAnnotationEntryStub to 'true' only if some arguments exist
Currently '()' is used for resolving ambiguity in parsing when annotating function types. This way a decompiled code
will need brackets, but compile code will have annotation without parameters. This commit will allow to make both stub-trees consistent.

Tested in ClsStubBuilderTestGenerated.testAnnotationsOnNullableTypes()
2016-10-25 13:30:37 +03:00
Nikolay Krasko
a344ad0644 Fix absence of annotation for function type in cls stubs and ignore @ExtensionFunctionType 2016-10-25 13:30:35 +03:00
Nikolay Krasko
d1dfcfaca1 Fix stub-psi mismatch exception on restoring annotation for nullable types
(cherry picked from commit 1aa37f1125)

Conflicts:
	compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt
	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt
2016-10-25 13:22:53 +03:00
Mikhail Glukhikh
e53940f4af KT-8442 related: correct handling of erroneous destructuring references, fixes EA-90434 2016-10-25 13:13:15 +03:00
Mikhail Glukhikh
e7e56ab85c KT-8442 related: destructuring declarations aren't taken into account during light classes generation, fixes EA-81204 2016-10-25 13:13:11 +03:00
Denis Zharkov
b7e8071a7d Do not use BasicInterpreter for bytecode analysis
The problem with BasicInterpreter is the following:
it creates BasicValue objects that should be replaced in favor of StrictBasicicValue

See commit message in 25c6ac1 for clarification

 #KT-14447 Fixed
2016-10-25 10:14:52 +03:00
Denis Zharkov
e9efc9e892 Replace usages of BasicValue constants in master with StrictBasicValue 2016-10-25 10:14:52 +03:00
Denis Zharkov
d279ded714 Add license and links to rewritten ASM classes 2016-10-25 10:14:52 +03:00
Denis Zharkov
3a197e8d7e Fix NPE caused by nullability checks optimizations
Mostly this commit replaces instances of original BasicValue from ASM
with ones of StrictBasicValue having strict equals implementation

Optimization issue was related to non-symmetric 'equals':
- NotNullBasicValue("java/lang/Object").equals(BasicValue("java/lang/Object")) == false
- BasicValue("java/lang/Object").equals(NotNullBasicValue("java/lang/Object")) == true

 #KT-14242 Fixed
2016-10-25 10:14:52 +03:00
Valentin Kipyatkov
18f10860df KT-14336 for to stdlib to takeWhile: propose conversion into takeWhile if break is located in else branch
#KT-14336 Fixed
2016-10-24 18:32:05 +03:00
Valentin Kipyatkov
5c8db294df Fixed index variable case 2016-10-24 18:32:05 +03:00
Valentin Kipyatkov
e5fcfae969 KT-13998 Loop to call chain converter produces 'none' instead of 'all'
#KT-13998 Fixed
2016-10-24 18:32:04 +03:00
Valentin Kipyatkov
89099b93b1 Split or glue together checks for not null and is instance + more intelligent use of filter vs filterTo
#KT-14284 Fixed
 #KT-14286 Fixed
 #KT-14287 Fixed
 #KT-14303 Fixed
2016-10-24 18:32:04 +03:00
Valentin Kipyatkov
53220b980e More correct checking of forEach requiring asSequence() 2016-10-24 18:32:04 +03:00
Valentin Kipyatkov
a87ca8432e KT-14341 for to stdlib to forEach: if the loop variable is not used in the last/innerest statement the conversion is not proposed
#KT-14341 Fixed
2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
5ca7688b7c Correct handling of explicit variable type 2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
9326dfa048 Honor errors in code before when checking smart casts 2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
eae23b548f KT-14294 for to stdlib to firstOrNull/lastOrNull: intention is absent if there is additional var before for loop
#KT-14294 Fixed
2016-10-24 18:32:03 +03:00
Valentin Kipyatkov
a89ef54578 KT-14210 for loop to stdlib: max/min is not recognized if there is additional if
#KT-14210 Fixed
2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
35ed689b9f any() and other find operations to work with checks for not null and is instance 2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
49ef880f3a Moved matcher 2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
b28d016709 count() to merge with filterNotNull and filterIsInstance + changed test for KT-14191 to use sum() 2016-10-24 18:32:02 +03:00
Valentin Kipyatkov
afd25548a2 KT-14209 for loop to stdlib: sum is not recognized if before was check for type
#KT-14209 Fixed
2016-10-24 18:32:01 +03:00
Valentin Kipyatkov
f5d4b1dc8d KT-14191 FormattingModelInconsistencyException Exception on applying intention Replace with count()
#KT-14191 Fixed
2016-10-24 18:32:01 +03:00
Denis Zharkov
10861e57ff Fix NDFDE for single underscore named property in primary constructor
NDFDE = NoDescriptorForDeclarationException

See the comment in change
2016-10-24 18:00:02 +03:00
Denis Zharkov
09dc207052 Add SingleUnderscoreForParameterName language feature 2016-10-24 18:00:02 +03:00
Denis Zharkov
1f0293eb42 Check modifiers applicability on destructured lambda parameters
#KT-14502 Fixed
2016-10-24 18:00:02 +03:00
Nikolay Krasko
8865c0be34 Step into functions with local variable on first line under "Skip simple getters" (KT-14488)
(cherry picked from commit 9423d65)

 #KT-14488 Fixed
2016-10-24 16:28:17 +03:00
Alexander Udalov
3f5d3e5dbc Fix errors and indent in built-ins sources 2016-10-24 15:30:40 +03:00
Alexander Udalov
2076a31094 Improve Collection/Array/String detection logic in intentions
Use static methods from KotlinBuiltIns and check all supertypes, support cases
of Collection, Map and CharSequence
2016-10-24 15:30:39 +03:00
Alexander Udalov
a5a422fc4d Use TypeConstructor equality instead of ClassDescriptor in CollectionStubMethodGenerator
Equals/hashCode are meaningful for TypeConstructor instances (see
AbstractClassTypeConstructor.java) in contrast to ClassDescriptor where
equality is referential
2016-10-24 15:30:39 +03:00
Alexander Udalov
08398178e0 Make class descriptors in JvmRuntimeTypes lazy
The main reason currently is to avoid eager construction of
defaultContinuationSupertype long before it's needed, which could fail without
built-ins in the classpath
2016-10-24 15:30:39 +03:00
Alexander Udalov
e1aaccaec1 J2K JvmRuntimeTypes: prettify 2016-10-24 15:30:39 +03:00
Alexander Udalov
32b672490f J2K JvmRuntimeTypes: convert 2016-10-24 15:30:39 +03:00
Alexander Udalov
9e4ffd9225 J2K JvmRuntimeTypes: rename .java -> .kt 2016-10-24 15:30:38 +03:00
Alexander Udalov
d9f248ccf4 Minor refactoring in JvmDependenciesIndexImpl
Make SearchResult a sealed class, inline local function & trivial utility
2016-10-24 15:30:38 +03:00
Alexander Udalov
76523cc175 Split JvmDependenciesIndex to several files, move to 'index' package 2016-10-24 15:30:38 +03:00
Alexander Udalov
cdf6567375 Drop TypeConstructor.getAnnotations(), uninherit TypeConstructor from Annotated
The method was unused on TypeConstructor instances, and almost all
implementations returned EMPTY anyway
2016-10-24 15:30:38 +03:00
Alexander Udalov
6b6ddf5f75 Import classes from kotlin.coroutines by default, add to default imports in JS 2016-10-24 15:30:38 +03:00
Mikhail Glukhikh
44d10672be KT-7929 related: KtDestructuringDeclarationEntry is not resolved to descriptor in OverridingDeprecatedMemberInspection 2016-10-24 15:17:56 +03:00
Mikhail Glukhikh
6b9252a5d3 KT-7929 related: incorrect KtDestructuringDeclarationEntry is not resolved to descriptor, fixes EA-76715 2016-10-24 15:17:52 +03:00
Mikhail Glukhikh
1c8a2bb4cc No more attempts to resolve KtDestructuringDeclaration to descriptor #KT-7929 Fixed
Also #KT-8442 Fixed
2016-10-24 15:17:48 +03:00
Denis Zharkov
7d89869c02 Do not suggest "Remove parameter" quick-fix on lambdas
Only "Rename to _" should work in the case.

The problem is that removing lambda's parameter may lead behaviour changes.
This quick-fix was not being invoked run before KT-14347 had been implemented

# Conflicts:
#	idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java
2016-10-24 10:19:25 +03:00
Denis Zharkov
5e1b219784 Implement quick-fix replacing parameter name with _
This quick-fix is registered for UNUSED_* diagnostic in places
where it can be applied (destructured declarations/lambda parameters)

 #KT-14431 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov
51f4244980 Report UNUSED_DESTRUCTURED_PARAMETER_ENTRY
on destructured lambda parameters

 #KT-14347 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov
9716d2ad54 Minor. Extract method in ControlFlowProcessor 2016-10-24 10:19:25 +03:00
Denis Zharkov
8a2c9ec7fe Minor. Extract method from the huge when entry 2016-10-24 10:19:25 +03:00
Denis Zharkov
4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00
Denis Zharkov
a9fcee098d Support single-underscore named variables in JVM backend
There are mainly two kind of changes:
- skipping 'componentX' calls for destructuring entries named _
- fixing local variable table for them
 - skip entries for destructuring entries named _
 - use $noName_<i> format for lambda parameters named _

 #KT-3824 Fixed
 #KT-2783 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov
544d8f5b66 Minor. Extract method for retreiving variable descriptor in codegen 2016-10-24 10:19:25 +03:00
Denis Zharkov
4041c702b3 Minor. Get rid of code duplication
For initialization of destructuring entries in loops use the same logic
as for common local destructuring

The behavior may change a little: variable start label in a table
becomes less precise (now it starts a little bit earlier than it become initialized),
but it can't be very important as the same logic works for common
destructuring
2016-10-24 10:19:25 +03:00
Denis Zharkov
dbca310d8c Support single-underscore variable names partially
Currently only parameters of lambdas/function expressions
and destructuring entries are allowed

 #KT-3824 In Progress
 #KT-2783 In Progress
2016-10-24 10:19:25 +03:00
Ilya Gorbunov
82364ad3e5 Filter out typealiases invisible due to API_VERSION < their SinceKotlin version, when determining excluded imports. 2016-10-21 18:19:03 +03:00
Ilya Gorbunov
11b03ebbb3 Annotate type aliases in kotlin-runtime with SinceKotlin 2016-10-21 18:19:03 +03:00
Alexander Udalov
47498ef835 Move ImportPath from 'descriptors' to 'frontend' 2016-10-21 17:10:41 +03:00
Alexander Udalov
4c52ce37d2 Drop TargetPlatform in utilities for module creation 2016-10-21 17:10:40 +03:00
Alexander Udalov
56e2173b3c Extract platform-independent default imports to TargetPlatform.Default.defaultImports
This is needed because SourceNavigationHelper uses default platform and it
needs default imports to be able to resolve references (otherwise
NavigateToLibrarySourceTestGenerated breaks)
2016-10-21 17:10:39 +03:00
Alexander Udalov
9ec781e859 Get rid of ModuleDescriptor#defaultImports, use DefaultImportProvider 2016-10-21 17:04:59 +03:00
Alexander Udalov
43c2b21987 Move import exclusion logic from ModuleDescriptorImpl to frontend 2016-10-21 17:04:58 +03:00
Alexey Tsvetkov
2bf0eb9e69 Fix pom.xml 2016-10-21 16:22:38 +03:00
Alexey Tsvetkov
0af7017836 Introduce common interface for common gradle options
This might be useful for future kotlin build scripts
2016-10-21 16:22:38 +03:00
Alexey Tsvetkov
b7d97a3aa2 Do not remove annotations.txt (kapt1) file before kotlin compiler is called
#KT-14250 fixed

 Before this change the following could happen:
 0. Successful build.
 1. Only java files are changed.
 2. CompileKotlin task starts because java files are also input files for kotlin.
 3. annotations.txt file is deleted, but kotlin compiler is not called, so it is not regenerated.
 4. Javac fails.
2016-10-21 16:22:38 +03:00
Nikolay Krasko
770ea75138 Regenerate formatter tests 2016-10-21 15:58:29 +03:00
Mikhail Glukhikh
bfaa9cf56f UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed 2016-10-21 10:31:50 +03:00
Dmitry Petrov
4fc135709e Inner classes lowering: remap old constructor parameters. 2016-10-21 10:05:41 +03:00
Dmitry Petrov
2986e7b508 Check for repeated annotations in type alias expansion. 2016-10-21 09:56:10 +03:00
Dmitry Petrov
5531762ab1 Check for repeated annotations in type alias declaration. 2016-10-21 09:56:10 +03:00
Ilya Gorbunov
c2554bd30e Use stable kotlin (1.0.x) for kotlin-stdlib-gen to compile with and compile against.
Makes it easy for kontributors to run the generator.
2016-10-21 04:35:00 +03:00
Nikolay Krasko
355dca2a97 Add toString for KotlinStubBaseImpl
Try to simplify "Stub and PSI element type mismatch" exception analyze.

(cherry picked from commit 11aa71e)
2016-10-21 00:18:27 +03:00
Mikhail Glukhikh
1e04945609 CFG refactoring: get rid of mergeWithLocalDeclarations (always true) + minor style fixes 2016-10-20 19:52:52 +03:00
Mikhail Glukhikh
cce3a77e5e Minor cleanup 2016-10-20 19:52:48 +03:00
Mikhail Glukhikh
a19d178867 Initialization analysis : more accurate handling of non-local variables while merging data #KT-14304 Fixed 2016-10-20 19:52:44 +03:00
Mikhail Glukhikh
bba34e0caa Minor style fix 2016-10-20 19:52:40 +03:00
Nikolay Krasko
e41886c1e7 J2K: actual convert for AbstractStubBuilderTest
(cherry picked from commit 33fa19b)
2016-10-20 19:22:07 +03:00
Nikolay Krasko
17e4cfd400 J2K: rename AbstractStubBuilderTest
(cherry picked from commit 31a356a)
2016-10-20 19:22:05 +03:00
Nikolay Krasko
2b231f7e31 Auto-indent line with chain-call continuation
(cherry picked from commit fdb4120)
2016-10-20 19:22:02 +03:00
Dmitry Neverov
3cc3ad2b9e Fix spaces in labeled expression (KT-14131)
https://github.com/JetBrains/kotlin/pull/978

(cherry picked from commit fdd5ba7)
2016-10-20 19:22:00 +03:00
Zalim Bashorov
bdecb661e3 KJS: fix wrongAbiVersion test after abi version was increased. Make it less fragile with the hack for JS tests. 2016-10-20 13:47:50 +03:00
Alexey Andreev
f22a507e39 JS: add test to prove that #KT-5051 is no more reproducible 2016-10-20 12:16:30 +03:00
Alexey Andreev
6d230aad35 Suppress tests marked by TARGET_BACKEND directive when running Android codegen tests 2016-10-20 12:15:40 +03:00
Dmitry Petrov
c41ec1ddfb KT-14400: Properly handle TypeAliasConstructorDescriptor in KotlinTypeMapper.mapToCallableMethod(...)
Implement getDefaultType() in TypeAliasDescriptor subclasses.
2016-10-20 09:56:03 +03:00
Dmitry Petrov
7dce1f438f Inner classes lowering. 2016-10-19 19:13:40 +03:00
Dmitry Jemerov
f933cf5395 Specify test framework to use explicitly in generate test tests 2016-10-19 17:04:42 +02:00
Denis Zharkov
4793f71da2 Properly generate indices for destructured parameters in inline case
#KT-14399 Fixed
2016-10-19 16:05:50 +03:00
Dmitry Jemerov
32290ec1d3 add missing prepareForWrite() calls 2016-10-19 13:24:42 +02:00
Nikolay Krasko
33f01ca5f3 Ignore not-prepared classes and add diagnostics for not-prepared classes for getting fields (EA-85900)
(cherry picked from commit 2ce6069)
2016-10-19 14:05:15 +03:00
Nikolay Krasko
67cc6bb004 Insert '()' under write action in finishing anonymous object template (EA-82700)
(cherry picked from commit 3234d76)
2016-10-19 14:05:06 +03:00
Zalim Bashorov
3513cef779 KJS: increase JS binary version since name mangling slightly changed 2016-10-19 12:57:46 +03:00
Alexander Udalov
7b2a80ffa4 Fix incremental recompilation of JvmMultifileClass with top level function
See 53b584f and previous changes where this behavior was broken (this was
untested, however). Fixes EA-90065
2016-10-19 12:50:10 +03:00
Ilya Gorbunov
0ac461927c Minor: Fix TODOs in stdlib tests 2016-10-18 17:13:17 +03:00
Ilya Gorbunov
68411aaa69 Add instruction how to run binary compatibility validator, share run configuration with its tests 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
23c6f6b5ee Report more details about update checker exceptions. 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
5db67ba2df diagnostics for EA-79913 - AIOOBE: ByDescriptorIndexer.getDeclarationForDescriptor$idea_analysis 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
221b55550c handle elements with null containing file (EA-84533 - IAE: KtPsiFactoryKt.getModuleInfo) 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
ada6e2a906 catch I/O exceptions from prepareToInstall() (EA-86183 - SE: AppInputStream.read) 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
0a8f01c6b2 EA-89031 - IAE: SmartTypeRenderer.render 2016-10-18 16:48:09 +03:00
Dmitry Jemerov
1144a5e136 EA-87284 - KNPE: KotlinTestRunLineMarkerContributor.getInfo 2016-10-18 16:48:09 +03:00
Alexey Sedunov
8c3fcf69f2 Convert Receiver to Parameter Intention: Update function descriptor after template is finished (otherwise some references may be processed incorrectly) 2016-10-18 16:48:09 +03:00
Alexey Sedunov
51566942f6 Add Library Quick-fix: Fix exception due to resolution being run in the "dumb mode"
#KT-14199 Fixed
2016-10-18 16:48:09 +03:00
Alexey Sedunov
cf69f1a946 Rename: Do not suggest type-based names for functions with primitive return types
#KT-14234 Fixed
2016-10-18 16:48:09 +03:00
Alexey Sedunov
394859afc5 Light Classes: Avoid empty scope on KtLightParameter
#KT-13882 Fixed
2016-10-18 16:48:09 +03:00
Dmitry Petrov
d397ef1ff8 Minor: Update generated tests for IR back-end. 2016-10-18 16:10:59 +03:00
Nikolay Krasko
74f0bb3d4e Remove mentioning KT-11395 from the wrong test
(cherry picked from commit c4fb0e9)

 #KT-11395 Open
2016-10-18 15:41:18 +03:00
Nikolay Krasko
b76ae9b35d Stop wrapping ProcessCanceledException into KotlinFrontEndException (EA-86153)
(cherry picked from commit 0ec664b)
2016-10-18 15:41:16 +03:00
Nikolay Krasko
a30d0d0f1e Commit all documents after J2K (KT-13584, EA-82451)
New Kotlin file will be generated after converting, they are created for virtual files that were renamed from Java.
The exception happens when Java file was previously opened in editor, in that case text is restored through getLastCommittedText(document) where
document is resored for virtual file.

See: SingleRootFileViewProvider.VirtualFileContent.getText()

Exception descriptions also mention "Create Test" action as a problem source. The issue was reproduced when J2K convertion was performed
on test creation.

(cherry picked from commit e44260a)

 #KT-13584 Fixed
2016-10-18 15:41:15 +03:00
Michael Bogdanov
c5e8139236 Test data fix 2016-10-18 15:26:24 +03:00
Denis Zharkov
aa281a659a Update ChangeLog.md 2016-10-18 14:40:21 +03:00
Dmitry Neverov
c3c5805a5f Fix indent in constructor delegate call (KT-7718)
(cherry picked from commit 5699b14)

 #KT-7718 Fixed
2016-10-18 14:01:51 +03:00
Zalim Bashorov
5f2ba70745 KJS: use cached KClass instead create new each time when getting it from JsClass 2016-10-18 13:26:05 +03:00
Zalim Bashorov
a085df914f KJS: allow to use KClass::isInstance; implement isInstance in KClassImpl 2016-10-18 13:26:05 +03:00
Denis Zharkov
6caf3c1c0f Update ChangeLog.md
- Fix formatting
- Refine some description notes
2016-10-18 13:18:43 +03:00
Valentin Kipyatkov
7ab2d0c951 KT-13810 Kotlin code completion missing last character
#KT-13810 Fixed
2016-10-18 11:56:59 +03:00
Michael Bogdanov
d48ef2efc7 Fix for KT-14012: Back-end (JVM) Internal error every first compilation after the source code change
#KT-14012 Fixed
2016-10-18 10:46:51 +03:00
Denis Zharkov
783e5e9083 Remove irrelevant notes from ChangeLog.md
KT-12707: is already in 1.0.5
KT-13836: as type aliases were unsupported there's no sense to mention
the issue
2016-10-18 09:56:47 +03:00
Dmitry Petrov
b5d81d8e31 Preparations to push to master branch.
Introduce tests-ir-jvm module (for IR-based JVM BE tests).
2016-10-18 09:15:19 +03:00
Michael Bogdanov
555f3e903e Rebase fixes 2016-10-18 09:10:20 +03:00
Michael Bogdanov
406fbfdba8 Synthetic accessors support 2016-10-18 09:10:20 +03:00
Michael Bogdanov
20c4f47253 Properly lower ImplicitClassReceiver 2016-10-18 09:10:19 +03:00
Dmitry Petrov
a93f929615 Minor: IrElementVisitorVoid#visitGetVariable -> visitGetValue 2016-10-18 09:10:19 +03:00
Dmitry Petrov
703110c0e2 Update after rebase on master. 2016-10-18 09:10:18 +03:00
Dmitry Petrov
6c9b8792c7 Minor: cleanup, use PropertyDescriptorImpl.initialize(...) 2016-10-18 09:10:18 +03:00
Dmitry Petrov
8d7c201339 Refactor special descriptors. 2016-10-18 09:10:17 +03:00
Dmitry Petrov
9b1e87ec84 Minor fixes. 2016-10-18 09:10:17 +03:00
Dmitry Petrov
a96aac090e Shared variables lowering: skip irrelevant variables. 2016-10-18 09:10:16 +03:00
Dmitry Petrov
fb5298237a Shared variables lowering. 2016-10-18 09:10:16 +03:00
Dmitry Petrov
fedfd3de16 Suggest names for captured receivers. 2016-10-18 09:10:15 +03:00
Michael Bogdanov
1658e110f2 Support default values for annotation properties 2016-10-18 09:10:15 +03:00
Michael Bogdanov
4b6ddc4a9d Initial annotation support 2016-10-18 09:10:15 +03:00
Michael Bogdanov
0bc3cc5e20 Object, enum processing on delegation generation 2016-10-18 09:10:14 +03:00
Michael Bogdanov
289cc8fed7 Added extension receiver procesing on interface lowering 2016-10-18 09:10:14 +03:00
Michael Bogdanov
f0d09288a8 Initial KCallableNameProperty support 2016-10-18 09:10:13 +03:00
Michael Bogdanov
b72d7557d1 KClassJavaProperty support 2016-10-18 09:10:13 +03:00
Dmitry Petrov
5ee2f87c4a Closure conversion: simple tests work. 2016-10-18 09:10:12 +03:00
Michael Bogdanov
6bd27e52bc Don't wrap return and error expressions into returns 2016-10-18 09:10:12 +03:00
Michael Bogdanov
72eb317164 Further try/catch/finally support 2016-10-18 09:10:11 +03:00
Michael Bogdanov
f1ea31450e Remove private methods from interface on lowering 2016-10-18 09:10:11 +03:00
Michael Bogdanov
59fc5befad !is support 2016-10-18 09:10:10 +03:00
Michael Bogdanov
12235faa39 Return proper type after cast 2016-10-18 09:10:10 +03:00
Michael Bogdanov
171e607250 Spread support 2016-10-18 09:10:10 +03:00
Michael Bogdanov
e965a2b3b5 Further SyntheticJavaPropertyDescriptor support 2016-10-18 09:10:09 +03:00
Michael Bogdanov
d6b5e48b2a Wrap Nothing type into return expression 2016-10-18 09:10:09 +03:00
Michael Bogdanov
5121fcb287 Initial try/catch/finally support 2016-10-18 09:10:08 +03:00
Michael Bogdanov
4bcd3d1bdb Support break/continue 2016-10-18 09:10:08 +03:00
Michael Bogdanov
e5bccf0963 Support do while cycles 2016-10-18 09:10:07 +03:00
Michael Bogdanov
70dbccb95e Sealed modality support 2016-10-18 09:10:07 +03:00
Michael Bogdanov
29d1231b97 Empty vararg support and SyntheticJavaPropertyDescriptor properties 2016-10-18 09:10:06 +03:00
Michael Bogdanov
45ebe354ee Initial support of const and @JvmField properties 2016-10-18 09:10:06 +03:00
Michael Bogdanov
e543972dad Properly calculate safe call receivers 2016-10-18 09:10:05 +03:00
Michael Bogdanov
bc6f691405 DefaultImpls fixes 2016-10-18 09:10:05 +03:00
Michael Bogdanov
c22bfaeefb Annotation class support 2016-10-18 09:10:04 +03:00
Michael Bogdanov
3fe84bba6c Initial IMPLICIT_NOT_NULL support 2016-10-18 09:10:04 +03:00
Michael Bogdanov
03ebf06cf8 Proper type for default parameters 2016-10-18 09:10:03 +03:00
Michael Bogdanov
e40c434c57 Write inner class attributes 2016-10-18 09:10:03 +03:00
Michael Bogdanov
0b45655b7b Support exhaustive when 2016-10-18 09:10:02 +03:00
Michael Bogdanov
a0d9d24c1f Introduced IrElseBranch 2016-10-18 09:10:01 +03:00
Michael Bogdanov
26b2a069fd Initial KClassJavaProperty support 2016-10-18 09:10:01 +03:00
Michael Bogdanov
607cf4c86d Support Nothing return type 2016-10-18 09:10:00 +03:00
Michael Bogdanov
24863a84c4 Return only onStack/none stackValues in results 2016-10-18 09:10:00 +03:00
Dmitry Petrov
a51efaacc9 Introduce IrGetValue as a replacement for IrThisReference / IrGetExtensionReceiver / IrGetVariable. 2016-10-18 09:09:59 +03:00
Dmitry Petrov
8efe326904 Introduce ValueDescriptor as a common super-interface
of ParameterDescriptor and VariableDescriptor.
2016-10-18 09:09:59 +03:00
Dmitry Petrov
b6c63a7823 Ignore type aliases in code generation. 2016-10-18 09:09:58 +03:00
Dmitry Petrov
2ead71ff86 Enum class is 'abstract' if it contains abstract members. 2016-10-18 09:09:58 +03:00
Michael Bogdanov
3a9f1e267b Anonymous object support 2016-10-18 09:09:57 +03:00
Michael Bogdanov
567b174e15 Funther default impl support 2016-10-18 09:09:57 +03:00
Dmitry Petrov
608d6a37d2 Some enum-related fixes
(NB: testEnumClass3 doesn't work yet, effective modality required for enum class)
2016-10-18 09:09:57 +03:00
Dmitry Petrov
de2bef910b Assertion error on singleton values in ExpressionCodegen. 2016-10-18 09:09:56 +03:00
Dmitry Petrov
f423369327 Objects (singletons) lowering. 2016-10-18 09:09:56 +03:00
Michael Bogdanov
866def0d20 Intrinsic fixes 2016-10-18 09:09:55 +03:00
Dmitry Petrov
fc754e533d Enum classes lowering. 2016-10-18 09:09:55 +03:00
Michael Bogdanov
af76840826 Support some new intrinsics 2016-10-18 09:09:54 +03:00
Michael Bogdanov
1cda60fcd1 Cast return expression to function return type 2016-10-18 09:09:54 +03:00
Michael Bogdanov
f30027b4de Generate ir-accessors for interface properties 2016-10-18 09:09:53 +03:00
Michael Bogdanov
011ed60eee Support default impls 2016-10-18 09:09:53 +03:00
Dmitry Petrov
7950235df3 Lowering for constructors & initializers. 2016-10-18 09:09:52 +03:00
Michael Bogdanov
6d575c1437 'Throw' support 2016-10-18 09:09:52 +03:00
Michael Bogdanov
a721876b67 Implicit cast support 2016-10-18 09:09:51 +03:00
Mikhail Glukhikh
9609c8af90 IR CFG: IrStatement is now used for CFG representation instead of IrElement 2016-10-18 09:09:51 +03:00
Mikhail Glukhikh
07eae1d206 IR to CFG: type operator unrolling 2016-10-18 09:09:50 +03:00
Mikhail Glukhikh
ea13386d0b IR to CFG: member access unrolling 2016-10-18 09:09:50 +03:00
Mikhail Glukhikh
5a04c72e75 Break / continue implementation, test with break / continue, related changes in loop & loop tests 2016-10-18 09:09:49 +03:00
Mikhail Glukhikh
e03e13af43 Do..while loop implementation and first test 2016-10-18 09:09:49 +03:00
Mikhail Glukhikh
bcf2b410ba While loop implementation && first loop test 2016-10-18 09:09:48 +03:00
Mikhail Glukhikh
979f2231a1 IR to CFG: when implementation in function generator, some when tests 2016-10-18 09:09:48 +03:00
Mikhail Glukhikh
eaf10a4675 IR to CFG test generator, sequential function tests 2016-10-18 09:09:47 +03:00
Mikhail Glukhikh
65db7aa1ba CFG renderer 2016-10-18 09:09:47 +03:00
Mikhail Glukhikh
bab0abeee6 IR to CFG: function generator (initial version) 2016-10-18 09:09:47 +03:00
Mikhail Glukhikh
ae96afb1dc CFG: function builder 2016-10-18 09:09:46 +03:00
Mikhail Glukhikh
59cdcdba28 CFG: interfaces implementation and builders 2016-10-18 09:09:46 +03:00
Mikhail Glukhikh
db810e55d3 Basic CFG interfaces 2016-10-18 09:09:45 +03:00
Mikhail Glukhikh
779d4f7f3e Module compiler/ir/ir2cfg added 2016-10-18 09:09:45 +03:00
Dmitry Petrov
45c999788a Deep copy for IR elements.
NB: we can transform descriptors during copying.
2016-10-18 09:09:44 +03:00
Michael Bogdanov
31d971a302 Get rid of impl classes 2016-10-18 09:09:44 +03:00
Michael Bogdanov
bdecffa1e1 Support singleton access 2016-10-18 09:09:43 +03:00
Michael Bogdanov
58ba5ed37b Default args support 2016-10-18 09:09:43 +03:00
Michael Bogdanov
bf822daa3b INSTANCEOF support 2016-10-18 09:09:42 +03:00
Michael Bogdanov
869f60a053 When and safe cast support 2016-10-18 09:09:42 +03:00
Michael Bogdanov
c34d140a53 Intrinsics update 2016-10-18 09:09:41 +03:00
Dmitry Petrov
e8c7c821a7 FileClassDescriptor should provide all information required for TypeMapper. 2016-10-18 09:09:41 +03:00
Dmitry Petrov
ce8bdef746 Minor: rename. 2016-10-18 09:09:40 +03:00
Dmitry Petrov
d66d582f25 Update to origin/master.
IrReturn should return 'Unit' for "return without value".
2016-10-18 09:09:40 +03:00
Michael Bogdanov
97dbec06e5 Codegen impl classes moved to 'codegen' package 2016-10-18 09:09:39 +03:00
Michael Bogdanov
29bd7c3804 Experimental 'CompareTo' intrinsic 2016-10-18 09:09:39 +03:00
Michael Bogdanov
0c92174e42 FunctionCodegen -> JvmFunctionCodegen 2016-10-18 09:09:39 +03:00
Dmitry Petrov
8551bcf103 Refactor IrWhen. 2016-10-18 09:09:38 +03:00
Michael Bogdanov
aca71dea22 Constuctors support, refactoring 2016-10-18 09:09:38 +03:00
Michael Bogdanov
204a8c5c14 Initial intrinsic implementation 2016-10-18 09:09:37 +03:00
Michael Bogdanov
95c88e4445 infrastructure 2016-10-18 09:09:37 +03:00
Michael Bogdanov
ca97f17cb6 Hack: intrinsic package support in typeMapper 2016-10-18 09:09:36 +03:00
Michael Bogdanov
b07fc09dac Added experimental coercion 2016-10-18 09:09:36 +03:00
Michael Bogdanov
7ad69bbea1 Add IR black box tests 2016-10-18 09:09:35 +03:00
Michael Bogdanov
978a4db07b Introduced IR CodegenFactory, added configuration key to enable it 2016-10-18 09:09:35 +03:00
Michael Bogdanov
0c60b21cca Package part support 2016-10-18 09:09:34 +03:00
Michael Bogdanov
1d8b9c5a58 Initial implementation of ExpressionCodegen 2016-10-18 09:09:34 +03:00
Michael Bogdanov
99e7df7035 Remove duplicated line from build.xml 2016-10-18 09:09:33 +03:00
Michael Bogdanov
fa5095977f JvmClassGenerator->JvmClassCodegen 2016-10-18 09:09:33 +03:00
Michael Bogdanov
fe51c35298 Fix for 'getNthResult' in IfThenElse expression impl 2016-10-18 09:09:32 +03:00
Dmitry Petrov
f4aee6cab5 Update testData. 2016-10-18 09:09:32 +03:00
Dmitry Petrov
7e7bc127d1 Coerce finally expression to Unit 2016-10-18 09:09:31 +03:00
Dmitry Petrov
663eb21990 Coerce loop body to Unit. 2016-10-18 09:09:31 +03:00
Dmitry Petrov
291d535de7 Fix IR generation for string templates containing single entry. 2016-10-18 09:09:30 +03:00
Dmitry Petrov
1c2a676cd6 Make coercion to Unit explicit in IR. 2016-10-18 09:09:30 +03:00
Dmitry Petrov
233a979932 Source element for file classes. 2016-10-18 09:09:29 +03:00
Dmitry Petrov
16334771ad Minor: comment for IrMemberAccessExpression::getTypeArgument 2016-10-18 09:09:29 +03:00
Dmitry Petrov
7ae6c55ddb IrMemberAccessExpression::getTypeArgument 2016-10-18 09:09:28 +03:00
Dmitry Petrov
89de2a2ebe Drop IrGeneralCall, pull up corresponding members to IrMemberAccessExpression. 2016-10-18 09:09:28 +03:00
Dmitry Petrov
d67d8016d3 Lowering for property declarations. 2016-10-18 09:09:27 +03:00
Dmitry Petrov
b19bcc0587 IrElementTransformerVoid 2016-10-18 09:09:27 +03:00
Dmitry Petrov
e0129ef33b IrDeclaration.transform(transformer, data) returns IrStatement.
Declaration containers assume that transformers maintain declaration structure.
2016-10-18 09:09:26 +03:00
Dmitry Petrov
65dcdaecfb Minor: irFile. 2016-10-18 09:09:26 +03:00
Dmitry Petrov
2b5cb0f722 Make statement containers mutable. 2016-10-18 09:09:26 +03:00
Dmitry Petrov
4c88ad408f Make declaration containers mutable. 2016-10-18 09:09:25 +03:00
Dmitry Petrov
4b9c5effd3 Minor: irElement rendering 2016-10-18 09:09:25 +03:00
Dmitry Petrov
90119880c5 IrCatch element. 2016-10-18 09:09:24 +03:00
Michael Bogdanov
c02ae4a4a5 Initial implemetation of JvmClassGenerator 2016-10-18 09:09:23 +03:00
Michael Bogdanov
4e258df26b Extract super class info calculation to utility class, make 'signature' static 2016-10-18 09:09:23 +03:00
Michael Bogdanov
709bc08fbd Add IR->JVM output to bytecode tool window 2016-10-18 09:09:22 +03:00
Michael Bogdanov
0838b28e10 Add IR modules to build.xml 2016-10-18 09:09:22 +03:00
Dmitry Petrov
001b95473a Drop 'parent' and 'slot'. 2016-10-18 09:09:21 +03:00
Dmitry Petrov
a8a6477ce5 IrOperator -> IrStatementOrigin 2016-10-18 09:09:21 +03:00
Dmitry Petrov
5386d27284 File class lowering 2016-10-18 09:09:20 +03:00
Dmitry Petrov
a25e781ee9 Minor: IrFieldAccessExpression, visitor methods. 2016-10-18 09:09:19 +03:00
Dmitry Petrov
c699e2d24c Include declaration origin in testData. 2016-10-18 09:09:19 +03:00
Dmitry Petrov
c2a7890ac4 JvmBackendFacade (initial import) 2016-10-18 09:09:18 +03:00
Dmitry Petrov
c4391ebce5 Minor: add test for suppressed error. 2016-10-18 09:09:18 +03:00
Dmitry Petrov
3fa33b5969 Fix compound assignment on arbitrary expression in LHS
(with a convention compound assignment operator defined).
2016-10-18 09:09:17 +03:00
Dmitry Petrov
0cdf831bf0 IrDeclarationContainer as a super-interface for IrFile and IrClass.
Builder for IrDeclarationContainer (initial implementation; TODO more flexible builders).
2016-10-18 09:09:16 +03:00
Dmitry Petrov
1a3dedaf1c Minor: add test for primary constructor default parameter values. 2016-10-18 09:09:16 +03:00
Dmitry Petrov
201d2414bc Properties declared in primary constructors should have proper accessors in IR. 2016-10-18 09:09:15 +03:00
Dmitry Petrov
5c720845a8 Drop IrPropertyAccessor (and subclasses).
Drop IrLocalPropertyAccessor (and subclasses).
Introduce IrField.
2016-10-18 09:09:15 +03:00
Dmitry Petrov
121e949a33 Minor: LocalVariableAccessorDescriptor modality should be FINAL
(otherwise it breaks MemberDescriptor contract).
2016-10-18 09:09:14 +03:00
Dmitry Petrov
aee2a58385 Drop assertDetached, unneeded ceremony. 2016-10-18 09:09:14 +03:00
Dmitry Petrov
00093ac901 Move IR tests to module 'compiler-tests'
(due to dependencies on classes from 'compiler-tests').

Minor: remove unused imports.
2016-10-18 09:09:13 +03:00
Dmitry Petrov
00a74699e2 SourceLocationManager -> SourceManager 2016-10-18 09:09:13 +03:00
Dmitry Petrov
1e00561b6f IrModule -> IrModuleFragment 2016-10-18 09:09:13 +03:00
Dmitry Petrov
e8bacad62b backend: introduce 'CodegenFactory' interface with default implementation
creating PackageCodegen and MultifileClassCodegen from an existing JVM back-end.
2016-10-18 09:09:12 +03:00
Dmitry Petrov
838b639692 IrComposite - block introducing immediate declarations to the surrounding scope.
E.g., destructuring declaration is represented as IrComposite.
2016-10-18 09:09:12 +03:00
Dmitry Petrov
aaa5fa4209 Minor: cleanup in 'backend.jvm' 2016-10-18 09:09:11 +03:00
Dmitry Petrov
da4079bfe7 Move implementation classes to 'impl' packages. 2016-10-18 09:09:11 +03:00
Dmitry Petrov
d6a3246586 Use throwNoSuchSlot consistently. 2016-10-18 09:09:10 +03:00
Dmitry Petrov
40a60e430f - Compact representation for empty blocks.
- Fix some issues in IrBlockImpl.
2016-10-18 09:09:10 +03:00
Dmitry Petrov
09c52696a5 Unique numbers for "special" slots. 2016-10-18 09:09:09 +03:00
Dmitry Petrov
4e270ef487 Store file-level annotations in IrFile (should be on some descriptor, really). 2016-10-18 09:09:09 +03:00
Dmitry Petrov
e23325b014 Bound callable references. 2016-10-18 09:09:08 +03:00
Dmitry Petrov
0da4c08520 Handle unresolved break/continue expressions as error expressions. 2016-10-18 09:09:08 +03:00
Dmitry Petrov
c0ac607a1d Additional tests for integer literal type promotion. 2016-10-18 09:09:07 +03:00
Dmitry Petrov
0c0dac4822 Some additional secondary constructor examples. 2016-10-18 09:09:07 +03:00
Dmitry Petrov
3e96f7b015 Do not generate those 2300+ tests for now. 2016-10-18 09:09:06 +03:00
Dmitry Petrov
8fc16345e6 Property initializers from primary constructor parameters
are generated as property initializer expressions
and should not be repeated in primary constructor.
2016-10-18 09:09:06 +03:00
Dmitry Petrov
a9dbaca473 AbstractPsi2IrDiagnosticsTest 2016-10-18 09:09:05 +03:00
Dmitry Petrov
88e0fed5d3 Minor: AbstractPsi2IrBoxTestCase.kt 2016-10-18 09:09:05 +03:00
Dmitry Petrov
4eda19b36a Do not generate constructors for annotation classes. 2016-10-18 09:09:04 +03:00
Dmitry Petrov
4e112b3f88 testData format update: detailed descriptor rendering. 2016-10-18 09:09:04 +03:00
Dmitry Petrov
993c3fe51e - Render IrModule.
- Dump IR for box tests to .txt.
2016-10-18 09:09:03 +03:00
Dmitry Petrov
15ed21ebae Stable order for delegated members. 2016-10-18 09:09:03 +03:00
Dmitry Petrov
ec2cfd2389 AbstractClosureAnnotator for IR. 2016-10-18 09:09:02 +03:00
Dmitry Petrov
ceeccfa1b7 Properties without accessors are generated as
IrGetBackingField / IrSetBackingField expressions.
2016-10-18 09:09:01 +03:00
Dmitry Petrov
a1ad828ea8 IrElementVisitorVoid 2016-10-18 09:09:01 +03:00
Dmitry Petrov
e29b8e356c Do not hold PsiFile in PsiFileEntry. 2016-10-18 09:09:00 +03:00
Dmitry Petrov
513ef0c1c8 Add test for SAM adapter. 2016-10-18 09:09:00 +03:00
Dmitry Petrov
a4b9f6b215 Handle empty lambdas properly. 2016-10-18 09:09:00 +03:00
Dmitry Petrov
539d7ccf6f Support configuration directives FULL_JDK, WITH_RUNTIME, WITH_REFLECT in Psi2Ir tests. 2016-10-18 09:08:59 +03:00
Dmitry Petrov
d623c70778 Handle break/continue in loop header (condition for 'while', range for 'for'). 2016-10-18 09:08:59 +03:00
Dmitry Petrov
b3866d53cd Handle arbitrary variable as assignment LHS
(e.g., conventional compound assignment for a parameter value).
2016-10-18 09:08:58 +03:00
Dmitry Petrov
1e3cdf300a Generate default super constructor calls for secondary constructors. 2016-10-18 09:08:58 +03:00
Dmitry Petrov
4cc5fb7454 Always generate temporary variables for receivers in a property compound assignment
(emulate 'resolve' behavior).
2016-10-18 09:08:57 +03:00
Dmitry Petrov
28b3ea27f3 Generate explicit call to 'Any()' if no superclass found.
Generate call super-constructor calls as IrDelegatedConstructorCall.
2016-10-18 09:08:57 +03:00
Dmitry Petrov
535ddd639f 'ignoreErrors' as a PSI2IR configuration parameter. 2016-10-18 09:08:56 +03:00
Dmitry Petrov
ea83407dce Multiple minor fixes. 2016-10-18 09:08:56 +03:00
Dmitry Petrov
da93f57afb Default getter/setter bodies. 2016-10-18 09:08:55 +03:00
Dmitry Petrov
fed09f059b Byte and Short literals. 2016-10-18 09:08:55 +03:00
Dmitry Petrov
66f6ce7f26 --- testdata for unresolvedReference 2016-10-18 09:08:54 +03:00
Dmitry Petrov
5cb7566975 Psi2IR acceptance test (failing). 2016-10-18 09:08:54 +03:00
Dmitry Petrov
a3dadd9e3f Callable references now can have receivers and arguments
(for bound references implementation).
2016-10-18 09:08:53 +03:00
Dmitry Petrov
fe397eddbe Handle erroneous code (initial drop, TBD). 2016-10-18 09:08:53 +03:00
Dmitry Petrov
bf03be97a1 Minor: workaround for IDE exception (1186485). 2016-10-18 09:08:52 +03:00
Dmitry Petrov
3c0cce4c48 Reflection literals (no bound member references yet). 2016-10-18 09:08:52 +03:00
Dmitry Petrov
8b95992af1 Generate get/set for local delegated properties as accessor calls. 2016-10-18 09:08:51 +03:00
Dmitry Petrov
f2e778d2d0 Some more tests. 2016-10-18 09:08:51 +03:00
Dmitry Petrov
42988383e0 Local delegated properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov
e42116bb6a Delegated implementations for properties and extension properties. 2016-10-18 09:08:50 +03:00
Dmitry Petrov
d27f22ae0e Delegated implementations for functions and extension functions. 2016-10-18 09:08:49 +03:00
Dmitry Petrov
2438876173 Implementing interface by delegation: creating delegates in class. 2016-10-18 09:08:49 +03:00
Dmitry Petrov
264c8afc78 Type aliases. 2016-10-18 09:08:48 +03:00
Dmitry Petrov
1b5dd50359 Represent class instance initialization "as from resolve". 2016-10-18 09:08:48 +03:00
Dmitry Petrov
c3c758c7cc Do not generate underlying classes for enum entries without member declarations. 2016-10-18 09:08:47 +03:00
Dmitry Petrov
759f0168c2 Delegated properties. 2016-10-18 09:08:47 +03:00
Dmitry Petrov
865d2c43c7 Default arguments stored in function declarations. 2016-10-18 09:08:46 +03:00
Dmitry Petrov
2d2100b1b5 IrSyntheticBody (for 'values', 'valueOf'). 2016-10-18 09:08:46 +03:00
Dmitry Petrov
c47e82f965 Cleaner IrBuiltIns. 2016-10-18 09:08:45 +03:00
Dmitry Petrov
93618ebb12 IrClassReference 2016-10-18 09:08:45 +03:00
Dmitry Petrov
9eeb492fe3 Underlying classes for enum entries. 2016-10-18 09:08:44 +03:00
Dmitry Petrov
bd76e39a8c Enum entries generation (no underlying classes yet) 2016-10-18 09:08:44 +03:00
Dmitry Petrov
917e7bffbd Property accessors are now children of IrProperty. 2016-10-18 09:08:43 +03:00
Dmitry Petrov
ed68b3ecd0 Use builder API in OperatorExpressionGenerator. 2016-10-18 09:08:43 +03:00
Dmitry Petrov
600fdf7eee Use builder API in increment/decrement desugaring. 2016-10-18 09:08:43 +03:00
Dmitry Petrov
1022725fd1 Data class members generation.
Builder-style API for desugaring expressions.
2016-10-18 09:08:42 +03:00
Dmitry Petrov
dc169e98d5 Local classes. 2016-10-18 09:08:42 +03:00
Dmitry Petrov
41d772d636 Object literal expressions. 2016-10-18 09:08:41 +03:00
Dmitry Petrov
86a52e6426 Character literals and string templates. 2016-10-18 09:08:41 +03:00
Dmitry Petrov
f83237498f Minor: DeclarationsGenerator can take care of secondary constructor delegating to 'super'. 2016-10-18 09:08:40 +03:00
Dmitry Petrov
a140d75016 Minor: IrSyntheticPropertyAccessorDescriptor.Kind. 2016-10-18 09:08:40 +03:00
Dmitry Petrov
7adf173a66 Add tests for companion objects and various kinds of classes
(no representation for enum entries yet).
2016-10-18 09:08:39 +03:00
Dmitry Petrov
a6bee7a22b Generate delegating constructor calls as IrDelegatingConstructorCall expressions
(they have different platform-level representation in JVM and JS).
2016-10-18 09:08:39 +03:00
Dmitry Petrov
6fbac2ed40 Minor: ir.backend.jvm -> backend.jvm 2016-10-18 09:08:38 +03:00
Dmitry Petrov
fe46a02885 Support all primitive literal types.
Apply simple unary operators to constants.
2016-10-18 09:08:38 +03:00
Dmitry Petrov
b3f605c4c4 Generate synthetic getter & setter descriptors for static properties in Java classes
(recognized as properties defined in classes without dispatchReceiver and extensionReceiver).
Fix 'when' generation for else-only case.
2016-10-18 09:08:37 +03:00
Dmitry Petrov
05b9eda809 Generate "raw" IR in Psi2IrTranslator. 2016-10-18 09:08:37 +03:00
Dmitry Petrov
ba85e714e3 Generate nested initializers for class. 2016-10-18 09:08:36 +03:00
Dmitry Petrov
415265276a Minor: CallGenerator is StatementGeneratorExtension. 2016-10-18 09:08:36 +03:00
Dmitry Petrov
8d86c0a2dd Representation for nested initializers in a class & nested initializers call. 2016-10-18 09:08:35 +03:00
Dmitry Petrov
8528c23194 Constructors represented "as in Java".
TODO: extract nested initializers somehow.
2016-10-18 09:08:35 +03:00
Dmitry Petrov
57c1b3e0e2 '!!' operator 2016-10-18 09:08:34 +03:00
Dmitry Petrov
92a7ecfac7 Render return target for IrReturn in tests.
Add tests for non-local returns from lambdas.
2016-10-18 09:08:34 +03:00
Dmitry Petrov
e459105128 Primary constructor generation. 2016-10-18 09:08:34 +03:00
Dmitry Petrov
225d792939 Secondary constructors in classes. 2016-10-18 09:08:33 +03:00
Dmitry Petrov
ac80195597 Anonymous function expressions ('fun(...) { ... }') and local functions (no closures yet). 2016-10-18 09:08:33 +03:00
Dmitry Petrov
83c3bdd788 Lambda expressions (no closures yet). 2016-10-18 09:08:32 +03:00
Dmitry Petrov
0b647ac358 Basic class members generation.
Split testData into 'classes' and 'expressions'.
2016-10-18 09:08:32 +03:00
Dmitry Petrov
703d3405ed Generate class members (functions, properties, nested classes). 2016-10-18 09:08:31 +03:00
Dmitry Petrov
19e95d232a Classes & type aliases, initial import. 2016-10-18 09:08:31 +03:00
Dmitry Petrov
b17e3b0299 Varargs. 2016-10-18 09:08:30 +03:00
Dmitry Petrov
d45811a5da Empty loops. 2016-10-18 09:08:30 +03:00
Dmitry Petrov
179a06672b IrExpression.type is no longer nullable.
Change expression typing contract.
2016-10-18 09:08:29 +03:00
Dmitry Petrov
be86739d3a IrBlockBody
Change block typing contract.
2016-10-18 09:08:29 +03:00
Dmitry Petrov
8bef05703e Inline rematerializable safe call receivers. 2016-10-18 09:08:28 +03:00
Dmitry Petrov
1ff12b4cb6 Loops and break/continue can have labels (as strings) (for KJS & other transpilers). 2016-10-18 09:08:28 +03:00
Dmitry Petrov
dc4bb3015c Inline safe call chains. 2016-10-18 09:08:27 +03:00
Dmitry Petrov
3f256fab67 Variable as function calls. 2016-10-18 09:08:27 +03:00
Dmitry Petrov
b3407de1e6 Array access expression. 2016-10-18 09:08:26 +03:00
Dmitry Petrov
54e6bbd007 Don't introduce additional variables for simple array assignment. 2016-10-18 09:08:26 +03:00
Dmitry Petrov
abb106c885 Fix operator markup for '!==' and '!in'. 2016-10-18 09:08:25 +03:00
Dmitry Petrov
6830a7db43 PregeneratedCall -> CallBuilder 2016-10-18 09:08:25 +03:00
Dmitry Petrov
17758d8c00 'try' 2016-10-18 09:08:24 +03:00
Dmitry Petrov
ebd8f1266d IrOperatorExpression -> IrPrimitiveCall
All "primitives" have their descriptors now.
2016-10-18 09:08:24 +03:00
Dmitry Petrov
c79b9c12d6 'throw' 2016-10-18 09:08:24 +03:00
Dmitry Petrov
4709aaafaa 'for' 2016-10-18 09:08:23 +03:00
Dmitry Petrov
03a666690b 'break' & 'continue' 2016-10-18 09:08:23 +03:00
Dmitry Petrov
87c7b4834b 'while' & 'do-while' loops 2016-10-18 09:08:22 +03:00
Dmitry Petrov
8bba49cba6 Block expressions & types. 2016-10-18 09:08:22 +03:00
Dmitry Petrov
594a553a04 Safe calls. 2016-10-18 09:08:21 +03:00
Dmitry Petrov
985f3b20c7 Unary operators. 2016-10-18 09:08:21 +03:00
Dmitry Petrov
97593fa19e Make 'when' great again. 2016-10-18 09:08:20 +03:00
Dmitry Petrov
f787f8ecbf Refactor desugaring (& operator conventions generation), step 1. 2016-10-18 09:08:20 +03:00
Dmitry Petrov
c0d521266b Use ternary 'if' for 'when' (and also '||' as ',' in 'when'). 2016-10-18 09:08:20 +03:00
Dmitry Petrov
c36a0d04ce Shrinking IR: introduce IrBuiltIns (as a container for special operator descriptors) 2016-10-18 09:08:19 +03:00
Dmitry Petrov
70dfb75f82 Shrinking IR: GetProperty / SetProperty expressions are now generated as calls. 2016-10-18 09:08:19 +03:00
Dmitry Petrov
8500f5ddb2 Preliminary work on loops. 2016-10-18 09:08:18 +03:00
Dmitry Petrov
de5181d642 More tests for 'when' 2016-10-18 09:08:18 +03:00
Dmitry Petrov
b96626fd4c When expression.
Fix object & enum references.
2016-10-18 09:08:17 +03:00
Dmitry Petrov
d6040d8570 Type operators. 2016-10-18 09:08:17 +03:00
Dmitry Petrov
5709826096 Refactoring.
'if' expressions (represented as 'when' without subject).
2016-10-18 09:08:16 +03:00
Dmitry Petrov
1ddf889d8a Comparisons:
- for primitive types and kotlin.String, use IrBinaryOperatorExpression
- for others, use call to 'compareTo'
2016-10-18 09:08:16 +03:00
Dmitry Petrov
ace98b91cc Handle infix function calls in binary expressions. 2016-10-18 09:08:16 +03:00
Dmitry Petrov
3614b0a06c Generate IMPLICIT_NOTNULL for (nullability flexible type) -> (non-null type) implicit conversion. 2016-10-18 09:08:15 +03:00
Dmitry Petrov
2b6171057e Fix type of increment/decrement for array element.
Minor cleanup.
2016-10-18 09:08:15 +03:00
Dmitry Petrov
64d630faa3 Detailed "operator" convention information (for JS). 2016-10-18 09:08:14 +03:00
Dmitry Petrov
4a62a6b7c3 Prefix increment / decrement.
Refactor IrLValue.
2016-10-18 09:08:14 +03:00
Dmitry Petrov
68cdcfa853 Minor: assertion in IrSingleExpressionValue to ensure that corresponding expression is detached and instantiated once. 2016-10-18 09:08:13 +03:00
Dmitry Petrov
8de21aadfa '?:' (currently represented as binary expression with operator ELVIS) 2016-10-18 09:08:13 +03:00
Dmitry Petrov
0d94c3aeb4 'in' and '!in' operators. 2016-10-18 09:08:12 +03:00
Dmitry Petrov
96e3c52878 Equality and identity operators. 2016-10-18 09:08:12 +03:00
Dmitry Petrov
db5843adc8 Desugar comparison operators as IrBinaryOperatorExpression.
They are not exactly 'compareTo' calls (although annotated with a related 'compareTo' function),
and require special treatment in BEs.
2016-10-18 09:08:11 +03:00
Dmitry Petrov
1b018a6ead Desugar basic binary operators (+, -, *, /, %, ..).
Fold String.plus calls to IrStringConcatenationExpression.
2016-10-18 09:08:11 +03:00
Dmitry Petrov
287d804131 Rematerialize simple expressions (local variables, literals, $this, $receiver) when generating calls. 2016-10-18 09:08:11 +03:00
Dmitry Petrov
c1583c4368 Complex augmented assignment test.
Fix string literal creation for empty string template.
2016-10-18 09:08:10 +03:00
Dmitry Petrov
64d7a97145 IR, testing framework: if no tree labels were provided in source file, use default golden file. 2016-10-18 09:08:10 +03:00
Dmitry Petrov
aee83f5a77 Minor: IrIndexedLValue can use IrExpression's, since its subexpressions should be evaluated once. 2016-10-18 09:08:09 +03:00
Dmitry Petrov
888b1685ed Introduce name hints for temporary variables.
Split IrValue.kt into a subpackage.
2016-10-18 09:08:09 +03:00
Dmitry Petrov
177acaabf5 Refactor top-down generation. 2016-10-18 09:08:08 +03:00
Dmitry Petrov
278dc14124 IrSingleExpressionValue 2016-10-18 09:08:08 +03:00
Dmitry Petrov
d7412c449e IR: augmented assignment for array access expressions 2016-10-18 09:08:07 +03:00
Dmitry Petrov
0a57eb8ea4 IR:
- smart casts handling separated from expression generation
- improved infrastructure for desugaring
2016-10-18 09:08:07 +03:00
Dmitry Petrov
ecf6ab9e25 IR:
- Redo smart casts handling (yet again).
Front-end typing information can't be used for expressions in IR,
since it provides inferred type for PSI expressions for the last corresponding resoled call.

- Assignments handling, initial implementation.
2016-10-18 09:08:07 +03:00
Dmitry Petrov
c4bbcadb34 IR: Collapse desugared blocks as a postprocessing pass. 2016-10-18 09:08:06 +03:00
Dmitry Petrov
aa7bf4637b IR:
- function with expression bodies are desugared to blocks with return statement;
- property initializers are generated as regular expression bodies.
2016-10-18 09:08:06 +03:00
Dmitry Petrov
2707d33ca7 IR: dummy declarations for class/object and typealias 2016-10-18 09:08:05 +03:00
Dmitry Petrov
f903fb8ad3 IR: destructuring declarations in regular statements 2016-10-18 09:08:05 +03:00
Dmitry Petrov
37cce98d19 Simplify IrElement hierarchy.
IrDeclaration can be now hosted under IrExpression (as IrStatement).
2016-10-18 09:08:04 +03:00
Dmitry Petrov
55eb79febf Make IrExpression.type nullable. 2016-10-18 09:08:04 +03:00
Dmitry Petrov
030111b130 IrBody is no longer a declaration owner.
Local declarations in expression tree.
Call generator supports argument reordering.
2016-10-18 09:08:03 +03:00
Dmitry Petrov
b1af1af8a4 IR test tests: use that magical '<<<' everywhere. No need for 'IR_FILE_TXT'. 2016-10-18 09:08:03 +03:00
Dmitry Petrov
4ccf3c3590 Refactor calls and related expressions 2016-10-18 09:08:02 +03:00
Dmitry Petrov
3e11f35918 Qualified expressions and safe calls 2016-10-18 09:08:02 +03:00
Dmitry Petrov
b80782c295 Testing framework: allow comparing subtrees starting at a given line with expected dump text. 2016-10-18 09:08:02 +03:00
Dmitry Petrov
c93666f6f1 - IR expressions for calls & references
- first calls "parsed"
2016-10-18 09:08:01 +03:00
Dmitry Petrov
c09ba962c4 minor: refactor TypeAliasQualifier, it doesn't have to provide type alias descriptor 2016-10-18 09:07:43 +03:00
Dmitry Petrov
dc7a90a081 Minor: IrFileElementFactory -> IrDeclarationFactory 2016-10-18 09:06:57 +03:00
Dmitry Petrov
7b3ae8ffec Use source offset ranges instead of source locations. 2016-10-18 09:06:56 +03:00
Dmitry Petrov
5e609c7de4 Declaration IR refactoring. 2016-10-18 09:06:56 +03:00
Dmitry Petrov
4f469c798c Mutable expressions IR. 2016-10-18 09:06:55 +03:00
Dmitry Petrov
cb79f377f0 Mutable declarations IR. 2016-10-18 09:06:55 +03:00
Dmitry Petrov
64abecf996 IR elements fixes & refactorings 2016-10-18 09:06:55 +03:00
Dmitry Petrov
7879fb7084 IR: first somewhat meaningful expression IR generation 2016-10-18 09:06:54 +03:00
Dmitry Petrov
ad405f26fd IR: first smoke test 2016-10-18 09:06:54 +03:00
Dmitry Petrov
520a3133bc minor: allow specifying indentation unit in Printer 2016-10-18 09:06:53 +03:00
Dmitry Petrov
1600037625 KT-14307, KT-14377: Run declaration checks on local type aliases. 2016-10-17 16:22:04 +03:00
Nikolay Krasko
6a72cebe88 Add indent before colon of super types list on new line (KT-13981, KT-5117)
#KT-13981 Fixed
 #KT-5117 Fixed

(cherry picked from commit dfea3af)
2016-10-17 15:16:48 +03:00
Nikolay Krasko
944b9b5b6c Evaluate overloaded toString() in watches for Kotlin classes with delegate properties (KT-14068)
(cherry picked from commit 7774d2c)

 #KT-14068 Fixed
2016-10-17 15:16:46 +03:00
Denis Zharkov
440bdea736 Update ChangeLog.md 2016-10-17 14:06:56 +03:00
shiraji
a1f1716044 Add inspection/intention for redundant calls of conversion methods #KT-10871 Fixed
Also #KT-12625 Fixed
2016-10-17 12:05:18 +03:00
Dmitry Petrov
a5d6559056 KT-14360 Microoptimizations in RedundantCoercionToUnitTransformer 2016-10-17 10:13:03 +03:00
Dmitry Petrov
753a558bcb KT-14352 Record short reference to companion object via type alias,
so that it would be checked properly.
2016-10-17 10:11:58 +03:00
Dmitry Petrov
ac675784c1 KT-14357 Run RedundantCoercionToUnitTransformer before DeadCodeEliminatingMethodTransformer.
Remove empty try-catch blocks in DeadCodeEliminatingMethodTransformer.
2016-10-17 10:10:46 +03:00
Ilya Gorbunov
932e6753e5 Update changelog: standard library and JS sections. 2016-10-15 07:32:09 +03:00
Nikolay Krasko
87fb6dd3b8 Minor: rename ForkJoinPoolPatcherForTeamCityTesting -> ThreadTrackerPatcherForTeamCityTesting
(cherry picked from commit c6b128e)
2016-10-14 21:06:28 +03:00
Nikolay Krasko
8c2e61604e Test for "Debugger: "Step over" dives into recursive call" (KT-12924)
Fixed in 7992df7b93

(cherry picked from commit 78e2f05)

 #KT-12924 Fixed
2016-10-14 21:06:27 +03:00
Zalim Bashorov
c21e1eb857 Report error when try to use unsupported reflection API in Kotlin JS; allow to use kotlin.Any members on reflection classes for both platforms. 2016-10-14 19:44:58 +03:00
Zalim Bashorov
11b2c5fe59 JS: change visibility to internal for library and marker annotations 2016-10-14 19:44:57 +03:00
Zalim Bashorov
77ceb3efb9 Don't render descriptors outside of modules directly mentioned in tests, e.g. descriptors from libraries. 2016-10-14 19:44:56 +03:00
Zalim Bashorov
279b4dc03c Remove obsolete test about class literals is not supported 2016-10-14 19:44:55 +03:00
Zalim Bashorov
71235eebd0 Minor: fix warnings in Namer 2016-10-14 19:44:54 +03:00
Zalim Bashorov
3c520a3ce3 JS backend: basic support for class literals.
Added:
* the ability to get KClass using class literals (`::class`);
* the ability to get KClass from JsClass and vice versa;
* the ability to get simpleName.

 #KT-13345 Fixed
2016-10-14 19:44:53 +03:00
Zalim Bashorov
ace10f46b2 Minor: move reflection/light/* -> reflection/* 2016-10-14 19:40:36 +03:00
Zalim Bashorov
d31f18137d JS: make Any as upper bound of type parameter of JsClass and helpers 2016-10-14 19:40:35 +03:00
Ilya Gorbunov
e6887ea4e5 Use abstract readonly collections as base classes for implementing collection properties of regex MatchResult 2016-10-14 19:06:25 +03:00
Ilya Gorbunov
703ee6bd78 Have mutable collection interfaces specified explicitly to get rid of platform types in parameter and return types. 2016-10-14 19:06:25 +03:00
Nikolay Krasko
06b72e608e Do an ordinal step over while stepping over inlined calls in dex
(cherry picked from commit d741895)
2016-10-14 18:57:38 +03:00
Ilya Gorbunov
b6460e6280 binary-compatibility-validator, minor: refactor annotation utilities. 2016-10-14 18:53:54 +03:00
Alexey Tsvetkov
01e0bc8d5e Ensure task build directory always exist
#KT-14253 fixed
2016-10-14 17:33:54 +03:00
Alexey Tsvetkov
d79679e647 Provide a way to force stdout output in Gradle tests 2016-10-14 17:33:54 +03:00
Alexey Tsvetkov
229e63f5c5 Minor: rename file its name is the same as class it contains 2016-10-14 17:33:54 +03:00
Alexey Tsvetkov
a0fa69c000 Do not check the content of JS file in Gradle test 2016-10-14 17:33:54 +03:00
Kirill Rakhman
09d6e2e0c0 Add quick-fixes for lateinit-related errors #KT-14342 Fixed 2016-10-14 16:14:00 +03:00
Alexey Tsvetkov
86cb7eea4a Test that kotlin gradle options are up to date
#KT-14317 fixed
2016-10-14 15:55:41 +03:00
Alexey Tsvetkov
0097e14ba1 Fix test dependencies for gradle integration tests 2016-10-14 15:55:24 +03:00
Denis Zharkov
48c33333ee Do not add special names to scopes even partially
See 7a41d13b41
It's may be dangerous to call `addDescriptor` and then
not to add descriptor into the variablesAndClassifiersByName map
2016-10-14 15:50:31 +03:00
Nikolay Krasko
fe901e9516 Use Dex suffix instead of dex prefix for better test sorting
(cherry picked from commit 7f3a9c1)
2016-10-14 14:52:56 +03:00
Nikolay Krasko
2511ef2c45 Refactoring: extract KotlinStepOverInlineFilter class
(cherry picked from commit 27b0e7d)
2016-10-14 14:52:51 +03:00
Nikolay Krasko
7510ff4864 Check current behaviour of stepping over inline 'hasNext' and 'next' in for
(cherry picked from commit 008e574)

 #KT-14296 Open
2016-10-14 14:52:44 +03:00
Nikolay Krasko
40d810ce60 Make step over for single thread work in Ultimate
(cherry picked from commit a220e64)
2016-10-14 14:52:39 +03:00
Nikolay Krasko
7992df7b93 Change the way 'step over' over inline calls works (KT-13751)
Previously it worked by invoking 'Run To Cursor' for the last position of inline function. As there's only one 'run to cursor' breakpoint
available in Idea framework, it couldn't work when inline function call was was used in conditions of control flow statements.

A new approach works through multiple step over operation and controlling stop position. In other words we try to "step over" inlined lines.
Same thing is actually done in "Smart Step Into" action.

(cherry picked from commit 2e8775d)

 #KT-13751 Fixed
2016-10-14 14:52:31 +03:00
Nikolay Krasko
9594316b0a Test for "Breakpoint inside lambda argument of InlineOnly function doesn't work" (KT-11395)
(cherry picked from commit d0ffe06)

 #KT-11395 Fixed
2016-10-14 14:52:22 +03:00
Nikolay Krasko
87b628a3f7 Generate 'nop' instruction on lambda call when everything on line is going to be eliminated by inliner (KT-6477)
(cherry picked from commit 462bdb2)

 #KT-6477 Fixed
2016-10-14 14:52:06 +03:00
Yoshinori Isogai
708a0e3b5d KT-14329 Do not report inspection "Remove empty class body" for anonymous objects (#972) 2016-10-14 13:00:55 +02:00
Valentin Kipyatkov
2b2042860d Fixed ParameterName annotation target 2016-10-14 12:24:43 +03:00
Michael Bogdanov
050139220d Fix for KT-14330 java.lang.IllegalArgumentException: Parameter specified as non-null is null: method ... parameter value
#KT-14330 Fixed
2016-10-14 10:56:15 +03:00
Dmitry Petrov
fbe3f1537f Make static initializer classes for inheriting multifile class parts annotated as SYNTHETIC_CLASS. 2016-10-14 10:41:20 +03:00
Zalim Bashorov
0a0a05d211 Add tasks to download node.js (platform independently) and tasks to publish packages to npm; extract some common things to common.xml 2016-10-13 23:22:36 +03:00
Zalim Bashorov
96830e306a JS: add templates for kotlin and kotlin-compiler packages 2016-10-13 23:22:36 +03:00
Valentin Kipyatkov
76fe1ec0d9 KT-14353 ClassCastException during offline inspections
#KT-14353 Fixed
2016-10-13 21:51:38 +03:00
Alexey Sedunov
3eb5076a7c Rename: Fix in-place rename on non-overriding functions 2016-10-13 19:01:00 +03:00
Alexey Sedunov
c6c65b1a20 Kotlin Facet: Initial implementation 2016-10-13 19:00:59 +03:00
Alexey Sedunov
5c2ad48375 Introduce Variable: Do not replace assignment left-hand sides
#KT-14240 Fixed
2016-10-13 19:00:58 +03:00
Alexey Sedunov
ec00b9f3ea Intentions: Implement "Convert sealed class to enum" intention
#KT-14245 Fixed
2016-10-13 19:00:57 +03:00
Alexey Sedunov
2187a77646 Intentions: Implement "Convert enum to sealed class" intention
#KT-14245 In Progress
2016-10-13 19:00:56 +03:00
Alexey Sedunov
02e8d58acd Rename: Forbid on backing field reference
#KT-14285 Fixed
2016-10-13 19:00:55 +03:00
Alexey Sedunov
c23c16f1a3 Extract Superclass/Interface: Add filename field to the dialog 2016-10-13 19:00:54 +03:00
Simon Ogorodnik
e14a043b0a Fix for KT-10885
Assignment as expression conversion: e.g int i = j = 0
2016-10-13 18:52:44 +03:00
Simon Ogorodnik
d731f97c7d Fix KT-13021, KT-13020, Test for already fixed KT-6941
Fixes on javadoc to kdoc comments convert
2016-10-13 18:52:31 +03:00
Simon Ogorodnik
155cfcb1f8 Fix for KT-6424
Remove "SuppressWarnings" and "//noinspection" on java to kotlin conversion
2016-10-13 18:51:48 +03:00
Dmitry Petrov
47b3420a65 Minor: testData fix after rebase 2016-10-13 18:03:00 +03:00
Dmitry Petrov
e7ca00d91b Support @SinceKotlin annotation for type aliases. 2016-10-13 17:52:21 +03:00
Dmitry Petrov
8d634f6003 KT-14274: resolve type alias constructors calls in supertypes list as type alias constructors.
Support @Deprecated for type aliases, including type alias constructors.
2016-10-13 17:52:21 +03:00
Dmitry Petrov
bee0e783f8 Minor cleanup. 2016-10-13 17:52:21 +03:00
Dmitry Petrov
3d0288ffed Annotations on type aliases: generate synthetic method for type alias annotations. 2016-10-13 17:52:21 +03:00
Dmitry Petrov
d2d8f72ffc Annotations on type aliases: typealias is not a "default target".
Add diagnostic test for annotations on type aliases.
2016-10-13 17:52:21 +03:00
Dmitry Petrov
344bb03e8c Annotations on type aliases: add annotation target TYPEALIAS,
use it for @Deprecated and @Suppress.
2016-10-13 17:52:21 +03:00
Dmitry Petrov
c6350e1afb Concatenate annotations in type alias expansion. 2016-10-13 17:44:14 +03:00
Mikhail Glukhikh
7a41d13b41 Do not add special names to scopes #KT-14319 Fixed 2016-10-13 17:17:05 +03:00
Dmitry Jemerov
7263109413 advance until-build to 171.* 2016-10-13 16:15:07 +02:00
Dmitry Jemerov
b1b171fbc5 correct way to check if intention is applicable; revert: Delete test that is transformed syntax error 2016-10-13 15:45:55 +02:00
takahirom
925c48c2f0 Fix 'in' operator intention for Strings (KT-13974) 2016-10-13 15:45:30 +02:00
takahirom
93c2e7dfc0 KT-13550 Fix Boolean.TYPE does not compile (#969)
* Fix Boolean.TYPE does not compile
2016-10-13 15:02:06 +02:00
Valentin Kipyatkov
29fe63d5a9 More correct code - ensure that equals works correctly! 2016-10-13 15:56:18 +03:00
Valentin Kipyatkov
0399772ee6 KT-9835 Completion thinks receiver is nullable when it is not
#KT-9835 Fixed
2016-10-13 15:11:19 +03:00
Valentin Kipyatkov
7b12dd498f KT-13780 No completion and assertion error in log
#KT-13780 Fixed
2016-10-13 15:10:53 +03:00
Ilya Chernikov
09a3741eb9 Add missing script runtime jar to plugin's lib folder 2016-10-13 10:36:51 +02:00
Dmitry Petrov
71362d6b0a Cleanup and unify RangeCodegenUtil functions. 2016-10-13 10:11:32 +03:00
Vsevolod
e788ef408f KT-5044 code cleanup, test added 2016-10-13 10:11:32 +03:00
Vsevolod
bd6f83b9b7 KT-5044 intrinsify all contains calls for primitive ranges from stdlib 2016-10-13 10:11:32 +03:00
Vsevolod
d7ad27ac3b KT-5044 implement missing Range#contains tests and move it to separate package 2016-10-13 10:11:32 +03:00
Ilya Gorbunov
0b3fb41eeb Do not include $DefaultImpls inner classes in public API when they do not contain any public members (i.e. used only as a container to hold synthetic methods with annotations for properties or typealiases) 2016-10-13 09:52:42 +03:00
Ilya Gorbunov
2c9b2652c1 kotlin-maven-plugin: Add apiVersion parameter linked with kotlin.compiler.apiVersion property.
Test apiVersion parameter is applied as explicitly and as implicitly inferred from languageVersion.
 #KT-14298
2016-10-13 08:37:34 +03:00
Ilya Gorbunov
ea51070446 Refactor: make languageVersion configuration parameter common for jvm and js kotlin maven compiler plugin. 2016-10-13 08:37:33 +03:00
Ilya Gorbunov
2a7717214b Annotate new API with @SinceKotlin in kotlin-runtime except reflection and type aliases. 2016-10-13 08:37:31 +03:00
Ilya Gorbunov
a57321dea8 Annotate all new API with SinceKotlin in kotlin-stdlib and kotlin-test 2016-10-13 08:37:30 +03:00
Ilya Gorbunov
a8f381cabc Annotate with SinceKotlin all in stdlib-jre7 and jre8 2016-10-13 08:37:28 +03:00
Ilya Gorbunov
70c3a0a244 Include new annotations (SinceKotlin, ParameterName) in public API reference. 2016-10-13 08:10:37 +03:00
Ilya Chernikov
0d73d9acc9 Update changelog: add scripting part to 1.1-M02 2016-10-12 22:59:33 +02:00
Alexander Udalov
321a19a247 Make JvmPlatform.defaultImports a stored property
It was incorrectly made a getter-only property in 2f616bdd
2016-10-12 23:30:03 +03:00
Ilya Chernikov
ebc8002eb2 Fix output comparison in tests under windows in libraries project as well 2016-10-12 20:29:49 +02:00
Ilya Chernikov
d8ecd2641d Fix script tests output comparison and idea jsr223 test dependency on windows 2016-10-12 20:16:15 +02:00
Simon Ogorodnik
e7635652bc Fix for KT-14205
If detected unfinished expression it passed through, added warning on action "Convert Java to Kotlin", if Java files contains syntax errors.
2016-10-12 19:01:58 +03:00
Alexander Udalov
efc0763c2f Add module dependency script.runtime -> builtins
To prevent balloons that propose to configure Kotlin in the project
2016-10-12 18:54:50 +03:00
Simon Ogorodnik
2a95a4a970 Test for KT-7332, already fixed 2016-10-12 18:16:15 +03:00
Simon Ogorodnik
4710f709ce Fix for KT-10545
//TODO unfix: see KT-14305
2016-10-12 18:10:55 +03:00
Simon Ogorodnik
2c99aac5a9 Post-review fixes, added support for octal escaping definition for char 2016-10-12 17:54:43 +03:00
Simon Ogorodnik
a64c45c9fe Fix KT-8091: J2K string with octal escaped chars 2016-10-12 17:54:43 +03:00
Alexander Udalov
383b7f89a6 Annotate ParameterName with SinceKotlin("1.1") 2016-10-12 17:07:10 +03:00
Alexander Udalov
ed1490dbc4 Add SinceKotlin("1.1") annotation to new reflection API 2016-10-12 17:07:10 +03:00
Alexander Udalov
8828e671f5 Refactor class lookup in deserialized scopes
Move the logic to DeserializedMemberScope; drop NestedClassDescriptors
2016-10-12 17:07:10 +03:00
Alexander Udalov
e1ce6f88d5 Remove extra cache of nested classes from DeserializedClassDescriptor
ClassDescriptor instances are already cached in ClassDeserializer
2016-10-12 17:07:09 +03:00
Alexander Udalov
2f616bdd33 Drop ModuleParameters, inline defaultImports everywhere 2016-10-12 17:07:09 +03:00
Ilya Chernikov
d335aea682 Add script runtime to ultimate project 2016-10-12 15:38:52 +02:00
Ilya Chernikov
846797ff61 Switch to templates in the separate script runtime 2016-10-12 15:38:52 +02:00
Ilya Chernikov
c2b5c11781 Fix all small and medium-sized issues after review 2016-10-12 15:37:54 +02:00
Ilya Chernikov
9617fc7d6b Add kotlin-daemon-client.jar to the lib folder of plugin artifact 2016-10-12 15:37:53 +02:00
Ilya Chernikov
e03601317b Attempt #2 to fix kotlin-script-util test on TeamCity 2016-10-12 15:37:53 +02:00
Ilya Chernikov
16897f4935 Remove usage of getLocalHost, other minor changes related to localhost connections in daemon
- attempt to fix behaviours similar to #IDEA-161962, #KT-14042
2016-10-12 15:37:53 +02:00
Ilya Chernikov
ea4a1df839 Refactor session accounting in daemon, add REPL to it, write a test 2016-10-12 15:37:53 +02:00
Ilya Chernikov
3a52c68973 Attempt to fix kotlin-script-util test on TeamCity 2016-10-12 15:37:53 +02:00
Ilya Chernikov
101d85fc0b Fix binary compatibility test data after adding more templates to the runtime 2016-10-12 15:37:52 +02:00
Ilya Chernikov
1a24d37e7f Rename back the file to avoid breaking compatibility with gradles-script-kotlin without real necessity 2016-10-12 15:37:52 +02:00
Ilya Chernikov
10d259771c Refactor repl and JSR 223 support code, add separate example jars for each type of JSR 223 repl (with tests) 2016-10-12 15:37:52 +02:00
Ilya Chernikov
079fece9b4 Add daemon client jar to libraries project 2016-10-12 15:37:52 +02:00
Ilya Chernikov
bf0d5b6237 Add basic bindings support to IDEA JSR223 scripting, fix evaluator 2016-10-12 15:37:51 +02:00
Ilya Chernikov
bdaaf4fb09 Add more basic script templates to runtime 2016-10-12 15:37:51 +02:00
Ilya Chernikov
063fbed75e Fix params handling in JSR 223 for Idea, add simple test 2016-10-12 15:37:51 +02:00
Ilya Chernikov
6da7276510 minor: Fix and relax error handling on script template loading 2016-10-12 15:37:51 +02:00
Ilya Chernikov
759f6f3ded Fix script tests with output capture 2016-10-12 15:37:51 +02:00
Ilya Chernikov
439622187f Move Jsr223 engine from compiler jar to script-util.jar (libraries part) 2016-10-12 15:37:50 +02:00
Ilya Chernikov
52f291f372 Implement tests for generic and remote repls 2016-10-12 15:37:50 +02:00
Ilya Chernikov
43037373d7 Implement params to pass args to generic and remote repls to support script templates with params 2016-10-12 15:37:50 +02:00
Ilya Chernikov
f0d2f458e0 Fix script codegen for REPL lines with ScriptTemplate with parameters 2016-10-12 15:37:50 +02:00
Ilya Chernikov
fe69185cd4 Refactor script definition and related parts:
- simplify script definition interface, convert it to class
 - create simple definitions right from base
 - refactor (rename and simplify) script definition with annotated template
 - simplify usages of script definition in many places
2016-10-12 15:37:50 +02:00
Ilya Chernikov
6bc488d95d Implement JSR 223 engine and factory for IDEA using daemon repl 2016-10-12 15:37:49 +02:00
Ilya Chernikov
1a137357e5 Add support for custom script compilation and execution to maven plugin, add simple test, relevant refactorings on the compiler side 2016-10-12 15:37:49 +02:00
Ilya Chernikov
86ece30330 Add remote repl support to the daemon, refactor repl classes accordingly, simple tests 2016-10-12 15:37:49 +02:00
Ilya Chernikov
042fc4fadc Add remote input stream support, plus minor tweaks 2016-10-12 15:37:49 +02:00
Ilya Chernikov
eaa332019a Prepare repl interfaces and generic implementation for separation into possibly remote parts 2016-10-12 15:37:48 +02:00
Ilya Chernikov
f992f91686 Add kotlin-script-util lib with tests
- collection of standard templates and resolvers
2016-10-12 15:37:48 +02:00
Ilya Chernikov
42a4f0ed70 Compile most test scripts with runtime 2016-10-12 15:37:48 +02:00
Ilya Chernikov
385aab8418 Add output checking to script tests 2016-10-12 15:37:48 +02:00
Ilya Chernikov
0b68f313ab minor: fix typos and terminology 2016-10-12 15:37:48 +02:00
Ilya Chernikov
ba4fab56a0 Implement basic JSR 223 scripting support 2016-10-12 15:37:47 +02:00
Ilya Chernikov
63c5133167 Remove support for xml-based script configs, other minor refactorings 2016-10-12 15:37:47 +02:00
Ilya Chernikov
0f31695a0b Convert error on retrieving gradle plugin settings to warning - fixes #KT-13975, #EA-87275, #EA-87677 and alike 2016-10-12 15:37:47 +02:00
Ilya Chernikov
9618863b72 Hide EA-86599 in a log warning 2016-10-12 15:37:47 +02:00
Ilya Chernikov
b127cc3941 Attempt to get more diagnostic from EA-86371 2016-10-12 15:37:46 +02:00
Alexander Udalov
777004a0e2 Fix test data after merge 2016-10-12 12:52:38 +03:00
Alexander Udalov
e37a20d6b3 Do not deserialize type aliases in compatibility mode
When "-language-version 1.0" is specified in command line arguments, the
compiler should not be able to see the declarations of type aliases in
libraries, because that corresponds to the behavior of the compiler of version
1.0. Note that type aliases are _completely invisible_ in this mode (i.e.
"unresolved reference" is reported) because they must not interfere with the
classifier resolution
2016-10-12 12:19:19 +03:00
Alexander Udalov
d96f10c7bd Refactor deserialization of nested type aliases
Do it exactly in the same way as with properties/functions, in
DeserializedMemberScope and nowhere else
2016-10-12 12:19:18 +03:00
Alexander Udalov
88af36001c Introduce DeserializationConfiguration
Will be used soon to deliver the language/API-version-related behavior to the
deserialization
2016-10-12 12:19:17 +03:00
Simon Ogorodnik
25b9542c06 Fix for KT-11375, KT-9710, KT-8161 2016-10-12 12:08:48 +03:00
Simon Ogorodnik
df0dddedc2 Fixes for test(@JvmStatic -> const), fix for prototype assign 2016-10-12 11:56:54 +03:00
Simon Ogorodnik
e84f56348c Fix KT-13750, J2K const val serialVersionUID 2016-10-12 11:56:54 +03:00
Denis Zharkov
05aa9a5682 Add a quickfix for warning on ambiguously annotated expression
#KT-14238 Fixed
2016-10-12 11:40:16 +03:00
Denis Zharkov
84153f9636 Add warning for ambiguous annotated expression syntax
#KT-14238 In Progress
2016-10-12 11:40:12 +03:00
Denis Zharkov
993d226c8f Minor. Extract method for annotations resolution on expression 2016-10-12 11:39:04 +03:00
Denis Zharkov
bec84b1d7b Change parsing of annotations on block level expressions
Attach annotations to the closest prefix expression instead of
whole statement if no new line found after annotations

The motivation is for a simple annotated expression like '@ann x + y'
its syntax form must not change after prepending 'val z = ' just before it
2016-10-12 11:39:04 +03:00
Denis Zharkov
9ff439e39e Change annotations parsing in bodies of operators
This change only matters in cases of if/when/for/while having braceless
blocks

Annotations on them are parsed now as on block-level expressions, i.e.
they're attached to the whole expression
2016-10-12 11:39:04 +03:00
Denis Zharkov
c01b4156d8 Minor. Rename methods in parser
Method that was called `parseControlStructureBody` is actually used for
loop bodies only, while `parseExpressionPreferringBlocks` used for
parsing body of control structure (i.e. it must be called
`parseControlStructureBody`)
2016-10-12 11:39:04 +03:00
Simon Ogorodnik
12efb20869 Regenerated tests 2016-10-12 11:08:49 +03:00
Simon Ogorodnik
1a7c507cc5 Fix for KT-13818
Javadoc @code conversion
2016-10-12 11:08:49 +03:00
Valentin Kipyatkov
452b77692d Incremented binary stub version because of changes with annotation rendering in decompiler 2016-10-11 23:43:45 +03:00
Valentin Kipyatkov
5e32589084 Do not take ParameterName annotations into implicit lambda signature 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov
03320d6559 Use partial resolve 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov
31a4c6671e Fixed incorrect test 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov
968a6cfd04 DescriptorRenderer to skip @ExtensionFunctionType and @ParameterName only when it's redundant 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
8baa9ba1de No parameter names in type of lambda expression and anonymous function 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
d4050ee074 More correct way of replacing parameter names to preserve overrides 2016-10-11 23:38:53 +03:00
Valentin Kipyatkov
4513f679de Fixed test data 2016-10-11 23:38:53 +03:00
Pavel V. Talanov
14f3e4c758 Cls stubs and decompiled text: Do not render parameter names in decompiled text and do not load ParameterName annotation in stubs
Add tests for decompiled text and stubs
2016-10-11 23:38:53 +03:00
Valentin Kipyatkov
86495fd136 No parameter name in functional type of lambda with 'it' 2016-10-11 23:38:53 +03:00
Valentin Kipyatkov
b2f215227d Fixed completion to not render functional types with parameter names in lookup items 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
7f0063013c Corrected test data 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
073845ebd4 Fixed test data 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
4a8b41c72c Do not render @ParameterName annotations for types 2016-10-11 23:38:52 +03:00
Valentin Kipyatkov
1b7f7fb799 Minor changes on code review 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
1f9e00b23f Added tests that surprisingly passed 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
a62a37f6d8 Added tests for parameter names in function type from SAM-adapter + fixed KT-13861
#KT-13861 Fixed
2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
59269ef1ae ParameterName annotation on type argument used to hold parameter name 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov
3bd39df587 No parameter names in types for error messages 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
6527ada775 Changes on code review 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
c0ea237ba4 Added test with type alias 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
d8759fcbcc Optimizations 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov
6b94e5fd34 Use parameter names from function type for invoke() function
#KT-435 Fixed
 #KT-9016 Fixed
2016-10-11 23:38:49 +03:00
Valentin Kipyatkov
0abb2edb2b Corrected test 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov
41ee06ec96 Use parameter names in DescriptorRenderer 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov
f335f32b48 Some use of parameter names in completion 2016-10-11 23:38:48 +03:00
Valentin Kipyatkov
147d1da1ed Supported obtaining function type parameter names from KotlinType 2016-10-11 23:38:48 +03:00
Valentin Kipyatkov
8d7b59777c Moved and renamed tests 2016-10-11 23:38:48 +03:00
Alexander Udalov
4eac12e350 Report warning when SinceKotlin value is greater than -api-version value
To prevent this diagnostic be reported in each test on SinceKotlin, disable it
when a diagnostic test contains the "!API_VERSION" directive
2016-10-11 17:46:14 +03:00
Alexander Udalov
167ab1f860 Introduce "-api-version" CLI option
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed
2016-10-11 17:46:01 +03:00
Alexander Udalov
e3df8ed2fe Introduce SinceKotlin annotation, check validity of its value
#KT-14297 Fixed
2016-10-11 17:45:51 +03:00
Alexander Udalov
8d660c2f6e Refactor gradle option generation mechanism
Ensure there's a statically checked dependency on LanguageVersion and
JvmTarget, so that this information is updated automatically once a new
language version or a JVM target is added
2016-10-11 17:30:15 +03:00
Alexander Udalov
2c66d4e59b Move LanguageVersionSettings and JvmTarget to module 'util'
To be used from cli-common in the subsequent commits
2016-10-11 17:30:14 +03:00
Alexander Udalov
aaeae8b948 Support deprecation level HIDDEN for classifiers
Classifiers annotated with `@Deprecated(level = HIDDEN)` now have smaller
priority in imports, similarly to private classes. For example, if two
classifiers named Foo are imported with a star import and one of them is
deprecated-hidden, the name Foo in the source code is resolved to the other
one.

Also a minor change in multi-module diagnostic tests: do not append newlines
after the last module in the test

 #KT-13926 Fixed
2016-10-11 17:30:14 +03:00
Alexander Udalov
83c86d06ed Report error instead of warning for deprecation level HIDDEN
Since functions usually are hidden from resolution when they are
deprecated-hidden, the problem can only be reproduced for properties with
deprecated-hidden accessors, where DeprecatedCallChecker reported warnings
instead of errors
2016-10-11 17:30:13 +03:00
Alexander Udalov
6e0e8c6dc3 Pass LanguageVersionSettings instance to isHiddenInResolution
Unused at the moment, will be used later to check if the API version prohibits
the usage of the element
2016-10-11 17:30:12 +03:00
Alexander Udalov
59b29cf00d Minor, extract isDeprecatedHidden for usage in codegen
Also remove a hundred year old TODO
2016-10-11 17:30:11 +03:00
Alexander Udalov
2e4592c6dc Report error on bound callable references in compatibility mode
Previously examples were failing with IllegalStateException from JVM back-end
because there was an error type without any error reported
2016-10-11 17:30:10 +03:00
Valentin Kipyatkov
73dc5fefcb KT-12077 Code completion inserts FQN for annotations with use-site target inside primary constructor
KT-13009 Kotlin: annotation auto-import is broken in multiple ways

  #KT-12077 Fixed
  #KT-13009 Fixed
2016-10-11 17:26:52 +03:00
Valentin Kipyatkov
0c14058d13 Moved tests 2016-10-11 17:26:52 +03:00
Ilya Gorbunov
16a0c55c6c Since 'printStackTrace' now fallbacks to the extension in stdlib, change the test expecting it to be deprecated due to language-version 1.0 accordingly. 2016-10-11 16:46:14 +03:00
Ilya Gorbunov
a239231c75 Revert dropping inline-only extensions for Throwable, to be able to use runtime of 1.1 with language version of 1.0 which makes mapped builtin members unavailable again.
#KT-14213 Fixed
2016-10-11 16:46:14 +03:00
Dmitry Jemerov
fc46afc108 reduce ComponentRegistry memory use
#KT-13136 Fixed
2016-10-11 15:35:06 +02:00
Dmitry Petrov
2cd6b1d586 KT-14282 No error on unused type alias with -language-version 1.0
Always resolve descriptors for type aliases.
2016-10-11 16:33:21 +03:00
Mikhail Glukhikh
206374cd17 Minor refactoring: destructure intention 2016-10-11 16:13:21 +03:00
Mikhail Glukhikh
c6fefbc223 Rename: intention tests "ifNullToElvis" --> "foldInitializerAndIfToElvis" 2016-10-11 16:13:16 +03:00
Mikhail Glukhikh
0903402282 "If null to elvis" now converts to elvis also !is check right after initializer #KT-14032 Fixed 2016-10-11 16:13:11 +03:00
Mikhail Glukhikh
121f0ec810 KT-14032 related: if expression to elvis now handles also is and !is checks 2016-10-11 16:13:06 +03:00
Mikhail Glukhikh
8188bb1e54 Destructure intention: entries / entrySet are now removed only for kotlin.Map inheritors #KT-14244 Fixed 2016-10-11 16:13:01 +03:00
Mikhail Glukhikh
304f6a3b3a KT-13943 related: inspection is now always reported if manual destructuring is available 2016-10-11 16:12:56 +03:00
Mikhail Glukhikh
475d5548c4 Destructure intention now handles the case with manual destructuring inside #KT-13943 Fixed 2016-10-11 16:12:51 +03:00
Nikolay Krasko
c7ba19696a Refactoring: stop calling deprecated method
(cherry picked from commit 083656c)
2016-10-11 15:35:44 +03:00
Nikolay Krasko
11f8c904c4 Refactoring: inline method + inline variable
(cherry picked from commit 7e0f100)
2016-10-11 15:35:43 +03:00
Nikolay Krasko
bd2ddbafb3 Refactoring: call apply method without returning intermediate object
(cherry picked from commit a2f7e00)
2016-10-11 15:35:41 +03:00
Nikolay Krasko
78525ed7c6 Refactoring: make createCommand non-nullable
(cherry picked from commit 67cc9b5)
2016-10-11 15:35:40 +03:00
Nikolay Krasko
f7813263ee Refactoring: rename getStepOverPosition -> getStepOverAction
(cherry picked from commit 2b71909)
2016-10-11 15:35:38 +03:00
Denis Zharkov
194853b5c2 Fix backend issue related to JvmStatic val with accessor
Do not treat accessors to JvmStatic properties as having dispatch receiver

 #KT-11585 Fixed
2016-10-11 12:22:03 +03:00
Denis Zharkov
543cf7b265 Minor. Move isJvmStatic* functions to backend 2016-10-11 12:22:03 +03:00
Alexey Andreev
30c2c85c94 KT-13830: support case when LHS of augmented assignment is something different than qualified expression or array access 2016-10-11 11:54:04 +03:00
Yoshinori Isogai
afe8244183 KT-14241 Add Intention + Inspection to remove empty class body (#968) 2016-10-10 19:24:39 +02:00
Ilya Gorbunov
4236a4dd07 Farewell, excluded imports from the platform. If anyone ever needs them again, they are buried in this commit. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
f2c5fee1cf Consider only direct children of non-kotlin default imported packages when looking for aliased types. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
3baf2f8942 Use fully-qualified references to exceptions in kotlin-runtime 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
7e2e2b9f19 Use effectively excluded imports from file's module descriptor. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
ff01b3d41b Search java.lang aliases also in kotlin.text package (for aliases to Appendable and StringBuilder) 2016-10-10 20:14:32 +03:00
Ilya Gorbunov
5042158df5 Determine automatically which types from java.lang is aliased in default imported kotlin packages and exclude them from imported java.lang.* scope. 2016-10-10 20:14:32 +03:00
Zalim Bashorov
45d42bdff8 JS: add inspection for the case when something with dynamic type implicitly casted to kotlin another type 2016-10-10 17:30:51 +03:00
Ilya Chernikov
d05cb9f894 Fix idea module file 2016-10-10 15:28:20 +02:00
Ilya Chernikov
1e59f96f6b Add missing idea module file 2016-10-10 13:57:41 +02:00
Valentin Kipyatkov
b84260f39f Fixed multiple bugs in optimize imports for JS-target
#KT-13689 Fixed
2016-10-10 14:48:16 +03:00
Valentin Kipyatkov
45cd4f1e29 Refactoring 2016-10-10 14:48:16 +03:00
Valentin Kipyatkov
326db55835 Used KtReference.resolvesByNames instead of own code 2016-10-10 14:48:16 +03:00
Valentin Kipyatkov
5734f2ba9b KT-9950 IntelliJ IDEA does not suggest importing extension methods which have the same name as an instance method
#KT-9950 Fixed
2016-10-10 14:48:15 +03:00
Valentin Kipyatkov
49ac6b99f6 Removed redundant 2016-10-10 14:48:15 +03:00
Valentin Kipyatkov
c06e2d994e KT-13884 Exception "Invalid root block PSI element" on replacing trivial when-expression to if
#KT-13884 Fixed
2016-10-10 14:48:15 +03:00
Valentin Kipyatkov
597cd04831 KT-13719 'var' can be made 'val' highlighting range with annotation before
#KT-13719 Fixed
2016-10-10 14:48:14 +03:00
Mikhail Glukhikh
8d48b0d2a0 UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed 2016-10-10 14:42:09 +03:00
Mikhail Glukhikh
126304c197 Destructure intention applied (compiler) 2016-10-10 14:42:04 +03:00
Michael Bogdanov
d911de20f9 Print bytecode on signature test fail 2016-10-10 14:17:51 +03:00
Michael Bogdanov
f8e9922c9e Don't generate generic signature for get/set methods in property reference class 2016-10-10 14:17:50 +03:00
Michael Bogdanov
5bd045c79c Fix for KT-14243: Wrong invocation descriptor on calling implicitly generated implementation in class
#KT-14243 Fixed
2016-10-10 14:17:50 +03:00
Dmitry Jemerov
ce0d81f670 to avoid running resolve under ClsTypeElement lock, return empty modifier list if we're currently calculating the return type (the modifier list is requested to apply type annotations, and we don't care about them anyway)
#KT-12966 Fixed
2016-10-10 12:48:51 +02:00
Dmitry Jemerov
e55c82d3f3 don't try to resolve declaration to descriptor if we don't have any annotations 2016-10-10 12:46:35 +02:00
Ilya Chernikov
b7a52dc685 Add more standard templates 2016-10-10 11:24:54 +02:00
Ilya Chernikov
5e5ebaa68b Create a script runtime jar with a copy of standard script template (renamed) 2016-10-10 11:24:53 +02:00
Alexey Andreev
61b429f2f0 JS: fix exception during translation of for expression with iterator having generic type constrained by Iterable. Fix #KT-8385 2016-10-10 11:22:21 +03:00
Alexey Andreev
977fd8f591 KT-12707: support case when secondary super constructor has optional parameters 2016-10-10 11:21:45 +03:00
Alexey Andreev
c1b8e50734 KT-12707: (JS) proper translation of a constructor in subclass that calls secondary constructor of parent class. Fix #KT-12707 2016-10-10 11:21:45 +03:00
Denis Zharkov
b1dc31a64e Minor. Invert if 2016-10-10 10:44:11 +03:00
Denis Zharkov
0905bf3e38 Refine redundant null checks interpreter
The main change here is addition of a check that NotNullBasicValue instances
are not being created for non-reference types

Exactly this change should be used instead of f25f0db10e
The latter commit lead to problem described in the KT-14242 issue:
v.getType().getSort() == w.getType().getSort() && (v.getType().getSort() != Type.OBJECT || v.equals(w))

Problem is that the condition above returns true without calling `v.equals(w)`,
because the sort of type is ARRAY, not OBJECT, so testArray was being treated
as NotNullable erroneously

So the second part of this change is effectively revering mentioned commit

 #KT-14242 Fixed
2016-10-10 10:44:11 +03:00
Denis Zharkov
2eece06d5c Minor. Add hashCode override after existing equals 2016-10-10 10:44:11 +03:00
Alexey Andreev
322f6fe7ac KT-2752: fix translation of call to internal function from subclass 2016-10-08 19:25:53 +03:00
Alexey Andreev
c814a9d1d2 KT-2752: fix support of typealiases 2016-10-08 19:25:52 +03:00
Alexey Andreev
831ac97ecd KT-2752: fix some tests and make them slightly less fragile 2016-10-08 19:25:51 +03:00
Alexey Andreev
9c7c82b151 KT-2752: refactor NameSuggestion, change rules for determining name stability and applying mangling 2016-10-08 19:25:50 +03:00
Alexey Andreev
6f7e7d8504 KT-2752: fixes after code review 2016-10-08 19:25:49 +03:00
Alexey Andreev
00867cb269 KT-2752: remove unnecessary hack that tries to treat annotation on property accessor as annotation on property itself; looks like FE has fixed that 2016-10-08 19:25:48 +03:00
Alexey Andreev
e7e6a917eb KT-2752: when simple name of class is a JS keyword or a well-known global name, add '$' to name of constructor function 2016-10-08 19:25:47 +03:00
Alexey Andreev
a4bf058be6 KT-2752: add hash-based suffix to private members of open/abstract public classes 2016-10-08 19:25:46 +03:00
Alexey Andreev
ba9c908875 KT-2752: export JsName on class via JS reflection 2016-10-08 19:25:45 +03:00
Alexey Andreev
aa5d15cff7 KT-2752: minor fixes after code review 2016-10-08 19:25:43 +03:00
Alexey Andreev
7956b038fd KT-2752: add test to prove that KT-13024 is no longer reproducible with new implementation of name mangling 2016-10-08 19:25:43 +03:00
Alexey Andreev
4e2b1d68cf KT-2752: deprecate parameter of @native annotation, prohibit simultaneous usage of parameterized @native and @JsName 2016-10-08 19:25:42 +03:00
Alexey Andreev
49022fd5bc KT-2752: move some diagnostics from entire declarations to their headers 2016-10-08 19:25:41 +03:00
Alexey Andreev
fb7f221158 KT-2752: add test to ensure that JsName affects classes 2016-10-08 19:25:40 +03:00
Alexey Andreev
b888d9e7d9 KT-2752: refactor NameSuggestion 2016-10-08 19:25:40 +03:00
Alexey Andreev
72ada61342 KT-2752: rename FQNPart to SuggestedName and FQNGenerator to NameSuggestion 2016-10-08 19:25:39 +03:00
Alexey Andreev
0c61f431ff KT-2752: add some docs to FQNGenerator 2016-10-08 19:25:38 +03:00
Alexey Andreev
c14795f66d KT-2752: refactor support of modules and root packages 2016-10-08 19:25:38 +03:00
Alexey Andreev
c657716ae0 KT-2752: minor fixes 2016-10-08 19:25:37 +03:00
Alexey Andreev
681a428473 KT-2752: prohibit JSName on extension properties 2016-10-08 19:25:36 +03:00
Alexey Andreev
33daf83f14 KT-2752: refactoring:
1. Get rid of most of ManglingUtils
2. Use simple mangling for delegated properties instead of stable mangling
3. Use stable mangling for public declarations of open non-public classes
4. When generating a fresh name in a JsScope, check it for clashing against parent scopes
5. JsFunctionScope does not generate fresh name instead of stable names
6. Function scopes inherit directly from global scope
7. Generate simple mangled names for backing fields of properties
2016-10-08 19:25:36 +03:00
Alexey Andreev
1dcb037aee KT-2752: remove diagnostic that reports about overridden method having several names from different sources. Generate proxies instead. Fix reporting name clash when two distinct fake overrides require same name. 2016-10-08 19:25:35 +03:00
Alexey Andreev
c5087779e4 KT-2752: add diagnostics that reports about conflicting overridden declarations 2016-10-08 19:25:34 +03:00
Alexey Andreev
16c172f053 KT-2752: add diagnostic that reports about applying JsName on overridden declarations 2016-10-08 19:25:33 +03:00
Alexey Andreev
725d13b72e KT-2752: fix JsName with explicit use target. Add some tests for JsName with use targets 2016-10-08 19:25:33 +03:00
Alexey Andreev
be0013d9f2 KT-2752: declare properties as a pair of functions when accessors are marked with @JsName 2016-10-08 19:25:32 +03:00
Alexey Andreev
6e1a0901ac KT-2752: add checkers for inconsistent usage of JsName 2016-10-08 19:25:31 +03:00
Alexey Andreev
638952e96e KT-2752: JsName renames native declarations 2016-10-08 19:25:31 +03:00
Alexey Andreev
7a7a6914a6 KT-2752: fix old tests, add test for clashing between class and its companion object 2016-10-08 19:25:30 +03:00
Alexey Andreev
50dd1e31c3 KT-2752: move tests, that check whether there's no name clash, to JS backend tests 2016-10-08 19:25:29 +03:00
Alexey Andreev
5ce158f297 KT-2752: add basic tests for JsName 2016-10-08 19:25:28 +03:00
Alexey Andreev
5e3aa33b13 KT-2752: add draft implementation of JsName annotation. Fix some tests using the annotation 2016-10-08 19:25:27 +03:00
Alexey Andreev
8738458c34 KT-2752: fix name clash diagnostic for case of extension property. Add more tests for the diagnostic 2016-10-08 19:25:27 +03:00
Alexey Andreev
8f829557c8 KT-2752: add diagnostic that checks whether Kotlin declarations produce conflicting names in generated JS 2016-10-08 19:25:26 +03:00
Alexey Andreev
f70b50b6e2 KT-2752: refactor generation of FQN in JS. Move backend-independent code to generic code in frontend. 2016-10-08 19:25:25 +03:00
Alexey Andreev
ed55923bb0 KT-2752: a new approach to compose fully-qualified names that does not depend on code generation and can be reused in JS front-end 2016-10-08 19:25:25 +03:00
Alexey Sedunov
d3c14ce7d6 Extract Function: Support implicit abnormal exits via Nothing-typed expressions 2016-10-07 20:20:39 +03:00
Alexey Sedunov
8e9f32db9e Search Everywhere: Render function parameter types. Render extension type in prefix position
#KT-13976 Fixed
 #KT-13977 Fixed
2016-10-07 20:20:38 +03:00
Alexey Sedunov
a6601b27e9 Move: Show error message on applying to enum entries
#KT-14182 Fixed
2016-10-07 20:20:37 +03:00
Alexey Sedunov
fad4944eee Rename: Use qualified class name when looking for occurrences in non-code files
#KT-14128 Fixed
 #KT-13862 Fixed
 #KT-6199 Fixed
2016-10-07 20:20:36 +03:00
Alexey Sedunov
da1178fe0c Create from Usages: Do not suggest on type-mismatched expressions which are not call arguments
#KT-14143 Fixed
2016-10-07 20:20:35 +03:00
Alexey Sedunov
e4dc2ae367 Rename: Implement popup chooser for overriding members
#KT-13963 Fixed
2016-10-07 20:20:34 +03:00
Alexey Sedunov
fe711da594 Rename: Rename do-while loop variables in the loop condition
#KT-14157 Fixed
2016-10-07 20:20:33 +03:00
Alexey Sedunov
140d0b61f1 Move: Fix exception on moving Kotlin file without declarations
#KT-14114 Fixed
2016-10-07 20:20:32 +03:00
Alexander Udalov
9004367f3c Minor refactoring in DeprecatedCallChecker 2016-10-07 20:14:54 +03:00
Alexander Udalov
8949ffbef1 Do not report deprecation on members of deprecated companion
This deprecation is reported on the companion itself anyway
2016-10-07 20:14:53 +03:00
Alexander Udalov
b08ed14f66 Rename PlatformTypesMappedToKotlinChecker -> PlatformClassesMappedToKotlinChecker
To prevent confusion with the term "platform type" which has gained a new
meaning since this class was introduced
2016-10-07 20:14:05 +03:00
Alexander Udalov
6ec868d84e Pass LanguageVersionSettings to ClassifierUsageChecker
To be used in future classifier usage checkers
2016-10-07 20:13:24 +03:00
Alexander Udalov
9fd698db36 Fix NPE in StorageManager on sanitizing stack trace
This could happen when running the compiler from the command line, where
MemoryBasedClassLoader is used which does not ever create Package instances.
2016-10-07 20:13:23 +03:00
Sergey Mashkov
17137f1c4f KT-13478 Error creating Maven project by archetype: The desired archetype does not exist
don't filter versions in internal mode or if all were filtered out
2016-10-07 17:56:05 +03:00
Sergey Mashkov
297248dc4f KT-13638 Update Maven configuration actions in IDE according to changes in https://github.com/JetBrains/kotlin-web-site/pull/458 2016-10-07 17:54:32 +03:00
Sergey Mashkov
dafe7e3539 KT-14003 kotlinc shebang should use env 2016-10-07 17:52:34 +03:00
Mikhail Glukhikh
375a2cc6ab Build fix (AdditionalResolveDescriptorRendererTestGenerated) 2016-10-07 17:04:29 +03:00
Yan Zhulanow
34efaea6ea Increment PsiModificationTracker counter in a write action
(cherry picked from commit 73307a2)
2016-10-07 16:28:34 +03:00
Yan Zhulanow
2f933cfcf2 Kapt: Handle exceptions during annotation processing gracefully
(cherry picked from commit ee26c19)
2016-10-07 16:28:33 +03:00
Yan Zhulanow
82160bc86d Parse enum arrays correctly
(cherry picked from commit 5f2b5cf)
2016-10-07 16:28:32 +03:00
Yan Zhulanow
f15f90a719 Kapt: Support apt options (KT-13984)
(cherry picked from commit b566a37)
2016-10-07 16:28:31 +03:00
Yan Zhulanow
0ae9a7a9d1 Add TransactionGuard application service to KotlinCoreEnvironment
(cherry picked from commit 3e0b79e)
2016-10-07 16:28:30 +03:00
Yan Zhulanow
46f3eae32c Kapt: Dispose every JeElement and JeTypeMirror because some annotation processors may store them in static fields. (KT-13917)
Hello, Data Binding, why you cache them? :(

(cherry picked from commit d86a30b)
2016-10-07 16:28:29 +03:00
Yan Zhulanow
f83e7509b2 Kapt: typeElement.asType() should preserve type parameters and propagate it to its supertypes (KT-13865)
(cherry picked from commit 92c9cea)
2016-10-07 16:28:28 +03:00
Yan Zhulanow
a22721fbd8 Kapt: Add test on Map<Key, Intf> and MutableMap<Key, Intf>
(cherry picked from commit 59cdbcb)
2016-10-07 16:28:28 +03:00
Yan Zhulanow
30ed279426 Kapt: Measure Annotation Processing time
(cherry picked from commit 2554d40)
2016-10-07 16:28:27 +03:00
Yan Zhulanow
e770b9ff60 Minor: add 'kapt' to dictionary
(cherry picked from commit 2f44b0b)
2016-10-07 16:28:26 +03:00
Yan Zhulanow
238340a143 Kapt: Simplify wrapper tests
(cherry picked from commit 1677984)
2016-10-07 16:28:25 +03:00
Yan Zhulanow
e04f834a0e Kapt: Support type parameters in asMemberOf() (KT-13804)
(cherry picked from commit 0d97d73)
2016-10-07 16:28:24 +03:00
Yan Zhulanow
415acfbd05 Kapt: asMemberOf() should also check the containing type itself, not only its supertypes (KT-13823)
(cherry picked from commit 9f9ffdf)
2016-10-07 16:28:23 +03:00
Yan Zhulanow
cb9dc21649 Dispose IntelliJ platform components after annotation processing complete.
Annotation processors may cache ProcessingEnvironment.

(cherry picked from commit bd7a9c6)
2016-10-07 16:28:22 +03:00
Yan Zhulanow
49926fda36 Use LightParameter from Kotlin light classes to add an inner class constructor parameter instead of calling addParameter(name, type). The latter tries to load an icon :( (KT-13798)
(cherry picked from commit cc86d79)

(cherry picked from commit de55de2)
2016-10-07 16:28:21 +03:00
Yan Zhulanow
f7f8cff00d Kapt: Return substituted supertypes in directSupertypes() for immediate class types (KT-13746)
(cherry picked from commit 3aae990)

(cherry picked from commit 198115b)
2016-10-07 16:28:20 +03:00
Yan Zhulanow
8d2a4c3f91 asMemberOf() should always substitute type parameters for methods using the relevant substitutor
(cherry picked from commit dfadd17)

(cherry picked from commit 49b07a7)
2016-10-07 16:28:19 +03:00
Yan Zhulanow
16a9941549 Kapt: Allow to make CompilerConfiguration mutable again
(cherry picked from commit 0780de8)

(cherry picked from commit 95dde72)
2016-10-07 16:28:18 +03:00
Nikolay Krasko
8d9e6f402c Enable using local caches by default for both TeamCity and local testing
(cherry picked from commit b028efa)
2016-10-07 13:06:04 +03:00
Nikolay Krasko
4fd0424b38 Auto-remove local debugger caches on test data modification
(cherry picked from commit 59c28e4)
2016-10-07 13:06:02 +03:00
Denis Zharkov
828ff87db4 Update rendered stdlib public API
Many redundant methods were optimized out in the previous commits
2016-10-07 11:59:15 +03:00
Denis Zharkov
1ad9f1c985 Fix serialVersionUID for EmptyMap and EmptySet
Otherwise removal of redundant special stubs
leads to InvalidClassException during deserialization
2016-10-07 11:59:15 +03:00
Denis Zharkov
dfb9b323ff Avoid generation of redundant abstract special stubs
#KT-13698 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
6e838f0adc Avoid generation of redundant toArray stubs
#KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Denis Zharkov
e05e0ec921 Optimize method count for collection stubs
Do not generate stubs if they're already present in superclasses

 #KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Denis Zharkov
900c442efd Write generic signature for autogenerated toArray
#KT-14195 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
3a100d4139 Improve exception message in collection stubs 2016-10-07 11:59:15 +03:00
Denis Zharkov
8ee568105c Do not generate collection stubs for Kotlin-specific signatures
#KT-14188 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
d2de4579de Minor. Extract computation of collection mutable stub list
It's necessary in the next commits to obtain these signatures
without actually emitting any code
2016-10-07 11:59:15 +03:00
Ilya Gorbunov
56ecbe52b2 Add a test verifying #KT-14194 Fixed 2016-10-07 00:15:48 +03:00
Mikhail Glukhikh
70949d10da Refactoring + minor fixes: destructure intention 2016-10-06 21:16:46 +03:00
Mikhail Glukhikh
dd7d7a5fc7 Destructure inspection: do not apply on variable declarations or function literals without explicit parameters + name & severity changed 2016-10-06 21:07:58 +03:00
Mikhail Glukhikh
37debf4436 Destructure intention: use also for variable declarations #KT-7488 Fixed 2016-10-06 21:03:29 +03:00
Mikhail Glukhikh
de865c6d46 getUseScope() fixed for destructuring declarations #KT-14181 Fixed 2016-10-06 21:03:24 +03:00
Mikhail Glukhikh
e7d290f726 Refactor PSI for destructuring declarations in for: they are now children of KtParameter and not instead of it 2016-10-06 21:03:19 +03:00
Mikhail Glukhikh
48437d5965 KT-13941 related: "Simplify using destructuring declaration" is now applicable for function literals without parameter specification 2016-10-06 21:03:13 +03:00
Mikhail Glukhikh
df0cf3da84 "Simplify using destructuring declaration" is now applicable for function literals #KT-13941 Fixed 2016-10-06 21:03:08 +03:00
Mikhail Glukhikh
42aea59253 Simplify for intention refactoring: focus on the loop parameter, not on the loop itself 2016-10-06 21:03:03 +03:00
Mikhail Glukhikh
0a8006a395 Minor: destructing --> destructuring in SimplifyForIntention 2016-10-06 21:02:58 +03:00
Mikhail Glukhikh
3163d28b29 Minor: test fixed 2016-10-06 21:02:53 +03:00
Alexander Udalov
8ccc168b87 Include output of module daemon-common to compiler jar in compiler-quick
This fixes CompilerDaemonTest with the compiler built by "ant compiler-quick"
2016-10-06 14:40:21 +03:00
Alexander Udalov
a1584377bf Do not pack IDEA core libraries into one idea-core-all.jar in pack-compiler
This is no longer needed because there's no more jsr166e.jar in IDEA core
libraries, which was the reason for the original change.

This reverts commit 9a762e0fa2.
2016-10-06 14:40:21 +03:00
Alexander Udalov
8ffe379c92 Use separate module analysis in CliReplAnalyzerEngine 2016-10-06 14:40:21 +03:00
Alexander Udalov
1e51ba7d00 Run classifier usage checkers for ambiguous references when possible
See comment in getReferencedClassifier and importJavaSamInterface.kt for
explanation
2016-10-06 14:40:21 +03:00
Alexander Udalov
ec53efd869 Run classifier usage checkers after all imports are resolved
Otherwise the diagnostic was not reported on an unused import of a deprecated
class in diagnostic tests, see the test case
2016-10-06 14:40:20 +03:00
Alexander Udalov
f7b4d7d35b Move ClassifierUsageChecker and DeclarationChecker to checkers/ 2016-10-06 14:40:20 +03:00
Alexander Udalov
0905b361d0 Drop LazyTopDownAnalyzerForTopLevel
Replace it everywhere with LazyTopDownAnalyzer
2016-10-06 14:40:20 +03:00
Alexander Udalov
9c70094ceb Move resolveImportsInAllFiles to LazyTDA#analyzeDeclarations
This does not change the behavior: in the other usage of analyzeDeclarations,
a local class is being resolved and therefore TopDownAnalysisContext there does
not contain any files where imports would be resolved
2016-10-06 14:40:20 +03:00
Alexander Udalov
7070b88ea4 Move PlatformToKotlinClassMap out from ModuleParameters
Configure it in the same way as other platform-specific components instead,
simplify some code
2016-10-06 14:40:20 +03:00
Alexander Udalov
b77388bd48 Pass PlatformToKotlinClassMap instance to PlatformTypesMappedToKotlinChecker
The purpose of this change is to allow PlatformToKotlinClassMap to be removed
from ModuleDescriptor
2016-10-06 14:40:19 +03:00
shiraji
0360d0e4f6 Refactoring to use Utils#resolvedToArrayType 2016-10-06 14:36:27 +03:00
shiraji
32b7b5a092 Inspection/Intention replace size check with 'isNotEmpty' and 'isEmpty' #KT-13937 Fixed 2016-10-06 14:35:57 +03:00
Alexey Tsvetkov
5fa561eb70 Add test for freeCompilerArgs in kotlin options for Gradle 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
0944e9076d Add 1.1 language version to kotlin options for Gradle 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
8fa7e1f93e Minor: JS test fix 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
7d657a8c58 Don't warn about absence of kotlin files
#KT-10401 fixed
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
a474d75fe2 Avoid exception when getting relative path
#KT-14056 fixed Target versions 1.0.5
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
d293138c28 Refactoring: use same module name as Intellij 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
0d8fa69760 Refactoring: move gradle tests imported from jps to separate dir
This will allow skipping jps tests when running all tests in directory from Intellij
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
1cc423b163 Refactoring: move gradle integration tests to separate module 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
8cc384a6dd Refactoring: specify internal visibility where possible 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
617bc6c296 Refactoring: use daemon by default in gradle tests 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
c144191522 Minor, set Groovy indent to 4 spaces 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
b3ed04230d Refactoring: cleanup build.gradle files in tests 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
11d971c4bf Refactoring: extract kotlin_version constant for gradle tests 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
18ffb974c7 Refactoring: cleanup after merge 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
139cead7b4 Refactoring: merge modules 'kotlin-gradle-plugin-dsl', 'kotlin-gradle-plugin-core' into 'kotlin-gradle-plugin' 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
892fc63fd1 Generate gradle options from compiler arguments
#KT-13633 fixed
2016-10-05 22:50:46 +03:00
Alexey Tsvetkov
2c34088859 Track changes in java files generated by kapt2
#KT-13500 fixed
2016-10-05 22:50:46 +03:00
Nikolay Krasko
c70e9a6702 Create special parameter for branch version auto-increment
Can be used when bootstrap branch differs from the one used for auto-increment.

Auto-increment is guarded by branch parameter to avoid accidental enabling after branches auto-merge.

(cherry picked from commit 46791a3)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
019ba77e2b J2K: AbstractBytecodeTextTest.java fix compile errors
(cherry picked from commit 02b59be)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
32dff799ff J2K: AbstractBytecodeTextTest.java convert
(cherry picked from commit 93fce11)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
5a873432d9 J2K: AbstractBytecodeTextTest.java rename
(cherry picked from commit 8edd7be)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
aae0b85684 Refactoring: hide state of occurrence class
(cherry picked from commit 4f438bc)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
3d9d6e666d Test several line numbers are generated for one instruction
(cherry picked from commit 1ea9280)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
25051746d1 Refactoring: no need in DebugProcessImpl.ResumeCommand for getting command action
(cherry picked from commit 5638f31)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
7ba0436d7f Add cause exception to AssertionError
(cherry picked from commit 0b60cbb)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
3d6ac2f277 Refactoring: create step-over kotlin position and move counting step over specific to create action stage
(cherry picked from commit 4b08bbd)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
60fbcb7e38 Refactoring: extract top-level functions from KotlinSteppingCommandProvider
(cherry picked from commit 2daac45)
2016-10-05 18:49:38 +03:00
Nikolay Krasko
dd42420a1e Revert using temp directory for building debugger application by default
(cherry picked from commit f131be0)
2016-10-05 18:49:38 +03:00
Dmitry Jemerov
b6e1327e89 allow to specify plugin.xml version number as build script parameter 2016-10-05 16:52:21 +02:00
Dmitry Jemerov
2bd948754e fix QualifiedNameTest 2016-10-05 11:35:06 +02:00
Alexey Sedunov
3f6e60fb51 Call Hierarchy: Show Kotlin usages of Java methods
#KT-12398 Fixed
2016-10-05 11:32:43 +03:00
Alexey Sedunov
5bb035282f Generate 'toString()': Permit for data classes
#KT-14122 Fixed
2016-10-05 11:32:42 +03:00
Alexey Sedunov
0616e869aa Quick Fixes: Implement "Remove unused assignment" quickfix
#KT-9931 Fixed
2016-10-05 11:32:41 +03:00
Alexey Sedunov
074ad6b5f0 Move out of Companion Object: Warn if traget class already contains function with the same signature
#KT-13877 Fixed
2016-10-05 11:32:40 +03:00
Alexey Sedunov
450d31b4bc Test Framework Support: Allow using whitespaces and other symbols in "Generate -> Test Function" dialog
#KT-12556
2016-10-05 11:32:39 +03:00
Alexey Sedunov
86c123164a Move Inner Class to Upper Level: Fix replacement of outer class instances used in inner class constructor calls
#KT-13928 Fixed
2016-10-05 11:32:38 +03:00
Alexey Sedunov
c76c834009 Rename: When renaming Kotlin file outside of source root do not rename its namesake in a source root
#KT-14096 Fixed
2016-10-05 11:32:37 +03:00
Alexey Sedunov
a5eee2d3d8 Move: Do not report accessibility conflicts on builtin declarations
#KT-13726 Fixed
2016-10-05 11:32:36 +03:00
Alexey Sedunov
ba1ee99e97 Navigation: Filter out candidate declarations coming from the wrong library
#KT-13726 In Progress
2016-10-05 11:32:36 +03:00
Alexey Sedunov
6c2d4ad8eb Pull Up: Replace unresolved type parameters with their upper bounds (Fixes test failure after switching to IDEA 2016.2) 2016-10-05 11:32:35 +03:00
Alexander Udalov
53b584f48c Simplify usages of IncrementalPackageFragment and related code
Since its scope is now empty, no descriptor now has a container that is an
instance of IncrementalPackageFragment -> a lot of code is not needed anymore
2016-10-05 11:24:30 +03:00
Alexander Udalov
7c6352a9f2 Refactor IncrementalPackageFragmentProvider 2016-10-05 11:24:30 +03:00
Denis Zharkov
4910024cdb Fix suppress at statement intention for asigmnents
There's no need now to consider precedence of element as
annotation preceding the beginning of block statement
is always now attached to the whole statement

 #KT-11673 Fixed
 #KT-12780 Fixed
2016-10-05 10:29:29 +03:00
Denis Zharkov
7353b08f09 Change parsing of statements starting with annotations
If a block statement starts with annotations treat them as they
belong to node of the statement rather than to the closest prefix expression

 #KT-10210 Fixed
2016-10-05 10:29:29 +03:00
Denis Zharkov
001a058529 Remove effectively dead code in parser
`parseLabeledExpression` can only be called from `parsePrefixExpression`,
but the latter in the beginning tries to parse annotated expression,
thus advances any number of AT symbols
2016-10-05 10:29:29 +03:00
Dmitry Jemerov
642027d790 fix find usages test 2016-10-04 22:20:54 +02:00
Dmitry Jemerov
d8b0c7aaec Binding trace filtering: do not calculate diagnostics if no one is going to query them 2016-10-04 18:50:30 +02:00
Dmitry Jemerov
b365e547c4 DelegatingBindingTrace: remove unnecessary secondary constructor 2016-10-04 18:50:30 +02:00
Dmitry Jemerov
bcde67dc91 DelegatingBindingTrace: J2K 2016-10-04 18:50:30 +02:00
Dmitry Jemerov
9e6f03cd94 DelegatingBindingTrace: rename to .kt 2016-10-04 18:50:30 +02:00
Valentin Kipyatkov
75d56e4902 Better tooltip for try 2016-10-04 19:36:07 +03:00
Valentin Kipyatkov
f1946ae154 No crash in dumb mode
#KT-13967 Fixed
2016-10-04 19:36:07 +03:00
Valentin Kipyatkov
a2976ac281 Better presentation for property accessor 2016-10-04 19:36:07 +03:00
Valentin Kipyatkov
af0b027952 All operator usages are searched with new searcher 2016-10-04 19:34:58 +03:00
Valentin Kipyatkov
ba76e4d24d Quick search of getValue/setValue operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
75a6b0ca5a Quick search of iterator operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
f2e5662154 Quick search of compareTo operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
ee64a1a2b7 Quick search of equals operator usages 2016-10-04 19:34:57 +03:00
Valentin Kipyatkov
309d82308f Optimization 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
4cc16e42b2 Use partial resolve multiple in operator reference search 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
f181458a58 More efficient way 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
5f8dca29aa Renames 2016-10-04 19:34:56 +03:00
Valentin Kipyatkov
32a436e893 Refactoring 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
c8260f8d98 Refactoring 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
7eac49be62 Added comments 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
73e3180699 More efficient way to check for Kotlin files 2016-10-04 19:34:55 +03:00
Valentin Kipyatkov
ee2d4870aa Added comments 2016-10-04 19:34:54 +03:00
Valentin Kipyatkov
ccc5d74649 Renames 2016-10-04 19:34:54 +03:00
Valentin Kipyatkov
c9bb3607ac More correct quickfix testing - do not include suppression actions not available at caret 2016-10-04 19:32:00 +03:00
Valentin Kipyatkov
aec2f19682 Renames 2016-10-04 19:28:54 +03:00
Valentin Kipyatkov
2f5e820afb KT-8664 Hide componentX() functions for data classes from completion
#KT-8664 Fixed
2016-10-04 19:28:53 +03:00
Valentin Kipyatkov
7263d0a056 KT-13728 Implicitly imported functions should be above in completion then non-imported
#KT-13728 Fixed
2016-10-04 19:28:53 +03:00
Valentin Kipyatkov
e8f4c65455 KT-13833 javascript: Smart type completion to lower priority of dynamic type
#KT-13833 Fixed
2016-10-04 19:28:53 +03:00
Dmitry Jemerov
dbbba45d63 show type of control statements used as expressions 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
02a5856ffd don't show function literals and selectors of qualified expressions in "show expression type" 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
256fd04e95 show detailed smart cast info in "Show expression type" (KT-8803) 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
2141cd268c don't include properties with declared return type and property accessors in "show expression type" popup 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
e8fcd194f9 add test for obsolete KT-11601 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
4f1f313b36 don't show type of statements if they are not used as expressions 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
6dccfd3b22 use short names in Show Expression Type
#KT-11310 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
4346afa19e test for handling smart casts in "show expression type"
#KT-10588 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
032d50bbbf handle multi-declarations in "show expression type" 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
fbd2c48fbd don't offer functions with block body and functions with declared return type as candidates for "show expression type" 2016-10-04 18:23:32 +02:00
Dmitry Jemerov
7b644e2c52 support "show expression type" in variable declaration position
#KT-10095 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
752a7451e5 get rid of Kotlin specific "Show expression type" action
#KT-13142 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
39ab1e985a Java-compatible "Copy Reference" action for Kotlin
#KT-13140 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
cbb2e5c379 show context when invoking Show Implementations from Find Usages popup
#KT-13475 Fixed
2016-10-04 18:23:32 +02:00
Dmitry Jemerov
e462a97c64 show two levels of hierarchy when grouping find usages by file structure
#KT-9019 Fixed
 #KT-10178 Fixed
2016-10-04 18:23:32 +02:00
Denis Zharkov
a4978c794f Fix accidental overrides computation
Consider the whole overridden tree instead of only direct overridden

 #KT-14146 Fixed
2016-10-04 16:47:10 +03:00
Denis Zharkov
aca05003a9 Set up tests for postfix templates properly
If there are some other completion-like tests before these ones
it may lead to the situation when some value is already written by
`previouslySuggestedExpressions`, so it should be cleared in setUp
2016-10-04 14:16:12 +03:00
Alexander Udalov
df680305ba Improve diagnostic message for UNSUPPORTED_FEATURE
Render lowercase words separated by spaces instead of CamelCase in the
diagnostic message
2016-10-04 10:24:43 +03:00
Alexander Udalov
73652f309f Do not create synthesized equals/hashCode/toString in data classes in compatibility mode
To simplify migration from 1.0 to 1.1, do not allow data classes to
automatically implement abstract equals/hashCode/toString declared in
super-interfaces (KT-11306) if "-language-version 1.0" is specified
2016-10-04 10:24:41 +03:00
Alexander Udalov
597912824b Report error on declaring 'getClass' in class or package
#KT-14147 Fixed
2016-10-04 10:24:01 +03:00
Valentin Kipyatkov
dca094e971 Refactoring + preserving formatting in some more places where it was missing 2016-10-03 23:23:14 +03:00
Valentin Kipyatkov
5a6f068130 Some formatting preserving for special methods too 2016-10-03 23:23:14 +03:00
Valentin Kipyatkov
f4d9909f6f Code refactoring 2016-10-03 23:23:13 +03:00
Valentin Kipyatkov
badbcd4989 KT-13628 New line is not preserved when converting java to Kotlin
#KT-13628 Fixed
2016-10-03 23:23:13 +03:00
Alexander Udalov
8fe57c8e84 Minor, fix apostrophes in diagnostic message 2016-10-03 21:52:18 +03:00
Alexander Udalov
c1f55e8018 Make scope of incremental package fragment empty
It's only needed to create IncrementalMultifileClassPackageFragment instances
now
2016-10-03 21:52:10 +03:00
Ilya Gorbunov
adf2c5a5ac Classify explicitly imported names higher than default imported in completion. Related to #KT-13447 2016-10-03 20:46:46 +03:00
Ilya Gorbunov
1af3b50e3d Remove obsolete testData (Filter.kt — didn't run even once). 2016-10-03 17:25:26 +03:00
Ilya Gorbunov
2aa60adbca Remove 'import java.util' from js tests. 2016-10-03 17:25:26 +03:00
Michael Bogdanov
1eac6d47ed GenerationState in TypeMapper replaced with boolean flag 2016-10-03 14:13:17 +03:00
Michael Bogdanov
95a1c254e1 Added error diagnostic on inheriting target 6 interface 2016-10-03 14:13:17 +03:00
Michael Bogdanov
7a5c211e8b Throw jvm-specific error on file compilation 2016-10-03 14:06:02 +03:00
Michael Bogdanov
d9bb519b76 Don't generate delegation to jvm8 default methods 2016-10-03 14:06:01 +03:00
Michael Bogdanov
c19e035f91 Properly map super calls in typeMapper 2016-10-03 14:06:00 +03:00
Michael Bogdanov
5f1f4a067d Map proper owner for method with default args 2016-10-03 14:06:00 +03:00
Michael Bogdanov
0390cd6ee1 Added GenerationState to KotlinTypeMapper 2016-10-03 14:05:59 +03:00
Michael Bogdanov
dd4d5e3aa1 Generate 'DefaultImpls' for jvm 8 target only within compiler option 2016-10-03 14:05:59 +03:00
Michael Bogdanov
ca41f01468 Generate interface property annotations in interface class (not in DefaultImpls) 2016-10-03 13:50:12 +03:00
Michael Bogdanov
dfd5be1a33 Generate all bodies in interfaces as default methods 2016-10-03 13:50:11 +03:00
Michael Bogdanov
fb48f70273 Move 'generateMethod' to 'codegenUtil.kt' file 2016-10-03 13:47:09 +03:00
Dmitry Petrov
06101dba52 KT-13961 REDECLARATION not reported on private-in-file 'foo' vs public 'foo' in different file
Private-in-file declarations conflict with public overload-equivalent declarations
in other files in the same package.

Move functions for grouping possible redeclarations to OverloadResolver
(since they are used only there).

Refactor redeclarations / conflicting overloads reporting.
2016-10-03 11:50:29 +03:00
Denis Zharkov
0120085443 Refine expression kind definition in postfix templates
- Do not treat if without else as values
- Some statements aren't contained in block (see tests)

 #KT-14107 Fixed
 #KT-14110 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
3c24996073 Refine default postfix templates selector
There is new settings checkCanBeUsedAsValue
Also expression filtering are split into to parts:
- getNonFilteredExpressions is trivially goes until it reaches
first block body of some declarations
- all additional filtering is merged into Condition that is passed into
PostfixTemplateExpressionSelectorBase super-call

Notable changes for users:
- do not suggest try for non-top-level expressions
- do not suggest var/par/etc for loops
2016-10-03 10:36:48 +03:00
Denis Zharkov
ba2d2a036e Suggest postfix templates on lambda expressions 2016-10-03 10:36:48 +03:00
Denis Zharkov
54d9b4bee6 Do not suggest assignment as a subject in postfix templates
#KT-14077 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
18146fafdf Allow if/when/try postfix templates in expression position
#KT-14078 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
bff9dd4ef5 Suggest assert/return postfix templates only for statements
#KT-14079 Fixed
 #KT-14090 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
ce128c5d6e Do not suggest operation references in postfix templates
#KT-14087 Fixed
2016-10-03 10:36:48 +03:00
Denis Zharkov
d5d18b2ad6 Enhance tests for postfix templates
Prohibit multiple suggested expressions in test mode
2016-10-03 10:36:48 +03:00
Alexander Udalov
4025bcb6e3 Use separate module mode for single-module diagnostic tests
More than 95% of diagnostic tests are single-module, and they'll use the same
two-module scheme that the normal compilation uses
2016-10-02 21:16:11 +03:00
Alexander Udalov
45190d9453 Support separate modules in compiler
Unless the compatibility option "-Xsingle-module" is passed, the compiler will
create two modules instead of one now (see TopDownAnalyzerFacadeForJVM): the
main module contains Kotlin and Java sources and binaries from the previous
compilation of the given module chunk, the dependency module contains all other
Kotlin and Java binaries. This fixes some issues where the compiler couldn't
detect that the used symbol was from another module, and did not forbid some
usages which are only possible inside the module (see KT-10001).

The ideal way to deal with modules here would be to exactly recreate the
project structure, for example as it's done in JvmAnalyzerFacade and usages.
This is postponed until later

 #KT-10001 Fixed
 #KT-11840 In Progress
2016-10-02 21:15:47 +03:00
Alexander Udalov
9d778711d2 Support rendering contents of different modules in load* tests
This is needed because otherwise with separate modules turned on in the
compiler, these tests do not display the contents of classes from the
dependency module in the rendered output
2016-10-02 21:03:38 +03:00
Alexander Udalov
3314725700 Pass GlobalSearchScope instance to JvmPackagePartProvider
Currently behavior is unchanged because the "all project" scope is passed,
however in the future this will allow to implement separate modules in the
compiler properly
2016-10-02 21:03:37 +03:00
Alexander Udalov
54dfe760c0 J2K JvmResolveUtil & GenerationUtils: convert & prettify 2016-10-02 21:03:36 +03:00
Alexander Udalov
12205016bc J2K JvmResolveUtil & GenerationUtils: rename .java -> .kt 2016-10-02 21:03:36 +03:00
Alexander Udalov
214abea4d6 Minor, introduce DeclarationProviderFactory.EMPTY 2016-10-02 21:03:35 +03:00
Alexander Udalov
0ed9897b03 Minor refactorings related to PackagePartProvider and implementations
- Document what exactly should findPackageParts return
- Make EMPTY a named object instead of a val in the companion
- Do not use JvmPackagePartProvider in tests where Empty works fine
- Add a couple default values to arguments of setupResolverForProject
2016-10-02 21:03:34 +03:00
Alexander Udalov
97f2051a03 Add debugName to ModuleMapping 2016-10-02 21:03:33 +03:00
Alexander Udalov
74ad6b1410 Drop obsolete logic related to obsolete package parts
Filtering out obsolete package parts in incremental compilation was necessary
before the big refactoring of package parts, when package parts had been
compiled together into a package class
2016-10-02 21:03:31 +03:00
Alexander Udalov
610c549225 Filter out equivalent calls before reporting "none applicable"
If a module is configured in such a way that the same function appears multiple
times via different dependencies, it's not helpful to report "none of the
following functions can be called", listing the same function multiple times
2016-10-02 21:03:30 +03:00
Alexander Udalov
5d37fab4f5 Minor, add toString for debug 2016-10-02 21:03:29 +03:00
Alexander Udalov
74d6ef73d4 Prevent double initialization in codegen tests, fix ScriptGenTest#testDependentScripts
Add an assertion to prevent duplicate initialization of CodegenTestFiles
instance in CodegenTestCase, which was happening in ScriptGenTest with multiple
invocation of loadFile()
2016-10-02 21:03:28 +03:00
Alexander Udalov
9fb9c12f5e Inline LazyTopDownAnalyzerForTopLevel#analyzeFiles
To make module initialization more explicit and configurable (especially in
TopDownAnalyzerFacadeForJVM)
2016-10-02 21:03:27 +03:00
Alexander Udalov
a5a874f23f Move module creation into TopDownAnalyzerFacadeForJVM#analyzeFilesWithJavaIntegration
The only place where the logic has changed is in AbstractDiagnosticsTest, where
modules are already created and sealed before the analysis. Copy-paste the
container creation logic there (it's almost fine because it's also present in a
bunch of other tests), and simplify it: get rid of incremental compilation and
other stuff irrelevant for diagnostic tests.

This is needed to make analyzeFilesWithJavaIntegration configure the module
properly before sealing it
2016-10-02 21:03:27 +03:00
Alexander Udalov
596fdab2f2 Extract container for single-module top-down analysis 2016-10-02 21:03:26 +03:00
Alexander Udalov
2699356ce3 Simplify JavaClassFinderPostConstruct, inline javaAnalysisInit 2016-10-02 21:03:25 +03:00
Alexander Udalov
278941a8a1 Deduplicate code in container creation for JVM analysis 2016-10-02 21:03:24 +03:00
Alexander Udalov
0250ea861c Simplify return types of createContainer* functions 2016-10-02 21:03:23 +03:00
Alexander Udalov
9cfe0be98e Prettify TopDownAnalyzerFacadeFor{JVM,JS} 2016-10-02 21:03:22 +03:00
Alexander Udalov
4467e127f0 J2K TopDownAnalyzerFacadeFor{JVM,JS}: convert to Kotlin 2016-10-02 21:03:21 +03:00
Alexander Udalov
b34150e1ce J2K TopDownAnalyzerFacadeFor{JVM,JS}: rename files 2016-10-02 21:03:21 +03:00
Alexander Udalov
be5e0f4275 Minor, improve exception when getting missing component from container 2016-10-02 21:03:20 +03:00
Alexander Udalov
87fe6c41df Drop ExternalDeclarationsProvider
It was added for Android extensions, but now another mechanism is used there
(PackageFragmentProviderExtension), and there were no other implementations of
ExternalDeclarationsProvider in the project
2016-10-02 21:03:19 +03:00
Alexander Udalov
1d6abc32bc Minor, delete ModuleContext#builtIns 2016-10-02 21:03:18 +03:00
Ilya Gorbunov
0180c614c0 Add parent pom reference to idl2k module.
Tie kotlin-version of dependencies to the version of parent project being built.
2016-10-01 01:19:15 +03:00
Valentin Kipyatkov
a55273646a Fixed check for convention operator 2016-09-30 21:37:48 +03:00
Valentin Kipyatkov
57faa5a39a Term changes 2016-09-30 21:37:48 +03:00
Valentin Kipyatkov
769943061e Changed String to Name 2016-09-30 21:37:47 +03:00
Valentin Kipyatkov
17adee68cd Fixed optimize imports for operators 2016-09-30 21:37:47 +03:00
Valentin Kipyatkov
95a3a29382 Optimize imports to prevent accedential changes in resolve because of import priorities
#KT-11640 Fixed
2016-09-30 21:37:47 +03:00
Valentin Kipyatkov
7628fa1608 Checked that KT-13766 Fixed by some changes in resolve
#KT-13766 Fixed
2016-09-30 21:37:46 +03:00
Valentin Kipyatkov
f4c65da8f1 Minor 2016-09-30 21:37:46 +03:00
Zalim Bashorov
a07e80f5d9 Make IDEA run configuration compatible with IDEA 2016.3; minor auto changes in run configurations. 2016-09-30 17:58:30 +03:00
Mikhail Glukhikh
ee5202f2ea Minor refactoring: convert secondary constructor to primary
(cherry picked from commit 47446b7)
2016-09-30 16:40:19 +03:00
Mikhail Glukhikh
e417a85276 Minor: secondary constructor to primary is suggested only on keyword and value parameter list
(cherry picked from commit 9a3e6d3)
2016-09-30 16:40:08 +03:00
Mikhail Glukhikh
0a4542c6c0 KT-9839 related, secondary constructor to primary: inspection for the single constructor
(cherry picked from commit aec0090)
2016-09-30 16:39:58 +03:00
Mikhail Glukhikh
3508bea391 KT-9839 related, primary constructor to secondary: comment restoration
(cherry picked from commit 48a1853)
2016-09-30 16:39:46 +03:00
Mikhail Glukhikh
d1958be2a8 KT-9839 related, secondary constructor to primary: comment restoration
(cherry picked from commit 998e39e)
2016-09-30 16:39:36 +03:00
Mikhail Glukhikh
725df49c8c KT-9839: intention introduced: convert secondary constructor to primary one #KT-9839 Fixed
(cherry picked from commit f3fa779)
2016-09-30 16:39:24 +03:00
Mikhail Glukhikh
28b70faa99 KT-9839: convert primary constructor to secondary one: leave independent properties in class body as is
(cherry picked from commit b90414a)
2016-09-30 16:39:13 +03:00
Mikhail Glukhikh
7f50e6e70e KT-9839: intention introduced: convert primary constructor to secondary one
(cherry picked from commit 93aaa48)
2016-09-30 16:39:01 +03:00
Denis Zharkov
d4418d5686 Prohibit not-Unit suspend functions
#KT-13560 Fixed
2016-09-30 12:25:59 +03:00
Denis Zharkov
96186c6217 Prohibit star-projections in last parameter of suspend functions 2016-09-30 12:25:59 +03:00
Alexey Andreev
ea18ea0b8c KT-13825: write simple name of class to constructor.$metadata$.simpleName. 2016-09-30 12:00:49 +03:00
Dmitry Petrov
bd95d2ef4c KT-14071 Type alias cannot be used as a qualifier for super
Use corresponding class for type alias in super qualifier resolution.
2016-09-30 10:17:30 +03:00
Vsevolod
ff7c7538d4 KT-13931 generate IntRange#contains with awareness of inverse in operator 2016-09-29 17:56:18 +03:00
Vsevolod
1ac07340c9 KT-13931 generate IntRange#contains with respect to side-effects on argument loading, test added 2016-09-29 17:56:18 +03:00
Vsevolod
1f9b148a5d KT-13931 more compact inIntRange bytecode generation 2016-09-29 17:56:18 +03:00
Mikhail Glukhikh
f95dcad179 CFA minor: retain initialization state while analyzing variable declaration
(cherry picked from commit c89f4db)
2016-09-29 15:57:01 +03:00
Mikhail Glukhikh
436b0ec873 CFA merge for definition / initialization : more accurate handling of unknown variables #KT-13969 Fixed
(cherry picked from commit 4a96589)
2016-09-29 15:56:47 +03:00
Zalim Bashorov
797f7ab28e JPS: don't consider that the module is not Kotlin JS until check all libraries.
#KT-14082 Fixed
2016-09-29 14:52:51 +03:00
Alexey Andreev
9797a1c35c JS: move RTTI tests to proper location 2016-09-29 12:00:46 +03:00
Alexey Andreev
c1e13cc788 JS: describe how to run tests in node.js 2016-09-29 12:00:45 +03:00
Alexey Andreev
0c3c2af76d JS: fix remaining tests. Suppress extensionFromTopLevelUnitOneStringArg.kt, use another approach to check whether object's property accessed via this 2016-09-29 12:00:45 +03:00
Alexey Andreev
44f7a94380 JS: fix bugs in test environment for mocha.js 2016-09-29 12:00:45 +03:00
Alexey Andreev
aa1a0307a6 JS: make most of box tests running in mocha.js 2016-09-29 12:00:44 +03:00
Alexey Andreev
9da1a50cae JS: move more test to box tests 2016-09-29 12:00:44 +03:00
Alexey Andreev
34bf3e6e56 JS: move more test to box tests 2016-09-29 12:00:43 +03:00
Alexey Andreev
3801052460 JS: move more test to box tests 2016-09-29 12:00:43 +03:00
Alexey Andreev
7e2d5b04de JS: move more test to box tests 2016-09-29 12:00:42 +03:00
Alexey Andreev
9bf124af3f JS: move more test to box tests 2016-09-29 12:00:42 +03:00
Alexey Andreev
a18f5eca2d JS: move more test to box tests 2016-09-29 12:00:41 +03:00
Alexey Andreev
cdf2212c73 JS: move more test to box tests 2016-09-29 12:00:41 +03:00
Alexey Andreev
efb82a044f JS: move inline test to box tests 2016-09-29 12:00:40 +03:00
Alexey Andreev
b159049be8 JS: move expressions test to box tests 2016-09-29 12:00:40 +03:00
Alexey Andreev
2bf0199959 JS: create new common directory for all generated tests, migrate several tests there 2016-09-29 12:00:39 +03:00
Alexey Andreev
34a57f863b JS: refactor test classes 2016-09-29 12:00:39 +03:00
Alexey Andreev
db86d34699 JS: move InlineMultiModuleTestGenerated under new test class 2016-09-29 12:00:38 +03:00
Alexey Andreev
dc0d7114be JS: introduce a new base class for generated tests 2016-09-29 12:00:38 +03:00
Ilya Gorbunov
282629f618 Remove overrides of equals and hashCode from AbstractCollection and AbstractMap.values, making the equality referential again. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
976260bda6 Fix state check in ListIterator.set, improve diagnostics. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
8627547a63 Provide java.util.AbstractCollection and AbstractList as deprecated classes with implemented abstract methods rather than as typealiases to smooth migration.
This comes at price that `ArrayList is java.util.AbstractColleciton` is false.
2016-09-28 22:06:03 +03:00
Ilya Gorbunov
ec6dbe7441 JS: use read-only AbstractList as a base class for read-only collection implementations. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
7dde8df9ae Make mutation methods in AbstractMutable-collections abstract rather than implement them unsupported. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
74e964aabe Rename files to match class names. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
f88a009653 Do not recreate entries, keys and values collections on each access to property. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
c6654fc9d8 Remove unused/redundant implementation details. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
38f030dce4 Split AbstractMap into readonly and mutable. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov
a5c0f11d60 Split AbstractCollection, List, Set in JS to readonly Abstract[Collection] and mutable AbstractMutable[Collection].
Update compatibility type aliases.
2016-09-28 22:06:03 +03:00
Ilya Gorbunov
2bb1d6d5b4 Provide implementation of read-only AbstractCollection, AbstractList and AbstractSet,
Alias AbstactMutableCollection to java.util.AbstractCollection.
Change inheritance hierarchy of reversed list views.
2016-09-28 22:06:03 +03:00
Dmitry Jemerov
53cd079333 download each IDEA version into separate directory 2016-09-28 14:42:38 +02:00
Simon Ogorodnik
18feb8f622 Return Kotlin fields and methods through KotlinShortNameCache
#KT-12205 Fixed
2016-09-28 13:36:20 +02:00
Simon Ogorodnik
b06bdcef75 Now possible to use // WITH_RUNTIME in multi file tests 2016-09-28 13:36:07 +02:00
Denis Zharkov
da2ebb1394 Revert erroneously applied changes in ChangeLog.md 2016-09-28 14:26:31 +03:00
Denis Zharkov
d5fd62fb40 Update 1.1-M02 section in ChangeLog.md 2016-09-28 14:20:29 +03:00
Dmitry Jemerov
a1acd04365 access archive.apache.org via plain HTTP 2016-09-28 10:52:42 +02:00
Denis Zharkov
bb1b8cca20 Fix AssertionError in CodegenUtil.getDelegates
Change getAllOverriddenDescriptors contracti, now it returns
original (not substituted) descriptors without any duplicates.

First of all it's necessary in CodegenUtil.getDelegates to avoid
duplicates (see assertion there), but also it's convenient for all
other usages of this method

 #KT-8154 Fixed
2016-09-28 11:40:35 +03:00
Denis Zharkov
49fee026fc Minor. Simplify CodegenUtil.getDelegates 2016-09-28 11:40:20 +03:00
Denis Zharkov
567b0cc8ea Add a couple of covariant necessary overrides
They become unavoidable after checking override conflicts
for delegation members
2016-09-28 11:40:20 +03:00
Denis Zharkov
c884cffeea Prohibit return type mismatch for delegation members
#KT-13952 Fixed
 #KT-13005 Fixed
2016-09-28 11:40:20 +03:00
Denis Zharkov
ddb7a6aa13 Minor. Extract subinterface for specific strategy
It contains only methods related to explicitly declared overrides
2016-09-28 11:40:20 +03:00
Dmitry Jemerov
0daa2d872a go back to archive.apache.org for Ant downloads 2016-09-28 10:30:56 +02:00
Alexey Sedunov
956c6eeec7 Push Down: Support moving members from Java to Kotlin class
#KT-9485 Fixed
2016-09-27 21:26:31 +03:00
Alexey Sedunov
924bb44862 Pull Up/Push Down/Extract Super: Support references to Java-declared superinterfaces 2016-09-27 21:26:30 +03:00
Alexey Sedunov
22271f0af0 Pull Up/Push Down/Extract Super: Show member dependencies in the refactoring dialog 2016-09-27 21:26:29 +03:00
Alexey Sedunov
8a5628cde5 Pull Up/Extract Super: Support members declared in the companion object of the original class 2016-09-27 21:26:28 +03:00
Alexey Sedunov
982d4d4ead Pull Up/Extract Super: Support properties declared in the primary constructor 2016-09-27 21:26:27 +03:00
shiraji
3aedf0d79f Add intention to replace Math.max/min with coerceAtLeast/coerceAtMost #KT-13945 Fixed 2016-09-27 20:05:11 +03:00
Mikhail Glukhikh
4522d2c7da Remove unnecessary lateinit intention / inspection removed (supported in compiler CFA instead)
(cherry picked from commit e17f222)
2016-09-27 18:49:51 +03:00
Mikhail Glukhikh
67cc83af05 Quick-fix for UNNECESSARY_LATEINIT
(cherry picked from commit 77f7bb0)
2016-09-27 18:49:13 +03:00
Mikhail Glukhikh
025d063b27 UNNECESSARY_LATEINIT: do not report if property is not initialized at use-site #KT-13806 Fixed
(cherry picked from commit 09c0865)
2016-09-27 18:49:02 +03:00
Mikhail Glukhikh
4da9a101cf UNNECESSARY_LATEINIT warning introduced #KT-13295 Fixed
(cherry picked from commit 88f9938)
2016-09-27 18:48:50 +03:00
Valentin Kipyatkov
b0ed6adce3 Fixed wrong test 2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
6baf633a8d Fixed bug found because of incorrect test fixed 2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
21c2268f70 Protection against "<caret>" missing in test data
Many incorrect tests fixed
2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
be8b31e82b Removed redundant and confusing .after files in negative tests 2016-09-27 18:05:26 +03:00
Valentin Kipyatkov
038068aa44 KT-13953 Import member popup should not suggest methods when only property or variable is valid
#KT-13953 Fixed
2016-09-27 18:05:25 +03:00
Dmitry Jemerov
e30c211b3e use plain HTTP for downloading AntForKotlin 2016-09-27 16:17:21 +02:00
Alexey Sedunov
d6b14ce480 Minor: Fix changelog 2016-09-27 13:27:57 +03:00
Alexey Sedunov
ca482c32c6 Introduce Variable: Fix exception on trying to extract variable of functional type
#KT-14004 Fixed
2016-09-27 13:27:56 +03:00
Alexey Sedunov
06936328ab Remove Redundant Receiver Parameter: Do not run refactoring inside write action
#KT-13878 Fixed
2016-09-27 13:27:55 +03:00
Alexey Sedunov
698660b9c6 Find Usages: Add special type for usages inside of type aliases
#KT-13955 Fixed
2016-09-27 13:27:54 +03:00
Alexey Sedunov
3adbe5515e Minor: Get rid of deprecated (as of IDEA 2016.2) method calls 2016-09-27 13:27:53 +03:00
Pavel V. Talanov
b275dacad8 Light classes: getOwnInnerClasses() filters out inner classes with null names
#KT-13927 Fixed
2016-09-26 19:51:57 +03:00
Pavel V. Talanov
827b56e277 Navigation to binaries: support navigation to type alias constructors
#KT-13479 Fixed
2016-09-26 18:34:19 +03:00
Pavel V. Talanov
24d805d2c1 Minor: remove code commited by mistake 2016-09-26 14:46:39 +03:00
Pavel V. Talanov
32daf048c2 PlatformConfigurator: create container for each platform (it contains static services, mostly checkers) ahead of time 2016-09-26 14:42:57 +03:00
Pavel V. Talanov
be00a6ec49 StorageComponentContainer: allow to specify parent container which can be reused to provide components to several child containers 2016-09-26 14:35:37 +03:00
Simon Ogorodnik
47bfb8133d KT-13146 J2K recursion while converting self-referenced anonymous functions (#956) 2016-09-26 13:47:31 +03:00
Alexander Udalov
33d33ab144 Exclude additional tests from Android codegen test runner 2016-09-24 11:31:59 +03:00
Alexander Udalov
9bc6d6ae92 Remove recursion workaround from DeprecatedClassifierUsageChecker 2016-09-24 11:26:57 +03:00
Alexander Udalov
dca99c3fd2 Move ClassifierUsageChecker invocation lower in LazyTopDownAnalyzer
Invoking checkers right after resolution of qualified expressions is too early:
DeprecatedClassifierUsageChecker tries to load the annotations of a referenced
classifier to report deprecation, and that may result in building light classes
for not yet analyzed declarations

 #KT-13954 Fixed
2016-09-24 11:26:56 +03:00
Ilya Gorbunov
35839695f7 Fix decompiled text consistency test to handle type aliases in JS.
by Alexey Andreev <Alexey.Andreev@jetbrains.com>
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
c508f75de4 Test data: change fully qualified type so that it's available as type (and not an alias) in both jvm and js runtimes to have the same output. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
ed70d1dfa6 Provide type aliases for collections in java.util to ease migration. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
b741c82a66 Fix completion tests after moving collection types in JS 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
bf56f04368 Simplify Kotlin.collectionsSort as it always being provided with MutableList. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
889040218b Rewrite ChainEntry not to be inner class. Cleanup unused code. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
54a640d733 Cleanup: remove unused code from HashMap, remove commented out specialization intrinsics. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
d0b7ddfceb Minor cleanup, rename parameters to match supertype names. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
1ea02198e0 Add tests to ensure #KT-10786 Fixed and #KT-8724 Fixed 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
26cbad8e7f Provide message for UnsupportedOperationException thrown from AbstractCollection.add. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
23d2654afd Refactor Map-InternalMap to provide specialized linked string map and set 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
e342593d2e Flatten HashMap hierarhy, provide string-keyed map and set specializations. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
5833d32f25 Import StringMap from GWT 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
d1a24de278 Consequences of map/set specializations removal:
- NaNs are no longer usable as keys in maps or elements in sets.
- Chars are stored as their underlying type string, and Longs are stored as objects.
Opened #KT-13610
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
ea82c20692 Remove js implementations of java.util maps and sets, disable intrinsic to select specialized implementations.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
5cd3417d4c Maps and sets: cleanup, simplify, refactor.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
b05c2c1f6a Import AbstractHashMap, HashMap, HashSet, LinkedHashMap, LinkedHashSet from GWT
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
f5e0c504d6 AbstractMap: cleanup and refactor
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
c54bc2ea18 Import AbstractMap implementation from GWT.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
d900efb34e AbstractSet implementation.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
828e7f8744 Add tests to ensure #KT-7473 and #KT-13459 and #KT-13429 are Fixed. 2016-09-24 07:08:21 +03:00
Ilya Gorbunov
89388f1f83 Fixes in ArrayList after review.
Provide better implementations for some methods of AbstractList.
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
472ef89baf AbstractList: cleanup and rename
#KT-12386
2016-09-24 07:08:21 +03:00
Ilya Gorbunov
75069143c7 Rewrite ArrayList, AbstractList, AbstractCollection in kotlin.
AbstractList is imported from GWT.
#KT-12386
2016-09-24 07:08:21 +03:00
Nikolay Krasko
0abf94c2f4 Allow to avoid rebuilding application in debugger tests on local machine
(cherry picked from commit 8b899a7)
2016-09-24 01:44:40 +03:00
Nikolay Krasko
520e187e46 Clean application after test in compiler tests
It's disposed after Disposer.dispose(myTestRootDisposable) in tearDown and mixing compiler tests
with non-compiler tests may ruin classes initialization with

"com.intellij.util.IncorrectOperationException: Sorry but parent: com.intellij.mock.MockApplicationEx@52439591 has already been disposed"

(cherry picked from commit f3badb6)
2016-09-24 01:44:38 +03:00
Alexey Tsvetkov
1c0be7f0ba Update changelog for 1.0.4 2016-09-23 20:55:49 +03:00
Denis Zharkov
217f033552 Prevent generation of delegations to interfaces private methods
#KT-13381 Fixed
 #KT-13996 Fixed
2016-09-23 14:51:14 +03:00
gitreelike
06c804787f Implement quick fix to convert a too long char literal to a string #KT-13635 Fixed 2016-09-23 13:04:41 +03:00
shiraji
391a0fdde5 Add "Copy concatenation text to clipboard" intention #KT-13744 Fixed 2016-09-23 12:46:22 +03:00
Valentin Kipyatkov
023c02deb3 Corrections on code review 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
e4f80e277f Better texts of change variable type quickfixes 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
80d82d2dee Made AddToStringFix low priority 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
7625672914 Better test data 2016-09-23 10:07:15 +03:00
Valentin Kipyatkov
dab6f7d13d Better texts for quickfixes to change return type 2016-09-23 10:07:14 +03:00
Ilya Gorbunov
8d67a65ed9 Build stdlib docs 3 times: one for each JDK 2016-09-22 22:32:02 +03:00
Ilya Gorbunov
47be8e664a Minor: replace var with val. 2016-09-22 22:28:14 +03:00
Ilya Gorbunov
2c0edf6652 Fix working directory where CompilerSmokeTest runs to be 'project.build.directory', otherwise it may vary depending on maven goals invoked. 2016-09-22 21:59:10 +03:00
Ilya Gorbunov
f60447328d Remove snapshot repository from idl2k module. 2016-09-22 21:52:33 +03:00
Ilya Gorbunov
0cd0f3caa0 Reorder maven project modules to run more tests earlier in build. 2016-09-22 21:52:33 +03:00
Alexey Tsvetkov
fc6773a416 Print gradle output only if test is failed 2016-09-22 20:43:01 +03:00
Alexey Sedunov
b412edf2a3 Extract Class: Implement 'Extract Interface' refactoring
#KT-11017 Fixed
2016-09-22 20:11:31 +03:00
Alexey Sedunov
af2de09840 Extract Class: Implement 'Extract Superclass' refactoring
#KT-11017 In Progress
2016-09-22 20:11:30 +03:00
Pavel V. Talanov
8f5725345f ModuleDescriptor: invert "friends" relation
Fixes memory leak caused by modules storing their friends (which can be potentially recreated many times)
2016-09-22 18:20:43 +03:00
Denis Zharkov
23c0bdbd05 Add filtering of suggested expressions for postfix templates
Do not suggest qualified expression's selector or a part of user type
because they aren't really independent expressions
2016-09-22 18:11:22 +03:00
Simon Ogorodnik
ab2b6743df KT-11990 J2K native to external conversion (#957) 2016-09-22 18:09:26 +03:00
Nikolay Krasko
293d3b4320 Remove toString() test for StorageManager
Storing place of creating was removed in cb32bc97dd
2016-09-22 16:28:46 +03:00
Denis Zharkov
5381c06936 Improve 1.0-compatibility mode for JDK dependent members
Just reporting error by call checker may be too restrictive
in case there are some extensions that can be used successfully

Solution is to annotate additional members with
@Deprecated(level=Error) + @kotlin.internal.LowPriorityInOverloadResolution
2016-09-22 15:40:37 +03:00
Denis Zharkov
a7dedfab70 Move JvmBuiltIns initialization after container setup
It will be used in the further commits to initilize built-ins instance
with components as arguments
2016-09-22 15:40:37 +03:00
Nikolay Krasko
63943c60d3 Patch ThreadTracker during Kotlin plugin init 2016-09-22 15:19:18 +03:00
Mikhail Glukhikh
68f0953b02 Random-order variable sets are no more in use in CFG #KT-13990 Fixed
(cherry picked from commit fc89385)
2016-09-22 13:32:01 +03:00
Alexander Udalov
b3803d6fe7 Exclude some codegen tests on Android
These tests rely on the fact that sources are located in the default package,
whereas Android tests alter the package name of each test
2016-09-22 13:03:26 +03:00
Dmitry Petrov
07198cf86d SAM constructors for type aliases. 2016-09-22 10:38:34 +03:00
Denis Zharkov
6663054f4d Fix false positive "Cannot capture" error reporting
There is no need to report an error in case of non-top-level
capture conversion, just don't add relevant capture type in the system instead

If system can be solved successfully without captured type, then it's just fine
(see KT-13950)
In case of contradiction TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR is reported

 #KT-13950 Fixed
2016-09-21 18:05:26 +03:00
Denis Zharkov
4431c6ad02 Fix inference when captured type is used as a lambda parameter type
Use lower approximation bound to obtain acceptable types for lambda parameters
those types depend on captured type

 #KT-12238 Fixed
 #KT-10627 Fixed
2016-09-21 18:05:26 +03:00
Nikolay Krasko
cb32bc97dd Remove logging in LockBasedStorageManager creation as it all the same useless
HEAD - 3 leads to "org.jetbrains.kotlin.storage.LockBasedStorageManager.createWithExceptionHandling(LockBasedStorageManager.java:65)" debug string
2016-09-21 15:54:42 +03:00
Nikolay Krasko
b7b6d319f1 Remove another place with mentioning bare plugin 2016-09-21 15:54:40 +03:00
Nikolay Krasko
37fb8d6306 Fix tests for looking implementations from Java - no search for Kotlin declaration from usages
Probably because of this commit: 7d95ff4d86
2016-09-21 15:52:16 +03:00
Alexander Udalov
621c6691d0 Support equals, hashCode, toString for annotations instantiated with reflection
#KT-13106 Fixed
2016-09-20 21:36:30 +03:00
Alexander Udalov
525937252d Support Java annotation constructors in reflection
#KT-13106 In Progress
2016-09-20 21:36:30 +03:00
Alexander Udalov
aeba124bdb Support Kotlin annotation constructors in reflection
#KT-13106 In Progress
2016-09-20 21:36:29 +03:00
Alexander Udalov
fb18e4bf4c Sort parameters of Java annotation constructors by name for stability 2016-09-20 21:36:29 +03:00
Alexey Sedunov
d6daaf0a85 Redundant 'toString()' in String Template: Disable for qualified expressions with 'super' receiver
#KT-13942 Fixed
2016-09-20 20:36:03 +03:00
Alexey Sedunov
85c45cf2fa Move Files/Directories: Fix behavior of "Open moved files in editor" checkbox
#KT-13909 Fixed
2016-09-20 20:36:02 +03:00
Alexey Sedunov
ad8b534e9c Move Nested Class to Upper Level: Preserve state of "Search in comments"/"Search for text occurrences" checkboxes
#KT-13904 Fixed
2016-09-20 20:36:01 +03:00
Alexey Sedunov
79f50975b1 Convert Parameter to Receiver: Do not qualify companion members with labeled 'this'
#KT-13933 Fixed
2016-09-20 20:36:00 +03:00
Alexey Sedunov
75481c34b4 Move to Companion Object: Warn if companion object already contains function with the same signature
#KT-13877 Fixed
2016-09-20 20:35:59 +03:00
Alexey Sedunov
72ff5dd2cc Move to Companion Object: Forbid for functions/properties referencing type parameters of the containing class
#KT-13876 Fixed
2016-09-20 20:35:58 +03:00
Alexey Sedunov
4cd4b8781d Move: Do not ignore target directory selected in the dialog (DnD mode)
#KT-13901 Fixed
2016-09-20 20:35:57 +03:00
Alexey Sedunov
65a1ecc464 Move Nested Class to Upper Level: Do not show directory selection dialog twice
#KT-13906 Fixed
2016-09-20 20:35:56 +03:00
Alexey Sedunov
6366383b31 Minor: Add test for KT-13916 2016-09-20 20:35:56 +03:00
Alexey Sedunov
951dc6a438 Move: Remove companion object which becomes empty after the move
#KT-13903 Fixed
2016-09-20 20:35:55 +03:00
Alexey Sedunov
11a7a242c8 Move to Companion Object: Fix exception when applied to class
#KT-13883 Fixed
2016-09-20 20:35:54 +03:00
Alexey Sedunov
64e5baade3 Move to Companion: Fix AssertionError on running refactoring from Conflicts View
#KT-13874 Fixed
2016-09-20 20:35:53 +03:00
Alexey Sedunov
6e8bcb987a Minor: Add tests for KT-13759 2016-09-20 20:35:52 +03:00
Alexey Sedunov
4313f249a4 Presentation: Add file name to the presentation of private top-level declaration
#KT-13838 Fixed
2016-09-20 20:35:51 +03:00
Nikolay Krasko
4adfb18990 Solve thread leaking problem in intellij idea ultimate with obfuscated fileds 2016-09-20 19:31:10 +03:00
Pavel V. Talanov
92b62f879b JavaClassImpl: add assertion on querying members of light classes
Hopefully this assertion happens before deadlock KT-12966
2016-09-20 19:09:05 +03:00
Pavel V. Talanov
631603c015 J2K JavaClassImpl: rename file 2016-09-20 19:09:04 +03:00
Pavel V. Talanov
724b0322c0 J2K JavaClassImpl: convert code 2016-09-20 19:09:03 +03:00
Mikhail Zarechenskiy
46ef1920d6 Update API listing after changes in runtime.jvm 2016-09-20 18:44:39 +03:00
Ilya Gorbunov
71af020beb Use explicit public visibility in kotlin-runtime. 2016-09-20 17:38:51 +03:00
Mikhail Zarechenskiy
2fc8f5d5e2 Move util function closer to its usage and remove empty file 2016-09-20 16:23:43 +03:00
Mikhail Zarechenskiy
8a0107ea5f Move property with template to script definition interface 2016-09-20 16:23:42 +03:00
Mikhail Zarechenskiy
7739677a06 Adapt ScriptCodegenTests to last changes
Get rid of possibility to configure script definition without template
class, therefore all tests now are using default script argument
2016-09-20 16:23:41 +03:00
Mikhail Zarechenskiy
f8774be8c3 Adapt ScriptGenTest to last changes
- Use script definitions created by script templates
 - Configure classpath before files were loaded
2016-09-20 16:23:40 +03:00
Mikhail Zarechenskiy
aa1368f4f3 J2K ScriptGenTest: convert and prettify 2016-09-20 16:23:39 +03:00
Mikhail Zarechenskiy
49e1603470 J2K ScriptGenTest: rename 2016-09-20 16:23:38 +03:00
Mikhail Zarechenskiy
b18cbc37c6 Do not generate properties from script constructor
From now all script parameter properties are generated by template class
2016-09-20 16:22:42 +03:00
Mikhail Zarechenskiy
0ba2d374bc Create standard script definition from standard template
Now each script without specified template has a StandardSriptTemplate
class as a base one. This allows to generalize script codegen and
resolve.
2016-09-20 15:44:44 +03:00
Nikolay Krasko
d69e7c7aec Problem: fix thread leaking check fail on teamcity for ultimate rename tests 2016-09-20 15:27:10 +03:00
Nikolay Krasko
ea1aac07ec Problem: workaround thread leaking problem 2016-09-20 15:27:08 +03:00
Nikolay Krasko
835474e5a1 Register TypeAnnotationModifier EP in environment for web demo converter 2016-09-20 15:27:07 +03:00
Nikolay Krasko
bf12908dfc Ignore irrelevant java classes in search results
It looks like JavaClassInheritorsSearcher started to give classes based on useScope
2016-09-20 15:27:05 +03:00
Nikolay Krasko
6cdb578f76 Fix goto implementation tests - deffered task should be executed 2016-09-20 15:27:04 +03:00
Nikolay Krasko
00db1c1490 Add standard inheritors to hierarchy test 2016-09-20 15:27:02 +03:00
Nikolay Krasko
89a1389512 Make caret left move not-applicable on first function parameter 2016-09-20 15:27:01 +03:00
Nikolay Krasko
5337fd05fb Update to 2016.2.3 2016-09-20 15:26:59 +03:00
Nikolay Krasko
7b19454d58 Don't run applicationEx.invokeAndWait in testing mode 2016-09-20 15:26:57 +03:00
Nikolay Krasko
058dbd3375 Test only: method signature changed 2016-09-20 15:26:56 +03:00
Nikolay Krasko
80bf0b9c3e Update compilation in 2016.2 2016-09-20 15:26:54 +03:00
Nikolay Krasko
4b9b3b07e7 Update to 162.1447.7 2016-09-20 15:26:53 +03:00
Denis Zharkov
329c1a1e72 Use editor instead of file in TypingIndentationTest
Nobody guarantees that changes in editor are saved immediately
2016-09-20 15:26:51 +03:00
Denis Zharkov
10c840327d Temporary move annotation to methods' modifier list
Java resolver ignores return type annotations if there are ones on modifier list

Related to this commit a2497edcee
2016-09-20 15:26:50 +03:00
Denis Zharkov
189705727f Implement a bunch of string based postfix templates
#KT-4710 Fixed
2016-09-20 15:26:48 +03:00
Denis Zharkov
1b391123e6 Implement for/iter postfix templates
#KT-4710 In Progress
2016-09-20 15:26:47 +03:00
Denis Zharkov
b702886f0d Introduce var/val postfix templates
#KT-4710 In Progress
2016-09-20 15:26:45 +03:00
Denis Zharkov
7ba914f92a Minor. Introduce 'isVar' parameter for KotlinIntroduceVariableHandler.doRefactoring 2016-09-20 15:26:44 +03:00
Denis Zharkov
4d28199cc2 Implement if/else/null/notnull/when/try postfix templates
#KT-4710 In Progress
2016-09-20 15:26:42 +03:00
Denis Zharkov
09266b222b Implement 'Surround expression with if' surrounder
#KT-3363 Fixed
2016-09-20 15:26:41 +03:00
Denis Zharkov
f18b9cceb3 Implement 'not' postfix template
#KT-4710 In Progress
2016-09-20 15:26:39 +03:00
Denis Zharkov
1eeec18303 Update IDEA version to 2016.2 2016-09-20 15:26:38 +03:00
Nikolay Krasko
3d0d82b862 Fix tests for move: check applicability from changed text
Presentation status has stopped working after 18ce2c6070
2016-09-20 15:26:36 +03:00
Nikolay Krasko
a471d8907a Register TypeAnnotationModifier as extension point 2016-09-20 15:26:34 +03:00
Nikolay Krasko
99a75021e1 Problem: manually shutdown AppScheduledExecutorService to allow compiler stop properly
Without such shutdown console program that gets PSI file will hang forever.

Introduced in 446b80077a

Stack example:

 java.lang.Thread.State: RUNNABLE
	  at com.intellij.util.concurrency.AppDelayQueue.<init>(AppDelayQueue.java:37)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.<init>(AppScheduledExecutorService.java:50)
	  at com.intellij.util.concurrency.AppScheduledExecutorService$Holder.<clinit>(AppScheduledExecutorService.java:41)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.getInstance(AppScheduledExecutorService.java:46)
	  at com.intellij.util.concurrency.AppExecutorUtil.getAppScheduledExecutorService(AppExecutorUtil.java:39)
	  at com.intellij.concurrency.JobScheduler.getScheduler(JobScheduler.java:43)
	  at com.intellij.psi.impl.source.AstPathPsiMap.<clinit>(AstPathPsiMap.java:45)
	  at com.intellij.psi.impl.source.PsiFileImpl.<init>(PsiFileImpl.java:76)
	  at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:39)
	  at org.jetbrains.kotlin.psi.KtFile.<init>(KtFile.java:48)
	  at org.jetbrains.kotlin.parsing.KotlinParserDefinition.createFile(KotlinParserDefinition.kt:73)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:407)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:348)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:326)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:171)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:155)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.trySetupPsiForFile(PsiFileFactoryImpl.java:121)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:100)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:56)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.doCreateFile(KtPsiFactory.kt:174)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.createFile(KtPsiFactory.kt:178)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processFileSingleEvaluator(Preprocessor.kt:82)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:105)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:135)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processSources(Preprocessor.kt:74)
	  at org.jetbrains.kotlin.preprocessor.PreprocessorCLI.main(PreprocessorCLI.kt:35)
2016-09-20 15:25:37 +03:00
Nikolay Krasko
cf63a77396 Update to idea 162.1024.1 2016-09-20 15:25:07 +03:00
Nikolay Krasko
e2860eb12a Tests only: fix compiler error because of changed nullability 2016-09-20 15:25:06 +03:00
Nikolay Krasko
22f3fe4784 Update to 162.844.8 2016-09-20 15:25:04 +03:00
Nikolay Krasko
dc35524fe1 Tests only: codeCleanup() method signature was changed 2016-09-20 15:25:03 +03:00
Nikolay Krasko
89175a0165 Compile error because of changed nullability 2016-09-20 15:25:01 +03:00
Nikolay Krasko
1a89d138fb API change: parameter became NotNull 2016-09-20 15:25:00 +03:00
Nikolay Krasko
6a11055389 Build against 162.646.4 2016-09-20 15:24:58 +03:00
Nikolay Krasko
ff9f3694f1 Problem: remove static import (temp workaround)
See KT-13954 for details
2016-09-20 15:24:55 +03:00
Nikolay Krasko
d5ae37d33a Problem: remove static import (temp workaround) 2016-09-20 15:10:57 +03:00
Nikolay Krasko
bfef8726bb Mock implementation for ExternalAnnotationsManager and InferredAnnotationsManager services 2016-09-20 15:10:56 +03:00
Nikolay Krasko
dc49f7f21b Update to idea 162 2016-09-20 15:10:54 +03:00
Nikolay Krasko
dba55ec34d More write action requirement remove
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock
2016-09-20 15:10:53 +03:00
Nikolay Krasko
7d1a5f1d2b Tests only: add new method in MockPsiManager.java 2016-09-20 15:10:51 +03:00
Nikolay Krasko
b05105e849 Problem: define idea.plugins.compatible.build setting explicitly to avoid exception about bad idea home path 2016-09-20 15:10:49 +03:00
Nikolay Krasko
72c6c66b48 API Change: Implement new method isSuppressAll() 2016-09-20 15:10:48 +03:00
Nikolay Krasko
db20daae88 API Change: remove explicit generic type information 2016-09-20 15:10:46 +03:00
Nikolay Krasko
9674e1a6c7 Tests only: No more WatchMessageNode
55029007ad
2016-09-20 15:10:45 +03:00
Nikolay Krasko
58ff7f53fa Tests only: Debugger test data modification: extra removed 2016-09-20 15:10:43 +03:00
Nikolay Krasko
c7ac8e1650 Tests only: implement new method 2016-09-20 15:10:42 +03:00
Nikolay Krasko
226735ae05 Tests only: Constructor for XWatchesViewImpl was changed
1a8de38449
2016-09-20 15:10:40 +03:00
Nikolay Krasko
99ed926554 Tests only: reparseRange parameters changed
94863a8df4
2016-09-20 15:10:38 +03:00
Nikolay Krasko
bea45ff2e5 registerUnresolvedError is in base class in idea from br146 2016-09-20 15:10:37 +03:00
Nikolay Krasko
06a0ebe352 No jsr166e.jar anymore in br146 2016-09-20 15:10:35 +03:00
Nikolay Krasko
5cecdddcb6 Add run configuration for downloading br146 2016-09-20 15:10:34 +03:00
Dmitry Petrov
bfcf7d9890 DM 19.09.2016: typealiases private in file are resolved as classes.
Add test for typealias private in file.
2016-09-20 14:42:29 +03:00
Denis Zharkov
42e85b07c9 Fix types in local var table for destructured variables 2016-09-20 13:44:44 +03:00
Mikhail Zarechenskiy
0792571256 Include default script template into mock-runtime 2016-09-20 11:29:10 +03:00
Mikhail Zarechenskiy
428763e886 Introduce default script template definition into runtime.jvm 2016-09-20 11:29:02 +03:00
Valentin Kipyatkov
f5a34ca5ae Fixed intentions 2016-09-20 10:55:36 +03:00
Dmitry Petrov
7b25331de1 Support type aliases in RecursiveDescriptorProcessorTest. 2016-09-20 10:55:36 +03:00
Dmitry Petrov
dac9d8b845 Additional checks for type alias constructors. 2016-09-20 10:55:36 +03:00
Dmitry Petrov
796d11c860 ClassDescriptor is now a super-interface for ClassConstructorDescriptor and TypeAliasConstructorDescriptor. 2016-09-20 10:55:36 +03:00
Valentin Kipyatkov
7d214c6e58 KT-13689 Typealias constructor usage counts as original type usage for optimize imports
#KT-13689 Fixed
(cherry picked from commit bde7e2b)
2016-09-20 10:55:36 +03:00
Dmitry Petrov
9d373fba67 (@alexey.andreev) JS BE should handle TypeAliasConstructorDescriptor accordingly. 2016-09-20 10:55:36 +03:00
Dmitry Petrov
b31ab729de Containing declaration for TypeAliasConstructorDescriptor
is a corresponding TypeAliasDescriptor.
2016-09-20 10:55:36 +03:00
Denis Zharkov
1cc7f19d10 Fix AnnotationDescriptorResolver tests
Do not run annotation resolver tests on lambda parameters,
mostly because it's impossible to annotate them by now
(see KT-13900 and `val functionLiteral` in compiler/testData/resolveAnnotations/testFile.kt)

It was working before only because lambda parameter hadn't been parsed at all,
while after introduction of destructuring in lambda parameters
it gets parsed normally

 #KT-13900 Submitted
2016-09-19 20:22:57 +03:00
Denis Zharkov
6e12fe3a78 Fix parameter changing in refactorings
Do not try to create new identifier if inherited name is invalid,
e.g. it's a destructuring declaration.

See KotlinChangeSignatureTest.testSAMRenameParam
2016-09-19 20:22:57 +03:00
Denis Zharkov
72d027d968 Introduce language feature DestructuringLambdaParameters
#KT-5828 Fixed
2016-09-19 20:22:57 +03:00
Denis Zharkov
e75efc88ff Add support for desctructuring of lambda parameters in JVM backend
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov
e975d32196 Implement resolution of desctructuring declarations in lambdas
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov
ace3655824 Minor. Rename diagnostic tests: multiDeclarations -> destructuringDeclarations 2016-09-19 20:22:57 +03:00
Denis Zharkov
3df3187e25 Minor. Refine variable name: innerScope -> headerScope 2016-09-19 20:22:57 +03:00
Denis Zharkov
75a51d915f Implement parsing of desctructuring declarations in lambdas
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Denis Zharkov
000ba33f59 Minor. Prettify value parameters' resolution parts 2016-09-19 20:22:57 +03:00
Denis Zharkov
435cafed99 Minor. Cleanup KotlinParsing code 2016-09-19 20:22:57 +03:00
Nikolay Krasko
d96863da93 Fix severe freezes because of long lint checks on large files (KT-13071)
- Run lint analyze under indicator with write action priority. Otherwise ProgressManager.checkCanceled() checks doesn't work
 - Move ProgressManager.checkCanceled() up or they are not called in large files without lint warnings

 #KT-13071 Fixed
2016-09-19 18:53:52 +03:00
Nikolay Krasko
131e77927a Skip lazy parsable lambdas without actually parsing them 2016-09-19 18:53:51 +03:00
Alexander Udalov
c91f77f2a4 Rename LanguageFeatureSettings -> LanguageVersionSettings 2016-09-19 15:21:24 +03:00
Alexander Udalov
aec31bd88f Uninherit LanguageVersion from LanguageFeatureSettings
Introduce LanguageVersionSettingsImpl to store everything related to the
selected language version
2016-09-19 15:20:47 +03:00
Alexey Andreev
7dbada0d06 JS: repair serialization of type aliases 2016-09-19 12:30:32 +03:00
Alexey Andreev
9dd6c9a65c KT-13664: write values of long compile-time constants as constants. Fix #KT-13664 2016-09-19 12:29:58 +03:00
Mikhail Glukhikh
1e5fb91d7d Minor refactoring: convert to expression body 2016-09-19 11:45:38 +03:00
Mikhail Glukhikh
909b9b6463 J2K fix: do not use auto-conversion of accessors to = Unit format 2016-09-19 11:07:24 +03:00
Mikhail Glukhikh
4509cd43cb Convert to expression body fix: do not allow = Unit for constructors 2016-09-19 10:58:37 +03:00
Mikhail Glukhikh
24c7efd323 Minor: WITH_RUNTIME removed from a set of intention tests 2016-09-19 10:57:16 +03:00
Mikhail Glukhikh
9ad820205e Partial build fix (new convert to expression body opportunity in quick-fixes) 2016-09-19 10:37:39 +03:00
Mikhail Glukhikh
608368997c Add function to supertype immediately removes redundant modifiers #KT-12297 Fixed 2016-09-16 16:26:01 +03:00
Mikhail Glukhikh
32d11c35a4 KT-12297 related: make not open quick-fix for REDUNDANT_OPEN_IN_INTERFACE 2016-09-16 16:25:57 +03:00
Dmitry Petrov
34240e2ff9 Create special descriptor for an object corresponding to type alias. 2016-09-16 15:44:44 +03:00
shiraji
4f49444f3b Allow to convert empty Unit returning functions to expression form #KT-13588 Fixed 2016-09-16 15:31:13 +03:00
Alexey Sedunov
cf28dd04c8 Shorten References: Compare resolved calls when shortening receiver of qualified call expression
#KT-13660 Fixed
2016-09-16 13:13:30 +03:00
Mikhail Glukhikh
c1296e2134 Retain nullability information for type alias arguments which are in turn type aliases #KT-13835 Fixed 2016-09-16 10:30:43 +03:00
Alexander Udalov
090d157f86 Update test data for data classes 2016-09-15 16:45:48 +03:00
Alexander Udalov
fea116f14e Allow data classes to implement equals/hashCode/toString from base classes
#KT-11306 Fixed
2016-09-15 16:45:48 +03:00
Alexander Udalov
98f6ea577a Move data class-related functions to DataClassDescriptorResolver 2016-09-15 16:45:48 +03:00
Alexander Udalov
22f8e7db3b Use independent context to type-check LHS of '::'
#KT-13110 Fixed
2016-09-15 16:45:48 +03:00
Alexey Sedunov
84aa82e73c Misc: Move conflict checking to moveConflictUtils.kt 2016-09-15 16:22:52 +03:00
Alexey Sedunov
54faac1cee Pull Up: Drop 'override' modifier if moved member doesn't override anything 2016-09-15 16:22:51 +03:00
Alexey Sedunov
dddb4fd792 Introduce Lambda Parameter: Use IDEA-provided action 2016-09-15 16:22:50 +03:00
Alexey Sedunov
f0a298e27b Minor: Fix NPE in MoveKotlinTopLevelDeclarationsDialog
#KT-13856 Fixed
2016-09-15 16:22:49 +03:00
Mikhail Glukhikh
f973be22e2 IntentionBasedInspection minor refactoring: inspectionRange --> inspectionTarget 2016-09-15 14:26:40 +03:00
shiraji
e4c873dc6a Add inspection + intention to replace .let { it.foo() } with .foo() #KT-13551 Fixed 2016-09-15 14:26:06 +03:00
Mikhail Glukhikh
cdf4309e04 Speed search is enable in add import action #KT-13326 Fixed 2016-09-15 14:03:53 +03:00
Denis Zharkov
556df93ca7 Refine diagnostic about type arguments for an outer class
#KT-11263 Fixed
2016-09-15 10:33:19 +03:00
Denis Zharkov
7ca84649d7 Fix implicit type arguments resolution for inner classes
When resolving arguments on inner classifier, one can omit the arguments
for outer class 'Outer' if they are present implicitly in the scope:
- One of the supertypes of current class is Outer
- One of the outer classes or one of their supertypes is Outer

Relevant arguments are obtained from the first type found by
the algorithm above

Note that before this commit implicit arguments were only been searched
in containing classes

 #KT-11123 Fixed
2016-09-15 10:33:19 +03:00
Denis Zharkov
15c0901a72 Minor. Add covariant override for TypeParameterDescriptor.original 2016-09-15 10:33:19 +03:00
Ilya Gorbunov
3471b3311f Fix js RegExp test not to rely on array equality. #KT-8283 2016-09-14 20:41:41 +03:00
Alexey Tsvetkov
7b99730e39 Test that typealias works with Gradle
#KT-13204 Obsolete
2016-09-14 18:30:02 +03:00
Alexey Andreev
dd062bfd6d JS: add explanation to inline/arrayLiteralAliasing.kt test 2016-09-14 16:37:54 +03:00
Alexey Andreev
a9330057cc KT-8283: fix Kotlin.equals method to compare arrays by reference 2016-09-14 16:37:53 +03:00
Alexey Tsvetkov
a04d60406b Fix snapshot version in gradle tests 2016-09-14 14:13:59 +03:00
Alexey Tsvetkov
1bac872047 Do not try to remove source annotations from not .class file 2016-09-14 13:53:35 +03:00
Alexey Tsvetkov
d2677c0500 Change directory for sync task cache #KT-13732 fixed 2016-09-14 13:53:08 +03:00
Alexey Tsvetkov
508b965d88 Minor: fix gradle plugin order in test 2016-09-14 13:53:04 +03:00
Alexey Tsvetkov
6ebb50751c Remove source annotations when copy class with kapt2
Writing source annotations enables incremental compilation for kapt2.
However they are not needed in bytecode, so we remove them when
copying classes.

# Conflicts:
#	compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
#	compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java
2016-09-14 13:52:56 +03:00
Alexey Andreev
5534350fd6 KT-7397: use reference comparison (===) when translating a is A, where A is an object. Use more sophisticated check for reified parameters. 2016-09-14 13:16:24 +03:00
Alexey Andreev
5d34f5fb75 KT-13836: fix generation of FQN of secondary constructor when it's called via typealias. Fix #KT-13836 2016-09-14 12:40:01 +03:00
Simon Ogorodnik
115d63a2f3 #KT-13750 fix (#951) 2016-09-13 18:12:22 +03:00
Valentin Kipyatkov
19ef29e96c KT-12949 Type aliases are not considered for import when there is an unresolved reference
#KT-12949 Fixed
2016-09-13 17:47:39 +03:00
Valentin Kipyatkov
e41ab2a270 Better presentation of aliases in completion list 2016-09-13 17:47:38 +03:00
Valentin Kipyatkov
50a0f9a4a7 KT-13266 Non-imported type aliases do not appear in completion
#KT-13266 Fixed
2016-09-13 17:47:38 +03:00
Valentin Kipyatkov
fcce1e3838 KT-12852 Support breadcrumbs for Kotlin
#KT-12852 Fixed
2016-09-13 17:46:16 +03:00
Dmitry Petrov
dae4521c68 KT-13822 Exception in the compiler for start-projection of a type alias
Use ClassifierWithTypeParameters in StarProjectionImpl.
2016-09-13 15:09:47 +03:00
Alexander Udalov
5b047684ab Use collections instead of sequences in KClassImpl.Data
Create less intermediate objects in extensions in KClasses.kt
2016-09-13 14:12:35 +03:00
Alexander Udalov
b9dec41ea0 Cache more stuff in reflection implementation
Delete KAnnotatedElementImpl because it's not possible to make it a class (its
subclasses have other classes in supertypes) to cache annotations in a property
2016-09-13 14:12:34 +03:00
Alexander Udalov
80db0e4b71 Minor, make KCallableImpl a class
This will allow to cache stuff common to all callables in KCallableImpl
2016-09-13 14:12:33 +03:00
Alexander Udalov
4d7d70db19 Regenerate public API reference after changes in runtime.jvm 2016-09-13 14:12:32 +03:00
Alexander Udalov
d128827a34 Inherit FunctionReference from CallableReference
This became possible now because FunctionImpl is no longer a class
2016-09-13 14:12:32 +03:00
Alexander Udalov
a10cf8a931 Support 'is/as FunctionN<...>' and 'invoke' for KFunction instances 2016-09-13 14:12:31 +03:00
Alexander Udalov
dcc66a6400 Drop KFunctionFromReferenceImpl, make FunctionImpl an interface
23 invokes in KFunctionFromReferenceImpl (and consequently, in FunctionImpl)
were needed before 1576160390: a wrapped function
reference must have had the necessary invoke to be called as an instance of a
specific function type. After 1576160390, this is
not needed anymore because KFunctionFromReferenceImpl is now an internal
implementation detail of reflection, and no invoke is ever called on it.
2016-09-13 14:12:30 +03:00
Alexander Udalov
fbfa61da5d Drop K(Mutable)Property{0,1,2}Augmented
Also store name in KPropertyImpl, so that calling 'name' on a KProperty
instance in the property delegate does not result in unnecessary descriptor
computation
2016-09-13 14:12:29 +03:00
Alexander Udalov
fc043c6e66 Drop KPropertyNFromReferenceImpl classes
The only place where their get/set methods were used was in
KPropertyNImpl.Getter.invoke, and it's fine if that results in a reflective
call instead (KPropertyN#getter is not available without kotlin-reflect.jar
anyway). The test data has been changed because a package local Java field is
not accessible via reflection
2016-09-13 14:12:29 +03:00
Alexander Udalov
b0af2581ae Drop unused get/set implementations from PropertyReference runtime classes
They are overridden in all subclasses anyway: either in the corresponding
(Mutable)PropertyReferenceNImpl class, or in the anonymous class for a
reference, generated by the compiler.
2016-09-13 14:12:28 +03:00
Alexander Udalov
d3abc83b4c Merge DescriptorBasedProperty into KPropertyImpl, make the latter a class 2016-09-13 14:12:27 +03:00
Alexander Udalov
cd703868d4 Inherit KPropertyImpl.Accessor from KCallableImpl
This is needed to make KCallableImpl a class
2016-09-13 14:12:26 +03:00
Alexander Udalov
304b5deacb Simplify KProperty implementations: get rid of KMutablePropertyImpl 2016-09-13 14:12:26 +03:00
Alexander Udalov
c7050ed445 Cache everything cacheable in KClassImpl
#KT-10651 Fixed
2016-09-13 14:12:19 +03:00
Alexander Udalov
6a97dc5f2c Cache declared/non-declared static/non-static KClass members
Making KClassImpl.Data, its superclass and ReflectProperties public was
required because they are accessed from other package in KClasses.kt
2016-09-13 14:01:52 +03:00
Alexander Udalov
f292ca3dad Simplify signature and usages of KDeclarationContainerImpl#getMembers 2016-09-13 14:01:52 +03:00
Alexander Udalov
b9067e6462 Introduce reflection cache in KClassImpl and KPackageImpl
Most of KClassImpl operations should be cached, but creating a lazy value for
each operation would significantly increase memory footprint of a KClassImpl
instance. Therefore we decide to store all lazy values under a single lazy
value named 'data' which is stored in KClassImpl. There's a minor overhead of
indirection on any operation now, however it'll allow us to substantially
increase reflection performance by caching everything we can
2016-09-13 14:01:52 +03:00
Valentin Kipyatkov
f6b471ac01 Better tests 2016-09-13 12:02:10 +03:00
Valentin Kipyatkov
5bf701ab03 KT-13047 Autocomplete inserts a fully-qualified variable name inside a String
KT-12083 String interpolation -- auto {} if there is a letter after cursor

 #KT-13047 Fixed
 #KT-12083 Fixed
2016-09-13 12:02:10 +03:00
Alexey Sedunov
6e02051be5 Rename: Rename all overridden members if user chooses to refactor base declaration(s)
#KT-8867 Fixed
2016-09-12 21:03:21 +03:00
Alexey Sedunov
a77e1dabce Move: Do not show directory selection dialog if target directory is already specified by drag-and-drop
#KT-13553 Fixed
2016-09-12 21:03:20 +03:00
Alexey Sedunov
bb859ea0f6 Misc: Do not use empty scope for KtParameter/KtTypeParameter (possible fix for EA-1185336) 2016-09-12 21:03:19 +03:00
Alexey Sedunov
23491afde2 Move to Companion Intention: Do not use qualified names as labels
#KT-11483 Fixed
2016-09-12 21:03:18 +03:00
Yan Zhulanow
78a4e90132 Minor: Fix Maven plugin compilation (configuration parameter is not required now in analyzeAndGenerate(), cherrypick problem) 2016-09-12 19:07:57 +03:00
Mikhail Glukhikh
222b964f3a Minor: intention message changed for if/when -> assignment/return 2016-09-12 15:01:17 +03:00
Mikhail Glukhikh
edacc7f8d7 Quick-fix for reassignment in try / catch (fold to assignment) #KT-13778 Fixed 2016-09-12 14:45:20 +03:00
Michael Bogdanov
69dc18b8b4 Proper concrete implementation filtering in java 8 interface case 2016-09-12 12:59:31 +03:00
Michael Bogdanov
4b0c272e19 'toString' implementation in DescriptorBasedFunctionHandle 2016-09-12 12:59:31 +03:00
Mikhail Glukhikh
babf61ec19 Minor: message fixed in diagnostics test 2016-09-12 12:57:48 +03:00
Mikhail Glukhikh
292384fb4c Merge pull request #948 from shiraji/quick_fix_for_final_upper_bound_2
KT-13674 Add quickfix to remove the final upper bound
2016-09-12 13:33:37 +04:00
Dmitry Jemerov
2a5f10855c Merge pull request #950 from shiraji/expand_brackets
KT-13693 Expand selection for array brackets
2016-09-12 12:17:50 +03:00
Dmitry Jemerov
cc29e28b2d Merge pull request #949 from calexHG/patch-1
Fix KtTypeReference.hasParentheses() to check for both LPAR and RPAR
2016-09-12 11:44:29 +03:00
Alexander Udalov
81556b1339 Fix AssertionError in notFoundClasses.kt on bad FQ names (EA-85046)
FQ names like "Foo." or "Foo..Bar" were causing this exception. No tests added:
no idea how to reproduce this exception
2016-09-12 10:39:21 +03:00
Alexander Udalov
90eafe0d71 Fix reflective access on overridden generic property reference
Generation of callable reference's signature in codegen should use the same
mechanism for obtaining the signature as the runtime in RuntimeTypeMapper,
namely DescriptorUtils.unwrapFakeOverride(...).original

 #KT-13700 Fixed
2016-09-12 10:39:21 +03:00
Denis Zharkov
6845d0958a Refine AALOAD handling in OptimizationBasicInterpreter
See comment in test data for clarifications

 #KT-13289 Fixed
2016-09-12 10:26:06 +03:00
Denis Zharkov
6269f890c8 Minor. Regenerate tests for type aliases in JS 2016-09-12 10:26:06 +03:00
Yan Zhulanow
261a300299 Do not dex kapt2 test classes (it consumes too much memory while RR)
(cherry picked from commit 54f7ac4)
2016-09-10 17:36:54 +03:00
Yan Zhulanow
015130832b Kapt: allow to use Kapt from compileBunchOfSources() 2016-09-10 17:36:53 +03:00
Yan Zhulanow
fbf44aa9be Kapt: Fix erasure() for immediate class types (KT-13748)
(cherry picked from commit 5fe01f6)
2016-09-10 17:36:51 +03:00
Yan Zhulanow
ef375e66cd Kapt: calculate default values of Kotlin annotations correctly for annotations from binaries (KT-13733)
(cherry picked from commit fed9cb2)
2016-09-10 17:36:50 +03:00
Yan Zhulanow
30a29eaa46 Minor: Fix Gradle tests, update Kotlin artifact version to 1.1 2016-09-10 17:36:15 +03:00
Yan Zhulanow
025f861e76 Minor: Fix path separators check on Windows
(cherry picked from commit 974bbe7)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
c6c1673902 Kapt: load all annotations, even if annotation processors does not require it explicitly. Some annotation processors may want to process some more annotations (see DbFlow, Database annotation).
Blacklist some common-used Java and Kotlin annotations instead (like Deprecated, Nullable or Metadata).
(cherry picked from commit 6856a7c)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
975364b2ed Kapt: Provide SourceRetentionAnnotationHandler for incremental compilation.
Collect annotations with the "SOURCE" retention.
(cherry picked from commit 6ef66e7)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
c3ae66bc9c Minor: fix compilation exception (due to exception in kotlinc)
(cherry picked from commit 5f2d3c4)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
471ddc5a93 Kapt: Write annotations with the "SOURCE" retention if kapt2 is enabled
(cherry picked from commit 6177b2b)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
00355f3c52 Kapt: Remove generated output directory each time before annotation processing
(cherry picked from commit c4b772a)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
32d77e5226 Kapt: support incremental compilation in Gradle (KT-13500)
Kapt will process sources on each step of incremental compilation.
(cherry picked from commit 4cb2127)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
743be477ec Kapt: Add tests with Filer.
JavaFileObject.getName() now returns a path as required.
(cherry picked from commit c611f9b)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
824b778a7b Kapt: support multiple annotation processing steps (KT-13651)
(cherry picked from commit 880e183)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
6ceaac63dc Kapt: provide a default constructor if PsiClass does not have any
(cherry picked from commit 550b1c0)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
7a00b028af Kapt: Do not substitute type arguments for PsiClassReferenceType
(cherry picked from commit 3954c71)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
cacec67044 Kapt: Do not use PsiType comparison in equals() where possible
(cherry picked from commit 89ba634)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
18068c699d Kapt: Represent a single element as an array if the annotation method type is array type
(cherry picked from commit 19ce4cb)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
9127788f4a Kapt: Fix erasure() for executable types (KT-13629)
(cherry picked from commit 461c29d)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
941d016cef Kapt: abort compilation on error in annotation processing stage (KT-13622)
(cherry picked from commit f78b8b4)
2016-09-10 17:36:15 +03:00
Yan Zhulanow
cc7eaeb910 Kapt: Allow passing primitive types and void to erasure() (KT-13617)
(cherry picked from commit 91444c5)
2016-09-10 17:36:15 +03:00
shiraji
d83b1747bb KT-13693 Expand selection for array brackets
#KT-13693 Fixed
2016-09-10 18:07:04 +09:00
Corey Hates Git
1d139d6b53 Fix KtTypeReference.hasParentheses() to check for both LPAR *and* RPAR, as was originally intended
Minor typo fix. A year old typo had this redundantly checking for LPAR twice, rather than checking once for LPAR and once for RPAR.
2016-09-10 02:39:44 -04:00
shiraji
7c3835bb77 KT-13674 Add quickfix to remove the final upper bound
#KT-13674 Fixed
2016-09-10 08:11:23 +09:00
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
Valentin Kipyatkov
8d16af41a9 Fixed test data 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
6d028fbcce Supported object value access expressions 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
e8471b4f32 Added TODO 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
77dfbda389 Added progress when searching invoke() by plain search 2016-09-07 19:04:48 +03:00
Valentin Kipyatkov
b1a6255ac2 Renamed class 2016-09-07 19:04:47 +03:00
Valentin Kipyatkov
29831f648d Added @TestOnly 2016-09-07 19:04:47 +03:00
Valentin Kipyatkov
82089da0cf Better test 2016-09-07 19:04:47 +03:00
Valentin Kipyatkov
5b638f51b0 Down-shift to plain search if reference in unknown language encountered 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
e314e22215 Minor refactoring 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
63ed93d1ac Minor optimization 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
a6a7075568 Fixed the case of public from private class inheritance in Java 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
904017eaff Covered case when variable of our type is multi-declaration entry 2016-09-07 19:04:46 +03:00
Valentin Kipyatkov
7b907e6518 Added comments 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
2322ecb032 Fixed test 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
4e0c3fcee7 Refactored reference searches to take read-actions when necessary 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
637da2e693 Converted to Kotlin and edited 2016-09-07 19:04:45 +03:00
Valentin Kipyatkov
843ff15943 Fixed assertion about read-action 2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
d7a94ac470 Fixed find usages for Java's invoke() 2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
478556890a KT-13605 Find Usages fails to find usages of component function defined in Java
#KT-13605 Fixed
2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
5e52e74963 Fixed test data 2016-09-07 19:04:44 +03:00
Valentin Kipyatkov
0158ff46f3 Fixed operator references search for functions declared in Java 2016-09-07 19:04:43 +03:00
Valentin Kipyatkov
f6fbd0b623 Fast search of contains operator 2016-09-07 19:04:43 +03:00
Valentin Kipyatkov
5ce780cafc Optimization 2016-09-07 19:04:43 +03:00
Valentin Kipyatkov
0f32574be0 Fast get/set operators search 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
eeea85c86a Fast search of assignment operations 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
cdf328475e Fast unary operators search 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
322df5b348 More correct operator treatment 2016-09-07 19:04:42 +03:00
Valentin Kipyatkov
43f8fbea2b More information in log 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
e1c1c5fb59 Minor change in log 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
8fd9b4a87b More information in log 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
1ca698cfc4 Implemented fast search for binary operators 2016-09-07 19:04:41 +03:00
Valentin Kipyatkov
f2c0d131e4 Refactored to avoid code duplication 2016-09-07 19:04:40 +03:00
Valentin Kipyatkov
e3b37f9219 Implemented fast search for invoke operator calls
#KT-13643 Fixed
2016-09-07 19:04:40 +03:00
Valentin Kipyatkov
e1c7d07189 Refactored component usages search extracted search for expressions of given type 2016-09-07 19:04:40 +03:00
Valentin Kipyatkov
47d624ac66 Better test 2016-09-07 18:10:13 +03:00
Valentin Kipyatkov
c068bd3158 Fixed correct detection of bold members in case of multiple receivers (broken by previous changes) 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
d93525d7f8 Minor 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
835c60f2a5 More correct completion list sorting by receivers 2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
a60d9d546d KT-12798 DSL-friendly completion
#KT-12798 Fixed
2016-09-07 18:10:12 +03:00
Valentin Kipyatkov
efac7a11b3 Do not include "operator" and "infix" into completion item text for override 2016-09-07 18:10:11 +03:00
Michael Bogdanov
8d2ffb2dab Fix wrong "InlineProperties are unsupported at this language level" error on inline functions when inline properties are disabled 2016-09-07 17:39:09 +03:00
Mikhail Zarechenskiy
3ad451e33e Partly support generics and nullable types as parameters for script templates 2016-09-07 17:24:19 +03:00
Michael Bogdanov
7230965e62 Support for property reference inlining 2016-09-07 12:01:49 +03:00
Michael Bogdanov
237afb4b7c Mark linenumber in property reference 2016-09-07 12:01:48 +03:00
Michael Bogdanov
b4ae70139a PropertyReferenceCodegen refactoring 2016-09-07 12:01:48 +03:00
Michael Bogdanov
a12d7b6019 Check lambda inlining in package part files in test framework 2016-09-07 12:01:47 +03:00
Dmitry Petrov
f2b8569b4b KT-13735 NoSuchMethodError for generic typealias acces
Use underlying constructor descriptor for type alias constructor code generation.
2016-09-07 09:46:00 +03:00
Nikolay Krasko
727ff15af3 j2k: fix converter
(cherry picked from commit a21e85b)
2016-09-06 15:28:00 +03:00
Nikolay Krasko
9970289efb j2k: right after convert
(cherry picked from commit c0db343)
2016-09-06 15:27:58 +03:00
Nikolay Krasko
9606282d01 j2k: rename file
(cherry picked from commit 8deaa34)
2016-09-06 15:27:57 +03:00
Nikolay Krasko
acc7c3286c Extract base class for goto action tests
(cherry picked from commit 0b25723)
2016-09-06 15:27:55 +03:00
Nikolay Krasko
115bc7e73b Tests for GotoTypeDeclaration action
(cherry picked from commit 3cd100b)
2016-09-06 15:27:54 +03:00
Alexey Tsvetkov
eb22c94b6d Fix maven build 2016-09-06 14:48:07 +03:00
Alexey Andreev
43abdaa894 KT-13658: don't capture FakeCallableDescriptorForObject in closure 2016-09-06 10:59:56 +03:00
Denis Zharkov
6a22d75dd7 Drop TypeAliasDeserializer
Currently it's only used for local type aliases, while code in
'deserializeTypeAlias' works properly only for nested or top-level type
aliases.

Also it seems that serialization of types based on local type aliases
doesn't work now anyway (see KT-13692)
2016-09-05 17:54:36 +03:00
Denis Zharkov
86c1dbe7b5 Fix decompilation of types based on local classifiers
If deserializing a type with arguments based on a local class for
decompiler, then just return Any type (without arguments).

Previously Any constructor was used with serialized arguments, that lead
to exception

Note that in case of deserialization for compiler nothing changes about
local-classes-based types (LocalClassifierResolverImpl is just inlined)

 #KT-13408 Fixed
2016-09-05 17:54:36 +03:00
Alexander Udalov
1be3b9c192 Exclude more irrelevant maven-generated stuff in CodeConformanceTest 2016-09-05 16:44:54 +03:00
Alexander Udalov
dc689ff514 Fix concurrent access issues in CallableReference implementations
Because of multiple reads from the same non-volatile variable, NPE was possible
to achieve in a multi-threaded application
2016-09-05 16:44:54 +03:00
Alexander Udalov
8fb5858dae Fix occasional NPE from reflection initialization
This could happen when a .jar containing Kotlin stdlib and reflection classes
was launched with 'java -jar'
2016-09-05 16:44:54 +03:00
Alexander Udalov
9da1840523 Minor, rename ConsPStack$1 -> ConsPStack$Itr
To somewhat improve stack traces (see
http://stackoverflow.com/questions/34214290/kotlin-massive-amounts-of-conspstack-how-can-i-avoid/34214718#34214718)
2016-09-05 16:44:54 +03:00
Alexander Udalov
f4a1aa640e Optimize KClass creation from Class instance
Don't create unnecessary iterator every time in HashPMap.get (see
https://github.com/hrldcpr/pcollections/pull/41). Also fix a warning and remove
misleading comment
2016-09-05 16:44:54 +03:00
Alexander Udalov
d0d1824e7d Optimize argument array creation in reflection call 2016-09-05 16:44:54 +03:00
Alexey Tsvetkov
c422de7c3c Update changelog for 1.0.4 2016-09-05 14:55:22 +03:00
Alexey Tsvetkov
2afd79c977 Fix compatibility with AS 2.2 gradle plugin
#KT-13594 fixed
2016-09-05 14:52:43 +03:00
Alexey Tsvetkov
6e4bbfef86 Fix snapshot version for testModuleKind 2016-09-05 14:52:35 +03:00
Alexey Tsvetkov
ed7d31eb6c Assume cache format is always up-to-date when compiling non-incrementally 2016-09-05 14:52:27 +03:00
Alexey Tsvetkov
0b017aa3ca Support multi-project IC for android projects 2016-09-05 14:52:23 +03:00
Alexey Tsvetkov
9f6509cd8e Fixes after review 2016-09-05 14:52:20 +03:00
Alexey Tsvetkov
4e8deb9566 Implement multiproject IC in Gradle
#KT-13528 fixed
2016-09-05 14:52:17 +03:00
Alexey Tsvetkov
f967edfaeb Join paths to string for better assertion message in idea 2016-09-05 14:52:14 +03:00
Alexey Tsvetkov
4ceec37bfe Refactor version checking 2016-09-05 14:52:11 +03:00
Alexey Tsvetkov
eea01f468b Introduce KotlinGradleBuildServices that is created once per build 2016-09-05 14:52:07 +03:00
Alexey Tsvetkov
7fa32a886d Minor: remove outdated TODO 2016-09-05 14:52:04 +03:00
Alexey Tsvetkov
3922ebcd4b Refactor loading kotlin version in gradle plugin 2016-09-05 14:51:56 +03:00
Alexey Tsvetkov
8a5df120a5 Ensure java is forced to compile when kotlin is compiled incrementally
Previously java compilation was not forced when there were only
removed kotlin files.
2016-09-05 14:51:49 +03:00
Alexander Udalov
cb209074d3 Minor, add regression test on incomplete code with callable reference
#KT-13685 Fixed

(cherry picked from commit c8b30d3310)
2016-09-05 13:13:57 +03:00
Nikolay Krasko
67f353903e Show lint diagnostics even if there're errors in the file (KT-12022)
It also affects working with KotlinChangeLocalityDetector. Right after error is fixed in local context file is still reported as having errors and diagnostics are not counted.

 #KT-12022 Fixed
2016-09-02 13:41:24 +03:00
Nikolay Krasko
795fef20d7 Don't highlight declaration with WRAPPED_INTO_REF
Leave highlighting only for usage. This may allow to make highlighting more local and lazy.
Java follows the same rules for "Implicit anonymous class parameter".
2016-09-02 13:41:24 +03:00
Nikolay Krasko
f797d53343 Precheck method is called main in RunConfiguration check 2016-09-02 13:41:24 +03:00
Nikolay Krasko
9a54aa99fa Drop kotlin-bare-plugin (KT-11859) 2016-09-02 13:41:24 +03:00
Nikolay Krasko
4a0f14b64b Minor: toString() for NONE filter 2016-09-02 13:41:24 +03:00
Nikolay Krasko
52dd02fe08 Make changes in super call lambda not cause out-of-block modification (KT-13474)
#KT-13474 Fixed
2016-09-02 13:41:24 +03:00
Nikolay Krasko
64d511566e Test that out-of-block behaviour conforms running the analyze of the nearest expression
Mark as exceptions cases with field initialize expression and body of class init for now
2016-09-02 13:41:24 +03:00
Nikolay Krasko
ec6780b49c Use AtomicLong for modification stamp 2016-09-02 13:41:24 +03:00
Nikolay Krasko
82bcd8192b Re-highlight only single function after local modifications 2016-09-02 13:41:24 +03:00
Nikolay Krasko
043502f836 Minor: remove warnings and refactoring 2016-09-02 13:41:24 +03:00
Dmitry Petrov
e0cdad30e4 KT-13181 Unresolved reference when referencing a type alias from a different module
Add corresponding resolution code.
2016-09-02 10:18:23 +03:00
Dmitry Petrov
6428a7655d KT-13422 Type alias for Java exception class can be used as an object in 'throw' expression
Report NO_COMPANION_OBJECT for type aliases.
2016-09-02 10:18:22 +03:00
Mikhail Glukhikh
c7f87e655c Build fix (ConvertLambdaToReferenceIntention) 2016-09-01 18:45:42 +03:00
Stanislav Erokhin
9fa6fb213b Potential fix for some random errors about "cannot choose between equals invoke functions". 2016-09-01 18:01:56 +03:00
Stanislav Erokhin
bebc75c8ef Set reference target and report custom error instead unresolved reference for cases: interface, generic parameter, object + invoke, class without companion.
#KT-2787 Fixed.
2016-09-01 18:01:55 +03:00
Stanislav Erokhin
eb6f444c19 Minor. rename context -> candidateFactory 2016-09-01 18:00:23 +03:00
Stanislav Erokhin
0072d6004a Refactoring: rename TowerContext to CandidatesFactory, InvokeTowerContext to CandidateFactoryProviderForInvoke. 2016-09-01 18:00:22 +03:00
Stanislav Erokhin
c910646eda Refactoring: remove name from ScopeTower. 2016-09-01 18:00:21 +03:00
Stanislav Erokhin
aa5be2ec7b Refactoring remove scopeTower from TowerContext. 2016-09-01 18:00:21 +03:00
Stanislav Erokhin
ddb75abe30 Rename ScopeTower to ImplicitScopeTower. 2016-09-01 18:00:20 +03:00
Stanislav Erokhin
0c60cda22a Refactoring: replace ReceiverValue to ReceiverValueWithSmartCastInfo, Receiver to DetailedReceiver 2016-09-01 18:00:20 +03:00
Stanislav Erokhin
d4a2cad35c Refactoring move DataFlowValue back to frontend module. 2016-09-01 18:00:19 +03:00
Stanislav Erokhin
58fd24943d Refactor DataFlowDecorator. 2016-09-01 18:00:18 +03:00
Stanislav Erokhin
8d2d5ea211 Minor refactoring in NewKotlinTypeChecker 2016-09-01 18:00:18 +03:00
Stanislav Erokhin
ea2d95fa79 Minor. Change predicate type from KotlinType to UnwrappedType. 2016-09-01 18:00:17 +03:00
Stanislav Erokhin
ca6c6ae0f3 Refactoring. Move creation of functionProcessor into resolution module. 2016-09-01 18:00:17 +03:00
Ilya Gorbunov
5dc31d2614 Mock-runtime isn't available when this configurations is run on teamcity. 2016-09-01 15:07:23 +03:00
Denis Zharkov
cebe67d90c Fix default value generation after suspension point
Replace coercion from VOID with call 'pushDefaultValueOnStack'

It's necessary because coercion of VOID to java/lang/Object ends with Unit instance on stack
that makes variables spilling algorithm thinking that variable is Unit

 #KT-13409 Fixed
2016-09-01 15:03:31 +03:00
Denis Zharkov
1226d8fc2c Refine 'handleResult' calls generation within coroutines
Before this change everything works just fine for 'handleResult' methods
accepting non-Unit parameters

For other cases the same coercion-to-unit strategy is in plain lambdas:
- if last statement is not Unit type, execute it, pop from the stack, then put Unit instance
- for 'return@label' (no expression) just put Unit on the stack

 #KT-13531 Fixed
2016-09-01 15:03:31 +03:00
Denis Zharkov
12dad29336 Minor. Cleanup block codegen
- Clarify variable names
- Use explicit condition 'statements.isEmpty()' instead of implicit one 'answer == null'
2016-09-01 15:03:31 +03:00
Mikhail Glukhikh
2ab553243c Convert lambda to reference: use fully qualified type names if needed #KT-13438 Fixed
(cherry picked from commit e2e761e)
2016-09-01 14:44:36 +03:00
Mikhail Glukhikh
a41c4b9a0f Convert lambda to reference: flexible receiver types are handled correctly #KT-13411 Fixed
(cherry picked from commit ecad1c3)
2016-09-01 14:44:22 +03:00
Mikhail Glukhikh
863e4afc7b Convert lambda to reference: no more allowed for extension KFunction parameters #KT-13527 Fixed
(cherry picked from commit 84c4ff7)
2016-09-01 14:44:11 +03:00
Mikhail Glukhikh
ec41289664 Convert lambda to reference: range reduced to a call itself #KT-13661 Fixed
(cherry picked from commit f7b5d34)
2016-09-01 14:44:00 +03:00
Alexey Sedunov
a6e3aac7ca Convert to Kotlin: AbstractExpressionSelectionTest 2016-09-01 13:43:54 +03:00
Alexey Sedunov
96a2c97aa2 Convert to Kotlin: AbstractExpressionSelectionTest (rename to .kt) 2016-09-01 13:43:53 +03:00
Alexey Sedunov
b0a1eca1ce Convert to Kotlin: AbstractSmartSelectionTest 2016-09-01 13:43:52 +03:00
Alexey Sedunov
1ab40f6d88 Convert to Kotlin: AbstractSmartSelectionTest (rename to .kt) 2016-09-01 13:43:51 +03:00
Alexey Sedunov
f6d0fca57b Refactoring: Split KotlinRefactoringUtil2.kt to several files 2016-09-01 13:43:50 +03:00
Alexey Sedunov
b6a671c45f Convert to Kotlin: KotlinRefactoringUtil2 (replace object with top-level declarations) 2016-09-01 13:43:49 +03:00
Alexey Sedunov
16b4c2c70d Convert to Kotlin: KotlinRefactoringUtil2 (prettify) 2016-09-01 13:43:48 +03:00
Alexey Sedunov
fc9b28884d Convert to Kotlin: KotlinRefactoringUtil2 2016-09-01 13:43:48 +03:00
Alexey Sedunov
1f8dba9c89 Convert to Kotlin: KotlinRefactoringUtil2 (rename to .kt) 2016-09-01 13:43:47 +03:00
Alexey Sedunov
f47b416f2a Minor: Temporary rename of KotlinRefactoringUtil before conversion to Kotlin (to avoid conflict with existing kotlinRefactoringUtil.kt) 2016-09-01 13:43:46 +03:00
Alexey Sedunov
da273419b9 fixup! Introduce Type Parameter 2016-09-01 13:43:45 +03:00
Alexey Sedunov
2f9a911624 Introduce Type Parameter
#KT-13155 Fixed
2016-09-01 13:43:44 +03:00
Mikhail Glukhikh
cd717467f0 Nested classes are no more allowed inside any anonymous objects or local classes #KT-13510 Fixed
(cherry picked from commit 5c3ec6c)
2016-08-31 19:28:13 +03:00
Mikhail Glukhikh
f8039249c6 CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:28:09 +03:00
Mikhail Glukhikh
43954699a7 KT-13612 KotlinPositionManager: fixed initialization in try / catch
(cherry picked from commit ecae5c6)
2016-08-31 19:28:05 +03:00
Mikhail Glukhikh
6a9d058db4 UNUSED_VALUE is now reported on expression only if this expression is unused in all (e.g. finally) branches #KT-9825 Fixed
(cherry picked from commit aac8e94)
2016-08-31 19:28:00 +03:00
Valentin Kipyatkov
e363809b37 Minor changes 2016-08-31 19:12:29 +03:00
Valentin Kipyatkov
05fae1d4db Optimization: don't search named arguments 2016-08-31 19:12:29 +03:00
Valentin Kipyatkov
29f61087ed More correct down-shifting to plain search 2016-08-31 19:12:29 +03:00
Valentin Kipyatkov
6562412bda Ignore usages in XML 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
06eea53246 Fixed bug with class using data class as type parameter in supers list 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
b332867b25 Use one KtDestructuringDeclarationReference per each entry - better highlight usages and other actions 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
9cd7e9d519 Down-shifting to plain search when operator usage search required 2016-08-31 19:12:28 +03:00
Valentin Kipyatkov
5682c917f9 Fixed infinite recursion 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
9022c71949 Better testing 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
d2ee10daa5 Fixed typo 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
8bfc746f4b Supported usage in super type list without parenthesis 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
5c1e42aa51 Class literal access supported 2016-08-31 19:12:27 +03:00
Valentin Kipyatkov
4cab04b24b Callable references handled 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
6af9567527 Extracted method 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
450d0dd5d1 Supported access to companion object members 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
63d4491eb8 More actions logged in tests 2016-08-31 19:12:26 +03:00
Valentin Kipyatkov
482225f622 Removed unused 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
724886c967 Better log 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
f447321e58 Split test for 'for' 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
c864fce035 Split one more test 2016-08-31 19:12:25 +03:00
Valentin Kipyatkov
1221b6bb67 Split test for whens 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
dc1f2d5b5f And one more split test 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
be94fe76f9 One more split test 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
0d9656d638 Split test 2016-08-31 19:12:24 +03:00
Valentin Kipyatkov
2ca163a375 Better testing via logging of performed operations 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
1e80ad3f98 Optimization 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
7a269a00af SAM-adapters supported 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
d0d8ea7c69 Added TODO 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
1183816b52 Disabled smart search for classes from library 2016-08-31 19:12:23 +03:00
Valentin Kipyatkov
6f21c07b66 Added TODO 2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
e00c8d6e05 "!is" in when case 2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
5b3102058c Handling of 2 more class of cases:
1. Function has parameter of functional type with our data class inside
2. Value of data class type used in a call with lambda
2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
ca2cd3d656 this@ClassName supported 2016-08-31 19:12:22 +03:00
Valentin Kipyatkov
7687c1646b Supported "is" in when entry condition 2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
ecb1910bf2 Different modes of search
Down-shift to plain search in non-test mode if unknown reference encountered
Internal action to check search algorithm
2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
d13cdc67f0 Supported usages as doc-comments 2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
696f382291 Supported usages as destructuring declaration for other class 2016-08-31 19:12:21 +03:00
Valentin Kipyatkov
80520b44c0 Plain search inside members and extensions 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
3910f31de9 Correct processing of "is" check 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
25ab66053b Added runReadAction (but it's incorrect anyway) 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
5d427d8d2e Support for 'as' and temporary support for 'is' 2016-08-31 19:12:20 +03:00
Valentin Kipyatkov
1674beb64b Initial implementation of faster component function usage search 2016-08-31 19:12:19 +03:00
Dmitry Jemerov
77bb9b8092 Update the pull request help link (#943) 2016-08-31 12:25:37 +02:00
Zalim Bashorov
e456fc540b Increase minimal version of ant (#941) 2016-08-31 13:15:25 +03:00
Alexey Sedunov
4e2c4d941d Rename: Support inplace rename on type parameters 2016-08-31 11:28:04 +03:00
Alexey Sedunov
34c268b08b Quick-Fixes: Do not show Change Signature dialog when applying "Remove parameter" quick-fix 2016-08-31 11:28:03 +03:00
Alexey Sedunov
c244baf087 Misc: Improve IDE rendering of type aliases 2016-08-31 11:28:02 +03:00
Alexey Sedunov
3405051bcc Misc: Use default presentation for KtTypeAlias
#KT-13611 Fixed
2016-08-31 11:28:02 +03:00
Morton Fox
61afc7e713 Update the pull request help link 2016-08-31 00:28:28 -04:00
Zalim Bashorov
8393c17df3 Increase minimal version of ant 2016-08-30 21:53:40 +03:00
Alexey Andreev
60a09ecb45 KT-12873: add temporary variables generated by delegation expression to class initializer. Fix #KT-12873 2016-08-30 12:26:06 +03:00
Yan Zhulanow
1a94e2202b Minor: Fix compilation error 2016-08-29 18:30:27 +03:00
Sergey Mashkov
8ae5ecf4ff KT-12810 IDL: support special modifiers(e.g. getter and setter) 2016-08-29 17:56:17 +03:00
Yoshinori Isogai
e1eba8f5c8 KT-5193 Make multiline strings foldable (#938)
* KT-5193 Make multiline strings foldable
 #KT-5193 Fixed

* Avoid multiple replace call
2016-08-29 16:52:29 +02:00
Yan Zhulanow
1a1eb7dcfa KT-12303 Pass only relevant annotations to annotation processors
(cherry picked from commit 01742aa)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
7810678389 Kapt: Fix type arguments in JeDeclaredType. In case of type variable, JeTypeVariableType should be returned
(cherry picked from commit ed34ec0)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
ebcc762ae9 Kapt: JeTypeElement getInterfaces() and getSuperClass() should provide reference type mirrors
(cherry picked from commit 5f50ab6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
cd44540965 Kapt: Support String[] in annotation proxy
(cherry picked from commit 5e9eab9)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
0042a59fb6 Kapt: Use also the compile classpath, not only apt classpath
(cherry picked from commit d810119)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
1b05c5fb0c Kapt, Gradle: The first dependency is kotlin-annotation-processing (we reuse the old configurations from kapt)
(cherry picked from commit f95a3d1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
a8b577cd09 Kapt: Support nested annotations property.
Also do not rely on Java class comparison, check against qualified names.
(cherry picked from commit 7610945)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
49bd303988 Kapt: Fix broken assertion
(cherry picked from commit 36b0b52)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
46367d720c Kapt: Gradle integration tests for the new kapt
(cherry picked from commit 467d0fd)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
9960e7f7cd Kapt: Get rid of the 'compiler-tests' dependency in 'plugins-tests'
(cherry picked from commit bb370f1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
a9de8ec89b Kapt: compile annotation-processing artifact with target "1.6"
(cherry picked from commit 1391e59)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
b13db88e6f Kapt: Make javaCompile parameter in KotlinGradleSubplugin non-null
(cherry picked from commit 9686344)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
46f9e02c06 Kapt: Fix type arguments order for JeDeclaredType, should not use substitutor
(cherry picked from commit a9c77e1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
d07e6c752b Kapt: Support default packages in Filer
(cherry picked from commit 3ced8a6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
8c4fb0a709 Kapt: Support inherited annotations
(cherry picked from commit 02a3e6b)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
9d340e1b83 Kapt: Filter out kapt2 sources in KotlinCompile task
(cherry picked from commit b248b20)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
04db25a190 Kapt Gradle plugin: use the old configuration names
(cherry picked from commit 6e72dc8)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
407af3a0e5 Kapt: Gradle plugin for the new kapt
(cherry picked from commit f4fc8f1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
399059729d Kapt: verbose output mode
(cherry picked from commit e6067d5)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
f5d58d9944 Kapt: Provide toString() implementations for no-types
(cherry picked from commit df9c825)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
badf8dbc53 Kapt: Fixes in KotlinElements:
1. 'overrides()' when 'type' extends containing(overrider) and implements containing(overridden). According to documentation, In this case the function should return true.
2. Handle both kotlin.Deprecated and java.lang.Deprecated for Kotlin in 'isDeprecated'.
3. Fix 'isFunctionalInterface'.
(cherry picked from commit a14d7ce)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
462c7d91d2 Kapt: Calculate constant values in the similar way.
Always use originalElement in JeAnnotationValue factory.
(cherry picked from commit 0ff9584)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
4710fab49f Kapt: Use the base types in KotlinProcessingEnvironment
(cherry picked from commit ed8e2e4)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
927280f7ce Kapt: add some JeElement tests
(cherry picked from commit 948a4b6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
0fc92c784b Kapt: add JeElementRenderer
(cherry picked from commit 3eecf78)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
cd09f2bcb8 Kapt: Minor, refactor JeAnnotationMirror:getElementValues()
(cherry picked from commit 649b938)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
23b343bb03 Kapt: annotation-processing is not dependent on 'cli' module anymore
(cherry picked from commit 4591f13)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
f61367df28 Kapt: Fixes on review
(cherry picked from commit be31262)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
5b8e6abdeb Kapt: Support Java source root processing.
Support resource file writing.
(cherry picked from commit 7a06a91)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
9d2144f221 Kapt: Support "*" in supported annotation qualified names (all annotations)
(cherry picked from commit 27ec053)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
a73cf65840 Kapt: Check DEFAULT modifier only in Java 8
(cherry picked from commit 71c8dfb)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
53921c3f74 Kapt: Drop custom annotation stub factory, implement it with AnnotationParser in sun.reflect as done in Javac
(cherry picked from commit 82dcbf3)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
6eb3d7e002 Kapt: Refactor kapt type wrappers. Now every ordinary (not NoType) type has a backed PsiType so it's easy to call utility functions from IntelliJ.
(cherry picked from commit 0a684aa)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
84d62f37eb Kapt: Analyze sources again if the received analysis result is 'RetryWithAdditionalJavaRoots'. ->
Add additional Java roots to Java source roots and clear diagnostic messages before the next analysis round.
(cherry picked from commit 17ad807)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
884e653490 Kapt: Add ability to get constant value from KtLightAnnotation
(cherry picked from commit 7180961)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
0181dd000d Kapt: Implement Annotation Processing plugin in Kotlin (KT-13499)
(cherry picked from commit 32c461a)
2016-08-29 16:31:16 +03:00
Yan Zhulanow
cc12a6c228 Kapt: Add APT wrappers for PSI elements
(cherry picked from commit 1214513)
2016-08-29 16:31:16 +03:00
Alexey Sedunov
89c39b9762 Misc: Use TODO() consistently in implementation stubs
#KT-13589 Fixed
2016-08-29 16:20:55 +03:00
Alexey Sedunov
639186ddae Convert Receiver to Parameter: Use template instead of the dialog
#KT-9490 Fixed
2016-08-29 16:20:52 +03:00
Alexey Sedunov
63092f6985 Create from Usage: Implement "Create type parameter" quickfix
#KT-11525 Fixed
2016-08-29 16:20:32 +03:00
Alexey Sedunov
6a2edabbd4 Create from Usage: Implement "Create type alias" quickfix
#KT-12904 Fixed
2016-08-29 14:13:56 +03:00
Valentin Kipyatkov
17edbac72b Fixed test data 2016-08-29 13:38:18 +03:00
Simon Ogorodnik
67c916a7d1 MultiFile tests now support java + kotlin testing. // FILE directive now accepts path in source root instead of just name 2016-08-29 13:38:18 +03:00
Valentin Kipyatkov
5f24b68368 Minor changes on code review 2016-08-29 13:38:17 +03:00
Valentin Kipyatkov
9cddd0d1a4 Renamed classes 2016-08-29 13:38:17 +03:00
Valentin Kipyatkov
cbae3d77df Don't use term "Static import" + refer quickfix by class name in negative tests 2016-08-29 13:38:17 +03:00
Valentin Kipyatkov
0072bf079d Changes on review of pull request 2016-08-29 13:38:17 +03:00
Simon Ogorodnik
939b4768f5 Added tests, and fixed some bugs using it 2016-08-29 13:38:16 +03:00
Simon Ogorodnik
251d87fd22 Added ability to test quickfix with java dependencies 2016-08-29 13:38:16 +03:00
Simon Ogorodnik
f40bb57d79 Refactored to use exiting impl of AutoImportBase 2016-08-29 13:38:16 +03:00
Simon Ogorodnik
9d56716897 #KT-9009 fixed 2016-08-29 13:38:16 +03:00
Kevin Greene
ce1844a6c9 Updates link to JavaScript issues on YouTrack (#939) 2016-08-27 21:18:20 +03:00
Alexander Udalov
26156b137f Micro optimizations to type rendering in DescriptorRendererImpl
Do not create StringBuilder instances when the resulting String will be
appended to some other StringBuilder anyway. This, and a couple of micro
FqNameUnsafe-related optimizations, helps reduce memory traffic in Kotlin
reflection when rendering is involved (toString() is called on reflective
objects)
2016-08-26 15:17:02 +03:00
Alexander Udalov
3298649bd7 Support "-no-reflect" in "kotlin" command
#KT-13491 Fixed
2016-08-26 15:17:00 +03:00
Mikhail Glukhikh
902232c8ad CFG refactoring: extractVariableDescriptorFrom
(cherry picked from commit 95add79)
2016-08-26 14:15:08 +03:00
Ilya Gorbunov
25d8af3112 JS: Implement Long.hashCode function.
#KT-13756 Fixed
2016-08-26 05:28:48 +03:00
Ilya Gorbunov
813bee62e5 JS: Remove intrinsic for Long.equals, because it's applied incorrectly for nullable longs.
#KT-7500 Fixed
2016-08-26 05:28:20 +03:00
Ilya Gorbunov
9c4221cda8 Return EMPTY range [0, -1] when MIN_VALUE is specified as exclusive upper bound.
#KT-12762 Fixed
2016-08-26 05:19:51 +03:00
Ilya Gorbunov
ca8b284805 Use 1.8 JVM target bytecode version for kotlin-stdlib-jre8 module to prevent loading on previous JRE versions. 2016-08-26 05:19:06 +03:00
Alexey Tsvetkov
522520b722 Update link to jarjar 2016-08-26 05:07:53 +03:00
Nikolay Krasko
d9b116c6d6 Remove net/sf/cglib/ classes from Kotlin compiler (KT-13565)
(cherry picked from commit eb160a2)

 #KT-13565 Fixed
2016-08-25 15:35:10 +03:00
Nikolay Krasko
8b84b7158a Debugger doesn't step into 'for' body if there's inline function call in range expression (KT-13534)
#KT-13534 Fixed
2016-08-25 15:35:08 +03:00
Nikolay Krasko
ef602be98e More emulate debugging after dexing - dex removes several lines mapped to one instruction
(cherry picked from commit 1b7d4ef)
2016-08-25 15:35:07 +03:00
Dmitry Jemerov
9264c876f8 show primary constructor properties in project view when "Show members" is enabled
#KT-11776 Fixed
2016-08-25 14:19:59 +02:00
Dmitry Jemerov
1cf79d9495 KtClassOrObjectTreeNode: cleanup after J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
fceb626cf8 KotlinProjectViewUtil, KtClassOrObjectTreeNode: J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
a7d5b7c4f8 KtClassOrObjectTreeNode: rename to .kt 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
49c957364c KotlinProjectViewUtil: rename to .kt 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
3ec583bb16 show icon of class initializer
#KT-11775 Fixed
2016-08-25 14:19:59 +02:00
Dmitry Jemerov
8ff0814221 show local functions in structure view
#KT-13473 Fixed
2016-08-25 14:19:59 +02:00
Dmitry Jemerov
509142089c KotlinStructureViewElement: cleanup after J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
50b1951746 KotlinStructureViewElement: J2K 2016-08-25 14:19:59 +02:00
Dmitry Jemerov
2ebacb6969 KotlinStructureViewElement: rename to .kt 2016-08-25 14:19:59 +02:00
Mikhail Glukhikh
8e5b833cca Has platform type inspection: do not suggest !! for not-null types #KT-12820 Fixed
(cherry picked from commit 8830ff7)
2016-08-25 10:32:50 +03:00
Mikhail Glukhikh
0ee1102e24 KT-13536 related: correct handling of objects
(cherry picked from commit 7ae9b6b)
2016-08-25 10:32:40 +03:00
Mikhail Glukhikh
6ac4bf3f17 No more SOE in UnusedSymbolInspection #KT-13536 Fixed
(cherry picked from commit 23961ee)
2016-08-25 10:32:31 +03:00
Mikhail Glukhikh
605ac0b25e Invert if: more correct handling of empty returns #KT-13444 Fixed
(cherry picked from commit be2adaf)
2016-08-25 10:32:21 +03:00
Mikhail Glukhikh
25eefdb6ec Pseudocode label now cannot be bound to a non-owning pseudocode #KT-13555 Fixed
Also EA-77641 Fixed
(cherry picked from commit 07643ce)
2016-08-25 10:32:04 +03:00
Mikhail Glukhikh
08f8a2b75c PseudocodeLabel is extracted from PseudocodeImpl (now not an inner class), some its properties / functions are supported now by base Label
(cherry picked from commit 30dd52e)
2016-08-25 10:31:53 +03:00
Mikhail Glukhikh
41ff51ca8c Label.java converted to Kotlin
(cherry picked from commit 3891d76)
2016-08-25 10:30:49 +03:00
Mikhail Glukhikh
ea041661fb CFG: break and continue are now handled in the same (safe) way EA-85060 Fixed
(cherry picked from commit eec4b1b)
2016-08-25 10:30:41 +03:00
Mikhail Glukhikh
d33745b646 BreakableBlockInfo : converted to Kotlin
(cherry picked from commit 22c7ee5)
2016-08-25 10:30:32 +03:00
Mikhail Glukhikh
d4c40d9db0 BreakableBlockInfo.java -> BreakableBlockInfo.kt
(cherry picked from commit d5f7c3f)
2016-08-25 10:30:24 +03:00
Mikhail Glukhikh
52571f0fa9 LoopInfo: converted to Kotlin
(cherry picked from commit f64d60e)
2016-08-25 10:30:15 +03:00
Mikhail Glukhikh
751f96b648 LoopInfo.java --> LoopInfo.kt
(cherry picked from commit d952dbd)
2016-08-25 10:30:07 +03:00
Mikhail Glukhikh
c9f9ae7d2a EA-85060: BreakableBlockInfo is split into LoopInfo & SubroutineInfo to make code more clear
(cherry picked from commit 48faf4a)
2016-08-25 10:29:58 +03:00
Alexey Sedunov
64f0532934 Move: Forbid moving of enum entries
#KT-13215 Fixed
2016-08-24 11:27:22 +03:00
Alexey Sedunov
c50f38aa52 Intentions: Implement intention to replace camel-case test function name with a space-separated one
#KT-12489 Fixed
(cherry picked from commit 21e24a1)
2016-08-24 11:27:21 +03:00
Alexey Sedunov
d9698dfa4d Search: Optimize usage scope of class members
#KT-9285 Fixed
2016-08-24 11:27:20 +03:00
Alexey Sedunov
e908c6c1b2 Search: Restrict KtParameter usage scope to its containing declaration
#KT-13542 Fixed
 #KT-8672 Fixed
2016-08-24 11:27:19 +03:00
Alexey Sedunov
6480118da6 Move: Report separate conflicts for each property accessor
#KT-13216 Fixed
2016-08-24 11:27:18 +03:00
Alexey Sedunov
9607fd0620 Pull Up: Remove visibility modifiers on adding 'override'
#KT-13535 Fixed
2016-08-24 11:27:17 +03:00
Alexey Sedunov
47d4454590 Type Hierarchy: Support Type Hierarchy on references inside of super type call entries
#KT-9125 Fixed
2016-08-24 11:27:16 +03:00
Alexey Sedunov
cd1943c8b0 Convert to Kotlin: HierarchyUtils (prettify) 2016-08-24 11:27:16 +03:00
Alexey Sedunov
4622f08b5e Convert to Kotlin: HierarchyUtils 2016-08-24 11:27:15 +03:00
Alexey Sedunov
91cc22e599 Convert to Kotlin: HierarchyUtils (rename to .kt) 2016-08-24 11:27:14 +03:00
Alexey Sedunov
05abc0127b Convert to Kotlin: KotlinTypeHierarchyProvider (prettify) 2016-08-24 11:27:13 +03:00
Alexey Sedunov
23d9f923ac Convert to Kotlin: KotlinTypeHierarchyProvider 2016-08-24 11:27:12 +03:00
Alexey Sedunov
438777a0de Convert to Kotlin: KotlinTypeHierarchyProvider (rename to .kt) 2016-08-24 11:27:12 +03:00
Stanislav Erokhin
0cf7490500 Moved OverloadingConflictResolver into resolution module. 2016-08-24 11:11:45 +03:00
Stanislav Erokhin
f31493f80f Introduce SimpleConstraintSystem for OverloadChecker and OverloadingConflictResolver 2016-08-24 11:11:44 +03:00
Stanislav Erokhin
5ad0e4e9b8 Refactoring. Support in OverloadingConflictResolver any kind of ResolvedCalls. 2016-08-24 11:11:37 +03:00
Stanislav Erokhin
b695f5edd9 Refactoring. Some simplifications in OverloadingConflictResolver. 2016-08-24 11:10:34 +03:00
Valentin Kipyatkov
512fb3f191 Renamed method 2016-08-23 22:47:43 +03:00
Valentin Kipyatkov
f21f23744e Hopefully fixed EA-87200 - TCE: UtilsKt.tryChangeAndCheckErrors
#EA-87200 Fixed
2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
2d875e516e Groupped tests by folders 2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
d0f6e25783 sum and sumBy supported 2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
7c92f7974f Corrected comment 2016-08-23 22:47:42 +03:00
Valentin Kipyatkov
61d1826980 Better test 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
91954e131a Math.max/min pattern for min/max supported 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
84fd24a1a0 Another pattern for min/max supported 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
930f7960ea max()/minI() supported 2016-08-23 22:47:41 +03:00
Valentin Kipyatkov
26cdd0d5d5 KT-13482 "Loop can be replaced with stdlib operations" changes semantics
#KT-13482 Fixed
2016-08-23 22:47:40 +03:00
Valentin Kipyatkov
38edb58e60 Preserve formatting of parenthesis in calls too 2016-08-23 22:46:44 +03:00
Valentin Kipyatkov
87294207f9 Introduced Identifier.withNoPrototype() 2016-08-23 22:46:43 +03:00
Valentin Kipyatkov
0554e1702c KT-11804 J2K: incorrect closing parenthesis position for method split to several lines
#KT-11804 Fixed
2016-08-23 22:46:43 +03:00
Valentin Kipyatkov
20c17fc435 Use of Block.of() 2016-08-23 22:46:43 +03:00
Alexey Andreev
7016ce9b41 JS: refactor how cached access translators work. Fix cached access translator in case of arrays. Use cached access translator to translate reassignments 2016-08-23 18:06:51 +03:00
Alexey Andreev
cb2c8edaf9 JS: don't translate RHS of overloaded assignment operators twice. It can break compilation in some cases, for example, when there are lambdas in RHS.
Fix #KT-12808 #KT-12807
2016-08-23 18:06:51 +03:00
Alexey Andreev
996c1b6f87 JS: add support of JS module kind to Gradle task. Add tests of support of module kind to Maven tests 2016-08-23 17:12:37 +03:00
Mikhail Glukhikh
d08d8af407 USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists
(cherry picked from commit c71b656)
2016-08-23 16:26:54 +03:00
Alexey Andreev
df86840515 KT-13025: when receiver of call of 'invoke' method is a Function, check whether receiver is an extension function and generate additional '.call' invocation. Fix #KT-13025 2016-08-23 15:45:48 +03:00
Alexey Andreev
c767b3d0ac KT-13043: fix translation of super call from secondary constructor when base constructor has default arguments 2016-08-23 15:44:27 +03:00
Mikhail Glukhikh
b00b0caa9b Merge pull request #937 from shiraji/useless_elvis_with_null
KT-13521 Warning right part of "expression ?: null" is useless
2016-08-22 19:38:09 +03:00
shiraji
a3f131d6c6 KT-13521 Warning right part of "expression ?: null" is useless
#KT-13521 Fixed
2016-08-23 01:10:10 +09:00
Alexey Tsvetkov
ebf3c9404a Fix incremental build with kapt and gradle 2.14
#KT-13179 fixed
2016-08-22 19:05:06 +03:00
Valentin Kipyatkov
c9d335394d KT-13529 Java function is not always converted to Kotlin after paste
#KT-13529 Fixed
2016-08-22 17:52:48 +03:00
Dmitry Jemerov
ebd45a8c5c use less brute-force method for updating converted file content in J2K (may fix KT-13493 and friends) 2016-08-22 16:20:10 +02:00
Mikhail Glukhikh
c07906fac4 Replace with safe calls forbidden for comparisons #KT-13432 Fixed 2016-08-22 15:11:33 +03:00
Kirill Rakhman
1fbd6678a5 Add quickfix for "A type annotation is required on a value parameter" #KT-12804 Fixed 2016-08-22 15:11:28 +03:00
Kirill Rakhman
2dd4194a79 Clean up quick fix package 2016-08-22 15:11:23 +03:00
shiraji
1bbde54e9d Inspection to warn on using == with array types #KT-13384 Fixed 2016-08-22 15:11:19 +03:00
Yoshinori Isogai
7d35316d95 KT-4519 Show first line with content of block comment when collapsed (#928) 2016-08-22 13:08:44 +02:00
Yoshinori Isogai
4669fb3ca7 KT-12697 Expand selection action select ": Type" (#898) 2016-08-22 12:35:23 +02:00
Mikhail Glukhikh
b3b83e344b Added fake override search in unused symbol inspection #KT-13288 Fixed 2016-08-22 13:18:40 +03:00
Mikhail Glukhikh
8de68e3e87 Merge pull request #931 from cypressious/empty_parens
Add intention+inspection to remove empty parentheses from method call with single lambda parameter
2016-08-22 11:34:24 +03:00
Mikhail Glukhikh
3aee2f004e Merge pull request #932 from cypressious/kt13480
Fix "Can be replaced with comparison" false positive if extension method called 'equals' is used
2016-08-22 11:32:53 +03:00
Kirill Rakhman
1bc2af6436 Add intention+inspection to remove empty parentheses from method call with single lambda parameter
Fixes #KT-13519
2016-08-20 16:03:42 +02:00
Kirill Rakhman
e6e46809de fix "Can be replaced with comparison" false positive if extension method called 'equals' is used
Fixes #KT-13480
2016-08-20 14:11:57 +02:00
Kirill Rakhman
45b5157ecf Clean up intentions package 2016-08-20 13:53:32 +02:00
Pavel V. Talanov
a683c2b68d IntentionBasedInspection: Removing synchronizing on intention instances
Recreate intention instance in `buildVisitor`
Lock caused contention for UpSource
2016-08-19 18:54:15 +03:00
Dmitry Jemerov
742d7db953 diagnostics that helped catch KT-13381 2016-08-19 16:29:21 +02:00
Alexey Sedunov
9fd61b869e Find Usages: Do not duplicate containing declaration in super member warning dialog
#KT-10209 Fixed
2016-08-18 19:15:40 +03:00
Alexey Sedunov
c2b38cfa41 Create from Usage: Place extension properties after the usage and generate stub getter
#KT-11795 Fixed
2016-08-18 19:15:38 +03:00
Alexey Sedunov
99ba340236 Create from Usage: Make extension functions/properties 'private' by default
#KT-11799 Fixed
2016-08-18 19:15:37 +03:00
Alexey Sedunov
92b0c852dd Remove Unused Receiver: update function/property usages
#KT-8903 Fixed
2016-08-18 19:15:36 +03:00
Alexey Sedunov
0fc28fe0b2 Rename: Support rename of packages with non-standard quoted names
#KT-13488 Fixed
2016-08-18 19:15:35 +03:00
Alexey Sedunov
f6de6eac09 Rename: Do not search for component convention usages
#KT-9381 Fixed
2016-08-18 19:15:34 +03:00
Alexey Sedunov
f507eed42d Rename: Fix parameter rename when new name matches call selector
#KT-13476 Fixed
2016-08-18 19:15:33 +03:00
Alexey Sedunov
5e577c391c Rename: Quote parameter name when necessary
#KT-13463 Fixed
2016-08-18 19:15:32 +03:00
Alexey Sedunov
238f99aa3d Override/Implement: Make return type non-nullable (platform collection case) when overriding Java method
#KT-13455 Fixed
2016-08-18 19:15:31 +03:00
Dmitry Jemerov
ac6f0b5419 diagnostics for EA-86187 - KNPE: KDocElementFactory.createNameFromText 2016-08-18 17:27:43 +02:00
Dmitry Jemerov
8a22e1ed7c don't try to walk over the siblings of PsiFile to check if "introduce variable" is enabled (EA-86136 - assert: SharedPsiElementImplUtil.getChildIndex) 2016-08-18 17:27:43 +02:00
Dmitry Jemerov
7ee72f2ebc stop at file level when going up the tree in KtPsiUtil.areParenthesesNecessary() (EA-86495 - NPE: KtPsiUtil.areParenthesesNecessary) 2016-08-18 17:27:43 +02:00
Dmitry Jemerov
ef791fedde check for project disposed in NewKotlinActivityAction (EA-82450 - assert: ComponentManagerImpl.getPicoContainer) 2016-08-18 17:27:43 +02:00
Nikolay Krasko
7e1d8fb8f5 Reformat main function templates
(cherry picked from commit d6d3846)
2016-08-18 17:25:38 +03:00
Nikolay Krasko
4d6206a7b5 Introduce 'maino' and 'psvmo' templates for generating main in object (KT-6520)
#KT-6520 Fixed
(cherry picked from commit cf1bdba)
2016-08-18 17:25:32 +03:00
Pavel V. Talanov
48d7e8c519 Implement navigation to type aliases in libraries 2016-08-18 16:34:37 +03:00
Mikhail Glukhikh
ac3dfd93bd More correct handling of compile time constant types #KT-13421 Fixed 2016-08-18 14:42:16 +03:00
Kirill Rakhman
354d047533 Add Intention to replace a..b-1 with a until b and vice versa #KT-13483 Fixed 2016-08-18 13:27:07 +03:00
Mikhail Glukhikh
d9358d44e7 KT-13426 related : added assertion to prevent smart cast type rewriting for (expression, call) or (expression, implicit receiver) pair 2016-08-18 09:50:27 +03:00
Zalim Bashorov
11107fd3fe Use target of current module when find libraries with incompatible binary format
#KT-12977 Fixed
(cherry picked from commit d975f21)
2016-08-17 20:42:14 +03:00
Kirill
1926825019 Make folding if to return/assignment work with if-else if-else #KT-13452 Fixed 2016-08-17 17:51:08 +03:00
Kirill
6bb4c28c2e Minor: make var val 2016-08-17 17:50:57 +03:00
Mikhail Glukhikh
1987187968 Build fix: IMPLICIT_RECEIVER_SMARTCAST and SMARTCAST slices in matchAndConvert.kt 2016-08-17 17:50:52 +03:00
Mikhail Glukhikh
ae856e834a Store map (Call to KotlinType) for SMARTCAST slice #KT-13426 Fixed
Also EA-86848 Fixed
2016-08-17 16:09:45 +03:00
Mikhail Glukhikh
dbff2be6fa Hack due to KT-678 was removed 2016-08-17 16:09:40 +03:00
Mikhail Glukhikh
cbcef67d82 KT-13426: store map from ImplicitReceiver into KotlinType for implicit receiver smart casts 2016-08-17 16:09:34 +03:00
Zalim Bashorov
33e96fcb9a JS: fix runtime type checking for native non-fake interfaces on WebKit (JavaScriptCore); add tests for object and object expressions. 2016-08-17 14:25:29 +03:00
Ilya Gorbunov
d845092b20 Take into account excluded fq-names when determining whether type has been imported by default.
Related to #KT-13447
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
e34bc30bd7 Exclude alias imported names from all-under imported packages when determining whether a type has been imported for completion.
#KT-13447 Fixed
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
b69661df8f Pseudocode and CFG changed after 'let' is resolved correctly. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
58a010464a Exception typealiases rendering in test output (CFG) 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
2a0076d9bd Test data: replace Exception with Throwable (in those tests where particular exception type is not crucial in order not to rename tests to have runtime dependency added with exception typealiases). 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
3115aa1dc2 Test data: replace Exception with Thread as the former is resolved not from java.lang anymore. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
570ac8b821 Add runtime dependency to tests where exception references are used. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
6f7b908dbb Test data: change fully qualified type so that it's available as type (and not an alias) in both jvm and js runtimes to have the same output. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
0ebfba7a1a Test data: do not use exceptions from java.lang, as they are not available in JS 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
d943079557 Exception typealiases rendering in test output 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
403e2ab4ea Redefine configuration kinds, so that the most of test dependent on JDK_ONLY now use mock kotlin runtime:
MOCK_RUNTIME -> JDK_ONLY
JDK_ONLY -> JDK_NO_RUNTIME
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
7579111df1 Include exception typealiases into mock runtime. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
9e238d26f2 Exclude builtins module from idea project build 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
cf898ae357 Exclude exceptions from java.lang package for which type aliases exist in kotlin package.
Add relevant note to the type aliases.
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
0d7819e011 Move exceptions to kotlin package in JS library, introduce type aliases for exceptions in kotlin package in JVM runtime.
#KT-18 Fixed
2016-08-17 12:40:50 +03:00
Ilya Gorbunov
afe1b7eab1 Allow to exclude specific types from packages imported by default. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov
0f8bf310f2 Kotlin script execution for maven: include kotlin-runtime as explicit dependency for script.
Relates to #KT-11839
2016-08-17 12:40:50 +03:00
Alexey Sedunov
fbd6edce92 Light Classes: Support property accessors with non-conventional names
#KT-13032 Fixed
2016-08-17 12:28:46 +03:00
Alexey Sedunov
94c4b426f5 Pull Up: Skip super members without explicit declarations
#KT-13124 Fixed
2016-08-17 11:50:00 +03:00
Alexey Sedunov
6766494581 Push Down: Do not specifiy visibility on generated overriding members
#KT-12971 Fixed
2016-08-17 11:49:59 +03:00
Alexey Sedunov
ad3ffdab18 Rename: Use RenameKotlinParameterProcessor for constructor/lambda parameters
#KT-13253 Fixed
2016-08-17 11:49:58 +03:00
Alexey Sedunov
2e887ebcef Rename: Do not report shadowing conflict if redeclaration is detected
#KT-13240 Fixed
2016-08-17 11:49:58 +03:00
Alexey Sedunov
8232c66617 Move: Warn about accessibility conflicts when moving entire file
#KT-13175 Fixed
2016-08-17 11:49:57 +03:00
Alexey Sedunov
baa549e7c8 Move: Warn about accessibility conflicts due to moving to unrelated module
#KT-13174 Fixed
2016-08-17 11:49:56 +03:00
Alexey Sedunov
6a42802240 Rename: Warn about function name conflicts
#KT-13239 Fixed
2016-08-17 11:49:55 +03:00
Alexey Sedunov
385640c86f Rename: Fix name quoting for automatic renamers
#KT-13282 Fixed
 #KT-13283 Fixed
2016-08-17 11:49:54 +03:00
Alexey Sedunov
a5da9e81a0 Rename: Conflict detection for type parameters
#KT-13254 Fixed
2016-08-17 11:49:53 +03:00
Alexey Sedunov
562488b348 Create from Usage: Disable "Create property" (non-abstract) in interfaces. Make "Create function" (non-abstract) generate function body in interfaces
#KT-13365 Fixed
2016-08-17 11:49:52 +03:00
Alexey Sedunov
f4d9f33f48 Change Signature: Yield to other usage processor if target element is neither KtFunction, nor PsiMethod
#KT-13277 Fixed
2016-08-17 11:49:52 +03:00
Michael Bogdanov
e6d96be329 Removed redundant 'addThis' flag 2016-08-17 11:26:46 +03:00
Michael Bogdanov
e0d525b72a Support bound function reference inlining 2016-08-17 11:26:45 +03:00
Michael Bogdanov
439431e923 ParameterBuilder refactoring: allow to generate captured parameter between value ones 2016-08-17 11:26:45 +03:00
Valentin Kipyatkov
7f07890f6a KT-13298 Suggest names for overridden properties / functions in completion
#KT-13298 Fixed
2016-08-16 18:17:24 +03:00
Valentin Kipyatkov
7ebf001d25 Moved class 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
8e6a01fe0a arrayListOf, mutableListOf, hashSetOf and mutableSetOf supported 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
054558ad95 More correct checking of smart cast preserving 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
bfed954e85 Added tests 2016-08-16 17:38:19 +03:00
Valentin Kipyatkov
f5530c8bf0 Added comment 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
e32724330f Moved shouldUseInputVariable from Transformation to TransformationMatcher and changed its semantics a bit 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
a5c7d4f1fd Added comment 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
50cd61ec9f Minor refactoring 2016-08-16 17:38:18 +03:00
Valentin Kipyatkov
407a3ddc8a Used utility 2016-08-16 17:38:17 +03:00
Valentin Kipyatkov
dde397f34d Fixed bug 2016-08-16 17:38:17 +03:00
Valentin Kipyatkov
bdd4363802 Option to use 'asSequence()' 2016-08-16 17:38:17 +03:00
Valentin Kipyatkov
acdf9e82b4 Minor 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
77064c7937 Fixed bug with user data not cleared 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
f4a04f04f0 Minor 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
c753e332ed More clear code 2016-08-16 17:38:16 +03:00
Valentin Kipyatkov
1fece52170 Typo correction 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
128896fa43 Formatting of "?:" onto the next line 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
9890cebfd9 Code refactoring 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
c9fa95927b Added comments 2016-08-16 17:38:15 +03:00
Valentin Kipyatkov
dd50f55415 Removed warnings 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
7c0f9a76a8 Added one more test 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
e5903f90f2 Added test and asserts 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
8b4f8e8359 Corrected test data after rebase on master 2016-08-16 17:38:14 +03:00
Valentin Kipyatkov
da772e11c2 Minor changes on code review 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
d658d3b9cf "Use withIndex()" intention&inspection 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
46055dfd2d Refactoring 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
ebdff775f3 Supported index++ pattern as non-last statement and even inside expressions 2016-08-16 17:38:13 +03:00
Valentin Kipyatkov
2c90114d28 Added TODO 2016-08-16 17:38:12 +03:00
Valentin Kipyatkov
4094d77782 Supported forEachIndexed 2016-08-16 17:38:12 +03:00
Valentin Kipyatkov
f28dca1fd5 Supported forEach 2016-08-16 17:38:12 +03:00
Valentin Kipyatkov
394cce8e10 Checking type of the collection being iterated 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
89dab52a14 Minor changes on code review 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
c2103e2200 Supported indexOf/lastIndexOf 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
c080ecb0d1 Code simplification 2016-08-16 17:38:11 +03:00
Valentin Kipyatkov
87c9af532e Refactoring 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
834fe9d535 Supported contains() 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
833f62e9b9 Fixed some cases when smart cast problems were not detected 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
fe52bed74e Remove fq-name 2016-08-16 17:38:10 +03:00
Valentin Kipyatkov
e8904d7727 Merging loop with initialization before in more cases + better formatting 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
5ddac24cdd Refactoring 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
b65ecdd660 Supported indexOfFirst/indexOfLast 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
5ac2c48879 Merging subsequent filtering checks even when index variable is used 2016-08-16 17:38:09 +03:00
Valentin Kipyatkov
aa6240a0c5 Do not generate redundant .toList() 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
813060fef3 Added TODO 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
9ea6341d46 Minor 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
4efc8fa2b1 Merged all map-transformations into one class 2016-08-16 17:38:08 +03:00
Valentin Kipyatkov
b6e05e058e Supported mapIndexedTo and mapIndexedNotNullTo 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
2652ea4233 Supported mapNotNullTo 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
8c7cdf1bf8 Supported other patterns for mapNotNull 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
a6132c7db9 Prohibiting incorrect transformations of loops with expression-embedded break or continue + allowed "?: continue" pattern for mapNotNull 2016-08-16 17:38:07 +03:00
Valentin Kipyatkov
cfc82c55c7 Checking that target collection is always the same 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
3f563f7058 takeWhile supported 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
9ff0f4d736 filterNotTo supported 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
0a61e5b0b2 filterIsInstanceTo NOT supported 2016-08-16 17:38:06 +03:00
Valentin Kipyatkov
395e61ca57 filterNotNullTo supported 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
318f3dfdd8 Supported filterIndexedTo 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
7c473e7159 Reduced amount of ResultTransformation implementations 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
a07bbf4aa8 More correct and easy comment restoring range management 2016-08-16 17:38:05 +03:00
Valentin Kipyatkov
27063bcd9b Supported case when result variable initialization is not right before the loop 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
9b69c5c375 Split into more files 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
b24aee9c92 Moved classes into separate file 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
d61daed461 Recognizing manually incremented index 2016-08-16 17:38:04 +03:00
Valentin Kipyatkov
14e87b1f2c Initial support for indexed transformations 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
955e1166fd Transformation not necessary has real input variable 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
e0a7e1dbed Checking that input variable is really used 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
345f2b8a52 More usable caret position 2016-08-16 17:38:03 +03:00
Valentin Kipyatkov
db53794663 Supported "count()" 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
53e3a67a7f Better formatting in some cases 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
fe7ddbcc0d More informative intention action text 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
bbb6ef4fbc Check that "break" and "continue" do not produce false errors when using analyzeInContext 2016-08-16 17:38:02 +03:00
Valentin Kipyatkov
49f2c5f657 Sometimes shorter code with filterTo, mapTo and flatMapTo 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
744186402d One more case when mapTo can be generated 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
db0028c11e AddToCollectionTransformation checks that the result collection type cannot be changed 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
f51c5a19dd Basic support for "add" to collection used inside the loop 2016-08-16 17:38:01 +03:00
Valentin Kipyatkov
d3721e9462 flatMapTo supported 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
f3c760607b Consistent use of term "input variable" instead of "working variable" 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
df08493337 Moved check about old working variable not needed into common place 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
22fb397662 Initial support for "+=", filterTo and mapTo for collections 2016-08-16 17:38:00 +03:00
Valentin Kipyatkov
ac46684592 Supported initialization with assignment instead of declaration 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
1fe84b8a25 Refactoring 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
bd6b38962d Elvis operator supported for all cases of find 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
79800492a9 firstOrNull() ?: ... supported 2016-08-16 17:37:59 +03:00
Valentin Kipyatkov
14ef93a797 More relaxed checks for any() with return 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
ff0bb4fbb8 Generating more simple construct instead of "let" in some cases 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
a760ef3665 Generating "firstOrNull()?.let {...}" 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
fba9b123dd More cases supported for "any" 2016-08-16 17:37:58 +03:00
Valentin Kipyatkov
c0f3ab59ab Supported "lastOrNull" and "any" without break in the loop 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
0243efd8b5 Added comments 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
fcbf68617e Merging subsequent .filter()'s 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
6dbd9c944a Refactored API to allow merging ResultTransformation with any kind of previous transformation 2016-08-16 17:37:57 +03:00
Valentin Kipyatkov
d7762778a2 Cannot transform to flatMap if old working variable used in the nested loop 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
50bd766992 Minor changes after code review 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
863040700e Check for continue-statement of the inner loop! 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
8c498af3d8 Checking that smart casts will not be broken by conversion 2016-08-16 17:37:56 +03:00
Valentin Kipyatkov
978fc468fa Temporary fix 2016-08-16 17:37:55 +03:00
Valentin Kipyatkov
12b1a99a6a Initial implementation of loop-to-call-chain intention 2016-08-16 17:37:55 +03:00
Valentin Kipyatkov
c50cf13611 KtExpression.analyzeInContext uses correct context when analyzing return's 2016-08-16 17:37:55 +03:00
Pavel V. Talanov
340fe82fa0 Minor, KotlinScriptConfigurationManager: add TODO 2016-08-16 16:49:09 +03:00
Pavel V. Talanov
10660f35d7 Add tests for script configuration machinery, namely ScriptTemplateProvider EP
Test highlighting and navigation depending on provided script definition
2016-08-16 16:45:59 +03:00
Pavel V. Talanov
b4cb4f9191 KotlinLanguageInjector: only run for project or library source 2016-08-16 16:45:58 +03:00
Kirill Rakhman
e6d76a9b71 Allow suppressing warnings for secondary constructor (KT-12627)
(cherry picked from commit 41cf868)

 #KT-12627 Fixed
2016-08-16 13:04:42 +03:00
Nikolay Krasko
7a4d20b4cf Make quick evaluate work on receiver in qualified expressions (KT-13269)
(cherry picked from commit 970ac5a)

 #KT-13269 Fixed
2016-08-16 13:04:41 +03:00
Michael Bogdanov
7325baa06a Fix for KT-13374: CompilationException: Inline function call with anonymous object implementing an interface by delegation
#KT-13374 Fixed
2016-08-16 10:47:01 +03:00
Natalia Ukhorskaya
fca5834557 Eval4J: loadClass should return prepared class, otherwise ClassNotPreparedException fails in invokeMethod
#KT-12641 Fixed
2016-08-16 09:08:34 +03:00
Natalia Ukhorskaya
f6bb70aad1 Debugger: allow to evaluate 'this' and fields in java files 2016-08-16 09:08:34 +03:00
Alexander Udalov
18887f8bec Rename CompanionObjectMapping.hasMappingToObject -> isMappedIntrinsicCompanionObject 2016-08-15 19:41:47 +03:00
Alexander Udalov
7b8ee5fba1 Add test case for obsolete issue
#KT-13172 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
bd88b0941d Fix incorrect unsupported error on synthetic extension call on LHS of ::
#KT-13271 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
9dc7e90e12 Disable some reflection tests on Android 2016-08-15 19:41:47 +03:00
Alexander Udalov
4e8f88d580 Refactor comments in SpecialFiles 2016-08-15 19:41:47 +03:00
Alexander Udalov
5b1ee13db8 Make KClasses for primitives equal to KClasses for wrapper types
Both primitive int and wrapper type java.lang.Integer are represented by the
single type kotlin.Int in Kotlin, so inequality between the corresponding
KClasses was confusing here. To keep the old behavior, one may call 'k1.java ==
k2.java' instead of `k1 == k2`

 #KT-13462 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
3efa738bc0 Fix NPE on .companionObjectInstance for built-in classes
#KT-13370 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
611899e9d3 Minor, make CompanionObjectMapping a singleton 2016-08-15 19:41:47 +03:00
Stanislav Erokhin
85a951db52 Fixed exception AssertionError: Illegal resolved call to variable with invoke
#KT-13330 Fixed
#KT-13349 Fixed
2016-08-15 19:24:17 +03:00
Kirill Rakhman
926deebff5 Format spaces around !is and !in (KT-13314)
#KT-13314 Fixed
2016-08-15 16:21:01 +03:00
Mikhail Glukhikh
b53cb91e88 Do not suggest "Replace infix with safe call" inside conditions or binary / unary expressions #KT-13328 Fixed 2016-08-15 15:42:27 +03:00
shiraji
42969271ab Fix problem with appending literal to variable omitting braces #KT-13336 Fixed 2016-08-15 15:13:40 +03:00
Kirill
223fd9fad0 Implement intentions to add/remove braces to/from when entries #KT-12043 Fixed 2016-08-15 14:13:13 +03:00
Kirill Rakhman
d68a681db5 Highlight use of toString() inside string interpolation as redundant #KT-10731 Fixed 2016-08-15 13:28:47 +03:00
Mikhail Glukhikh
52dacd1d49 KT-13430 related: add non-null assertion works also for UNSAFE_INFIX_CALL 2016-08-12 17:43:31 +03:00
Mikhail Glukhikh
cf2d575eec Add non-null assertion: correct handling of unary expression unsafe calls #KT-13430 Fixed 2016-08-12 17:43:26 +03:00
Mikhail Glukhikh
13975778c5 Unused symbol: handling of import as alias not only for objects / enums #KT-11933 Fixed 2016-08-12 17:42:33 +03:00
Mikhail Glukhikh
e01e08402c Minor: convert to expression body is forbidden also for nested non-exhaustive whens 2016-08-12 17:41:33 +03:00
Mikhail Glukhikh
6a6c67dd5f Convert to expression body is forbidden for if without else #KT-12951 Fixed 2016-08-12 17:41:28 +03:00
Mikhail Glukhikh
1c5c6506ce Report of UNINITIALIZED_ENUM_COMPANION also for implicit receivers #KT-11769 Fixed 2016-08-12 15:06:43 +03:00
Mikhail Glukhikh
04f71bccf2 KT-11769 case with companion function call: error is now detected if companion receiver is stated explicitly 2016-08-12 15:06:38 +03:00
Sergey Mashkov
3c002625c6 KT-13211 KotlinCompileMojoBase could provide better compilation failure info 2016-08-12 13:59:58 +03:00
shiraji
3e58283d7e Add quickfix for adding 'inline' to a function with reified generic #KT-6975 Fixed 2016-08-12 12:15:40 +03:00
Mikhail Glukhikh
6cf90cfc4e Fix for SOE in VarianceChecker #KT-13401 Fixed 2016-08-11 13:04:58 +03:00
Ilya Chernikov
82a53912a9 Add two more options copying from gradle-visible option to compiler-visible ones 2016-08-11 09:11:11 +02:00
Ilya Chernikov
46a7c706e1 Fixes and refactorings after review 2016-08-11 09:11:11 +02:00
Ilya Chernikov
295f2fd40a Fix GeneratedClassloader creation in scripts compilation, fixes test 2016-08-11 09:11:11 +02:00
Ilya Chernikov
9f18ad606a Fix exception on incompatible resolver class - #EA-86599 2016-08-11 09:11:11 +02:00
Ilya Chernikov
e99697e3a2 Fix testdata for cli help tests 2016-08-11 09:11:11 +02:00
Ilya Chernikov
4d5b96ab8a Change error loading script template to warning - not to show an exception...
because it is not an exception e.g. in case of using old gradle
2016-08-11 09:11:11 +02:00
Ilya Chernikov
324b4544c6 Generate kotlin metadata for scripts - see TODO 2016-08-11 09:11:11 +02:00
Ilya Chernikov
e79d8014fa Add support for script templates settings in gradle plugin, add kts files to source sets 2016-08-11 09:11:11 +02:00
Ilya Chernikov
ce6966b486 Add settings to compiler to specify templates to load, add templates provider using the settings 2016-08-11 09:08:40 +02:00
Ilya Chernikov
c9441bd7b3 Update template(s) provider interface to support multiple templates, rename it appropriately 2016-08-11 09:08:40 +02:00
Ilya Chernikov
6c0b78fb01 Add script-templates option to compiler options, fix templates and definitions loading in compiler 2016-08-11 09:08:40 +02:00
Alexey Tsvetkov
4702842afd Revert replacing convention with extension
It seems that was wrong
2016-08-10 22:28:21 +03:00
Alexey Tsvetkov
791c7fe6e6 Invalidate jar cache at the end of a Gradle build
#KT-12912 fixed
2016-08-10 22:28:20 +03:00
Alexey Tsvetkov
fa0344a1b2 Add simple file modification util for gradle incremental tests 2016-08-10 22:22:54 +03:00
Alexey Tsvetkov
aff5dd1691 Refactoring: cleanup gradle plugin 2016-08-10 22:22:50 +03:00
Alexey Tsvetkov
81bc2701fa Refactoring: move util functions to gradleUtils.kt 2016-08-10 22:22:47 +03:00
Alexey Tsvetkov
f649ebfdba Refactoring: remove unused ScriptHandler 2016-08-10 22:22:43 +03:00
Alexey Tsvetkov
5f4e56c251 Refactoring: simplify KotlinSourceSet creation 2016-08-10 22:22:40 +03:00
Alexey Tsvetkov
cc585cf6f3 Refactoring: extract constants 2016-08-10 22:22:36 +03:00
Alexey Tsvetkov
eeed0a6eee Refactoring: stop using internal classes to create DSL extensions 2016-08-10 22:22:32 +03:00
Alexey Tsvetkov
d9c9fb11ea Refactoring: taskUtils.kt->gradleUtils.kt 2016-08-10 22:22:28 +03:00
Alexey Tsvetkov
6c80b33664 Refactoring: remove usages of ProjectInternal 2016-08-10 22:22:25 +03:00
Alexey Tsvetkov
f0ff0d0a18 Refactoring: inject FileResolver
This is part of refactoring to minimize using of internal API in gradle plugin
2016-08-10 22:22:21 +03:00
Ilya Gorbunov
2c1d90c79d Improve test coverage of map operations 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
dcd6e86cd3 Minor: rename type parameter from C to M as it stands for Map 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
bb774cea76 Minor: remove anonymous class for Map.asSequence 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
fb99919c59 Accept maps out-projected by key where possible. 2016-08-10 21:52:24 +03:00
Ilya Gorbunov
738219d53e Make Map.toSortedMap accept Map out-projected by key type as the receiver.
Update related completion testData.
2016-08-10 21:52:24 +03:00
Ilya Gorbunov
9ff6a6260e Minor: explicit visibility and improved code formatting 2016-08-10 21:32:33 +03:00
Ilya Gorbunov
200f1c98ed Minor: fix formatting and improve docs 2016-08-10 18:23:32 +03:00
Laszlo Hornyak
6fda0816f3 buildString with initial capacity for the StringBuilder instance
this method helps save computation time when the developer knows or have a good
educated guess about the size of the generated string and have to use control
structures while filling the string builder

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2016-08-10 18:23:32 +03:00
Ilya Chernikov
4e18e91463 Attempt to fix EA-82064:
"java.lang.NoClassDefFoundError: Could not initialize class kotlin.Unit"
2016-08-10 14:18:03 +02:00
Zalim Bashorov
9ece62fa0f JS backend: fix runtime type checking for interfaces 2016-08-10 15:04:27 +03:00
Zalim Bashorov
060255e8f7 Fix printing file size of generated js files for TeamCity statistics 2016-08-10 15:03:56 +03:00
Dmitry Jemerov
f08a7f14e0 workaround for IDEA's issue that throws an exception when using union() on a LocalSearchScope with no elements (EA-82063 - AIOOBE: GlobalSearchScope.union) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
180f70b573 don't use document for checking whether a folding region is one-line, use only PSI, as it may not correspond to the state of the document (EA-81838 - IOOBE: LineSet.findLineIndex) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
a4aa3cdf57 don't crash if we don't have a descriptor for the declaration under caret (EA-86248 - KNPE: KDocNameCompletionSession.doComplete) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
ddb91cc0d9 correct fix for showing dialog from popup callback (EA-86138) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
5c113a4237 correct fix for invoking 'safe delete' refactoring outside of write action (EA-80766 - E: BaseRefactoringProcessor.run) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
5d92f655f7 one more missing read action in Find Usages (EA-81276 - assert: SharedImplUtil.getParent) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
f9d3804111 check element validity in KotlinSelectInProjectViewProvider (EA-84485 - PIEAE: OwnBufferLeafPsiElement.getContainingFile) 2016-08-10 13:26:13 +02:00
Dmitry Jemerov
8632790446 don't check intention availability on PsiFile (EA-85587 - assert: SharedPsiElementImplUtil.getChildIndex) 2016-08-10 13:26:13 +02:00
Mikhail Glukhikh
d21061ff60 CAST_NEVER_SUCCEEDS: some type alias tests (1.1 only!) 2016-08-10 12:23:09 +03:00
Mikhail Glukhikh
687698da9a Do not report USELESS_CAST when casting null to nullable (special case) 2016-08-10 12:23:02 +03:00
Mikhail Glukhikh
8d537d294a Minor: imports removed, formatting 2016-08-10 12:22:58 +03:00
Mikhail Glukhikh
098520de64 CAST_NEVER_SUCCEEDS: do not report when casting nullable to nullable #KT-260 Fixed 2016-08-10 12:22:53 +03:00
Alexey Sedunov
2b44335c27 Presentation: Render valid description for type aliases 2016-08-10 11:45:41 +03:00
Alexey Sedunov
3475a1fd1f Introduce Property: Fix duplicate count in popup window
#KT-13395 Fixed
2016-08-10 11:45:41 +03:00
Alexey Sedunov
ab7d48a34e Light Classes: Do not compute annotations for light elements with invalid
origin (possible fix for KT-13199)
2016-08-10 11:45:40 +03:00
Alexey Sedunov
4ab25bd0bb Move: Quote package name (if necessary) when moving declarations to new file
#KT-13385 Fixed
2016-08-10 11:45:39 +03:00
Alexey Sedunov
b793252a5f Extract Function: Skip callable reference selectors
#KT-13218 Fixed
2016-08-10 11:45:38 +03:00
Alexey Sedunov
6e3d1d726e Create from Usage: Do not suggest creating annotations/enum classes for unresolved type parameter bounds
#KT-13364 Fixed
2016-08-10 11:45:37 +03:00
Alexey Sedunov
1b546d18ff Override/Implement Members: Do not expand type aliases in the generated members. Retain abbreviated types during flexible type approximation
#KT-13244 Fixed
2016-08-10 11:45:36 +03:00
Alexey Sedunov
1a4ff598e3 Override/Implement Members: Do not make return type non-nullable if base
return type is explicitly nullable
 #KT-13383 Fixed
 #KT-13379 Fixed
2016-08-10 11:45:35 +03:00
Alexey Sedunov
75573bd6a5 Quick Fixes: Use simple class name in "Change function return type" quickfix
#KT-12919 Fixed
2016-08-10 11:45:35 +03:00
Alexey Sedunov
f57c9279f9 Override/Implement Members: Support "Copy JavaDoc" options for library classes
#KT-12997 Fixed
2016-08-10 11:45:34 +03:00
Alexey Sedunov
8a9a3285de Introduce Variable: Skip leading/trailing comments inside selection
#KT-13054 Fixed
2016-08-10 11:45:33 +03:00
Alexey Sedunov
00b6839e59 Introduce Variable: Retain entered name after changing "Specify type explicitly" option
#KT-13128 Fixed
2016-08-10 11:45:32 +03:00
Alexey Sedunov
792177f206 Extract Function: Extract Function: Fix generation of destructuring declarations
#KT-13010 Fixed
2016-08-10 11:45:31 +03:00
Alexey Sedunov
06e767279b Extract Function/Parameter/Type Alias: Automatically quote declaration name when necessary
#KT-13157 Fixed
2016-08-10 11:45:30 +03:00
Alexey Sedunov
59a714ca5c Presentation: Render function signature in RefactoringDescriptionLocation
#KT-12943 Fixed
2016-08-10 11:45:29 +03:00
Alexey Sedunov
892c8436f3 Introduce Variable: Do not suggest expressions without type
#KT-12922 Fixed
2016-08-10 11:45:28 +03:00
Alexey Sedunov
3cd35f8a3b Rename: Fix function description in super method warning dialog
#KT-12945 Fixed
2016-08-10 11:45:27 +03:00
Ilya Gorbunov
e35a214eaf Review fixes: special case of toMap for singleton map.
#KT-9108
2016-08-09 21:49:57 +03:00
Ilya Gorbunov
efc8f2c88a Provide extensions to copy maps.
#KT-9108
2016-08-09 21:49:57 +03:00
Ilya Gorbunov
0ce4bce4a5 Changelog for 1.0.4: stdlib changes 2016-08-09 19:05:32 +03:00
Ilya Gorbunov
ae985e24ca Docs: clarify docs for 'generateSequence'. 2016-08-09 17:43:12 +03:00
Ilya Gorbunov
fed24c2be6 Docs: preserve empty lines in the generated documentation to separate summary and paragraphs in the body. 2016-08-09 17:43:12 +03:00
Ilya Gorbunov
e31167e74f Improve FileTreeWalk documentation,
#KT-13297 Fixed
2016-08-09 17:43:12 +03:00
Ilya Gorbunov
e7d250b7d7 Document that sequences could be iterated multiple times.
#KT-13115 Fixed
2016-08-09 17:43:12 +03:00
Denis Zharkov
1df9724c0c Refine stack frames markup calculation
It fixes VerifyError with coroutines on Dalvik happening because of
variables spilling before/after suspension point

BasicInterpreter from ASM does not distinct 'int' types from other
int-like types like 'byte' or 'boolean', neither do HotSpot and JVM spec.
But it seems like Dalvik does not follow it, and spilling
boolean value into an 'int' field fails with VerifyError on Android 4,
so it's necessary to distinct int types for variables spilling

 #KT-13289 Fixed
2016-08-09 16:36:52 +03:00
Denis Zharkov
d8c3cefc7c Extract backward analysis framework 2016-08-09 16:36:52 +03:00
Alexander Udalov
0d26087040 CLI, Ant: add kotlin-reflect.jar to classpath by default, support "-no-reflect"
Note that now "-no-stdlib" implies "-no-reflect".

 #KT-13237 Fixed
2016-08-09 11:24:24 +03:00
Mikhail Glukhikh
30fd22499b Test data fix (after cherry-pick from 1.0.4) 2016-08-09 10:32:15 +03:00
Mikhail Glukhikh
b668206aa7 Minor: test comment, relevant to KT-13322
(cherry picked from commit 7606b1d)
2016-08-09 10:28:49 +03:00
Mikhail Glukhikh
729de536de Rewrite slice error removed for LEAKING_THIS #KT-13371 Fixed
Also EA-86478 fixed
(cherry picked from commit 5ac3126)
2016-08-09 10:28:40 +03:00
Mikhail Glukhikh
13e64c18d9 Correct CFA order for enums: first own members, then entries, and at last companion object members #KT-6054 Fixed
(cherry picked from commit 94d3b4c)
2016-08-09 10:28:27 +03:00
Alexander Udalov
1bc7b4e363 Fix test data 2016-08-08 21:48:10 +03:00
Alexander Udalov
d14843cb0e Update API listing of built-in classes in kotlin.reflect 2016-08-08 17:54:11 +03:00
Alexander Udalov
7f142253bf Reflection: simplify KTypeProjection 2016-08-08 17:54:11 +03:00
Alexander Udalov
a7f4037206 Reflection: change order of arguments of inner generic type
As in KClassifier.createType and everywhere in the compiler, specify arguments
for the innermost type first. This is more convenient to use because generally
the construction/introspection of such type starts from the innermost class
anyway (i.e. something like generateSequence can be used, without the need to
call .reverse() in the end)
2016-08-08 17:54:11 +03:00
Alexander Udalov
89d69bc7eb Reflection: add KClass.createInstance 2016-08-08 17:54:11 +03:00
Alexander Udalov
0525b1e6c1 Reflection: add KClass.declaredMembers 2016-08-08 17:54:11 +03:00
Alexander Udalov
30b7334e48 Reflection: add utilities to filter parameters by kind and name 2016-08-08 17:54:11 +03:00
Alexander Udalov
d78988a12a Reflection: add KVisibility, KClass.visibility, KCallable.visibility 2016-08-08 17:54:11 +03:00
Alexander Udalov
7e317f7a7c Reflection: add API for declaration modifiers
#KT-10447 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
ada81923dc Reflection: add KClass.isInstance, KClass.cast, KClass.safeCast
#KT-11284 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
3702f4a7a7 Reflection: add KClass.{isSubclassOf,isSuperclassOf}, KType.{isSubtypeOf,isSupertypeOf}
The behavior in primitives.kt is likely to be reconsidered

 #KT-8998 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
4cd252d9d5 Reflection: add KClass.{supertypes,superclasses,allSupertypes,allSuperclasses}
Some things are not implemented yet for allSupertypes, such as KType->Type
mapping of types and generic substitution of built-in types
2016-08-08 17:54:11 +03:00
Alexander Udalov
486ea62c72 Reflection: add KType.withNullability 2016-08-08 17:54:11 +03:00
Alexander Udalov
f958483e56 Reflection: deprecate KClass.defaultType
Its semantics were unclear and its javaType was implemented incorrectly (it
should have returned ParameterizedType with star projections for generic type)
2016-08-08 17:54:11 +03:00
Alexander Udalov
6b79782951 Reflection: add KClassifier.starProjectedType
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
1edf3c7809 Reflection: add KClassifier.createType
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
153e837a84 Reflection: add KType.jvmErasure
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
e760b5ed53 Reflection: add KTypeParameter.toString
The test covers different type parameters with and without bounds, in case we
decide to also output upper bounds in toString
2016-08-08 17:54:11 +03:00
Alexander Udalov
170ea4dead Reflection: add KVariance, KTypeParameter.{variance,upperBounds,equals,hashCode} 2016-08-08 17:54:11 +03:00
Alexander Udalov
127e7ab5b7 Reflection: add KClass.typeParameters, KCallable.typeParameters
Inheritance from KCallable is removed in kt9078.kt because it was irrelevant to
the test and because it gets in the way of modification of KCallable
2016-08-08 17:54:11 +03:00
Alexander Udalov
f69cc01f8e Reflection: add KTypeProjection and KType.arguments
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
c1dd831e65 Reflection: add KType.classifier
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
2ab0f489b5 Reflection: add KClassifier, KTypeParameter, KTypeParameter.name
The ability to obtain classifier from types is going to be added later
2016-08-08 17:54:11 +03:00
Alexander Udalov
5e3efe0e58 Reflection: improve support of built-in classes in 'toJavaClass'
Also support mock class descriptor created for java.io.Serializable. This will
be needed (and covered with tests) later for correct implementation of advanced
reflection API
2016-08-08 17:54:11 +03:00
Mikhail Glukhikh
0c98231f53 Report UNINITIALIZED_VARIABLE also for qualified object property #KT-12809 Fixed
(cherry picked from commit 7b2857f)
2016-08-08 17:48:08 +03:00
Mikhail Glukhikh
35446037bb UNINITIALIZED_ENUM_ENTRY compiler warning introduced #KT-2349 Fixed
(cherry picked from commit 76ac6d1)
2016-08-08 17:47:56 +03:00
Mikhail Glukhikh
b7ed68db05 CFA: No more UNRESOLVED_CALL for object / enum entry qualifiers
(cherry picked from commit 4b09de8)
2016-08-08 17:47:40 +03:00
Mikhail Glukhikh
962c2e5dd2 ControlFlowInformationProvider: convert to Kotlin
(cherry picked from commit a1394bc)
2016-08-08 17:45:52 +03:00
Mikhail Glukhikh
16cf6379c1 ControlFlowInformationProvider.java --> ControlFlowInformationProvider.kt
(cherry picked from commit 28bb9ea)
2016-08-08 17:45:41 +03:00
Alexander Udalov
de68d96236 Minor, add test for obsolete issue
#KT-12843 Obsolete
2016-08-08 15:42:52 +03:00
Valentin Kipyatkov
6ff91d1399 KT-12793 Code completion doesn't suggest abstract protected extension methods
#KT-12793 Fixed
2016-08-05 19:36:52 +03:00
Zalim Bashorov
88ad00b0bc JS backend: add the ability to get JS constructor function by class name and from instance. Support it for reified type parameters too. Add ability to get name of class.
#KT-5987 Fixed
 #KT-4115 Fixed
2016-08-05 18:13:05 +03:00
Zalim Bashorov
e7eb35b169 JS backend: always (explicitly) generate constructor function for classes. Use name of class as name of constructor function when it isn't special.
#KT-4115 In Progress
2016-08-05 18:13:05 +03:00
Nikolay Krasko
bfb4c48785 Minor: rename variables 2016-08-05 16:46:25 +03:00
Nikolay Krasko
c137b0d740 Decrease xmx in tests 2016-08-05 16:46:23 +03:00
Nikolay Krasko
bc0d302760 Use nullable value and destroy it in tearDown for REPL tests 2016-08-05 16:46:22 +03:00
Alexey Andreev
19cea48637 JS: add tests to show that #KT-12865 fixed as well 2016-08-05 16:32:27 +03:00
Alexey Andreev
4ff2b62bc0 KT-12864: add Comparable interface to Enum metadata so that RTTI should handle is Comparable case correctly 2016-08-05 16:32:27 +03:00
Michael Bogdanov
67808ef7fc Disable kt13133 test on android 2016-08-05 14:11:00 +03:00
Nikolay Krasko
300e0acd27 Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
#KT-13340 Fixed
2016-08-05 13:16:05 +03:00
Mikhail Zarechenskiy
95ea191442 Fix handling after ScriptTest execution: clean up temporary files on exit hooks
Test "testStandardScriptWithSaving" uses classloader and prevents from
 deleting temporary files on windows
2016-08-04 15:19:15 +03:00
Mikhail Zarechenskiy
7679e49b25 Do not generate properties for script parameters if there is template definition 2016-08-04 15:19:15 +03:00
Alexey Tsvetkov
e4226fbe48 Update changelog for 1.0.4 2016-08-04 11:27:08 +03:00
Natalia Ukhorskaya
7087f10660 Fixes after review: get last statement in codeFragmetn using psi instead of findElementAt 2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya
ed204e9bac Minor: extract similar parts to separate function 2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya
6a04cd39b2 Debugger: allow to evaluate kotlin expressions in java files
#KT-7549 Fixed

 If the context is inside PsiJavaFile, get list of all local variables available in current frame (this logic was removed in 29778311e8 01.12.2015 Drop unnecesary logic about additional context for lambda in debugger). For each variable create KtProperty inside top-level KtFunction in KtFile and set it as contextElement for KtCodeFragment. This file should have all imports from PsiJavaFile. We do not create properties on top-level because they will be highlighted as top-level vals/vars.
2016-08-03 17:51:49 +03:00
Natalia Ukhorskaya
d823d6f4ab Debugger tests: mark objects using NodeDescriptorImpl.getMarkup. Primitive values cannot be marked. 2016-08-03 17:51:49 +03:00
Pavel V. Talanov
252b8ec6db Add assertions to prohibit creating LazyJavaClassDescriptor by KtLightClass
Diagnosing KT-12966
2016-08-03 17:29:08 +03:00
Pavel V. Talanov
30892e0154 KtLightClassForDecompiledDeclaration is now marked by KtLightClassMarker
Rename: KtJavaMirrorMarker -> KtLightClassMarker
Introduce code to be able to tell light classes from source and binaries apart in 'frontend.java'
2016-08-03 17:29:06 +03:00
Alexey Tsvetkov
d402a15049 Update changelog for 1.0.4 2016-08-03 15:09:20 +03:00
Alexey Tsvetkov
e0ebf2482b Configure KotlinCompile.destinationDir before evaluation
Previously it was possible to refer to destinationDir
in gradle scripts (evaluation phase), so in order to
preserve compatibility destinationDir should be configured
before evaluation.

This does not affect android plugin because in this case kotlin
tasks were created after evaluation anyway, so it
was not possible to refer to destinationDir
during evaluation anyway.
2016-08-03 13:09:56 +03:00
Ilya Chernikov
1248230c69 Fix after review, add logging for scripting-specific behavior 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
fbc5d64aab gradleScriptTemplateProvider: fix NPE 2016-08-03 09:51:40 +02:00
Ilya Chernikov
f73b8e80be Fixes after review 2016-08-03 09:51:40 +02:00
Ilya Chernikov
df64736192 Refactor script dependnecies template and resolver interfaces:
- get rid of obsolete interfaces and annotations
- rename actual resolver interface to ScriptDependenciesResolver
- make ScriptDependenciesResolverEx interface compatible with the one from 1.1-M01 to be able to support both on the provider side
- add possibility to override file patter in the script template provider
- construct resolver lazily, if possible
2016-08-03 09:51:40 +02:00
Ilya Chernikov
8024367915 Move KotlinScriptDefinitionFromTemplate to separate file...
leaving only interfaces in the scriptTemplate.kt. It could now be extracted into the separate lib if necessary.
2016-08-03 09:51:40 +02:00
Ilya Chernikov
c73ab6c0a1 Fix pathlist comparison - fixes too frequent caches updates 2016-08-03 09:51:40 +02:00
Ilya Chernikov
31d9da3d4f Update resolver interface - make it return Future and add message reporter function +
plus minor fixes
2016-08-03 09:51:40 +02:00
Ilya Chernikov
5117ecb817 Collect annotations lazily 2016-08-03 09:51:40 +02:00
Ilya Chernikov
80f7dda6c7 Update gradle script resolver environment:
- JVM options from IDEA config to connect/run daemon with appropriate options (need to be tested)
- A lexing function to allow gradle plugin to check whether dependency-defining part of the script is actually changed
2016-08-03 09:51:40 +02:00
Ilya Chernikov
3b1e7494b8 Change dependencies resolver API - it gets message reporter and returns Future now 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
464445c260 KotlinCacheServiceImpl: Add all sdks from project sdk table when building facadeForSdk
As of now facadeForSdk should contain all sdks that we can possibly reference while resolving including those that scripts depend on
More granular approach may be beneficial in the future
2016-08-03 09:51:40 +02:00
Ilya Chernikov
45ed340444 Add passing of allowKotlinPackage option from gradle plugin to compiler 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
bc0ccd4861 Refactor: move script module info related code to a separate file 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
a8416035b1 IDE Script support: use particular scripts dependencies when building analyzers
Use javaHome property to detect jdk to analyze script files against, use default jdk if it's null
2016-08-03 09:51:40 +02:00
Pavel V. Talanov
350abbe8cd KotlinScriptConfigurationManager, minor: Extract utility to get transform list of file to vfs roots 2016-08-03 09:51:40 +02:00
Pavel V. Talanov
500554e58c Clarify API so that it's possible to get single KotlinScriptExternalDependencies per script file 2016-08-03 09:51:40 +02:00
Ilya Chernikov
59712d4bf8 Implement updatable dependencies index with usage API in the environment for using in REPL 2016-08-03 09:51:40 +02:00
Ilya Chernikov
210a37e08c Support for multiparam dependency annotations (with reservations)
Due to missing feature (#KT-13106) it works either with single argument
or with all named arguments.
2016-08-03 09:51:40 +02:00
Ilya Chernikov
5900cad8b3 Add possibility to pass script dependency resolver directly rather than via definition annotation
This may help to reduce dependencies in certain situations
2016-08-03 09:51:40 +02:00
shiraji
5fb79259f7 Intention / inspection for unnecessary lateinit #KT-13011 Fixed
(cherry picked from commit 45d82f1)
2016-08-03 09:31:03 +03:00
Mikhail Glukhikh
d868410093 Single-expression string template is inspection for strings and intention otherwise #KT-13113 Fixed
(cherry picked from commit 266f9d0)
2016-08-02 15:31:16 +03:00
shiraji
9b8c55d823 KT-13113: Add inspection to detect single-expression string template
(cherry picked from squashed commits 49a3ef3 and 4c7a42a)
2016-08-02 15:30:23 +03:00
Nikolay Krasko
a9ee10a8b7 Ignore intervals that has no mapping for origin line (KT-12896) 2016-08-02 01:05:08 +03:00
Nikolay Krasko
2dd7470cdc Better search for inlined strings in strata: there might me several file mappings to the same file (KT-12896)
#KT-12896 In Progress
2016-08-02 01:05:05 +03:00
Nikolay Krasko
ace58e8aa2 Refactorings: functions moves 2016-08-02 01:02:07 +03:00
Nikolay Krasko
5df7358dab Fix breakpoints in inline functions after dexing (KT-12896)
#KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko
64979ae190 Allow to step into inline functions while debugging Android app (KT-12896)
#KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko
2a2d7cd358 Emulate debugging after dexing for stepping tests with 'dex' prefix (KT-12896)
Remove SourceDebugExtension attribute from resulting class files

 #KT-12896 In Progress
2016-08-02 01:02:07 +03:00
Nikolay Krasko
ad1907f48d Refresh output dirs to make CompilerPaths.getModuleOutputDirectory() method work 2016-08-02 01:02:07 +03:00
Nikolay Krasko
64e034959f Refactoring: introduce constants with strata names and reuse them in debugger 2016-08-02 01:02:07 +03:00
Nikolay Krasko
66bbcf470c Refactoring: move smapUtil and DebuggerUtils to debugger package 2016-08-02 01:02:07 +03:00
Mikhail Glukhikh
39090113e9 KT-13262 related: surround with null check is applicable now also for qualified calls with argument type mismatch
(cherry picked from commit 8f13c84)
2016-08-01 12:24:49 +03:00
Mikhail Glukhikh
b7fd41844d Wrap with safe let call handles qualified calls correctly #KT-13262 Fixed
(cherry picked from commit 7044348)
2016-08-01 12:24:38 +03:00
Mikhail Glukhikh
77b7648f10 Build fix: replace call with comparison inspection test
(cherry picked from commit 7f6be5b)
2016-08-01 12:24:27 +03:00
Mikhail Glukhikh
475dc6541b Replace call with comparison inspection introduced #KT-11425 Fixed
(cherry picked from commit 042fc0d)
2016-08-01 12:24:14 +03:00
Mikhail Glukhikh
fc13b25ca4 KT-11425: convert a.compareTo(b) to binary comparison if possible
(cherry picked from commit 7219904)
2016-08-01 12:23:19 +03:00
Mikhail Glukhikh
f309021c9f KT-11425: convert !a.equals(b) to a != b
(cherry picked from commit 56c7786)
2016-08-01 12:23:07 +03:00
Mikhail Glukhikh
2850a7898d KT-11425: replace call with binary operator works now also with equals() and ==
(cherry picked from commit 5d47fdf)
2016-08-01 12:22:54 +03:00
Ilya Gorbunov
39d7d3381c Make unchecked cast in Map.getOrDefault extension that is covariant by K, since getOrDefault member now requires K as key.
Relates to #KT-13209.
2016-07-29 21:03:56 +03:00
Ilya Gorbunov
0a0bdbc8b3 Minor: fix test source root 2016-07-29 21:03:56 +03:00
Mikhail Glukhikh
d8bd90fb90 ReplaceInfixCallFix --> ReplaceInfixOrOperatorCallFix
(cherry picked from commit 679867b)
2016-07-29 20:12:21 +03:00
Mikhail Glukhikh
995a633229 Replace with safe call works now on UNSAFE_IMPLICIT_INVOKE #KT-12628 Fixed
(cherry picked from commit 208798d)
2016-07-29 20:12:11 +03:00
Mikhail Glukhikh
a9c30e878b KT-12628: !! is now correctly added to array expressions
(cherry picked from commit 56c9d7e)
2016-07-29 20:12:02 +03:00
Mikhail Glukhikh
47493c1a65 KT-12628: replace infix call supports now array accesses too
(cherry picked from commit 3d67f84)
2016-07-29 20:11:45 +03:00
Mikhail Glukhikh
c439a751ab KT-12628: new test for arg + something with nullable arg
(cherry picked from commit a7e4e2d)
2016-07-29 20:11:36 +03:00
Mikhail Glukhikh
9830140a15 Make constructor parameter a property: additional test for private property in superclass
(cherry picked from commit dd30bd5)
2016-07-29 20:11:27 +03:00
Mikhail Glukhikh
838cfc7dca Make constructor parameter a property: select 'private' to be able to remove it #KT-13187 Fixed
(cherry picked from commit dc8c195)
2016-07-29 20:11:18 +03:00
Mikhail Glukhikh
0278a6c8a4 Make constructor parameter a property: message shortened a bit
(cherry picked from commit 1938909)
2016-07-29 20:11:09 +03:00
Alexey Tsvetkov
e51f2457bf Add additional java source dir to source set in android test 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
ef70814f60 Refactoring: extract function to map classpath 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
2cae5f01cf Move call to kotlinTask.source to doTargetSpecificProcessing 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
ad1340caf3 Refactoring: move mapKotlinTaskProperties call to createKotlinJVMTask 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
048982cf36 Refactor classpath handling in KotlinCompile
#KT-13234 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
815e297328 Add test for code using internal compiled incrementally
The issue was fixed during refactoring

    #KT-12923 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
2e3b3da029 Track changes in generated source files
#KT-12962 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
7fe29a7e55 Refactoring: simplify source roots search 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
b13e1b451d Refactoring: use convention mapping for configuring classpath of kotlin tasks
#KT-12658 fixed
    #KT-12750 fixed
2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
d55a8f8054 Refactor source configuration for android 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
d36de54aa9 Minor: cleanup 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
d376e76e75 Refactoring: set task properties directly 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
54659fcacf Refactoring: remove extra property to pass stubs directory 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
92af1e9454 Refactoring: do not use extraProperties to pass kapt options to task 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
c838eed6a3 Refactoring: remove reflection calls 2016-07-29 17:56:30 +03:00
Alexey Tsvetkov
f297de401c Refactoring: remove remainings of custom classloader in gradle plugin 2016-07-29 17:56:30 +03:00
Stanislav Erokhin
aa91b5a1b0 KT-13264 IAE: Argument for @NotNull parameter 'errorClass' createErrorTypeConstructorWithCustomDebugName must not be null
#KT-13264 Fixed
2016-07-29 17:53:12 +03:00
Stanislav Erokhin
19e4dbc37c Refactoring. Move functionTypeResolveUtils.kt to resolution module. 2016-07-29 17:53:11 +03:00
Stanislav Erokhin
df461d6e7f Refactoring. Remove supertype TowerContext from class InvokeTowerContext. 2016-07-29 17:53:11 +03:00
Stanislav Erokhin
2c2f105c5d Do not add receiver for function expression by expected type. 2016-07-29 17:53:10 +03:00
Dmitry Petrov
2b63c6a2d5 Merge branch 'typealias_completion' of https://github.com/cypressious/kotlin into cypressious-typealias_completion 2016-07-28 18:07:43 +03:00
Pavel V. Talanov
3bb1ce7e1d Sync code in 'idea-ultimate' 2016-07-28 18:01:01 +03:00
Pavel V. Talanov
7273ef2754 Fix test data 2016-07-28 18:01:00 +03:00
Pavel V. Talanov
5600433baf KtLightClassForSourceDeclaration.create(): check for enum entry earlier 2016-07-28 18:00:59 +03:00
Pavel V. Talanov
82a2b94490 LightClassDataProvider: FqName calculation is redundant now 2016-07-28 18:00:58 +03:00
Pavel V. Talanov
ae0d450acf Light class test for classes with dollars in name 2016-07-28 18:00:58 +03:00
Pavel V. Talanov
e51957a431 PsiChecker test for classes with dollars in name 2016-07-28 18:00:57 +03:00
Pavel V. Talanov
4ee0f7052f StubClassBuilder: correctly calculate short name when building delegates for light classes 2016-07-28 18:00:56 +03:00
Pavel V. Talanov
c85ddc3da2 Do not build light classes for scripts
Supports old behaviour
2016-07-28 18:00:55 +03:00
Pavel V. Talanov
913a1baf56 FqName is not required to create source light classes 2016-07-28 18:00:54 +03:00
Pavel V. Talanov
5a1a1fc03a Drop KtLightClass#getFqName() and some usages of classFqName in KtLightClassForDecompiledDeclaration 2016-07-28 18:00:53 +03:00
Pavel V. Talanov
1fda24fbbf Local classes do not have qualified names
Mirros java psi
2016-07-28 18:00:52 +03:00
Pavel V. Talanov
85fb16ef1b Refactor: restructure light class hierarchy for sources
KtLightClassBase
	| KtLightClassForSourceDeclaration
		| KtLightClassImpl (new!) // top level or inner/nested of top level class
		| KtLightClassForInterfaceDefaultImpls
		| KtLightClassForLocalDeclaration (new!)
			| KtLightClassForAnonymousDeclaration
				| KtLightClassForEnumEntry
2016-07-28 18:00:52 +03:00
Pavel V. Talanov
252235787d Refactor: rename KtWrappingLightClass -> KtLightClassBase 2016-07-28 18:00:51 +03:00
Pavel V. Talanov
999c8e7486 Refactor: rename KtLightClassForExplicitDeclaration -> KtLightClassForSourceDeclaration 2016-07-28 18:00:50 +03:00
Pavel V. Talanov
b686b37cbf Refactor: move KotlinCodeBlockModificationListener to 'idea-analysis' module 2016-07-28 18:00:49 +03:00
Pavel V. Talanov
0294551433 Refactor: move OldPackageFacadeClassUtils to 'frontend.jvm' module 2016-07-28 18:00:48 +03:00
Pavel V. Talanov
cdbd7fbab0 Refactor: split classes in 'asJava' package into several subpackages to reflect their structure 2016-07-28 18:00:47 +03:00
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
Kirill Rakhman
f378089b96 Fix Completion: keyword 'typealias' is not suggested
Fixes #KT-13242
2016-07-27 19:02:08 +02: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
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
Alexander Udalov
b6b2303aa7 Improve error message for inaccessible invisible_fake members
#KT-8989 Fixed
2016-07-22 18:13:40 +03:00
Alexander Udalov
a92f0a0446 Do not report "reflection is not available" on built-in sources 2016-07-22 18:13:39 +03:00
Alexander Udalov
9be219b69c Check presence of dispatch receiver parameter in modifier checks
Also fix typo in "inapplicable infix" diagnostic message
2016-07-22 18:13:39 +03:00
Alexander Udalov
2a390155a9 Fix quotes in diagnostic messages
See 8316953259
2016-07-22 18:13:38 +03:00
Kirill Rakhman
5948b69679 AddConstModifierIntention: handle more edge cases #KT-13173 Fixed
(cherry picked from commit 4755596)
2016-07-22 18:07:14 +03:00
Nikolay Krasko
adbb07f30b Do not fail on adding sources to libraries that can't be recognized (EA-73238)
It's valid situation when user in Gradle project had created ordinal Java module and wants to configure
it with Kotlin. We should add Gradle library to dependency but there's no need to configure sources for it.
2016-07-22 15:21:27 +03:00
Nikolay Krasko
0f4319de8e Minor: fix warning 2016-07-22 15:21:27 +03:00
Nikolay Krasko
95d0604339 Evaluate getting text under read action (EA-82155, EA-82587) 2016-07-22 15:21:27 +03:00
Nikolay Krasko
3d0cfdf585 Don't fail if there's no modules in combobox with unconfigured modules (EA-76203)
Confirmed reproduction steps:
1. Open Kotlin gradle project (or do the sync) - it will be considered unconfigured until synchronisation is finished
2. Click configure and see Choose Configuration popup
3. Wait sync is finished
4. Click proposed configurator in popup

As all projects are considered configured now, single module selection will be empty
2016-07-22 15:21:27 +03:00
Alexander Udalov
0dd71cc0c0 Minor, add test on bound reference to enum entry member 2016-07-22 11:05:19 +03:00
Alexander Udalov
9ab8da2ef9 Fix type of reference to protected var
#KT-12982 Fixed
2016-07-22 11:05:19 +03:00
Alexander Udalov
6baf3ae737 Minor, inline LexicalScope.Companion.empty 2016-07-22 11:05:19 +03:00
Alexander Udalov
969ff43152 Merge CallableReferencesResolutionUtils.kt into DoubleColonExpressionResolver 2016-07-22 11:05:19 +03:00
Alexander Udalov
2fcd4e955a Simplify code in callable reference resolution 2016-07-22 11:05:19 +03:00
Alexander Udalov
00f1415ed7 Fix "rewrite at slice LEXICAL_SCOPE" during callable reference resolution
Following the TODO in CallableReferencesResolutionUtils.kt, delete the
suspicious scope and use the new resolution process with the qualifier which
was obtained after the resolution of LHS. However, by default the tower
resolution algorithm also considers each qualifier as a class value as well,
which would be wrong here because resolution of LHS as a "value" happens
earlier in DoubleColonExpressionResolver and with slightly different rules. To
avoid that, do not mix in the "explicit receiver" scope tower processor when
creating processors for callable reference resolution.

Also delete unused functions and classes related to deleted scope, refactor
Scopes.kt

 #KT-8596 Fixed
2016-07-22 11:05:19 +03:00
Alexander Udalov
7b59864ed9 Refine double colon LHS resolution if expression is an object 2016-07-22 11:05:19 +03:00
Alexander Udalov
5a6237b357 Refactor resolution of double colon expression LHS
Try resolving the LHS only when it looks (PSI-wise) like it could represent a
type element. This, for example, allows "illegal selector" error to be reported
on weird expressions like '""?.""::class'.

Also remove expression text from the "illegal selector" diagnostic, it's not
needed and can screw up the error message if the text is too big
2016-07-22 11:05:19 +03:00
Mikhail Glukhikh
5a2f34b351 Deduct x != null from x?.y is NotNullType 2016-07-21 21:15:34 +03:00
Mikhail Glukhikh
90c6868f9b renderDataFlowValue() moved to test from completion 2016-07-21 21:15:31 +03:00
Mikhail Glukhikh
edeef90c4b Minor improvements in DataFlowValue / IdentifierInfo 2016-07-21 21:15:27 +03:00
Mikhail Glukhikh
11f50186fa x?.y != null and x?.call() != null provoke now x != null, a set of tests #KT-2127 Fixed 2016-07-21 21:15:19 +03:00
Mikhail Glukhikh
9001b9bcc0 DataFlowValue & DataFlowValueFactory major refactoring, get rid of DataFlowValue.id : Any?
Instead, DataFlowValue now requires IdentifierInfo implementation to be created
DataFlowValue is compared using IdentifierInfo
2016-07-21 21:15:05 +03:00
Mikhail Glukhikh
7f9b9ddb45 DataFlowValueFactory: converted to Kotlin 2016-07-21 20:19:44 +03:00
Mikhail Glukhikh
b1a2a0723c DataFlowValueFactory.java --> DataFlowValueFactory.kt 2016-07-21 20:19:41 +03:00
Mikhail Glukhikh
17a2a971c4 A pair of "Suppress" changed from CAST_NEVER_SUCCEEDS to UNCHECKED_CAST
(cherry picked from commit 2ac8a66)
2016-07-21 20:16:15 +03:00
Mikhail Glukhikh
dbbc4ec281 Array<Subtype> can be now cast to Array<Supertype(?)> without CAST_NEVER_SUCCEEDS #KT-6391 Fixed
(cherry picked from commit 2629d55)
2016-07-21 20:16:06 +03:00
Mikhail Glukhikh
90e5e561e3 KT-6391: Arrays with same erased types counted as cast-compatible now
(cherry picked from commit 9e6f4bf)
2016-07-21 20:15:55 +03:00
Mikhail Glukhikh
82e69d9587 Remove setter parameter type inspection #KT-5771 Fixed
(cherry picked from commit 731a670)
2016-07-21 20:15:44 +03:00
Michael Bogdanov
1d5924d236 'superConstructorCall' test folder moved under 'innerNested' 2016-07-21 19:10:42 +03:00
Michael Bogdanov
55382ba848 Removed obsolete code in 'lookupConstructorExpressionsInClosureIfPresent' method 2016-07-21 19:10:42 +03:00
Michael Bogdanov
5dca4dbc67 Fix for KT-11833: Error generating constructors of class null with kind IMPLEMENTATION on anonymous object inheriting from nested class of super class
#KT-11833 Fixed
2016-07-21 19:10:42 +03:00
Stanislav Erokhin
6556cde329 Introduce new type checker. 2016-07-21 16:07:16 +03:00
Stanislav Erokhin
d4d98c87ee Minor. fixed equals for TypeProjection.
Note: unclear where this equals is used.
2016-07-21 16:07:15 +03:00
Stanislav Erokhin
663752f086 Create error supertype instead of non-checked supertypes to avoid cyclic hierarchy in subtyping. 2016-07-21 16:07:15 +03:00
Stanislav Erokhin
ebe9e6db37 Type constructors with different counts of type parameters are not equal from now. 2016-07-21 16:07:14 +03:00
Stanislav Erokhin
8193032ffb Refactoring. Separate KotlinTypeChecker to interface & Impl class. 2016-07-21 16:07:14 +03:00
Alexander Udalov
2c08796c45 Report ABI version incompatibility error always, not only if there are other errors
This is a radical but likely temporary measure to forbid the current compiler
from compiling code against binaries compiled by newer compilers

Cherry picked from commit 149a4eddff and commit
285b20e3ff
2016-07-21 15:03:52 +03:00
Alexey Tsvetkov
ddc9369299 Update changelog for 1.0.4 2016-07-21 15:02:10 +03:00
Alexey Tsvetkov
5e4724a3b5 Update changelog for 1.0.4 2016-07-20 22:44:13 +03:00
Alexey Sedunov
e232905614 Fix compilation 2016-07-20 17:01:07 +03:00
Michael Bogdanov
6da97027cc 'getSuperCallLabelTarget' refactoring 2016-07-20 16:50:50 +03:00
Michael Bogdanov
6f41e3b462 Fix for KT-11634: UOE in ConstructorContext.getOuterExpression for super call in delegation
#KT-11634 Fixed
2016-07-20 16:50:49 +03:00
Alexey Sedunov
ae06f01c95 Create from Usage: Approximate unresolvable types
#KT-7722 Fixed
(cherry picked from commit 917cd22)
2016-07-20 16:36:12 +03:00
Alexey Sedunov
a1e86e8bfa Create from Usage: Show target class name in the text of "Create member" quick fix
(cherry picked from commit a51d3fc)
2016-07-20 15:39:19 +03:00
Alexey Sedunov
82bdd1e42b Minor: Convert CallablePlacement to sealed class
(cherry picked from commit 47073b5)
2016-07-20 15:39:16 +03:00
Alexey Sedunov
e1f58c554d Rename: Fix exception on property rename preview
(cherry picked from commit 7b54ad0)
2016-07-20 15:39:15 +03:00
Alexey Sedunov
1a13c21377 Create from Usage: Show receiver type in the text of "Create extension" quick fix
(cherry picked from commit c0d5df1)
2016-07-20 15:39:13 +03:00
Alexey Sedunov
79f73d3cc2 Minor: Fix compilation
(cherry picked from commit 5397e11)
2016-07-20 15:39:11 +03:00
Alexey Sedunov
2abcd17713 Create from Usage: Support "Create member/extension" corresponding to the extension receiver of enclosing function
#KT-10668 Fixed
(cherry picked from commit bc4c013)
2016-07-20 15:39:09 +03:00
Alexey Sedunov
49b6811b44 Create from Usage: Support "Create abstract function/property" inside an abstract class
#KT-7492 Fixed
(cherry picked from commit 75f6b7f)
2016-07-20 15:39:07 +03:00
Alexey Sedunov
3ba776fffa Code Insight: Format generated declarations
#KT-11176 Fixed
(cherry picked from commit 3641ad6)
2016-07-20 15:39:05 +03:00
Alexey Sedunov
a33f946c14 Override/Implement Members: Implement Members: Fix base member detection when abstract and non-abstract members with matching signatures are inherited from an interface
#KT-11115 Fixed
(cherry picked from commit a3a2e57)
2016-07-20 15:39:01 +03:00
Alexey Sedunov
dd7bd2b869 Inline Property: Support "Do not show this dialog" and "Inline this occurrence" options
#KT-12017 Fixed
(cherry picked from commit b53d8da)
2016-07-20 15:30:14 +03:00
Alexey Sedunov
59f37a8291 Introduce Property: Do not skip outer classes if extractable expression is contained in object literal. Skip outer classes of non-inner class
#KT-12084 Fixed
(cherry picked from commit 2852f44)
2016-07-20 15:30:12 +03:00
Alexey Sedunov
00ad37b769 Introduce Property: Fix extraction of expressions referring to primary constructor parameters
#KT-12294 Fixed
(cherry picked from commit 78212a4)
2016-07-20 15:30:10 +03:00
Alexey Sedunov
c075d27731 Change Signature: Consider default value context an initial type context. Use parameter list as a type context for bodyless function
#KT-12413 Fixed
(cherry picked from commit f417b05)
2016-07-20 15:30:09 +03:00
Alexey Sedunov
57bc0d6734 Change Signature: Consider super call a by-name propagation site if either its class, or its primary constructor is a propagation target.
This fixes testJavaConstructorParameterPropagation test flickering
2016-07-20 15:30:07 +03:00
Alexey Sedunov
130e4fb745 Introduce Type Alias
#KT-12902 Fixed
2016-07-20 11:46:59 +03:00
Alexey Sedunov
ce0e5b4b46 Convert to Kotlin: AbstractParameterTablePanel.java 2016-07-20 11:46:58 +03:00
Alexey Sedunov
27773fbe99 Convert to Kotlin: AbstractParameterTablePanel.java (rename to .kt) 2016-07-20 11:46:57 +03:00
Alexey Sedunov
3d49b27269 Convert to Kotlin: ExtractFunctionParameterTablePanel.java 2016-07-20 11:46:57 +03:00
Alexey Sedunov
abe7b8c513 Convert to Kotlin: ExtractFunctionParameterTablePanel.java (rename to .kt) 2016-07-20 11:46:56 +03:00
Alexey Sedunov
6b0968c939 Refactoring: Extract AbstractParameterTablePanel class 2016-07-20 11:46:55 +03:00
Alexey Sedunov
9e339c12e9 Minor: Move and rename KotlinFunctionSignatureComponent 2016-07-20 11:46:54 +03:00
Alexey Sedunov
301f86cc96 Refactoring: Extend expression selection utilities to support KtTypeElement 2016-07-20 11:46:54 +03:00
Dmitry Jemerov
ef0318e038 more testdata updates due to default function template change 2016-07-20 10:44:54 +02:00
Valentin Kipyatkov
cc6b1faddd Minor 2016-07-19 20:35:31 +03:00
Valentin Kipyatkov
cd5ffa5895 "class" and "class.java" should be available after expression too 2016-07-19 20:35:31 +03:00
Valentin Kipyatkov
a25841e9c7 Smart completion for bound callable references 2016-07-19 20:35:31 +03:00
Valentin Kipyatkov
e05aa41bbc Completion and import popup for bound callable references 2016-07-19 20:35:31 +03:00
Dmitry Jemerov
079d857aa2 update testdata for https://github.com/JetBrains/kotlin/pull/896/ 2016-07-19 17:58:09 +02:00
Natalia Ukhorskaya
3cbe28095b Debugger: check that label for marked object is a valid java identifier (KT-12651)
#KT-12651 Fixed
2016-07-19 17:52:55 +03:00
Nikolay Krasko
5ea74ed562 Remove call invokeAndWait() under read lock in debugger (KT-13037)
Call to invokeAndWait() in dispatch thread or in situation when read lock isn't held left untouched. Can't remove invokeAndWait() completely because without the
progress bar idea looks to be stacked on debugger start because of long search for inline functions usages (searching for breakpoints places).

 #KT-13037 Fixed
2016-07-19 17:52:55 +03:00
Laszlo Hornyak
fafbbf697d new function body changed to call the shorter TODO() function (#896)
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2016-07-19 17:09:05 +03:00
Alexey Sedunov
ccfca0e3dd Inline Type Alias
#KT-12903 Fixed
2016-07-19 15:44:35 +03:00
Alexey Sedunov
7773a1c4e0 Inline Variable/Property: Move test data 2016-07-19 15:42:15 +03:00
Mikhail Glukhikh
8bdc88f763 Grammar: obsolete 'annotationEntry' changed to 'unescapedAnnotation' in a few places
(cherry picked from commit d9818bd)
2016-07-19 15:09:17 +03:00
Mikhail Glukhikh
75832f9d80 Grammar: obsolete 'package' element removed #KT-8429 Fixed
(cherry picked from commit 7bdf556)
2016-07-19 15:09:08 +03:00
Mikhail Glukhikh
23ae042154 A set of soft modifiers added to grammar #KT-13143 Fixed
(cherry picked from commit 904a18c)
2016-07-19 15:08:58 +03:00
Dmitry Jemerov
3ad6daea6c fix muted test KotlinFindUsagesWithLibraryTestGenerated$KotlinLibrary.testLibraryCompanionObjectUsages 2016-07-19 13:25:58 +02:00
Dmitry Jemerov
dc0020b666 in REPL tests, wait for process destroyed handler to fire after destroying process and before performing the rest of dispose 2016-07-19 13:24:56 +02:00
Dmitry Jemerov
30f00bb618 fix muted test MultiFileIntentionTestGenerated.testImplementAbstractMember_implementVarInJava_ImplementAllInJava: apply intention in deterministic order, remove trailing space in expected output file 2016-07-19 11:17:48 +02:00
Dmitry Jemerov
9100ca8837 fix testdata for muted test IntentionTestGenerated$ReplaceItWithExplicitFunctionLiteralParam.testApplicable_nestedFunctionWithIt 2016-07-19 11:17:03 +02:00
Mikhail Glukhikh
785d04708a Merge pull request #899 from cypressious/wrong_long_suffix
Implement quickfix for wrong long suffix
2016-07-19 09:46:51 +03:00
Kirill
b9d235dec8 Implement quickfix for wrong long suffix
Fixes: KT-13134
2016-07-18 22:49:22 +02:00
Alexey Andreev
df05b20bc6 JS: in tests add verifier that checks whether no expression statements with only null expression exist 2016-07-18 19:26:50 +03:00
Alexey Andreev
a27f5c8fee JS: add TranslationContext.cacheExpressionIfNeeded and use it where possible 2016-07-18 19:26:50 +03:00
Alexey Andreev
b5f9287bfa JS: add tests for support of 'for' statement in TemporaryAssignmentElimination 2016-07-18 19:26:49 +03:00
Alexey Andreev
f8b96a1c62 JS: add tests to prove that KT-8003, KT-8318 and KT-12157 are no longer reproducible 2016-07-18 19:26:49 +03:00
Alexey Andreev
9cb6b22d62 JS: minor code style and formatting fixes 2016-07-18 19:26:48 +03:00
Alexey Andreev
9fcad45edb JS: refactor generation of temporary variables 2016-07-18 19:26:48 +03:00
Alexey Andreev
9edb9fabe5 JS: get rid of JsEmptyExpression, use JsLiteral.NULL instead, rely on optimizer to remove redundant code 2016-07-18 19:26:47 +03:00
Alexey Andreev
fe5a7aaf46 JS: during translation of expression mark assignment to temporary variables as synthetic statement.
This helps optimizer to find and eliminate temporary variables.
2016-07-18 19:26:47 +03:00
Dmitry Jemerov
82babaff7e to reduce VM contention between JVM with tests and JVM with Ant, run Ant with -Xmx128m 2016-07-18 16:56:46 +02:00
Dmitry Jemerov
5224ad7ff2 to ensure that JNA uses the DLL version from the jar and not an incompatible version that happens to be available on the machine running the tests, run tests with -Djna.nosys option 2016-07-18 16:54:39 +02:00
Dmitry Jemerov
b315a07f0d delete work dir after each JPS test 2016-07-18 16:52:16 +02:00
Mikhail Glukhikh
9df96bdd26 KotlinJUnitStaticEntryPoint.wasSelected made public field #KT-13114 Fixed
(cherry picked from commit 5cafae5)
2016-07-18 17:10:41 +03:00
Mikhail Glukhikh
a3b52fd8a6 Lambda to callable reference: inspection is optional depending on text length
(cherry picked from commit ce0c43c)
2016-07-18 17:10:31 +03:00
Mikhail Glukhikh
220141ab2b Convert lambda to callable reference intention / inspection #KT-10903 Fixed
(cherry picked from commit b620099)
2016-07-18 17:10:15 +03:00
Denis Zharkov
b5bdb070a0 Fix test data after 4725dd3 2016-07-16 09:10:35 +03:00
Denis Zharkov
3b0131fd04 Fix ConvertTextJavaCopyPasteProcessor after 4725dd3
In cases like 'fun foo() = \n fun dummy(){}'
declaration on the next line is parsed as top-level declaration.

But ConvertTextJavaCopyPasteProcessor expects that 'fun dummy(){}'
would be a part of an expression body, so we replace "\n" with " "
to turn off recovery in the case

See TextJavaToKotlinCopyPasteConversionTestGenerated.testAsExpressionBody
2016-07-16 09:10:00 +03:00
Denis Zharkov
2f2b1a7f80 Minor. Drop unused method 2016-07-15 18:59:33 +03:00
Denis Zharkov
4725dd3028 Implement recovery for incomplete expression before declaration
It's needed when declarations are parsed as a part of previous expression
(see tests)

Currently we apply this kind of recovery in a conservative way,
only when declaration starts at the next line, and while
the condition could be relaxed, there's no need to do this

 #KT-4948 Fixed
 #KT-7118 Fixed
2016-07-15 18:59:31 +03:00
Denis Zharkov
06a659e6e7 Minor. Invert boolean parameter meaning
It looks much more sensible to me
2016-07-15 18:27:01 +03:00
Denis Zharkov
fcb870a303 Add EOL to EXPRESSION_FOLLOW recovery set
This change is used in further commits, but it's extracted
to emphasize that testData modifications are caused by this.
2016-07-15 18:27:00 +03:00
Dmitry Jemerov
e224041760 show line markers for properties defined in the primary constructor (KT-12626) 2016-07-14 23:32:07 +02:00
Dmitry Jemerov
4391d833b9 do not reenter indices to avoid deadlock
#KT-12718 Fixed
2016-07-14 23:32:05 +02:00
Dmitry Jemerov
5380b63522 don't consider calls to methods with the same name as a property to be calls to accessors of that property
#KT-12813 Fixed
2016-07-14 23:32:04 +02:00
Dmitry Jemerov
14037f099c correctly find usages of overridden Java method through synthetic accessors
#KT-12869 Fixed
2016-07-14 23:32:02 +02:00
Alexey Andreev
e2b836db09 JS: refactor TemporaryVariableElimination 2016-07-14 18:00:34 +03:00
Alexey Tsvetkov
941437a9a2 Correct test case for KT-12776
After minifying test, it stopped failing without fix
2016-07-14 16:48:30 +03:00
Alexey Tsvetkov
58e13ddf54 Do not force dependency resolution when configuring kapt with stabs
#KT-12776 fixed
2016-07-14 16:15:19 +03:00
Ilya Gorbunov
a66fc90434 Minor: exclude directory with the generated stdlib documentation 2016-07-13 20:40:01 +03:00
Ilya Gorbunov
d55b2cd00d Docs: include JRE7/8-specific sources into the documentation. 2016-07-13 20:39:59 +03:00
Ilya Gorbunov
e9ccc480b0 Docs: improve docs for Closeable.use and AutoCloseable.use 2016-07-13 20:39:54 +03:00
Dmitry Jemerov
b09fc7c146 Kotlin JUnit run configuration producer needs to take precedence over IDEA's PatternConfigurationProducer
#KT-13084 Fixed
2016-07-13 15:48:21 +02:00
Dmitry Jemerov
e66e292052 add alternate path to common.jar dependency to work around the fact that it's no longer shipped in plugins/android/lib since AS 2.2 preview 2016-07-13 13:41:05 +02:00
Dmitry Jemerov
5201fc171b ClsWrapperStubPsiFactory can be a singleton 2016-07-13 13:16:15 +02:00
Alexander Udalov
87387d030f Minor, fix yellow code in OverrideResolver and OverridingUtil 2016-07-13 13:42:46 +03:00
Alexander Udalov
8f33830f29 Suppress UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS in several places
This is related to KT-6611 being fixed recently. Note that not all cases of
incorrect "cast never succeeds" were fixed
2016-07-13 13:42:42 +03:00
Alexander Udalov
13b0fda3c2 Fix AssertionError in DescriptorResolver#checkBounds
#KT-9620 Fixed
2016-07-13 13:42:39 +03:00
Denis Zharkov
b777b081b7 Increase SOURCE_STUB_VERSION and BINARY_STUB_VERSION in 1.1 on 50
Mostly because of type aliases and coroutines related changes

The reason why not just +1 is to avoid clashes between 1.0.x and 1.1
in cases when version must be increased in both branches
2016-07-13 13:19:11 +03:00
Denis Zharkov
bef7d5da2f Increase SOURCE_STUB_VERSION
It's necessary because of changes in parser
(mostly recovery f1026935a0)
2016-07-13 13:14:57 +03:00
shiraji
113ab7640e Implement inspection to remove @ from annotation argument #KT-9228 Fixed
(cherry picked from commit 543c6bc)
2016-07-13 13:11:43 +03:00
Dmitry Jemerov
c80e094967 specify FQ names for collection types as well 2016-07-12 17:34:09 +02:00
Denis Zharkov
d88fc864e4 Revert "Use weak-reference based SLRU cache for module resolvers"
This reverts commit 28e33aaf56.

Reverting is necessary because this change leads to complicated
exceptions, while it's usefulness is not that obvious.

 #EA-82372 Fixed
2016-07-12 17:54:49 +03:00
Mikhail Glukhikh
39ffb68cc6 KT-12942 related: remove braces now does not work for if inside if
(cherry picked from commit c1faed5)
2016-07-12 17:27:19 +03:00
Mikhail Glukhikh
3fe114fc24 When to if now add braces for if branches inside #KT-12942 Fixed
(cherry picked from commit 29a7bfe)
2016-07-12 17:27:03 +03:00
Mikhail Glukhikh
b675b49daf Specify type explicitly: do not consider star projection arguments in KotlinType.isFlexibleRecursive() #KT-13055 Fixed
(cherry picked from commit 828f4bf)
2016-07-12 17:26:50 +03:00
Mikhail Glukhikh
51ccfc120e Can be primary constructor property: check whether property belongs to the same class #KT-12876 Fixed
(cherry picked from commit eb05a7a)
2016-07-12 17:26:39 +03:00
Dmitry Jemerov
e492d23d58 more sensible docs for @MustBeDocumented 2016-07-12 16:23:58 +02:00
Dmitry Jemerov
ccbc19f7e9 fix qualified links in Module.md
#KT-11373 Fixed
2016-07-12 16:23:58 +02:00
Denis Zharkov
3845ea863c Do not generate DefaultImpl method for MutableMap.remove(K;V)Z
#KT-13069 Fixed
2016-07-12 16:27:48 +03:00
Denis Zharkov
2d42ba23b3 Minor. Replace TraitImpl -> DefaultImpls, Trait -> Interface
There are still a lot of trait word entries in the source code,
only some of them got replaced here
2016-07-12 16:27:48 +03:00
Nikolay Krasko
57ef3f5656 Generate linenumber for goto instruction in while (KT-13059)
Otherwise linenumber for previous instruction will be used in debugger. That can lead to error stepping
because it might be line that isn't reachable on current iteration.

 #KT-13059 Fixed
2016-07-12 15:19:02 +03:00
Nikolay Krasko
ce74d6c7df Refactoring: invert if 2016-07-12 15:19:00 +03:00
Ilya Chernikov
ee2c5c1b73 minor: Make script dependencies classpath processing more robust 2016-07-12 13:21:11 +02:00
Denis Zharkov
9fd78ac1ff Temporary disable reflection test on Android 2016-07-12 12:52:03 +03:00
Denis Zharkov
18c2d3070d Refine variables liveness analysis
Do not treat var as alive just because current instruction belongs to an item range
in local variables table, but the item has different sort of type

As liveness analysis is mostly used in coroutines spilling,
not applying this change may lead that to problems on Android (see tests)
2016-07-12 12:52:03 +03:00
Nikolay Krasko
434a84eab6 Disable local mirrors for public teamcity 2016-07-12 12:16:39 +03:00
Nikolay Krasko
6b10a9d94e Tests for Gradle inspections with configured Gradle project 2016-07-12 12:16:38 +03:00
Nikolay Krasko
585c8eea0b Warn about using different versions of Kotlin plugin and standard library in Gradle (KT-12730)
#KT-12730 Fixed
2016-07-12 12:16:35 +03:00
Nikolay Krasko
5246b8a926 Fix getting external path for retrieving gradle model 2016-07-12 12:14:25 +03:00
Nikolay Krasko
9b1eb0931f Refactoring: extract method for getting Kotlin plugin version and remove findAllRecursively usage 2016-07-12 12:14:24 +03:00
Nikolay Krasko
8852c8812b Use internalName for compare with module name 2016-07-12 12:14:23 +03:00
Pavel V. Talanov
ae5659538b Increase BINARY_STUB_VERSION
Should have been done after earlier changes: 022ef6410d
2016-07-11 19:07:19 +03:00
Pavel V. Talanov
254ab72eb5 Put all stub versions into one place, explain their meaning 2016-07-11 19:07:16 +03:00
Pavel V. Talanov
00afc1dbf2 update ChangeLog for 1.0.3 2016-07-11 19:07:14 +03:00
Nikolay Krasko
0b5786b9e8 Fix LocalVarShadowingMemberProperty test by renaming test files 2016-07-11 13:52:37 +03:00
Nikolay Krasko
b0226fd91c Fix bad refactoring 2016-07-11 13:52:15 +03:00
Nikolay Krasko
74877d2fa9 Minor: add some comments after review 2016-07-11 13:52:14 +03:00
Nikolay Krasko
6fbcb6448d Support multi-module environment in DifferentKotlinGradleVersionInspection 2016-07-11 13:52:13 +03:00
Nikolay Krasko
e6c05aa92d Make DifferentKotlinGradleVersionInspection inpection work for classpath call with braces 2016-07-11 13:52:12 +03:00
Nikolay Krasko
b04ed12ee1 Update description in DifferentKotlinMavenVersionInspection 2016-07-11 13:52:11 +03:00
Nikolay Krasko
feea1f554a Refactoring: extract strings 2016-07-11 13:52:11 +03:00
Nikolay Krasko
8acb96fb4d Fallback to properly resolved version if heuristic doesn't work in DifferentKotlinGradleVersionInspection 2016-07-11 13:52:10 +03:00
Nikolay Krasko
620ddcd63a Add inspection that warns if Gradle plugin version differs from the one in IDE (KT-12730)
#KT-12730 Fixed
2016-07-11 13:52:06 +03:00
Denis Zharkov
7a9af072b4 Fix ClassCastException when data object is being analyzed
#KT-12687 Fixed
2016-07-10 15:04:32 +03:00
Michael Bogdanov
23a0e19620 Fix for KT-13040: Invalid bytecode generated for extension lambda invocation with safe call
#KT-13040 Fixed
2016-07-09 14:55:49 +03:00
Michael Bogdanov
93f6761671 Print bytecode on linenumber test fail 2016-07-09 07:45:57 +03:00
Michael Bogdanov
486aa5675f Fix for KT-12908: Variable initialization in loop causes VerifyError bad local variable type
#KT-12908 Fixed
2016-07-09 07:45:57 +03:00
Dmitry Jemerov
00d651711a fix incompatibility with ASM 6: don't call getReturnType() on a type which is not a method type (IDEA-158090) 2016-07-08 17:17:45 +02:00
Denis Zharkov
3aa1a56cb9 Extend recovery set when expecting property accessor
#KT-12987 Fixed
2016-07-08 16:06:47 +03:00
Denis Zharkov
f1026935a0 Add recovery for properties without name
If property name is parsed on the next line and declaration is invalid
(no receiver/type/initializer), treat that name as it does not belong to property

 #KT-12987 In Progress
2016-07-08 16:06:47 +03:00
Denis Zharkov
141db1809f Minor. Drop redundant AnnotationParsingMode 2016-07-08 16:06:47 +03:00
Denis Zharkov
36a7f31358 Minor. Extract parsePropertyDelegateOrAssignment 2016-07-08 16:06:47 +03:00
Denis Zharkov
4981b730ef Minor. Cleanup KotlinParsing
- Remove unused field and commented code
- Add some comments
- jet -> kotlin
2016-07-08 16:06:47 +03:00
Denis Zharkov
bed6e312ae Minor. Drop unreachable conditional branch
- allowShortAnnotations is true only for IN_ANNOTATION_LIST
- when starting parsing of annotation list we can't come to modifier list
(see the only usage of IN_ANNOTATION_LIST)
2016-07-08 16:06:47 +03:00
Denis Zharkov
46f11a5ec4 Add val/var tokens in parameter name recovery set
Recovery after val/var everywhere beside value parameters works
properly without this change

 #KT-7915 Fixed
2016-07-08 16:06:47 +03:00
Dmitry Petrov
b0edec8449 KT-13023 Char operations throw ClassCastException for boxed Chars
Char is not a Number, so we can't use the same coercion strategy for Char members,
since it doesn't work for boxed Chars.
2016-07-08 10:26:04 +03:00
Dmitry Petrov
2ccb0caa6c Minor: fix NPE in CallableMethod.toString for methods of primitive types 2016-07-08 10:26:04 +03:00
Dmitry Jemerov
dec2f982ee add test for resolving links to library classes from KDoc comments 2016-07-07 19:28:59 +02:00
Dmitry Jemerov
80e10c6928 use navigation element to resolve KDoc links, so that we have correct context when resolving links in the documentation of library elements
#KT-10654 Fixed
2016-07-07 19:28:31 +02:00
Dmitry Jemerov
fac1b85d26 use a better API for locating target element when navigating by documentation link, to ensure we find the source for descriptors belonging to library classes
#KT-12932 Fixed
2016-07-07 19:27:53 +02:00
Dmitry Jemerov
88fe6680fa use QualifiedNameResolver for resolving links in KDoc
#KT-10398 Fixed
2016-07-07 19:27:45 +02:00
Dmitry Jemerov
60523fb93f avoid NPE when trying to create a file that already exists
#KT-12655 FIxed
2016-07-07 18:01:43 +02:00
Dmitry Jemerov
972ebd5fec check that main() returns Unit
#KT-12760 Fixed
2016-07-07 18:01:42 +02:00
Dmitry Jemerov
30d721c458 MainFunctionDetector: cleanup after J2K 2016-07-07 18:01:41 +02:00
Dmitry Jemerov
b58c659e46 MainFunctionDetector: J2K 2016-07-07 18:01:40 +02:00
Dmitry Jemerov
b9a9f2504d MainFunctionDetector: rename to .kt 2016-07-07 18:01:40 +02:00
Dmitry Jemerov
193a404c07 to restore pre-1.0.3 highlighting behavior, inherit "extension function" and "extension property" colors from "static method" and "static field"
#KT-12937 Fixed
2016-07-07 18:01:39 +02:00
Dmitry Jemerov
216d548e98 fix rendering of code blocks escaped with multiple backticks or containing backslashes
#KT-12998 Fixed
 #KT-12999 Fixed
2016-07-07 18:01:38 +02:00
Dmitry Jemerov
801a128547 don't lose ! when rendering markdown
#KT-13000 Fixed
2016-07-07 18:01:37 +02:00
Alexey Tsvetkov
621ffca194 Do not run integration tests with old gradle versions
Reason finalizedBy is not supported with gradle < 2.0
2016-07-07 15:42:01 +03:00
Alexander Udalov
720c29e8f4 Minor, fix NonExistentClass name and format 2016-07-07 13:56:01 +03:00
Alexander Udalov
ceb54492e6 Get rid of CallChecker#checkPropertyCall, create fake ResolvedCall 2016-07-07 13:55:48 +03:00
Dmitry Jemerov
623673c3df fix ASM 5 src download URL (file was removed in IDEA commit ed9c9fc) 2016-07-07 12:49:00 +02:00
Nikolay Krasko
54da3e73c0 Add description for Kotlin gradle plugin 2016-07-07 02:54:38 +03:00
Nikolay Krasko
c051bd2d2c Refactoring: better name for SameVersionInspection
It now has better suppression string
2016-07-07 02:54:37 +03:00
Nikolay Krasko
8450921b58 Refactoring: rename SameVersionIDEPluginInspection
It now has better suppression string
2016-07-07 02:54:36 +03:00
Nikolay Krasko
16b8f3fd57 Show versions that are reported different in SameVersionIDEPluginInspection 2016-07-07 02:54:28 +03:00
Nikolay Krasko
5cfebe4120 Avoid "loader constraint violation: when resolving method "ActionsKt.runReadAction()" 2016-07-07 02:51:26 +03:00
Nikolay Krasko
9f0e8ca6b0 Read test files with \r removed on Windows 2016-07-07 02:51:26 +03:00
Nikolay Krasko
2783c9bde2 Fix AbstractAnnotationProcessorBoxTest on Windows: load text without \r 2016-07-07 02:51:25 +03:00
Nikolay Krasko
dcfb5f1554 Minor: mark folder as resources not a source root 2016-07-07 02:51:24 +03:00
Alexey Tsvetkov
03b4eba4ef Remove dependency on Files from guava 2016-07-06 16:39:08 +03:00
Alexey Tsvetkov
16b1616ebc Gradle: copy kotlin classes after java compilation
#KT-9392 fixed
    #KT-12295 fixed
    #KT-12736 fixed
2016-07-06 16:38:48 +03:00
Denis Zharkov
3a59e1d222 Support suspending extension functions 2016-07-06 15:25:19 +03:00
Denis Zharkov
2cc09f928e Allow suspend extensions for specially annotated controllers 2016-07-06 15:25:19 +03:00
Denis Zharkov
30b4dfa65d Minor. Make extension's receiver to be a type parameter and simplify usage 2016-07-06 15:25:19 +03:00
Dmitry Petrov
3445fe0d30 KT-12985 Do not create range instances for 'for' loop in CharSequence.indices 2016-07-06 12:50:41 +03:00
Dmitry Petrov
3dc23a0e02 KT-12983 java.lang.VerifyError: Bad type on operand stack in arraylength
Use proper receiver value type.
2016-07-06 09:59:00 +03:00
Michael Bogdanov
6b8e8cee17 Fix for KT-12891: Allow to omit type in local delegated property declaration
#KT-12891 Fixed
2016-07-05 21:22:48 +03:00
Alexander Udalov
191dfa1f2b Minor, add test that language feature settings are used in local analysis
This test checks that the correct LanguageFeatureSettings instance (not
LanguageVersion.LATEST) is being passed to
createContainerForLazyLocalClassifierAnalyzer
2016-07-05 19:54:16 +03:00
Alexander Udalov
b557f9e712 Fix typo in inline property diagnostic message 2016-07-05 19:25:24 +03:00
Alexander Udalov
d331b6ae8e Minor, move isInfixCall implementation out of InfixCallChecker 2016-07-05 19:23:21 +03:00
Alexander Udalov
9bf91e95d0 Change default visibility for TypeAlias from 'internal' to 'public'
Since public type aliases will supposedly be more common than internal ones, it
makes sense to save on writing flags for the former rather than the latter
2016-07-05 18:18:45 +03:00
Alexander Udalov
a48e1680e9 Minor, fix typo in KParameter#isOptional kdoc 2016-07-05 18:18:44 +03:00
Alexander Udalov
3b349e9be0 Fix reflection on reference to generic property
See a93484b457 for the similar fix to function
references

 #KT-12967 Fixed
2016-07-05 18:18:43 +03:00
Alexander Udalov
48fe9fb2c0 Fix AssertionError in OverrideResolver on bad hierarchy
Previously the code was operating under the assumption that if the
implementation of some function (both the implementation and the function come
from supertypes) does not have a proper return type (the one which is a subtype
of return type of all declarations of this function in the supertypes), then
there's necessarily at least one abstract declaration of the function, such
that the implementation's return type is not a subtype of the return type of
that declaration. The assertion makes sense when the hierarchy above the
current class does not have any errors: we should report at least one function
as being "not implemented" in the current class.

However, as demonstrated by the test case, if there's an error already in the
supertypes with regard to overridability of members, this assertion may be
wrong. Reporting the "not implemented" error in such case is in fact not
necessary because of the already existing error ("return type mismatch" in the
test) in the supertypes

 #KT-12482 Fixed
2016-07-05 18:18:43 +03:00
Alexander Udalov
a533f8597d Fix debug names for some slices
Also move RUNTIME_ASSERTION_INFO and LOAD_FROM_JAVA_SIGNATURE_ERRORS to a
single class for simplicity
2016-07-05 18:18:26 +03:00
Denis Zharkov
a420fda825 Fix problem with missing handleResult call
At first we try to resolve 'handleResult' just as last expression
in a lambda is first argument, then if results are unsuccessful
try resolve 'handleResult' with fake Unit expression

 #KT-12969 Fixed
2016-07-05 15:36:06 +03:00
Denis Zharkov
888db4b3b5 Make 'controller' field package-private
To make it accessible from nested lambdas

 #KT-12974 Fixed
2016-07-05 15:36:06 +03:00
Denis Zharkov
d657bc8110 Treat any coroutine as it has non-const closure
Because it's always does capture controller
2016-07-05 15:36:06 +03:00
Denis Zharkov
df4bf61378 Refine types returned by OptimizationBasicInterpreter.newValue
#KT-12958 Fixed
2016-07-05 15:36:06 +03:00
Denis Zharkov
17a41ecc79 Revert 1431e2a0: Fix variables spilling for coroutines
Tracking variable type in table is unnecessary after variables liveness introduction:
values having types conflicting with table should be dead
2016-07-05 15:36:06 +03:00
Dmitry Jemerov
58378c074d fix compilation 2016-07-05 13:56:12 +02:00
Kirill Rakhman
79fff4aa3c Show quick doc for implicit lambda parameter 'it' (#889)
* Show quick doc for implicit lambda parameter 'it'
Fixes #KT-9271

* Remove useless code
2016-07-05 14:51:56 +03:00
Dmitry Jemerov
a770fe2ec8 fix test 2016-07-05 13:43:19 +02:00
Kirill Rakhman
b50176fa2e Implement quickfix for wrong primitive literal (#885)
* Implement quickfix for wrong primitive literal
Fixes: KT-12251

* fix style issue
2016-07-05 14:34:14 +03:00
Kirill Rakhman
3b290ce3dd Add quickfix for "Illegal usage of inline parameter" that adds noinline (#888)
Fixes #KT-12838
2016-07-05 13:13:14 +03:00
Yoshinori Isogai
68dd3dde59 Change contributing section of "this query" link to finding open Kotlin issues (#891) 2016-07-05 01:09:49 +03:00
Ilya Gorbunov
5891aa0c5e Improve Standard Library changelog for 1.1-M1 2016-07-04 21:21:25 +03:00
Valentin Kipyatkov
5e48b7349e KT-12803 Unused import when class is used in method reference
#KT-12803 Fixed
2016-07-04 20:49:40 +03:00
Valentin Kipyatkov
1941572717 KT-10433 Copy-pasting reference to companion object member causes import dialog in specific case
#KT-10433 Fixed
2016-07-04 20:49:40 +03:00
Valentin Kipyatkov
9463880c4e KT-12646 ConvertToBlockBody intention should use BodyResolveMode.PARTIAL
#KT-12646 Fixed
2016-07-04 20:49:40 +03:00
Denis Zharkov
62e69af53c Report declaration that was being analyzed when internal error happened
#KT-12188 Fixed
2016-07-04 18:16:06 +03:00
Denis Zharkov
ea7496044e Minor. Move KotlinFrontEndException to frontend module 2016-07-04 18:16:06 +03:00
Denis Zharkov
60a0cd8cfd Do not add error types as upper bounds in type parameter
#KT-10237 Fixed
 #KT-11821 Fixed
 #KT-8200 Fixed
2016-07-04 18:16:05 +03:00
Denis Zharkov
7723a3a105 Refine definition of whether single parameter the method should be boxed
Only 'Collection<Int>.remove(E): Boolean' should match
2016-07-04 15:44:00 +03:00
Denis Zharkov
adff666b0e Introduce additional overridability rule
It works only for Java methods and it's purpose is Java overridability rules emulation,
namely distinction of primitive types and their wrappers.

For example `void foo(Integer x)` should not be an override for `void foo(int x)`

 #KT-11440 Fixed
 #KT-11389 Fixed
2016-07-04 15:44:00 +03:00
Denis Zharkov
082c4f971e Minor. Extract overridability rule into separate method 2016-07-04 15:44:00 +03:00
Denis Zharkov
167882df5d Temporary return BuiltinOverridabilityCondition class
Otherwise bootstrap problems appear
2016-07-04 15:44:00 +03:00
Denis Zharkov
dc713cda2c Rename: BuiltinOverridabilityCondition -> JavaIncompatibilityRulesOverridabilityConditionBuiltinOverridabilityCondition 2016-07-04 15:44:00 +03:00
Denis Zharkov
6284598eff Minor. Fix comment 2016-07-04 15:44:00 +03:00
Alexander Udalov
b44f060ffa Do not consider fake variables for objects in :: resolution
The main change is in
NewResolutionOldInference.ResolutionKind.CallableReference, where
createVariableProcessor creates a processor which no longer lists objects

 #KT-12322 Fixed
2016-07-04 15:42:35 +03:00
Alexander Udalov
f290f1be68 Initial support of type inference for callable references
There are two main changes here:

- In CallCompleter, there was a bug: we assumed that the return type of a
  candidate must be a subtype of the expected type and were adding a
  corresponding constraint to the system. However, this is not true for
  callable references where the type of the expression is KFunctionN<...> and
  the return type of the candidate must be a subtype of the _last generic
  argument_ of the functional type.
- In CandidateResolver, we use a more correct (although still not precise)
  heuristic to determine if a candidate fits based on the non-substituted type
  of the callable reference expression which it would produce.

This can be further improved, see TODOs in CallCompleter. Also this does not
influence resolution of callable references being passed as arguments to
generic calls (that happens in GenericCandidateResolver)

 #KT-10968 Fixed
 #KT-11075 Fixed
 #KT-12286 Fixed
 #KT-12963 Open
 #KT-12964 Open
2016-07-04 15:42:35 +03:00
Alexander Udalov
24682bf1ec Fix AssertionError on property generation in multi-file classes
See 4a533168d9 for the original change which
introduced the problem

Note that the added test case _was not failing_ before the change. It's added
because there were no tests on multi-file class behavior in light classes mode
at all. The actual repro for the problem is difficult to make a test from

 #KT-12755 Fixed
2016-07-04 15:42:35 +03:00
Alexey Andreev
80deebbc2a Fix configuration of maven test of moduleKind configuration property 2016-07-04 14:56:45 +03:00
Alexey Andreev
88eef7337e KT-12928: decompose invocation like "a.foo(b)" to "$t = a; $s = $t.foo.bind($t); $s(b)" instead of "$t = a.foo; $t(b)", since in the latter case foo won't receive proper this. Add optimization that replaces "foo.bar.bind(baz)(args)" with "baz.bar(args)" 2016-07-04 14:52:12 +03:00
Dmitry Petrov
07cb3e09b9 KT-11892: explicitly qualified 'super' with a supertype that is overridden
by a different explicitly declared supertype is an error (as in Java)
(see http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.12.3)
2016-07-04 13:53:49 +03:00
Dmitry Petrov
dbf38823b9 Minor: use NoLookupLocation.WHEN_GET_SUPER_MEMBERS
for unqualified 'super' resolution
2016-07-04 13:53:49 +03:00
Dmitry Petrov
bf4f26318e KT-6916: do not create Progression instances in for-in-downTo loops 2016-07-04 13:38:37 +03:00
Dmitry Petrov
e187f799d9 Minor: extract optimized loop codegen creation logic for optimized 'for' cases.
There will be some more of those, and they all require some ad hock processing.
2016-07-04 13:38:36 +03:00
Dmitry Petrov
d45330c184 Fix CCE when typealias is used in a class reference ('TA::class') 2016-07-04 08:52:09 +03:00
Dmitry Petrov
5dfbaede4f Typealias can't be a qualifier 2016-07-04 08:30:18 +03:00
Dmitry Petrov
c8a5ccb1d0 "Go to class / symbol / super" & type aliases 2016-07-04 08:30:18 +03:00
Dmitry Petrov
0033cf85c4 Shorten references tests for typealias. 2016-07-04 08:30:18 +03:00
Dmitry Petrov
075195a3e4 Provide base icon for type alias descriptor.
Use platform icon for a class (as we do for type parameters).
2016-07-04 08:30:18 +03:00
Zalim Bashorov
48617caacc JS: generate a function with the required name for callable references instead try to change the name later. The previous solution doesn't work properly on some JS VMs (e.g. in FireFox)
#KT-12929 Fixed
2016-07-01 21:13:15 +03:00
Ilya Gorbunov
919c099a95 Minor: make test output less verbose 2016-07-01 18:50:53 +03:00
Ilya Gorbunov
157ed3f8c1 Claim a stream produced from a Sequence having ORDERED property.
Add a test verifying that property is respected.
2016-07-01 18:06:54 +03:00
Ilya Gorbunov
22ee3a8dc1 Relax type parameter constraint for Closeable.use and AutoCloseable.use to allow nullable receiver.
#KT-12894 Fixed
2016-07-01 18:05:25 +03:00
Ilya Gorbunov
e04873957e Notes in README about required environment variables to build libraries maven project. 2016-07-01 18:05:24 +03:00
Ilya Gorbunov
dd0ecb5ece Adjust exposed visibility of platform specific implementations. 2016-07-01 18:05:23 +03:00
Ilya Gorbunov
a45da393b9 Provide access to named groups of regex match result on JDK8.
#KT-12753 Fixed
2016-07-01 18:05:22 +03:00
Ilya Gorbunov
25974be3f8 Provide specialized stdlib function implementations depending on current JRE version #KT-8254 2016-07-01 18:05:21 +03:00
Ilya Gorbunov
b16f46d932 Add extensions from kotlinx.support libraries:
use for AutoCloseables: #KT-5899,
extensions for java.util.Stream.
2016-07-01 18:04:42 +03:00
Ilya Gorbunov
d6261521ff Create new artifacts for standard library extensions for JRE7 and JRE8.
Set default JDK for kotlin compiler plugin.
Set default JRE path for maven surefire plugin.
Run tests for extension modules on the corresponding JRE.
#KT-8254
2016-07-01 16:49:13 +03:00
Ilya Gorbunov
17e7c269ad Minor: make tryInlined test not depend on 'Closeable.use' implementation. 2016-07-01 04:42:38 +03:00
Stanislav Erokhin
24ad167b9d Update changelog for 1.1-M01. 2016-06-30 23:46:09 +03:00
Ilya Chernikov
3bc826a542 Update changelog - add scripting part 2016-06-30 21:32:42 +02:00
Ilya Chernikov
d345d2bc95 Reduce GradleScriptTemplateProvider dependency from gradle plugin, add missing pieses to it's environment
Fixes #KT-12913
2016-06-30 21:32:41 +02:00
Ilya Chernikov
55e084db8e Refactor script resolving interface again
- remove Future from resovler since the idea need additional considerations
- simplify script contents interface
 -extend script dependencies with additional javaHome property
2016-06-30 21:32:40 +02:00
Ilya Chernikov
dfec16d8e0 Refactor script resolving interface
- return Future from resovler
- pack script contents data to a separate interface
 -extend script dependencies with additional scripts property
 - minor renames and moves
2016-06-30 21:32:39 +02:00
Ilya Chernikov
4cd8101bad minor: rename depends annotation in script tests, add it to implicit imports 2016-06-30 21:32:38 +02:00
Ilya Chernikov
2ca4d635ea Support backward compatibility with gradle-script-kotlin 0.2.0, some refactoring 2016-06-30 21:32:37 +02:00
Alexander Udalov
1690dcd8df Refactor FakeCallResolver and usages
Remove useless overload, inline another to the single usage in tests, make some
parameters non-null
2016-06-30 21:29:23 +03:00
Alexander Udalov
95ed3ed78b Minor, remove unused components in ForLoopConventionsChecker
This is an addition to 8357f30
2016-06-30 21:29:23 +03:00
Denis Zharkov
1c3db309e5 Support repeated 'invoke' calls on coroutines defined within inline lambdas
#KT-12782 Fixed
2016-06-30 20:22:39 +03:00
Denis Zharkov
ae46c726fc Add try/catch block around method transformations 2016-06-30 20:22:39 +03:00
Denis Zharkov
c2ac49ec96 Support repeated 'invoke' calls on coroutines
#KT-12782 In Progress
2016-06-30 20:22:39 +03:00
Denis Zharkov
a25602c709 Fix spilling algorithm for double-sized coroutine parameters 2016-06-30 20:22:39 +03:00
Denis Zharkov
84964a76f9 Move generation of coroutines 'invoke' after 'doResume'
It's necessary because in next commits 'invoke' will depend on captured variables
that are being calculated during 'doResume' calculation
2016-06-30 20:22:39 +03:00
Alexey Tsvetkov
d3461d1519 Fix shading of META-INF/services in kotlin-compiler-embaddable 2016-06-30 20:14:21 +03:00
Denis Zharkov
9efd50c49c Minor. Cleanup getSpecialBridgeSignatureIfExists 2016-06-30 20:13:07 +03:00
Denis Zharkov
bb537aa834 Simplify method contract and add assertion
We don't generate stubs for final built-ins anyway
(as well as special bridges)
2016-06-30 20:12:34 +03:00
Denis Zharkov
84eb009c29 Refine stubs generation for special built-ins
Do not generate stub if declaration has the same signature

 #KT-12909 Fixed
2016-06-30 20:12:34 +03:00
Denis Zharkov
5c34b27ea9 Fix stub generation for special built-ins
Do not generate stubs if there is no special bridge in the current class
- there are already Kotlin super class in hierarchy
- special bridge has the same signature as method itself

 #KT-11915 Fixed
2016-06-30 20:12:34 +03:00
Alexander Udalov
c07d0d48d3 Fix KCallable#callBy to JvmStatic companion object members
#KT-12915 Fixed
2016-06-30 19:41:47 +03:00
Nikolay Krasko
e2bcdf8b9c Postpone counting fqName for anonymous classes (KT-12645)
#KT-12645 Fixed
2016-06-30 15:54:59 +03:00
Alexander Udalov
8357f3021e Do not report errors on fake elements in call checkers
#KT-12875 Fixed
2016-06-29 22:03:36 +03:00
Alexander Udalov
95291cdc18 Minor, move some checkers to more appropriate places 2016-06-29 22:03:35 +03:00
Alexander Udalov
ff72348105 Report error on protected setter call from super's companion
#KT-12847 Fixed
2016-06-29 22:03:35 +03:00
Alexander Udalov
77bb691d4e Rename SymbolUsageValidator -> ClassifierUsageChecker
Also validateTypeUsage -> check
2016-06-29 22:03:34 +03:00
Alexander Udalov
89730dfbc3 Move SymbolUsageValidator#validatePropertyCall to CallChecker 2016-06-29 22:03:33 +03:00
Alexander Udalov
d599d87978 Drop SymbolUsageValidator#validateCall in favor of CallChecker#check 2016-06-29 19:21:07 +03:00
Alexander Udalov
260689eb8c Invoke call checkers where symbol usage validators are called
The change in componentAccess.kt is a minor regression that should be addressed
later
2016-06-29 19:21:06 +03:00
Alexander Udalov
4a05c749b5 Support smart casts for functions of local variable delegates 2016-06-29 19:21:06 +03:00
Alexander Udalov
70a994b135 Drop resolution of deprecated plus/minus/get/set conventions
Also remove the corresponding quick fix
2016-06-29 19:21:05 +03:00
Alexander Udalov
291f1f6c3a Remove obsolete errors related to 'invoke' called on extension 2016-06-29 19:21:04 +03:00
Alexander Udalov
6ba32ed624 Refactor CallChecker and subclasses
Encapsulate everything that is needed in checkers into CallCheckerContext. Pass
an instance of this context instead of BasicCallResolutionContext to checkers.

Also pass an instance of the element to report errors on: this is useful
because before this, every checker had its own way of determining where should
the error be reported on. Some of them, for example, were not doing anything if
Call#calleeExpression returned null, which is wrong, see operatorCall.kt

 #KT-12875 Open
2016-06-29 19:20:00 +03:00
Alexander Udalov
f6f825e0dc Minor, extract validatePropertyCall out of SymbolUsageValidator#validateCall
BasicExpressionTypingVisitor#checkLValue is the only place where it's used.
There's no ResolvedCall instance for the setter call (only for the property
itself), that's why this special method is needed
2016-06-29 19:19:59 +03:00
Alexander Udalov
d7d2780666 Drop SymbolUsageValidator.Composite, use validators similarly to call checkers
Also fix warnings in DeprecatedSymbolValidator, DelegatedPropertyResolver and
elsewhere
2016-06-29 19:19:58 +03:00
Alexander Udalov
e94fd8f777 Make infix & operator checkers implement CallChecker
Instead of SymbolUsageValidator
2016-06-29 19:19:57 +03:00
Yan Zhulanow
bb083a51cc KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin file.
newOutputStreamSupplier() is deprecated and was deleted in Guava 18.
2016-06-29 17:52:25 +03:00
Nikolay Krasko
51a2abdbc2 Minor: remove outdated comment 2016-06-29 16:16:32 +03:00
Nikolay Krasko
eee45e91ce Add more tests for PropertyAccessorDescriptor.isDeafult() usages 2016-06-29 16:16:31 +03:00
Nikolay Krasko
c936b3f3e0 Don't fail in setup because of access restricted exception 2016-06-29 16:16:30 +03:00
Kirill Rakhman
0320bd8184 Formatter: Remove spaces before question mark in nullable types (KT-12830)
#KT-12830 Fixed
2016-06-29 16:15:59 +03:00
Alexey Andreev
9a50e91cd8 KT-12893: fix another potential issue (could not reproduce) 2016-06-29 14:44:44 +03:00
Michael Bogdanov
476c1ec264 Compile android tests against jdk 6 2016-06-29 12:14:01 +03:00
Alexey Andreev
3a3e7bb814 KT-12893: when opening Kotlin compiler settings while kotlinc.xml does not specify which module kind to use, fallback to default value ("plain").
Fix #KT-12893
2016-06-29 12:02:26 +03:00
Michael Bogdanov
a8af654a20 Exclude 'immutableRemove.kt' test from Android tests 2016-06-29 09:33:42 +03:00
Michael Bogdanov
3b419e8ba3 Fix for KT-11964: No TABLESWITCH in when on enum bytecode if enum constant is imported
#KT-11964 Fixed
2016-06-29 09:32:45 +03:00
Alexey Sedunov
81ec18e1fc Minor: Fix test data 2016-06-28 20:58:58 +03:00
Denis Zharkov
efe718602a Support type aliases in incremental compilation
#KT-12871 Fixed
2016-06-28 16:22:08 +03:00
Denis Zharkov
f1363cbf88 Fix visibility checks for constructor call based on type alias
Constructor is invisible iff. either underlying constructor or corresposing type alias is invisible

 #KT-12888 Fixed
2016-06-28 16:22:08 +03:00
Pavel V. Talanov
1b416a674d ChangeLog, minor: make usages of quotes and backticks more consistent 2016-06-28 16:08:10 +03:00
Pavel V. Talanov
a6b1abf8d4 Minor: fix typos in ChangeLog 2016-06-28 16:08:08 +03:00
Pavel V. Talanov
5a2cd11c78 Update Changelog for 1.0.3 2016-06-28 16:08:06 +03:00
Alexey Sedunov
b83902a8b5 Rename: Update references to facade class when renaming file via matching top-level class
#KT-11903 Fixed
(cherry picked from commit a1d9a25)
2016-06-28 15:07:39 +03:00
Alexey Sedunov
932892243c Line Markers: Filter out irrelevant declarations before resolving in KotlinTestRunLineMarkerContributor
#KT-12647 Fixed
(cherry picked from commit cceeaeb)
2016-06-28 15:07:37 +03:00
Alexey Sedunov
068a120600 Rename: Constraint search scope of parameter declared in a private member
#KT-9649 Fixed
(cherry picked from commit fa144b0)
2016-06-28 15:07:36 +03:00
Alexey Sedunov
746b8895e2 Rename: Disable JavaMemberByKotlinReferenceInplaceRenameHandler for synthetic properties referenced from Kotlin code
#KT-9168 Fixed
(cherry picked from commit dfebdaf)
2016-06-28 15:07:34 +03:00
Alexey Sedunov
7a584e876b Rename: Support automatic test renaming for facade files
#KT-10578 Fixed
(cherry picked from commit 35050f4)
2016-06-28 15:07:32 +03:00
Alexey Sedunov
f9d28bf76d Override/Implement: Prefer not-nullable return type when overriding Java method without nullability annotation
#KT-12381 Fixed
(cherry picked from commit 2b87f8e)
2016-06-28 15:07:31 +03:00
Alexey Sedunov
542f8d9fd2 Move: Support quoted package names
#KT-12411 Fixed
(cherry picked from commit 95239e5)
2016-06-28 15:07:30 +03:00
Alexey Sedunov
89816c5f12 References: Support implicit references to annotation method 'value'. Support Find Usages/Rename on these references
#KT-12657 Fixed
(cherry picked from commit 68d0d84)
2016-06-28 15:07:28 +03:00
Alexey Sedunov
efa27e6048 Rename: Suggest renaming both property accessors with matching @JvmName when renaming one of them from Java
#KT-12759 Fixed
(cherry picked from commit 81a8e6a)
2016-06-28 15:07:25 +03:00
Alexey Sedunov
248f4c1645 Light Classes: Implement light elements for 'extends'/'implements' reference lists. Support adding/removing of super type list entries via light elements.
Fix exception on applying "Convert to class" intention to Java interface with Kotlin inheritor(s)
 #KT-11281 Fixed
(cherry picked from commit 4ec4914)
2016-06-28 15:07:24 +03:00
Alexey Sedunov
8e061c9ec1 Implement Abstract Member: Navigate to the generated declaration
#KT-12290 Fixed
(cherry picked from commit 6274c6b)
2016-06-28 15:07:23 +03:00
Alexey Sedunov
0d80bf030f Create from Usage: Fix exception in "Create class" quickfix applied to unresolved references in type arguments. Create class body when necessary
#KT-12777 Fixed
(cherry picked from commit dc90ec9)
2016-06-28 15:07:21 +03:00
Alexey Sedunov
ffe4e760d7 Override/Implement: Implement JavaDoc/KDoc copying
#KT-8682 Fixed
 #KT-12735 Fixed
(cherry picked from commit f4486be)
2016-06-28 15:07:19 +03:00
Alexey Sedunov
3f09b7f9d5 Minor: Rename jetRefactoringUtil.kt -> kotlinRefactoringUtil.kt
(cherry picked from commit a841f87)
2016-06-28 15:07:17 +03:00
Alexey Sedunov
0e5a997506 Minor: Drop unused variable
(cherry picked from commit 4441323)
2016-06-28 15:07:15 +03:00
Alexey Sedunov
296c7a16d3 Copy: Filter out invalid elements to prevent PsiInvalidElementAccessException
#KT-12747 Fixed
(cherry picked from commit 4a0a440)
2016-06-28 15:07:14 +03:00
Alexey Sedunov
69704c017f Create from Usage: Suggest "Create function/secondary constructor" quick fix on argument type mismatch
#KT-11864 Fixed
(cherry picked from commit 1912783)
2016-06-28 15:07:12 +03:00
Alexey Sedunov
5296b61ce9 Rename: Qualify references to members of enum companions in case of conflict with enum entries
#KT-10033 Fixed
(cherry picked from commit 3373d54)
2016-06-28 15:07:11 +03:00
Alexey Sedunov
35aa3f7646 Inspections: Don't show "Package directive doesn't match file location" in injected code
#KT-12376 Fixed
(cherry picked from commit a5a5fe5)
2016-06-28 15:07:09 +03:00
Alexey Sedunov
1da6c885e4 Rename: Preserve "Search in comments and strings" and "Search for text occurrences" settings in Rename dialog
#KT-8510 Fixed
(cherry picked from commit d9584d2)
2016-06-28 15:07:07 +03:00
Alexey Sedunov
7c95b5041b Minor: Fix changelog
(cherry picked from commit 2ea3980)
2016-06-28 15:07:06 +03:00
Alexey Sedunov
46c2dc9895 Rename: Record new name for Kotlin function which is being renamed via light method
#KT-12732 Fixed
(cherry picked from commit 28b9d3e)
2016-06-28 15:07:05 +03:00
Alexey Sedunov
04f54bee88 Rename: Process property accesor usages (Java) in comments and string literals
#KT-9435 Fixed
(cherry picked from commit 911afee)
2016-06-28 15:07:03 +03:00
Alexey Sedunov
14b6c1930e Rename: Add name suggestions to Rename dialog
#KT-6372 Fixed
(cherry picked from commit 84ca283)
2016-06-28 15:07:02 +03:00
Alexey Sedunov
d0a3732c94 Rename: Rename overridden property and all its accessors on attempt to rename overriding accessor in Java code
#KT-4791 Fixed
(cherry picked from commit 29e450e)
2016-06-28 15:07:01 +03:00
Alexey Sedunov
4c447d0580 Rename: Fix rename of ambiguous import reference to class/function when some referenced declarations are not changed
#KT-6663 Fixed
(cherry picked from commit 9ba8ecd)
2016-06-28 15:06:58 +03:00
Alexey Sedunov
b87d8e29e4 Rename: Implement conflict analysis for parameters. Qualify property references to avoid shadowing by parameters
#KT-10687 Fixed
(cherry picked from commit 7d6466d)
2016-06-28 15:06:54 +03:00
Alexey Sedunov
c9f659e89b Rename: Implement Rename conflict analysis for classes. Qualify class references to resove rename conflicts when possible
#KT-8611 Fixed
 #KT-8562 Fixed
(cherry picked from commit 8989ccc)
2016-06-28 15:06:52 +03:00
Alexey Sedunov
77b0bb9849 Rename: Implement Rename conflict analysis for properties. Qualify property references to resove rename conflicts when possible
#KT-8732 Fixed
 #KT-12543 Fixed
(cherry picked from commit e23029d)
2016-06-28 15:06:49 +03:00
Stanislav Erokhin
43f5da0ece Add eap channel for 1.1 into plugin updater. 2016-06-28 14:47:49 +03:00
Denis Zharkov
ed28b5a15e Use modality and visibility from mutable class declaration
Otherwise open may be used instead of abstract (in most cases)
2016-06-28 14:25:44 +03:00
Pavel V. Talanov
cbf78c7298 KotlinCacheServiceImpl: create new locks when creating caches that delegate to other caches
Remove single globalContext that was passed around to every configurations
Correctly create exception trackers when delegating caches
Delegate builtIns instance when delegating caches
Create specialized JvmBuiltIns only if Sdk is specified
2016-06-28 12:40:28 +03:00
Denis Zharkov
d53c53a900 Support annotations on type aliases declarations 2016-06-28 10:33:29 +03:00
Denis Zharkov
e24f0653fb Support type aliases in stub builder 2016-06-28 10:33:29 +03:00
Denis Zharkov
daa356860c Minor. Drop redundant parameter 2016-06-28 10:33:29 +03:00
Denis Zharkov
067fe35b72 Fix type deserialization failure when type alias was not found
It's crucial for decompilation as declarations are always being deserialized
with no dependencies

 #KT-12832 Fixed
2016-06-28 10:33:29 +03:00
Denis Zharkov
15ce4f8856 Minor. Add comment about type aliases based types metadata format 2016-06-28 10:33:29 +03:00
Denis Zharkov
d78177dc23 Refine metadata format for typealias based type 2016-06-28 10:33:29 +03:00
Denis Zharkov
d39d36b94c Render unabbreviated part of type wrapped in common comments
It's necessary for preserving DescriptorRenderer invariant, namely
only valid code should be generated
2016-06-28 10:33:29 +03:00
Michael Bogdanov
249be0a142 Small changes in tests to support them on Android 2016-06-28 10:12:15 +03:00
Alexander Udalov
601dc96a34 Minor, rename protobuf field according to style guide 2016-06-27 20:18:57 +03:00
Alexander Udalov
4c8e8b099a Update protobuf from 2.5.0 to 2.6.1 2016-06-27 20:14:00 +03:00
Alexey Andreev
cfbe48ac46 KT-3008: fix ABI compatibility test 2016-06-27 15:33:31 +03:00
Alexey Andreev
33248e7721 KT-3008: minor code style fixes 2016-06-27 15:33:31 +03:00
Alexey Andreev
da53b9a9a4 KT-3008: fix support of KProperty/KMutableProperty 2016-06-27 15:33:30 +03:00
Alexey Andreev
202400cb97 KT-3008: remove unused code that handles anonymous modules, since there's no way to declare them via configuration 2016-06-27 15:33:30 +03:00
Alexey Andreev
055be070e9 KT-3008: when inlining functions from external modules, replace calls to functions in the external module via new mechanism instead of Kotlin.modules 2016-06-27 15:33:29 +03:00
Alexey Andreev
f029b720e7 KT-3008: change the way how descriptions of module kind are rendered in IDEA configuration tab 2016-06-27 15:33:29 +03:00
Alexey Andreev
97605a97da KT-3008: multiple minor fixes after code review 2016-06-27 15:33:28 +03:00
Alexey Andreev
713a7efcdf KT-3008 Add support of module kind to Ant task. Repair Ant JS tests 2016-06-27 15:33:28 +03:00
Alexey Andreev
a9ed789727 KT-3008 Fix CLI and JPS tests related to JS translator 2016-06-27 15:33:28 +03:00
Alexey Andreev
2d994c1a03 KT-3008 Run Google closure compiler in a separate JVM 2016-06-27 15:33:27 +03:00
Alexey Andreev
64cd0b70d7 KT-3008 Minor refactoring and clean up 2016-06-27 15:33:27 +03:00
Alexey Andreev
b090b79d92 KT-3008 Add UI that allows to change module kind in IDEA Kotlin configurator 2016-06-27 15:33:26 +03:00
Alexey Andreev
496539d101 KT-3008 Add module kind attribute to Maven plugin. Fix tests from libraries subproject 2016-06-27 15:33:26 +03:00
Alexey Andreev
b6b604d78f KT-3008 Fix UMD and plain module wrappers when module id is not a valid JS identifier 2016-06-27 15:33:25 +03:00
Alexey Andreev
e38b83880f KT-3008 Add tests for module wrappers 2016-06-27 15:33:25 +03:00
Alexey Andreev
0cfacfa44a KT-3008 Merge JS runtime modules in one kotlin.js 2016-06-27 15:33:25 +03:00
Alexey Andreev
b556b6efca KT-3008 Fix JS backend tests 2016-06-27 15:33:24 +03:00
Alexey Andreev
848d7f92fa KT-3008 Implement AMD, CommonJS and UMD wrappers. Compile stdlib and builtins modules into separate JS files and wrap them in UMD. 2016-06-27 15:33:24 +03:00
Alexey Andreev
95b78e18df KT-3008 Change the way how modules are referenced in JS 2016-06-27 15:33:23 +03:00
Alexey Andreev
2909533522 KT-3008 Add module kind. Include module kind and module dependencies in metadata 2016-06-27 15:33:23 +03:00
Nikolay Krasko
8d055f6952 Use file.modificationStamp to invalidate caches for synthetic files
It previously worked because of updating all counters. That behaviour was removed in
3b860d69ee.

getUserData(FILE_OUT_OF_BLOCK_MODIFICATION_COUNT) is probably useless because copied file has
isEventSystemEnabled() == false that prevents sending notifications about PSI changes. This need additional checks.
2016-06-27 15:02:42 +03:00
Nikolay Krasko
67eca2cbb7 Minor: remove superfluous method that was necessary becuase of KT-5457 2016-06-27 15:02:42 +03:00
Michael Bogdanov
abc7d5101d Fix for KT-12106: import static of reified companion object method throws IllegalAccessError
#KT-12106 Fixed
2016-06-27 12:31:31 +03:00
Mikhael Bogdanov
5df52e08cc Temporary removed increment and '+=' tests on local delegated properties 2016-06-27 12:13:28 +03:00
Pavel V. Talanov
6d04c6e102 Drop no longer used FileLibraryScope 2016-06-25 22:25:31 +03:00
Pavel V. Talanov
80de07d98f KotlinScriptConfigurationManager: refactor roots caching and use NonClasspathDirectoriesScope 2016-06-25 22:25:29 +03:00
Pavel V. Talanov
9c09b8a37d KotlinScriptConfigurationManager: do not use dumbService and 'scriptExternalImportsProvider' is no longer nullable 2016-06-25 22:25:27 +03:00
Pavel V. Talanov
2534a5fdfc KotlinScriptConfigurationManager: perform initial caching using StartupManager 2016-06-25 22:25:26 +03:00
Pavel V. Talanov
6a1096a8e9 KotlinCacheServiceImpl: cache all script dependencies as whole to provide faster completion in scripts
A lot of stuff to be fixed after
2016-06-25 22:25:24 +03:00
Pavel V. Talanov
be1e8fcfda Disable templates that are available on "TOP_LEVEL" in scripts 2016-06-25 22:25:21 +03:00
Pavel V. Talanov
c3df743a28 FileScopeFactory: extra imports computed via virtual file as opposed to KtFile
This fixes completion session acting as if there are no imports
2016-06-25 22:25:19 +03:00
Pavel V. Talanov
e46fab5151 KotlinScriptConfigurationManager: Use invokeLater in notifyRootsChanged 2016-06-25 22:25:17 +03:00
Pavel V. Talanov
c9583f3aa9 Provide (not actually correct) resolve scope for script files that have dependencies
This is needed for completion to determine dependencies of the file correctly
2016-06-25 22:25:16 +03:00
Pavel V. Talanov
2e126d3452 Allow navigating to Java sources of script dependencies
Using deprecated API seems the only working solution atm
2016-06-25 22:25:14 +03:00
Pavel V. Talanov
8ad856e1d0 Allow navigating to Kotlin library sources of script dependencies 2016-06-25 22:25:12 +03:00
Pavel V. Talanov
693eeb9f0a Split ScriptModuleInfo into script itself and its dependencies
For now include all dependencies of all scripts for every script, to be improved later
2016-06-25 22:25:10 +03:00
Pavel V. Talanov
1a9c46f34b Ide Scopes: Allow including script dependencies into search scope
This includes script dependencies into scopes for some of the IDE services
Should be revisited later to decide if given service should work for scripts
2016-06-25 22:25:08 +03:00
Pavel V. Talanov
7ededbd5e2 KotlinScriptConfigurationManager: run caching code in smart mode 2016-06-25 22:25:05 +03:00
Pavel V. Talanov
1da3efea81 Implement API to get source roots of script dependencies in KotlinScriptConfigurationManager and KotlinScriptConfigurationManager 2016-06-25 22:25:03 +03:00
Pavel V. Talanov
ae61767bc7 Refactor: move KotlinScriptDependenciesIndexableSetContributor to a separate file 2016-06-25 22:25:02 +03:00
Pavel V. Talanov
ad9c8eedfb Implement JavaClassesInScriptDependenciesShortNameCache to allow completion and auto-import of java classes 2016-06-25 22:25:00 +03:00
Pavel V. Talanov
9185baf13c J2K KotlinSourceFilterScope: rename file 2016-06-25 22:24:58 +03:00
Pavel V. Talanov
a461dd0da2 J2K KotlinSourceFilterScope: autoconvert 2016-06-25 22:24:56 +03:00
Pavel V. Talanov
ddb3327992 Minor: Remove scoping limitation in newly created indices 2016-06-25 22:24:54 +03:00
Pavel V. Talanov
8921ced9dd Indenter: fix indentation on top level in scripts 2016-06-25 22:24:52 +03:00
Ilya Chernikov
b0bff64cff fixes after review 2016-06-25 22:24:50 +03:00
Ilya Chernikov
5a77d2e92b Change to single ScriptTemplateDefinition annotation and separate AcceptedAnnotations annotation on resolver 2016-06-25 22:24:48 +03:00
Ilya Chernikov
f24d954302 Remove unused support for script templates configs 2016-06-25 22:24:47 +03:00
Ilya Chernikov
4f05f839a3 Add previous imports to resolving interfaces to enable effective caching implementations 2016-06-25 22:24:45 +03:00
Ilya Chernikov
f30b402640 Change a parameter "context" in script templates to environment: Map<String, Any?>? 2016-06-25 22:24:43 +03:00
Ilya Chernikov
bf683a63fb Implement annotation proxy generation for script dependencies resolvers 2016-06-25 22:24:41 +03:00
Ilya Chernikov
8a06eafaf1 Rename-refactor interfaces and methods of the script dependencies resolving 2016-06-25 22:24:39 +03:00
Ilya Chernikov
5fd013ef42 minor: rename a field in ScriptTemplateProvider interface 2016-06-25 22:24:37 +03:00
Ilya Chernikov
5bea5bcc37 Add script files changes monitoring, logic for initialization during index rebuilding 2016-06-25 22:24:36 +03:00
Ilya Chernikov
8dac72f465 Add support for script classfiles caching 2016-06-25 22:24:34 +03:00
Ilya Chernikov
3157421189 Fix File Manager tests after classpath/index initialization became lazy 2016-06-25 22:24:32 +03:00
Ilya Chernikov
64bb47ed37 Switch to File instead of String for classpaths in script dependencies 2016-06-25 22:24:30 +03:00
Ilya Chernikov
5e3ba36cc1 Simplify GetScriptDependencies interface 2016-06-25 22:24:28 +03:00
Ilya Chernikov
a60e1ab807 Fix implementation of gradle ScriptTemplateProvider extension
WARNING: adds dependency to idea's gradle-and-groovy-plugin to idea-core
2016-06-25 22:24:27 +03:00
Ilya Chernikov
834372a3b3 Implement extension point for providing script templates 2016-06-25 22:24:25 +03:00
Ilya Chernikov
082290f8e3 Refactor script dependencies management 2016-06-25 22:24:23 +03:00
Ilya Chernikov
c244414f3c Convert ScriptNameUtil to Kotlin: phase 3 - refactor 2016-06-25 22:24:21 +03:00
Ilya Chernikov
590f09ee58 Convert ScriptNameUtil to Kotlin: phase 2 - convert 2016-06-25 22:24:19 +03:00
Ilya Chernikov
f96517a54a Convert ScriptNameUtil to Kotlin: phase 1 - rename file 2016-06-25 22:24:17 +03:00
Ilya Chernikov
d212d369b0 Implement support for extra imports 2016-06-25 22:24:16 +03:00
Ilya Chernikov
402e8c1e3e Add dependency from annotation extraction mechanisms to the prototype, with tests 2016-06-25 22:24:14 +03:00
Ilya Chernikov
3f5a2c2781 Add initial prototype of script def based on annotated base class, with simple tests 2016-06-25 22:24:12 +03:00
Ilya Gorbunov
1e66147e91 Update changelog for 1.0.3: section about new compiler options 2016-06-25 09:17:11 +03:00
Mikhael Bogdanov
a090133581 Inline properties support in incremental compilation 2016-06-24 17:05:53 +03:00
Mikhael Bogdanov
93a770fcc8 Code clean 2016-06-24 17:05:53 +03:00
Mikhael Bogdanov
853c4d4453 Added language feature check for inline properties 2016-06-24 17:05:52 +03:00
Mikhael Bogdanov
321e97a329 AnalyzerExtension refactoring, added support for inline properties 2016-06-24 17:05:52 +03:00
Mikhael Bogdanov
7baf70e8fa Support reified extension properties 2016-06-24 17:05:51 +03:00
Mikhael Bogdanov
7c67a3315a Temporary throw exception on unsupported increment and augment assignment on local delegated properties and inline properties 2016-06-24 17:05:50 +03:00
Mikhael Bogdanov
5a2e00d2ad Base support of StackValue.Property inlining 2016-06-24 17:05:50 +03:00
Mikhael Bogdanov
d524a34fc7 Support property accessor in inline checks 2016-06-24 17:05:49 +03:00
Mikhael Bogdanov
2cc177255f Don't report inapplicable target for 'inline' keyword on property and its accessors 2016-06-24 17:05:49 +03:00
Mikhael Bogdanov
db5d9940df Added 'isInline' implementation to property accessor descriptors 2016-06-24 17:05:48 +03:00
Mikhael Bogdanov
679f53b449 Inline get/setValues for local delegated properties 2016-06-24 17:05:48 +03:00
Mikhael Bogdanov
6f761d4e7d Construct delegates in expression codegen, not in LocalLookup 2016-06-24 17:05:47 +03:00
Denis Zharkov
2578fc3344 Do not generate mutable collection stub methods in interfaces
#KT-12359 Fixed
2016-06-24 16:37:19 +03:00
Denis Zharkov
1780f57265 Fix mutable collection stub methods generation for corner case
The problem is that
`override fun remove(element: E): CollectionWithRemove<E>`
seems to be illegal from Java's point of view, while it's OK for JVM

These declarations have the same signature (return type is isgnored)
- override fun remove(element: E): CollectionWithRemove<E>
- override fun remove(element: E): Boolean

When we meet such declaration we choose random declaration for fake override in synthetic class
that may lead to signature clash
2016-06-24 16:37:19 +03:00
Zalim Bashorov
47e1ff34f0 JS: fix that kotlin's breakpoints don't work with JavaScript debugger
#KT-12773 Fixed
2016-06-24 15:46:30 +03:00
Yan Zhulanow
6e6c9682ec Fix KT-12173 (Kotlin Lint False Positive for "Toast created but not shown" inside SAM adapter).
(cherry picked from commit 4940d3b)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
1720f8b4ff KT-12681 (Lint: run from main menu / Analyze: Kotlin inspections reports only java source)
Cause we've copied Lint diagnostics to the Kotlin project, there's no harm in making them Kotlin-only.
(cherry picked from commit 7105648)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
8f75ababde KT-12674 "Calling new methods on older versions" errors for inlined constants
Inlined constants from Java should not be detected.
(cherry picked from commit b34ee4e)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
206e439595 KT-12023 Kotlin Lint: Cast doesn't trigger minSdk error
Check Kotlin as/is types.
(cherry picked from commit c0db8e0)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
6752df189d Make infix modifier diagnostic message more informative (KT-12589)
(cherry picked from commit 2744309)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
a434055b55 Load Gradle subplugin artifacts from the root project buildscript classpath as well (KT-11885)
(cherry picked from commit b54b0da)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
1de05b965e KT-12015 (Kotlin Lint False Positive for Bundle.getInt())
Java approach is not sufficient here, in Kotlin receivers can be implicit.
Use Kotlin extension/dispatch receivers to figure out the receiver type for our method call.
(cherry picked from commit cdedf1d)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
530ab42de6 Android Extensions: Fix KT-10969 (NullPointerException when finding view in Fragment if getView() is null)
(cherry picked from commit 80f5852)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
2cd0e9c8d8 Fix EA-80764. Do not try to get the resource manager for the disposed module
(cherry picked from commit c3bd243)
(cherry picked from commit cddcf02)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
e0243fd568 Fix EA-82394. PsiType.getClassName() can return null. Return "<anonymous type>" in that case.
(cherry picked from commit 8be1335)
(cherry picked from commit 5101596)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
1a0acf3208 Fix EA-82166. NPE. loadModel() can return null, and it's a bad idea to call methods on a null pointer.
(cherry picked from commit cf033d0)
(cherry picked from commit 37dc0ae)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
001d5397c5 Fix EA-82449. Do not run Lint diagnostics if the project is already disposed
(cherry picked from commit 98b2899)
(cherry picked from commit 2179ee8)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
c5e0f992e5 KT-12387 Fix Performance problem with Lint in IDE
Call checkCanceled() before running Lint diagnostics (UastScanner)
(cherry picked from commit c6e328a)
(cherry picked from commit 696475e)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
4ee19cce93 Fix #KT-12047 (Kotlin Lint: "Missing @JavascriptInterface on methods" does not report anything)
(cherry picked from commit 61e8e01)
(cherry picked from commit dbc54e2)
2016-06-24 15:10:19 +03:00
Yan Zhulanow
d1447faf2b Fix #KT-12015 (Kotlin Lint False Positive for Bundle.getInt()).
Android firstly checks API version against the function call receiver type, so we should do the same to be consistent.
(cherry picked from commit c3d01ec)
(cherry picked from commit 5c78acc)
2016-06-24 15:10:19 +03:00
Denis Zharkov
8caee7940e Use 'Any?' instead of throwing NPE when calculating star projection type
It's a quite hacky solution, but the choice seems to be conservative, so these types can be refined later

 #KT-9597 Fixed
2016-06-24 10:23:16 +03:00
Ilya Gorbunov
71476d5d43 Minor: remove unused commonArgs 2016-06-23 22:47:47 +03:00
Ilya Gorbunov
7c5c4610e8 Rename -jdk compiler option to -jdk-home (jdkHome), add jdk path validation. 2016-06-23 22:47:45 +03:00
Ilya Gorbunov
13016cae93 Add tests for 'jdk' compiler option for CLI, maven and gradle. 2016-06-23 22:46:07 +03:00
Ilya Gorbunov
644df89dc9 CLI: Allow to specify JDK for classpath building with '-jdk' compiler argument.
Maven: support jdk parameter linked to kotlin.compiler.jdk property.
Gradle: support jdk compiler option.
2016-06-23 22:46:07 +03:00
Ilya Gorbunov
1157e052ee Maven: support languageVersion parameter, linked to property kotlin.compiler.languageVersion. 2016-06-23 22:46:07 +03:00
Ilya Gorbunov
848599e940 Maven and Gradle tests for jvmTarget parameter. 2016-06-23 22:46:07 +03:00
Ilya Gorbunov
3f3a3820b8 Maven: support jvmTarget parameter in Maven, linked to property kotlin.compiler.jvmTarget.
Gradle: support jvmTarget compiler option.
2016-06-23 22:46:07 +03:00
Alexander Udalov
1ebcd193a2 Add release notes for 1.0.2-1 2016-06-23 17:37:43 +03:00
Pavel V. Talanov
5d31d6d98d REPL: call 'toString()' for returned values explicitly and correctly report exceptions
#KT-12389 Fixed
2016-06-23 16:12:03 +03:00
Pavel V. Talanov
8ac40d7401 Refactor Repl: use sealed class to represent line result 2016-06-23 16:12:01 +03:00
Pavel V. Talanov
17832e10e7 Refactor ReplInterpreter and ReplFromTerminal classes
Drop some of the exception reporting code
2016-06-23 16:11:50 +03:00
Pavel V. Talanov
246409d033 J2K ReplFromTerminal: rename file 2016-06-23 15:58:07 +03:00
Pavel V. Talanov
35c56431b3 J2K ReplFromTerminal, convert code 2016-06-23 15:58:05 +03:00
Stanislav Erokhin
7c2825b397 KT-12623 Fixed ISE: Type parameter ... not found for public fun ...
#KT-12623 Fixed
Also EA-72653 fixed.
2016-06-23 02:03:24 +03:00
Alexander Udalov
3eeccb407e Simplify and fix createReflectionTypeForCallableDescriptor
Previously its call sites needed to determine if the receiver type should be
ignored (e.g. if the reference is to static member or nested class constructor,
or if it's a bound reference), and 3 of 4 callers did it incorrectly. Simplify
this by passing the DoubleColonLHS instance everywhere.

Also rename it to createKCallableTypeForReference

 #KT-12738 Fixed
 #KT-12751 Fixed
 #KT-12799 Fixed
2016-06-22 21:35:57 +03:00
Alexander Udalov
6cc10aa226 Minor, move utilities form CallableReferencesResolutionUtils.kt closer to usages 2016-06-22 21:35:57 +03:00
Alexander Udalov
80bf6e1bee Refactor CallableReferencesResolutionUtils.kt
Get rid of trace & reportOn parameters of
createReflectionTypeForCallableDescriptor: move the two checks that required
them to DoubleColonExpressionResolver and combine with other checks into a
single function that checks the validity of the referenced symbol. This also
makes these checks reported only once when invalid expressions are passed as
function arguments (previously they were also reported from
getResolvedCallableReferenceShapeType).

Also inline getReflectionTypeForCandidateDescriptor after this, and refactor
its usages
2016-06-22 21:35:57 +03:00
Alexander Udalov
cf630e01db Minor, refactor "is KProperty" checks in ReflectionTypes 2016-06-22 21:35:57 +03:00
Alexander Udalov
e68de436bb Allow data classes to inherit from other classes
#KT-10330 Fixed
2016-06-22 21:35:57 +03:00
Stanislav Erokhin
065c4e19ec Add debug info for EA-79267 - (T is not T) assert: TypeCheckingProcedure.checkSubtypeForTheSameConstructor 2016-06-22 19:42:09 +03:00
Stanislav Erokhin
ad285d5ca2 KT-11679 Fixed exception at ResolvedCallImpl.getArgumentMapping()
#KT-11679 Fixed
Also fixed EA-75913 EA-78908
2016-06-22 19:42:09 +03:00
Stanislav Erokhin
7389d412a5 Fixed visibility check on a property with private setter of the subclass
#KT-3689 Fixed
2016-06-22 19:42:08 +03:00
Pavel V. Talanov
f607bdebd3 Update Changelog for 1.0.3-eap-58 2016-06-22 14:18:08 +03:00
Pavel V. Talanov
0d52a20a46 Add Kotlin "Tips of the day"
Content from https://youtrack.jetbrains.com/issue/DOC-4026
2016-06-22 14:17:56 +03:00
Pavel V. Talanov
b750f20718 Update changelog for 1.0.3 2016-06-22 14:17:44 +03:00
Pavel V. Talanov
585440b3bd Minor, changelog: add 1.0.4 section 2016-06-22 14:17:03 +03:00
Mikhail Glukhikh
bd8c7577e1 Replace explicit parameter with it : correct handling of it from outer lambda #KT-12437 Fixed
(cherry picked from commit cb8fe96)
2016-06-21 22:24:54 +03:00
Mikhail Glukhikh
b44c94a887 Fix for EA-81477 : correct handling of a property without initializer (but with e.g. getter)
(cherry picked from commit 4e2d35a)
2016-06-21 22:24:44 +03:00
Mikhail Glukhikh
5b328e9042 Can be parameter inspection: delete only particular modifiers (e.g. no vararg) #KT-12768 Fixed
(cherry picked from commit d4116b5)
2016-06-21 22:24:27 +03:00
Mikhail Glukhikh
4abcc278fd Can be constructor property: comment saver introduced to retain comments; unbound comments now added before, not after
(cherry picked from commit 886cf21)
2016-06-21 22:23:23 +03:00
Mikhail Glukhikh
4145e3438f Minor fixes: can be constructor property
(cherry picked from commit 4d44e15)
2016-06-21 22:23:12 +03:00
Mikhail Glukhikh
8d2389d15c Code cleanup: "can be constructor property" applied
(cherry picked from commit 6967711)
2016-06-21 22:23:01 +03:00
Nikolay Krasko
49aaeb5a38 Refactoring: wrap Spacing.createSpacing to Kotlin function with default parameters 2016-06-21 21:54:50 +03:00
Nikolay Krasko
f8196d8331 Add space after a semicolon only if there's another child at the same line 2016-06-21 21:54:50 +03:00
Kirill Rakhman
b560aab06d Format spaces before enum arguments
Fixes #KT-12714
2016-06-21 21:54:50 +03:00
Kirill Rakhman
a520be5509 Format spaces around semicolon
Fixes #KT-12689
2016-06-21 21:54:50 +03:00
Kirill Rakhman
db387bd573 Format spaces after annotation in annotated expression
Fixes #KT-12781
2016-06-21 21:54:50 +03:00
Kirill Rakhman
ae83330679 Format spaces inside curly braces in string template
Fixes #KT-12791
2016-06-21 21:54:50 +03:00
Kirill Rakhman
655fc45a87 Format spaces around in keyword
Fixes: KT-10680
2016-06-21 21:54:50 +03:00
Alexey Tsvetkov
8fe63cdfaf Prevent usage of deprecated constructor
This removes warning with gradle 2.14.
Before 2.14 constructor was removed, then it was returned and deprecated.

    #KT-12786 fixed
2016-06-21 20:22:53 +03:00
Alexey Tsvetkov
34181402fb Fix CCE when creating kotlin-js task in gradle plugin 2016-06-21 20:22:53 +03:00
Denis Zharkov
453ee55615 Fix coroutine generation in case of empty lambda
'handleResult' should be called in such case too
2016-06-21 15:52:44 +03:00
Denis Zharkov
b6ccd03ef4 Make loops generation lazy
As well as all other kinds of expressions

While it's not necessary in a sense that 'for' loop can not be plain expression,
i.e. it can't be an argument for safe-call etc., but laziness is still very convenient property.

E.g. 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 lazy.
2016-06-21 15:52:44 +03:00
Denis Zharkov
ad71934c55 Minor. Add 'operator' modifier in test for handleResult 2016-06-21 15:52:44 +03:00
Alexey Andreev
2e6a48576d KT-12417: add support of RTTI against K(Mutable)Property* types 2016-06-21 15:42:50 +03:00
Mikhail Glukhikh
048b6b60e9 dangerousFlexibleTypeOrNull : minor refactoring
(cherry picked from commit 31e8fe5)
2016-06-21 15:22:26 +03:00
Mikhail Glukhikh
70becfbd86 Has platform type inspection is now intention-based
(cherry picked from commit 7cc6b9b)
2016-06-21 15:22:15 +03:00
Mikhail Glukhikh
a68e8e0db5 Introduce additional fixes & configurable problem range for intention-based inspection
(cherry picked from commit ed23aa9)
2016-06-21 15:21:48 +03:00
Mikhail Glukhikh
2b2b937263 Specify type explicitly intention: now derived from self targeting range intention
(cherry picked from commit b09b5a9)
2016-06-21 15:20:24 +03:00
Mikhail Glukhikh
5c4b6ba8b0 Has platform type : public API only option
(cherry picked from commit a084c1d)
2016-06-21 15:20:11 +03:00
Kirill
86b70ba995 Add quickfix tests for HasPlatformTypeInspection
(cherry picked from commit af1b26b)
2016-06-21 15:20:00 +03:00
Kirill Rakhman
d7bf03be46 Implement inspection for declarations with implicit platform types #KT-12310 Fixed
(cherry picked from commit 00d8c26)
2016-06-21 15:19:13 +03:00
Sergey Mashkov
1cb72169f9 KT-12512 "Different IDE and Maven plugin version" inspection is being invoked for non-tracked pom.xml files 2016-06-21 13:56:22 +03:00
Sergey Mashkov
7999dc8d01 Fix EA-83601 - ISE: PomFile.<init> 2016-06-21 13:56:17 +03:00
Sergey Mashkov
49ccfa0ec4 KT-12558 Configure Kotlin in Project: Maven: Undo could revert changes in all poms 2016-06-21 13:56:13 +03:00
Sergey Mashkov
f47fd46b7a Maven: script tag injects kotlin 2016-06-21 13:56:08 +03:00
Sergey Mashkov
0250ab4ac2 KT-12568 Maven pom.xml: execution configuration: file path completion works only in some sub-elements 2016-06-21 13:56:03 +03:00
Dmitry Jemerov
75b860ab95 handle IOException from File.getCanonicalFile() (EA-83981 - NA: KotlinToJVMBytecodeCompiler.reportRuntimeConflicts)
(cherry picked from commit 765bd44)
2016-06-21 12:07:50 +02:00
Dmitry Jemerov
450caf4033 VirtualFile.getParent() is nullable (EA-84222 - NPE: DecompiledFileWritingAccessProvider.isPotentiallyWritable)
(cherry picked from commit a77f4df)
2016-06-21 12:07:39 +02:00
Dmitry Jemerov
4bc64b8014 PsiElement.getNode() is nullable (EA-84534 - NPE: DocCommentConverterKt.content)
(cherry picked from commit c3e38dd)
2016-06-21 12:07:24 +02:00
Denis Zharkov
132190a71e Minor. Optimize imports 2016-06-21 11:07:36 +03:00
Denis Zharkov
fe5fe63f0a Fix visibility check for dynamic members within protected method
#KT-11857 Fixed
2016-06-21 11:07:36 +03:00
Valentin Kipyatkov
4a7a04e366 Temporarily reverted commit "Smart cast to not null should affect flexible types too" because it causes exception in compiler 2016-06-20 23:18:53 +03:00
Alexander Udalov
311301f430 Check return type when locating method in reflection
#KT-11824 Fixed
2016-06-20 21:03:51 +03:00
Pavel V. Talanov
bafe8e55ce Create SyntheticMemberDescriptor interface
Implement this interface by sam adapters/constructors and use it in navigation

 #KT-11708 Fixed
2016-06-20 20:15:34 +03:00
Nikolay Krasko
4087e650aa Wrong delegation to delegation property in debugger when property defined in another module (KT-12678)
Different bytecode can be generated for delegated property and for non-delegated one. Backend inspects DELEGATED_PROPERTY_CALL to understand the property type, and expects that
this information had been already recorded into context. Frontend writes DELEGATED_PROPERTY_CALL into context during body resolve or type inference if type is not present.

Either way in debugger context it may happen that the DELEGATED_PROPERTY_CALL won't be written into context.

 #KT-12678
2016-06-20 16:22:04 +03:00
Valentin Kipyatkov
0bc5007147 KT-12369 Completion: pressing dot after class name should not cause insertion of constructor call
#KT-12369 Fixed
2016-06-20 16:19:02 +03:00
Valentin Kipyatkov
b9719bfe82 Fixed test so that it really tests what's intended 2016-06-20 16:19:02 +03:00
Valentin Kipyatkov
eb1dbfc652 KT-12669 Completion should show variant with () when there is default lambda
#KT-12669
2016-06-20 16:19:02 +03:00
Valentin Kipyatkov
962a8f9bf4 KT-12447 Don't use CompletionProgressIndicator in Kotlin plugin
#KT-12447 Fixed
2016-06-20 16:19:02 +03:00
Valentin Kipyatkov
4e16d67321 KT-12427 Completion doesn't work for "@receiver:" annotation target
#KT-12427 Fixed
2016-06-20 16:19:01 +03:00
Valentin Kipyatkov
1413a3fe63 KT-12328 Qualified function name inserted when typing before "if"
#KT-12328 Fixed
2016-06-20 16:19:01 +03:00
Valentin Kipyatkov
2ec81f44bf Fixed extension properties not completed after "get" 2016-06-20 16:19:01 +03:00
Valentin Kipyatkov
88bf7f883e No need to specially handle extensions from current file anymore (since searchScope for KotlinIndicesHelper includes current file) 2016-06-20 16:19:01 +03:00
Valentin Kipyatkov
568195bb34 Smart cast to not null should affect flexible types too 2016-06-20 16:19:00 +03:00
Denis Zharkov
5ee33e6ad5 Generate last expression in coroutine block even for Unit expected type 2016-06-19 12:50:54 +03:00
Denis Zharkov
96eb3f411d Minor. Simplify 'async' tests 2016-06-19 12:50:54 +03:00
Denis Zharkov
72eb87f5d0 Support inline suspend functions
A lot of additional work was required to support them:
- Suspension points are being identified by two markers
  instead of one pointing to suspend function call
- Approach with replacing return type of suspend function does not work anymore.
  So we decode suspension return type as an argument for begin marker
- It became necessary to perform variables liveness analysis
  (see comment in org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitor.spillVariables)
2016-06-19 12:50:54 +03:00
Denis Zharkov
5c3e554240 Minor. Remove redundant import 2016-06-19 12:50:53 +03:00
Denis Zharkov
99511cbf65 Minor. Replace Exception with Throwable in the root catch clause 2016-06-19 12:50:53 +03:00
Denis Zharkov
e7b9564699 Support coroutine lambda parameters in JVM backend 2016-06-19 12:50:53 +03:00
Denis Zharkov
5bac2fd5c9 Make mutable continuation fields volatile 2016-06-19 12:50:53 +03:00
Denis Zharkov
1431e2a06d Fix variables spilling for coroutines
Skip variables that conflict with local variable table info
Otherwise DEX rejects generated code
2016-06-19 12:50:53 +03:00
Denis Zharkov
07dcc6c616 Support 'handleException' operator in JVM backend 2016-06-19 12:50:53 +03:00
Denis Zharkov
6795393989 Introduce 'handleException' operator and relevant checks 2016-06-19 12:50:52 +03:00
Alexander Udalov
0e881daba3 Update diagnostic tests ReadMe, explain tests with diagnostic arguments 2016-06-19 12:45:22 +03:00
Alexander Udalov
456ba79793 Consider callable reference's LHS when resolving RHS
Previous resolution sequence (static scope, nested classes scope, receiver) and
a check against type parameters only made sense when there's a type, not an
expression, on the LHS of a callable reference. Also TransientReceiver is
incorrect in such case because private-to-this visibility check only works for
ExpressionReceiver values
2016-06-19 12:45:22 +03:00
Alexander Udalov
6562a2db19 Type-check reference to property with invisible setter to KProperty
#KT-12337 Fixed
2016-06-19 12:45:22 +03:00
Ilya Gorbunov
c5a208f3eb Rearrange stdlib unit tests across packages.
Rearrange JS stdlib unit tests.
2016-06-18 16:50:32 +03:00
Ilya Gorbunov
d266f546f4 Remove obsolete and not relevant to stdlib tests 2016-06-18 16:50:32 +03:00
Nikolay Krasko
43407f1c74 Remove old hack: Idea doesn't expect increasing modification count during highlighting (KT-12526)
addImport() is called from ImportAllMembersIntention.isApplicableTo() and increasing modification count during highlighting ruins Idea expectations.

 #KT-12526 Fixed
2016-06-18 16:06:37 +03:00
Alexey Tsvetkov
d4494d605a Exclude resources dir from surefire test search 2016-06-17 20:00:46 +03:00
Valentin Kipyatkov
1b16ff6c82 KT-11975 Invert if-condition intention does not simplify "is" expresssion
#KT-11975 Fixed
2016-06-17 18:09:07 +03:00
Alexander Udalov
3fa87fe4de Move get-protobuf later in update_dependencies
It invokes kotlinc, so should happen after the bootstrap compiler is downloaded
2016-06-17 17:23:19 +03:00
Mikhail Glukhikh
5ccbf47531 Elvis / if / when now infer error type in case of ErrorType + Nothing #KT-6665 Fixed
(cherry picked from commit 9a50a0b)
2016-06-17 16:43:24 +03:00
Mikhail Glukhikh
49fb9ff424 Sealed class hierarchies are now correctly processed in when (by checking possible smart casts to nested sealed classes) #KT-10648 Fixed
(cherry picked from commit 2eaaf9c)
2016-06-17 15:22:15 +03:00
Stanislav Erokhin
01430b4b99 Create hack for exception about "Empty intersection for types".
Hackaround for KT-11266, EA-79963, EA-72093,  EA-79976.
2016-06-17 01:39:44 +03:00
Nikolay Krasko
490ff621b6 Implement isInheritor method with utility method that has special behaviour for anonymous classes 2016-06-16 18:50:40 +03:00
Nikolay Krasko
784fd963cd Implement copy methods for anonymous and enum entry light classes 2016-06-16 18:50:39 +03:00
Nikolay Krasko
29b94f650c Make Kotlin light class more like PsiAnonymousClassImpl
Avoid delegating to cls delegate in more places
2016-06-16 18:50:39 +03:00
Nikolay Krasko
9359d0aab4 Compare anonymous classes with psi only to avoid counting qualified name 2016-06-16 18:50:38 +03:00
Alexander Udalov
de986ed051 Do not skip synthesized members when generating bridges
The condition here is obsolete since SAM adapters can no longer be overridden:
they are now extensions in another scope

 #KT-12708 Fixed
2016-06-16 16:51:18 +03:00
Alexander Udalov
af9883bccf Add test on accidental redeclaration of final members from java.lang.Enum
This is working because of the additional built-ins members added in 1.1
2016-06-16 16:51:18 +03:00
Alexander Udalov
79ecc9751b Report error on accidentally "overriding" wait/notify
Hard-code only Object members because diagnostics are reported for all other
classes out of the box in 1.1

 #KT-7174 Fixed
2016-06-16 16:51:18 +03:00
Alexander Udalov
da332d1a27 Validate "-jvm-target" value in CLI, improve message 2016-06-16 16:51:18 +03:00
Alexander Udalov
02fd5371aa Update metadata version to 1.1.2 and bytecode version to 1.0.1
This is needed for the upcoming 1.1 EAP: it'll be easier to diagnose problems
arising from new language features and bytecode modifications
2016-06-16 16:51:18 +03:00
Alexander Udalov
b4f81d4bb5 Use 'JVM_TARGET: 1.8' directive in codegen tests on 1.8 target 2016-06-16 16:51:18 +03:00
Mikhail Glukhikh
ac03d98cb2 Inspection "can be primary constructor property" with relevant quick-fix #KT-8477 Fixed
(cherry picked from commit 2db7562)
2016-06-16 16:24:43 +03:00
Dmitry Petrov
9240c82934 KT-12733 'rangeTo' as a non-qualified call is not optimized in 'for'
Use ResolvedCall corresponding to 'for' loop range expression
for optimized "for-in-range-literal".
Cleanup.
2016-06-16 11:30:05 +03:00
Alexey Tsvetkov
5e21af7bdd Ensure direcory for class file stubs always exists
This fixes the warning "classpath entry does not exist"

    #KT-12352 fixed
2016-06-15 20:28:47 +03:00
Alexey Tsvetkov
af10c13ef1 Set friend modules for android gradle test tasks
This fixes the following issues:
1. When product flavors were used, android unit tests could not refer
to internal symbols from main source set.
2. Android instrumentation tests could not refer
to internal symbols from main source set

    #KT-11166 fixed
2016-06-15 20:28:47 +03:00
Zalim Bashorov
0e428ca10c JPS: don't consider that production target of module "B" is depends on test target of module "A" when "B" depends on "A"
#KT-12595 Fixed
2016-06-15 15:01:32 +03:00
Dmitry Petrov
a17b0dd1b5 KT-5075 Optimize array/collection indices usage in 'for' loop
Use specialized 'for' loop code generation strategy for loops over array indices and collection indices.
2016-06-15 14:01:18 +03:00
Mikhael Bogdanov
3a8591a729 Support 'jvm-target' in CLI 2016-06-15 13:43:29 +03:00
Mikhael Bogdanov
1c3ce93275 Generate same delagation structure as in jvm 6 target until new binary compatibility design
We need to make some decision about binary compatibility beetwen targets and semantics, so now old logic is used
2016-06-15 13:43:29 +03:00
Mikhael Bogdanov
bb59638039 Support bridges in interfaces. Fix for KT-12416: Missed bridges in js backend
#KT-12416 Fixed
2016-06-15 13:43:28 +03:00
Mikhael Bogdanov
c778af518b isJvm6Interface -> isAnnotationOrJvm6Interface 2016-06-15 13:43:28 +03:00
Mikhael Bogdanov
16159c483d Generate defaults methods on extending jvm6 interfaces 2016-06-15 13:43:27 +03:00
Mikhael Bogdanov
331341bd4d Don't generate delegates on overriding jvm8 interfaces 2016-06-15 13:43:27 +03:00
Michael Bogdanov
01aa89b1ea Generate delegation body for default interface methods, calculate proper abstractness for them 2016-06-15 13:43:26 +03:00
Mikhael Bogdanov
fc8058848f Added classVersion to KotlinJvmBinaryClass 2016-06-15 13:43:26 +03:00
Michael Bogdanov
0ae2175a00 Add jvm8 target key, added jvm 8 option to bytecode tool window
IsJava8 renamed to isJvm8
2016-06-15 13:43:25 +03:00
Michael Bogdanov
96f892d60c Obtain class file version from GenerationState 2016-06-15 13:43:25 +03:00
Mikhael Bogdanov
77a386a266 Move java8 'compileKotlinAgainstKotlin' test under 'codegen/java8/compileKotlinAgainstKotlin/jvm6' folder 2016-06-15 13:43:24 +03:00
Mikhael Bogdanov
0169f10bf3 Support directives in write flag tests 2016-06-15 13:43:23 +03:00
Mikhael Bogdanov
5d5734841b Compile logic moved from AbstractBlackBoxCodegenTest to CodegenTestCase 2016-06-15 13:43:23 +03:00
Mikhael Bogdanov
dce260563c Support directives in CompileKotlinAgainstKotlinTest 2016-06-15 13:43:22 +03:00
Alexander Udalov
99f4c7b6e7 Fix error in kapt on enum constructors with parameters
Do not skip writing the fictitious 'java/lang/Synthetic' annotation in KAPT
mode, because its absence makes ASM confuse indices of enum constructor
parameters (it cannot figure out that there are two additional parameters, name
and ordinal)

 #KT-12694 Fixed
2016-06-14 22:06:45 +03:00
Nikolay Krasko
5e7d007e75 Build output parser in separate module under 1.6 (KT-12159)
KotlinOutputParser accessed from gradle execution environment that can be started under Java 1.6.

 #KT-12159 Fixed
2016-06-14 20:58:07 +03:00
Alexander Udalov
7e38b93d80 Use protobuf with renamed packages, pack to IDEA plugin
Update GenerateProtoBuf.kt to also regexp-replace com.google.protobuf with
org.jetbrains.kotlin.protobuf in generated Java sources

 #KT-12581 Fixed
2016-06-14 14:17:22 +03:00
Alexander Udalov
952a85414b Rename packages in protobuf-java binaries and sources
#KT-12581 In Progress
2016-06-14 14:17:22 +03:00
Mikhail Glukhikh
b1734920b6 Surround with null check : applicable also for TYPE_MISMATCH 2016-06-13 15:56:41 +03:00
Mikhail Glukhikh
10935ba9db Wrap with safe let call : minor refactoring 2016-06-13 15:42:04 +03:00
Mikhail Glukhikh
954952ae71 Surround with null check : apply for ITERATOR_ON_NULLABLE 2016-06-13 15:34:15 +03:00
Mikhail Glukhikh
7f771075fb Surround with null check : minor refactoring 2016-06-13 15:34:10 +03:00
Mikhail Glukhikh
230f73acc9 KT-11104 extra : name validator introduced for wrap with safe let call 2016-06-13 15:34:04 +03:00
Mikhail Glukhikh
3c49b5f342 KT-11104 extra : "wrap with safe let call" is now applicable for argument type mismatches 2016-06-13 15:33:59 +03:00
Mikhail Glukhikh
47c1106d5d Quick-fix "wrap with safe let call" introduced #KT-11104 Fixed 2016-06-13 15:33:53 +03:00
Mikhail Glukhikh
f8b6ed226a Correct "Show type" on an invoked expression #KT-12671 Fixed 2016-06-13 15:33:48 +03:00
Mikhail Glukhikh
90342ea33b KT-11104 : quick fix "surround with null check" 2016-06-13 15:33:36 +03:00
Stanislav Erokhin
585dcbf1f3 KT-10717 Type inference for lambda with local return
#KT-10717 Fixed
2016-06-10 21:28:05 +03:00
Stanislav Erokhin
da01e4a57c Add assertion for variable as operator call. 2016-06-10 21:28:04 +03:00
Stanislav Erokhin
03241419bd Minor. removed several tests with error calls. 2016-06-10 21:28:04 +03:00
Dmitry Petrov
c414f456a4 Like nested classes, it is not possible to reference inherited nested type alias by a child class. 2016-06-10 16:21:27 +03:00
Dmitry Petrov
7b6c1c092c Inherited type alias capturing type parameters of generic base class:
doesn't work partially due to KT-11123.
2016-06-10 16:21:27 +03:00
Dmitry Petrov
bee1762b0e 'Nothing' as function return type and property type can't be abbreviated. 2016-06-10 16:21:27 +03:00
Dmitry Petrov
0ff677596f Modifiers checking for type aliases.
Exposed type checking for type aliases.
2016-06-10 16:21:26 +03:00
Dmitry Petrov
139e219ebd Star projections in type alias expansions are substituted to star projections
for corresponding type parameters in expanded type.
Test that type alias arguments are substituted literally,
and no type approximation is performed on substitution.
2016-06-10 16:21:26 +03:00
Dmitry Petrov
1efbd34529 Test: arguments of type aliases should be substituted literally,
without type approximation.
TYPE_MISMATCH is an expected error.
2016-06-10 16:21:26 +03:00
Dmitry Petrov
7da50069eb Additional tests for illegal type in type alias expansion:
'Array<Nothing>' passed as an unused parameter to type alias.
2016-06-10 16:21:26 +03:00
Dmitry Petrov
115f40d371 UNUSED_TYPEALIAS_PARAMETER: special diagnostic for typealias parameters
explicitly telling that such type parameters are not used in type checking.
Move typealias-related utility functions on types to TypeUtils.kt.
2016-06-10 16:21:25 +03:00
Dmitry Petrov
40dd36bcf6 Recursive type alias expansion:
when resolving abbreviated type, do not check bounds
if the resulting type contains type aliases.
2016-06-10 16:21:25 +03:00
Nikolay Krasko
688c742802 j2k: minor fixes in KtLightClassForAnonymousDeclaration 2016-06-10 14:17:36 +03:00
Nikolay Krasko
4679ae60ab j2k: actual convert KtLightClassForAnonymousDeclaration 2016-06-10 14:17:35 +03:00
Nikolay Krasko
81b94d0988 j2k: rename KtLightClassForAnonymousDeclaration 2016-06-10 14:17:31 +03:00
Nikolay Krasko
9e9c670ada Minor: clean up and reformat 2016-06-10 14:17:20 +03:00
Dmitry Petrov
a4267f069d Codegen should just skip (local) type alias declarations. 2016-06-10 10:25:10 +03:00
Dmitry Petrov
c04b16d6cc Type parameters for type alias constructor are declared type parameters for type alias
(no implicit type parameters from containing scopes).
2016-06-10 10:25:09 +03:00
Dmitry Petrov
bcd1df4efe More tests for type alias constructor type parameters. 2016-06-10 10:25:09 +03:00
Dmitry Petrov
6924ed53ec Local type aliases: resolve 2016-06-10 10:25:09 +03:00
Dmitry Petrov
9a7bbc1516 Type alias shouldn't expand to a malformed type (e.g., 'Array<Nothing>'). 2016-06-10 10:25:09 +03:00
Dmitry Petrov
d02785806d Type alias shouldn't capture type parameters of inaccessible outer classes. 2016-06-10 10:25:09 +03:00
Dmitry Petrov
12710bec2f Redeclaration errors for type aliases: type alias vs function. 2016-06-10 10:25:08 +03:00
Dmitry Petrov
5ad4c8b9c7 Redeclaration errors for type aliases: type alias vs property. 2016-06-10 10:25:08 +03:00
Mikhail Glukhikh
9470308fe7 If to when: more accurate comment handling #KT-12649 Fixed 2016-06-09 20:00:14 +03:00
Denis Zharkov
d2bf4cbfa0 Fix reference resolution on suspension calls 2016-06-09 17:57:15 +03:00
Denis Zharkov
f1b0204ffe Fix public API test data after Continuation introduction 2016-06-09 17:57:15 +03:00
Denis Zharkov
036f90053e Minor. Fix formatting 2016-06-09 17:57:15 +03:00
Denis Zharkov
92bd6880da Add AdditionalBuiltInsMembers language feature and relevant checks 2016-06-09 17:57:15 +03:00
Denis Zharkov
072abe89cd Minor. Replace manual checkCoroutineBuilderCall with BuilderFunctionsCallChecker 2016-06-09 17:57:15 +03:00
Denis Zharkov
1b82e43d76 Add LanguageFeatureSettings parameter to single method in checkers interfaces
This parameter will be used further for target-dependent checks

Also introduce SimpleDeclarationChecker/SimpleCallChecker sub-interfaces (more weak ones)
Implementing them instead of base checkers is more convenient in most cases
2016-06-09 17:57:15 +03:00
Alexander Udalov
59342000ae Fix toString() and reflectLambda() for lambdas with generic types in signatures
#KT-10771 Fixed
2016-06-09 17:28:56 +03:00
Alexander Udalov
dc2972d99e Implement copy in FunctionDescriptorImpl, call doSubstitute only in CopyConfiguration#build 2016-06-09 17:28:56 +03:00
Alexander Udalov
ee8ca0b850 J2K JavaElementCollectionFromPsiArrayUtil 2016-06-09 17:28:56 +03:00
Stanislav Erokhin
cd4c9968df Minor. fix test 2016-06-09 16:42:42 +03:00
Stanislav Erokhin
53bf720503 Fix type alias problems after rebase. 2016-06-09 16:42:41 +03:00
Alexander Udalov
db3e0798c8 Minor, move the Lombok hack a bit higher 2016-06-09 16:38:47 +03:00
Alexander Udalov
3477f6ee85 Minor, drop java_generic_services option from .proto files
There are no service definitions in our .proto files, so this option had no
effect
2016-06-09 15:54:49 +03:00
Alexander Udalov
aba1cc3d83 Minor, cleanup GenerateProtoBuf.kt 2016-06-09 15:54:49 +03:00
Alexander Udalov
0c0a451d20 J2K serialization: fix compilation and prettify 2016-06-09 15:54:49 +03:00
Alexander Udalov
6692aca5f3 J2K serialization: invoke automatic J2K conversion 2016-06-09 15:54:49 +03:00
Alexander Udalov
89c0af0d80 J2K serialization: move .java -> .kt 2016-06-09 15:54:49 +03:00
Alexander Udalov
3469e980cb Minor, remove 'depends' from kotlin-build-common-test Ant task
Similarly to other targets in build.xml, this simplifies manual partial
compilation of artifacts
2016-06-09 15:54:49 +03:00
Alexander Udalov
70378a07c9 Minor, fix code style in CompilerConfiguration 2016-06-09 15:54:49 +03:00
Stanislav Erokhin
4f943dcbf8 KT-11778 Exception in Lombok plugin: Rewrite at slice FUNCTION
#KT-11778 Fixed.
EA-64051 Fixed.
2016-06-09 14:22:23 +03:00
Stanislav Erokhin
93b27417af Minor. update testdata. 2016-06-09 12:59:06 +03:00
Stanislav Erokhin
6bce4f6d6a Minor. compilation after rebase. 2016-06-09 12:58:25 +03:00
Stanislav Erokhin
541b9954f5 Minor. Roll back behaviour for FlexibleType.isError. 2016-06-09 12:58:23 +03:00
Stanislav Erokhin
74be53d297 Add documentation for KotlinType. 2016-06-09 12:58:21 +03:00
Stanislav Erokhin
fd40273a0d Removed interface LazyType. 2016-06-09 12:58:19 +03:00
Stanislav Erokhin
63b2f89356 Removed laziness from TypeDeserializer, because DeserializedMemberScope has cache for callable descriptors. 2016-06-09 12:58:18 +03:00
Stanislav Erokhin
de97bc2a05 Minor. simplified creation of simple type with default scope. 2016-06-09 12:58:16 +03:00
Stanislav Erokhin
0bec639b07 Introduce LazyWrappedType. 2016-06-09 12:58:14 +03:00
Stanislav Erokhin
7a5469faa4 Minor. rename LazyJavaTypeResolver -> JavaTypeResolver. 2016-06-09 12:58:12 +03:00
Stanislav Erokhin
c30754ae3c Remove laziness from LazyJavaTypeResolver.
This laziness was removed because main client of JavaTypeResolver is LazyJavaMemberScope. And this scope run enhance signatures which run resolve for this types.
2016-06-09 12:58:10 +03:00
Stanislav Erokhin
e5aa8ebe7c Minor. simplify code. 2016-06-09 12:58:09 +03:00
Stanislav Erokhin
8c2ad82de7 Minor. fixes after review 2016-06-09 12:58:07 +03:00
Stanislav Erokhin
797ef8d143 Refactoring. Removed all usages of asSimpleType except related to TypeSubstitution. 2016-06-09 12:58:05 +03:00
Stanislav Erokhin
dd362f683c Corrected util method getFunctionTypeForSamType for flexible types. 2016-06-09 12:58:03 +03:00
Stanislav Erokhin
a6da15f8e2 Minor. remove several methods from TypeUtils 2016-06-09 12:58:02 +03:00
Stanislav Erokhin
f41c8dc045 Refactoring. Removed several usages of asSimpleType 2016-06-09 12:58:00 +03:00
Stanislav Erokhin
1d9ca06b96 Remake KotlinTypes. 2016-06-09 12:57:59 +03:00
Stanislav Erokhin
56122460aa Remove type capabilities. 2016-06-09 12:57:58 +03:00
Stanislav Erokhin
4c0572fb2f Remove type capability CustomTypeVariable. 2016-06-09 12:57:56 +03:00
Stanislav Erokhin
a5c1e009c3 Remove type capability AbbreviatedType. 2016-06-09 12:57:55 +03:00
Stanislav Erokhin
203c4cd94d Remake Raw type representation.
(cherry picked from commit b21cede)
2016-06-09 12:57:53 +03:00
Stanislav Erokhin
04e97f5058 Refactoring. Do not use SubtypingRepresentatives as TypeCapability. 2016-06-09 12:57:51 +03:00
Stanislav Erokhin
1eaefa7fed Refactoring. Remove type capability Flexibility. 2016-06-09 12:57:50 +03:00
Stanislav Erokhin
669558c4ba Refactoring. Move flexible type factory to deserialization module. 2016-06-09 12:57:48 +03:00
Stanislav Erokhin
42857992ed Minor. Add ALLOW_AST_ACCESS to two tests.
We suppose, that AST access is allowed if we have property with initializer.
2016-06-09 12:57:47 +03:00
Stanislav Erokhin
7bc2c55d12 Refactoring. Create WrappedType. 2016-06-09 12:57:46 +03:00
Stanislav Erokhin
957bae18be Refactoring. Move flexible type creation to KotlinTypeFactory. 2016-06-09 12:57:44 +03:00
Stanislav Erokhin
3a451744c5 Introduce KotlinTypeFactory 2016-06-09 12:57:43 +03:00
Stanislav Erokhin
8c6dd95e3f Introduce SimpleType. 2016-06-09 12:57:41 +03:00
Dmitry Petrov
44829a61e7 Report redeclaration errors for type aliases vs class/interface/object. 2016-06-09 10:27:51 +03:00
Dmitry Petrov
d3721872b2 Tests for type alias diagnostics: type parameter bound violation in type alias constructor 2016-06-09 10:27:51 +03:00
Dmitry Petrov
b552425558 Tests for type alias diagnostics: type projections in type alias constructor
(should report same errors as for classes)
2016-06-09 10:27:51 +03:00
Dmitry Petrov
d86be43171 Tests for type alias diagnostics: wrong number of type arguments in type alias constructor 2016-06-09 10:27:51 +03:00
Dmitry Petrov
ccbade663b Do not perform type alias expansion for error types. 2016-06-09 10:27:50 +03:00
Dmitry Petrov
b2e5cfebee Diagnostics for type alias expansion errors in type alias RHS 2016-06-09 10:27:50 +03:00
Ilya Gorbunov
753be08de6 Minor: update links in ReadMe 2016-06-08 21:45:25 +03:00
gandrianakis
83e97d272e Small grammar fixes for documentation of default value handling related methods for Map 2016-06-08 21:45:24 +03:00
gandrianakis
cbc5c6f792 Slight improvement of wording in the section that explains the benefits of contributing code examples for library functions 2016-06-08 21:34:18 +03:00
Pavel V. Talanov
e032e4ad54 Update changelog for 1.0.3 2016-06-08 19:29:21 +03:00
Pavel V. Talanov
b08881df58 Changelog, minor: merge duplicating JS sections 2016-06-08 19:29:07 +03:00
Denis Zharkov
9c929dd609 Minor. Rename MandatoryMethodTransformer -> FixStackWithLabelNormalizationMethodTransformer
It's necessary because some usages suppose that it's only purpose is fixing stack
2016-06-08 18:53:16 +03:00
Denis Zharkov
2c78ce22a5 Minor. Simplify coroutine transformation 2016-06-08 18:53:16 +03:00
Denis Zharkov
771cca9c23 Fix some try-catch block related problems in coroutine transformer
Split all try-catch blocks when they intersect suspension points
2016-06-08 18:53:16 +03:00
Denis Zharkov
e802049fd0 Ignore handleReturn calls if functions is not operator 2016-06-08 18:53:16 +03:00
Denis Zharkov
692acc463a Fix handleResult call generation for statement-like last expression in a block 2016-06-08 18:53:16 +03:00
Denis Zharkov
3a5197d1ae Minor. Simplify collecting save/restore markers for FixStackMethodTransformer 2016-06-08 18:53:16 +03:00
Denis Zharkov
0d01edb7f9 Adapt FixStackAnalyzer to code generated by coroutine transformation
Without this change internal error happens while inlining coroutine code with try/catch inside
Also get rid of hack with SKIP_MANDATORY_TRANSFORMATIONS_ANNOTATION_DESC
See comment within MethodAnalyzer for clarification
2016-06-08 18:53:16 +03:00
Denis Zharkov
678e8c2baa Setup label value in constructor to be invalid until 'invoke(Controller)' call 2016-06-08 18:53:16 +03:00
Denis Zharkov
759cb83dfb Add checks that coroutines are available at the given language level 2016-06-08 18:53:16 +03:00
Denis Zharkov
2bdaec6eac Refine definition of whether call is suspension point
It's not about all calls to suspend functions, they may called from non-coroutine code
2016-06-08 18:53:16 +03:00
Denis Zharkov
1067531224 Introduce light-weight user data parts into FunctionDescriptor 2016-06-08 18:53:16 +03:00
Denis Zharkov
dd3de8372f Minor. Cleanup FunctionDescriptorImpl 2016-06-08 18:53:16 +03:00
Denis Zharkov
07592398c1 Preserve sources properly for coroutine parts
Otherwise incremental reporting leads to exception when inlining into coroutine body happens
2016-06-08 18:53:16 +03:00
Denis Zharkov
7dda2d9f62 Add ability to set up source element when copying descriptor 2016-06-08 18:53:16 +03:00
Denis Zharkov
dddd7413a1 Fix generated code for suspending in the middle of object construction 2016-06-08 18:53:16 +03:00
Denis Zharkov
b8d4d39f4d Add custom applicability checks for suspend/coroutine modifiers 2016-06-08 18:53:16 +03:00
Denis Zharkov
d760a2ec3b Add CallChecker prohibiting non-local suspension calls
Effectively suspension point is local <=> return to relevant lambda is allowed in place
2016-06-08 18:53:16 +03:00
Denis Zharkov
b1189eff23 Make suspension calls generation more stable
Instead of performing signature change during transformation
it's convinient to make just when generating corresponding call,
for example there is no need to think about default parameters as they just work as is

See comment above replaceSuspensionFunctionViewWithRealDescriptor for clarification
2016-06-08 18:53:16 +03:00
Denis Zharkov
84ae28992e Minor. Drop unused class 2016-06-08 18:53:16 +03:00
Denis Zharkov
611490e080 Support non-local returns to coroutine label from inline lambda
- Use proper class descriptor when retreiving continuation object (see previous commit)
- Use return type as VOID for such cases
- Load correct labels related to coroutine lambda from outer context
2016-06-08 18:53:16 +03:00
Denis Zharkov
94bd6dcc82 Use proper coroutine class descriptor for extension receiver generation
Before this commit context.getThisDescriptor() has been used, that was quite correct
until suspension happens inside inlined lambda (it has different this-descriptor)
2016-06-08 18:53:16 +03:00
Denis Zharkov
75e112e752 Implement basic support for coroutines in JVM backend 2016-06-08 18:53:16 +03:00
Denis Zharkov
077fc528d1 Minor. Change CompilationException parameter to @Nullable
A lot of call sites actally pass null as an element,
so it's better to fail with original stack-trace instead of NPE
caused by nullability check
2016-06-08 18:53:16 +03:00
Denis Zharkov
20d1d12f3b Revert "'yield' reserved as a keyword"
This reverts commit 434082cadb.
2016-06-08 18:53:16 +03:00
Denis Zharkov
5c1e17c8e7 Revert "Completion fix for reserved 'async' syntax"
This reverts commit 318f0c89b2.
2016-06-08 18:53:16 +03:00
Denis Zharkov
3ede8f97e6 Revert "Quick fix for deprecated async syntax"
This reverts commit afc1e24571.
2016-06-08 18:53:16 +03:00
Denis Zharkov
1af9321c20 Revert "'async' reserved in front of function literals"
This reverts commit 6155d836a5.
2016-06-08 18:53:16 +03:00
Denis Zharkov
7d3333e86e Revert "Reserve "async* {}", extend the quick-fix"
This reverts commit a7e7d53e2b.
2016-06-08 18:53:16 +03:00
Denis Zharkov
bf3e6247aa Minor. Extract TransformationMethodVisitor with abstract performTransformations(@NotNull MethodNode methodNode) 2016-06-08 18:53:16 +03:00
Denis Zharkov
b1ec0dda45 Resolve all return expressions in coroutine as fake calls to 'handleResult' 2016-06-08 18:53:16 +03:00
Denis Zharkov
372791eb15 Replace common extension receiver of coroutine-lambda with magic one
Currently it only contains additional synthetic declarations for suspend-functions

E.g. `fun <V> await(f: CompletableFuture<V>): V` for `fun <V> await(f: CompletableFuture<V>, machine: Continuation<V>): Unit`
2016-06-08 18:53:16 +03:00
Denis Zharkov
8f4ee0528e Implement operator checks for controller's handleResult 2016-06-08 18:53:16 +03:00
Denis Zharkov
fcbff72f6f Replace expected type for coroutine-lambda
Use 'handleResult' method of controller to determine what lambda should return

If original declaration was
fun builder(coroutine c: Controller.() -> Continuation<Unit>) = 1
and there is 'fun handleResult(x: X, c: Continuation<Nothing>)',
then expected type for lambda is 'Controller.() -> X'
2016-06-08 18:53:16 +03:00
Denis Zharkov
e97376bb2c Introduce coroutine-related API into built-ins 2016-06-08 18:53:16 +03:00
Denis Zharkov
1a93c276f6 Minor. Apply 'Simplify if' 2016-06-08 18:53:16 +03:00
Denis Zharkov
88637ba336 Minor. Cleanup codegen.optimization package 2016-06-08 18:53:16 +03:00
Denis Zharkov
329fb9d619 Introduce 'coroutine'/'suspend' modifiers 2016-06-08 18:53:16 +03:00
Denis Zharkov
38d74a16fe Change FlagsToModifiers from enum to abstract
Add 2 non-trivial implementations and one for boolean flags
2016-06-08 18:53:16 +03:00
Denis Zharkov
f434801bf6 Minor. Drop 'CodegenBased.callableDescriptor' field and relevant generic parameter
It was redundant for most of subclasses
2016-06-08 18:53:16 +03:00
Alexey Sedunov
158037dd68 Create Test Intention: Fix RuntimeException on attempt to convert generated test class to Kotlin
#KT-12285 Fixed
 #EA-82281 Fixed
2016-06-08 17:50:21 +03:00
Pavel V. Talanov
32c5ccdaad plugin.xml: Add dependency on java module
This restricts usage of plugin to IDEA and Android Studio
2016-06-08 17:45:32 +03:00
Dmitry Petrov
9c74f27967 Type alias can't expand to 'dynamic' 2016-06-08 15:55:52 +03:00
Dmitry Petrov
ef4c3bdae8 Don't expand types that don't contain type aliases or type parameters. 2016-06-08 15:55:52 +03:00
Dmitry Petrov
cf8cbad11c Refactor: extract TypeAliasExpander as a separate class. 2016-06-08 15:55:52 +03:00
Dmitry Petrov
cb08d976d3 Tests for importing type aliases 2016-06-08 15:55:52 +03:00
Mikhail Glukhikh
4b6b35dadf Type parameter is considered capable of taking any value for the purpose of cast possibility check #KT-6611 Fixed 2016-06-08 15:25:34 +03:00
Mikhail Glukhikh
99acbf16b2 CastDiagnosticsUtil.kt: converted to Kotlin 2016-06-08 15:25:29 +03:00
Mikhail Glukhikh
f3f7bff376 CastDiagnosticsUtil.java --> CastDiagnosticsUtil.kt 2016-06-08 15:25:25 +03:00
Ilya Chernikov
7153ea61d8 Restore logic of StandardScriptDefinition handling, fixes codegen tests 2016-06-07 21:13:06 +02:00
Ilya Chernikov
e8c13882b4 Make script detection API generic, fix tests 2016-06-07 21:13:05 +02:00
Ilya Chernikov
3393d7b7d2 Optimize script definitions handling
Loading script configs only from project root dir
Optimize script definition retrieval in the KtScript
2016-06-07 21:13:04 +02:00
Ilya Chernikov
656fcc9775 Refactor and fixes after review
improving script constructor search algorithm - now default params should be supported
remove prefix Customized- from scripts ModuleInfo-related classes
refactoring ideaModuleInfos after review
refactoring ResolveSessionProvider construction for readability
refactoring KotlinScriptConfigurationManager after review
fixing KotlinScriptDefinitionProvider after review
2016-06-07 21:13:04 +02:00
Pavel V. Talanov
d5b486eb80 Refactor LazyClassDescriptor and minor changes
Minor: get script definition once
Refactor: get rid of 'LazyClassDescriptor#getInjectedSupertypes'
Minor: rename scope
2016-06-07 21:13:03 +02:00
Ilya Chernikov
4d95e873a9 Add a guard for empty dependencies list, fixes EA-82348 2016-06-07 21:13:02 +02:00
Pavel V. Talanov
8e700cdb10 Do not limit scope when searching in index by default 2016-06-07 21:13:01 +02:00
Ilya Chernikov
478ae96e50 Implement a compiler config key to add preconfigured extra imports for scripts 2016-06-07 21:13:01 +02:00
Ilya Chernikov
956bcf6d7a Fix permgen problems with script launching by avoiding reflection as much as possible 2016-06-07 21:13:00 +02:00
Ilya Chernikov
b9ea9513b1 Rewrite handing and caching of script configurations
The refactoring could enable lazy update of the index on script loading, but seems that makeRootsChange
call doesn't work as expected, therefore initial project scan is performed in the KotlinScriptConfigurationManager
anyway
2016-06-07 21:12:59 +02:00
Ilya Chernikov
3e6616de42 Read script config if appropriate flag is specified, fix classpath handling 2016-06-07 21:12:58 +02:00
Ilya Chernikov
abfda50077 Workaround URISyntaxException in tests on windows + JDK 6 2016-06-07 21:12:58 +02:00
Ilya Chernikov
0d7ecee6ee Update index on definition/import files changes 2016-06-07 21:12:57 +02:00
Ilya Chernikov
1a98c5eb0e Allow script dependnencies to be found as a candidates for decompilation 2016-06-07 21:12:56 +02:00
Ilya Chernikov
9ed8dec9fb Make a marker interface to allow ScriptDependenciesClassFilter to be used in the resolving 2016-06-07 21:12:55 +02:00
Ilya Chernikov
5c37017484 Prepare infrastruct for fixing customized script resolving
Move ConfigManager and ClassFinder to the idea-analysis
 Add (back) IndexableSetContributor
 Add a method in ConfigManager to generate all dependencies scope
 Add and use delegating scope with possibility to get base scope from it (used in the class finder)
2016-06-07 21:12:54 +02:00
Ilya Chernikov
3e17724e58 Implement class finder for customized scripts resolving - not yet completely functional 2016-06-07 21:12:54 +02:00
Ilya Chernikov
b63ed0f4aa Make script launcher aware of custom scripts, minor correction is core env 2016-06-07 21:12:53 +02:00
Ilya Chernikov
8ba9d2b75c minor: Fix daemon client diagnostic 2016-06-07 21:12:52 +02:00
Ilya Chernikov
06a586bb82 Add reading script configuration files on compilation 2016-06-07 21:12:51 +02:00
Ilya Chernikov
14ae795aaa Support extra imports configuration for scripts (only classpath so far) 2016-06-07 21:12:51 +02:00
Ilya Chernikov
57f03332c2 Add module dependencies to script module info 2016-06-07 21:12:50 +02:00
Ilya Chernikov
dfc96d216b Refactor configs loading, Add config script definitions reloading on config files changes 2016-06-07 21:12:49 +02:00
Ilya Chernikov
310e8014a8 Refactor KotlinScriptDefinitionProvider access to scriptDefinitions 2016-06-07 21:12:48 +02:00
Ilya Chernikov
f185d3639d Move KotlinScriptConfigurationManager to idea module 2016-06-07 21:12:48 +02:00
Ilya Chernikov
95703786ee Change error reporting for unresolved script definition types 2016-06-07 21:12:47 +02:00
Ilya Chernikov
3c18f98d3d Make variables replacements in classpath be able to work with lists 2016-06-07 21:12:46 +02:00
Ilya Chernikov
0921258e5d Add environment vars dictionary for classpath customization in script configs 2016-06-07 21:12:45 +02:00
Ilya Chernikov
339f945ce0 Implement searching for config files in th whole project directory tree 2016-06-07 21:12:45 +02:00
Ilya Chernikov
9273b0cd8d Add config loader from stream 2016-06-07 21:12:44 +02:00
Pavel V. Talanov
24b4afb3b8 Enable full highlighting in script files everywhere (was inside source roots only)
Extract KotlinHighlightingUtil to hold this logic
2016-06-07 21:12:43 +02:00
Pavel V. Talanov
34f8e9303f scopeUtils: support CustomizedScriptModuleInfo info in completion 2016-06-07 21:12:42 +02:00
Ilya Chernikov
834bb51643 Add tests with partial classpath for script compilation 2016-06-07 21:12:39 +02:00
Ilya Chernikov
9d9fe97a8e Refactor script configuration for better functionality separation 2016-06-07 21:11:30 +02:00
Ilya Chernikov
5590bcf024 Add initial prototype of custom script support in IDE 2016-06-07 21:11:29 +02:00
Ilya Chernikov
770ef16ef7 Replace script recognition from by PsiFile to by virtual file, fix custom script name generation 2016-06-07 21:11:28 +02:00
Ilya Chernikov
ad7fcc92d2 Add configurable script definition and appropriate manager component
The component is intended for configuring script types defined in some specific xml files and add appropriate script definitions to the provider
2016-06-07 21:11:27 +02:00
Ilya Chernikov
d225385d19 Add name and classpath to KotlinScriptDefinition 2016-06-07 21:11:26 +02:00
Ilya Chernikov
d63b53886c Convert KotlinScriptDefinitionProvider to kotlin - phase 2 - convert; related fixes and refactorings 2016-06-07 21:11:26 +02:00
Ilya Chernikov
b9836d8c87 Convert KotlinScriptDefinitionProvider to kotlin - phase 1 - rename 2016-06-07 21:11:25 +02:00
Ilya Chernikov
e1ca45f360 Add support for script base class with parameters
including possibility to describe which script params to pass to superclass
2016-06-07 21:11:24 +02:00
Ilya Chernikov
3c1503564e Add possibility to specify supertypes for script, with tests 2016-06-07 21:11:23 +02:00
Ilya Chernikov
670627ac4e Add helpers, compilation function and tests for passing classes as a parameters to a script 2016-06-07 21:11:23 +02:00
Ilya Chernikov
bd70481bea Convert ScriptTest to Kotlin - phase 2 - convert 2016-06-07 21:11:16 +02:00
Ilya Chernikov
0699293fb7 Convert ScriptTest to Kotlin - phase 1 - rename .java to .kt 2016-06-07 21:06:00 +02:00
Alexander Udalov
e3164119c1 Inline PrintingMessageCollector#PLAIN_TEXT_TO_SYSTEM_ERR
Otherwise 'hasErrors' flags was not cleared between subsequent runs of tests
which were using this message collector
2016-06-07 21:12:24 +03:00
Nikolay Krasko
c93d0f69ca Support Idea 163 branch 2016-06-07 19:18:55 +03:00
Kirill Rakhman
5c68681f96 Formatter: handle spaces before value arguments list (KT-12634)
#KT-12634 Fixed
2016-06-07 19:11:28 +03:00
Pavel V. Talanov
922dc85e11 Update changelog for 1.0.3 2016-06-07 17:08:13 +03:00
Alexey Tsvetkov
5e550a1280 Minor fixes of android test project 2016-06-07 16:51:17 +03:00
Jake Wharton
c199fd25e6 Add support for the Android test plugin.
#KT-11767 fixed
2016-06-07 16:51:17 +03:00
Dmitry Jemerov
060c285715 search for Kotlin convention usages of Java methods
#KT-5960 Fixed
2016-06-07 14:50:16 +02:00
Dmitry Jemerov
7e2ce2d4e0 when finding usages of parameter of annotation class primary constructor, search also for light method generated from that parameter
#KT-9399 Fixed
2016-06-07 14:50:09 +02:00
Alexey Tsvetkov
5161b6bfe0 Shade in kotlin-build-common-test 2016-06-07 14:42:42 +03:00
Alexey Tsvetkov
5fead88ced Shade in kotlin-android-extensions 2016-06-07 14:42:39 +03:00
Alexey Tsvetkov
23353facca Shade in kotlin-compiler-embeddable
Now kotlin gradle plugin is compatible with android gradle plugin 2.2

     #KT-12478 fixed
     #KT-12431 fixed
     #KT-12406 fixed
2016-06-07 14:42:35 +03:00
Alexey Tsvetkov
fd60ec4171 Set idea.io.use.nio2=true every build on windows
Otherwise (setting property once in static block) gradle daemon might clear system properties

     #KT-11770 fixed
2016-06-07 14:42:30 +03:00
Alexey Andreev
0e1dde022a KT-6942: in JS backed for value equalitity patterns in when generate structural equality check (i.e. Any.equals) instead of referential check (===).
(cherry picked from commit 97228e5)
2016-06-07 12:59:16 +03:00
Alexander Udalov
61290d1225 Temporarily disable inline for bound function references 2016-06-07 12:43:10 +03:00
Alexander Udalov
b9e61f035f Support bound callable references in codegen 2016-06-07 12:43:09 +03:00
Alexander Udalov
526a64dc36 Pass data flow info from '::' expressions, fix expected type 2016-06-07 12:43:07 +03:00
Alexander Udalov
d8db769823 Use empty list instead of ThrowingList in callable reference resolution
Clients of the call resolution do not expect to see a throwing list in call's
arguments, and it's wrong to make each of them check against the special case
that is the resolution of callable references

Fixes EA-69901
2016-06-07 12:42:45 +03:00
Alexander Udalov
e2d6e0cbab Propagate control flow to bound double colon expressions
"Unused expression" should be reported on unused double colon expressions, this
is postponed

 #KT-12551 Open
2016-06-07 12:42:42 +03:00
Alexander Udalov
0ce6bd9999 Ignore resolution to function without arguments on LHS of '::'
In the expression "Runnable::run" we were resolving the left-hand side to the
SAM constructor of Runnable. Now we detect this situation, ignore the result of
such resolution, and continue resolving the LHS as a type
2016-06-07 12:42:19 +03:00
Alexander Udalov
04c190231a Support bound references to objects and companion objects
Tweak member extension detection a little bit to prohibit extensions imported
from objects (they don't have one of the receiver parameters)
2016-06-07 12:41:30 +03:00
Alexander Udalov
d90b40c661 Use LanguageFeatureSettings instead of custom option for bound callable references 2016-06-07 12:41:29 +03:00
Alexey Andreev
7240a8df6c JS/Inliner: fix build 2016-06-07 12:18:23 +03:00
Alexey Andreev
b1fcad6dcc JS/Inlining: in RedundantStatementElimination remove unnecessary side effect check for binary expressions 2016-06-07 11:54:48 +03:00
Alexey Andreev
f0e64f8e38 JS/Inlining: rename IneffectiveStatementElimination to RedundantStatementElimination 2016-06-07 11:54:45 +03:00
Alexey Andreev
07d5a4506c JS/Inlining: minor improvements and clarifications after code review. Test whether expression without side effect does not prevent to relocate another expressions 2016-06-07 11:54:41 +03:00
Alexey Andreev
6b99d4e1c5 JS/Inlining: change sideEffects metadata to take three values: producing side effect, dependding on side effect and purity 2016-06-07 11:54:41 +03:00
Alexey Andreev
774efa4e70 JS/Inlining: improve test for removal of binary expresions without side effect, add tests for removal of a reference to a function parameter 2016-06-07 11:54:34 +03:00
Alexey Andreev
b395d40e97 JS/Inlining: refactor TemporaryVariableElimination 2016-06-07 11:54:31 +03:00
Alexey Andreev
0c0fc81e5f JS/Inlining: refactor IneffectiveStatementElimination 2016-06-07 11:54:28 +03:00
Alexey Andreev
d829bf4914 JS/Inlining: clarify why it's necessary to remove expression statements like a[b] 2016-06-07 11:54:23 +03:00
Alexey Andreev
57ac23a606 JS/Inlining: in temporary variable elimination don't treat FQN without side effects as trivial, i.e. disable moving these vars freely across function body 2016-06-07 11:54:20 +03:00
Alexey Andreev
878e95e040 JS/Inlining: minor simplifications after code review 2016-06-07 11:54:19 +03:00
Alexey Andreev
a26c09ae81 JS/Inlining: refactor TemporaryAssignmentElimination, add more tests 2016-06-07 11:54:12 +03:00
Alexey Andreev
b8b6999afc JS/Inlining: add test case for KT-10931 2016-06-07 11:54:12 +03:00
Alexey Andreev
5fdf7cbac9 JS/Inlining: minor code style fixes 2016-06-07 11:54:03 +03:00
Alexey Andreev
4783c9b612 JS/Inlining: in function call like fn() extract fn to a local variable, since fn can be access to property with side effects. Add tests to prove that evaluation order became proper in certain cases. Fix KT-11711, KT-7674, KT-7043 2016-06-07 11:54:02 +03:00
Alexey Andreev
c3d0fca92b JS/Inlining: mark closure constructors as free from side effects 2016-06-07 11:54:02 +03:00
Alexey Andreev
47cb0cde01 JS/Inlining: in temporary variable elimination improve moving of some expressions which are provably pure 2016-06-07 11:54:01 +03:00
Alexey Andreev
50aa1b271f JS/Inlining: when generating expression for default property accessor, mark this expression as side effect free, so optimizer has opportunity to move it 2016-06-07 11:53:56 +03:00
Alexey Andreev
96532f1fc2 JS/Inlining: fix broken evaluation order after applying temporary variable elimination 2016-06-07 11:52:58 +03:00
Alexey Andreev
ee6483b7ec JS/Inlining: in expression like f(g()), where *f* is inline, don't treat g() as a lambda constructor 2016-06-07 11:52:57 +03:00
Alexey Andreev
65876c36eb JS/Inlining: introduce removal of expression statements without side effects 2016-06-07 11:52:57 +03:00
Alexey Andreev
551ed28d84 JS/Inlining: introduce removal of unused variables 2016-06-07 11:52:56 +03:00
Alexey Andreev
776c7447b1 JS/Inlining: in temporary variable elimination introduce better recognition of FQNs without side effects 2016-06-07 11:52:56 +03:00
Alexey Andreev
c08e2e8ca0 JS/Inlining: always create temporary variables to alias expressions in following cases:
* when decomposing expression that contains inline calls, alias all subexpressions
* when substituting arguments to inline call
* for value returned from inline function.

Instead, rely on dedicated optimization pass. Improve lookup of function to inline, since the old one relied on immediate optimizations. Give more hints to optimizer.

This should make inlining more stable in different hard-to-reproduce corner cases with evaluation order.
2016-06-07 11:52:55 +03:00
Alexey Andreev
c11f2fe2d6 JS/Inlining: fix bug in temporary assignment elimination which causes excess removal of assignment statement. When there is a set of temporary variables that receive same value in different execution branches, remove them carefully so that at least one (and, preferably, at most) remains in each branch. 2016-06-07 11:52:55 +03:00
Dmitry Petrov
48c417285c LazyImportScope: accept TypeAliasDescriptor 2016-06-07 09:47:54 +03:00
Alexey Sedunov
fe01035e3c Rename: Do not rename ambiguous references in import directives
#KT-6363 Fixed
2016-06-06 21:29:23 +03:00
Alexey Sedunov
8ba1aff7e6 Rename: Show more detailed element descriptions in Rename dialog
#KT-8544 Fixed
2016-06-06 21:29:19 +03:00
Alexey Sedunov
9692c210fd Rename: Copy default values if function to be renamed inherits default values from some base function which is excluded from rename
#KT-9446 Fixed
2016-06-06 21:29:15 +03:00
Alexey Sedunov
188531017a Rename: Implement automatic renamer for test classes
#KT-8512 Fixed
2016-06-06 21:29:11 +03:00
Alexey Sedunov
42b71ae90c Rename: Do not show 'Rename overloads' options if target function has no
overloads. Consider extensions and members overloads if they have the same
recever class
 #KT-8541 Fixed
 #KT-8786 Fixed
2016-06-06 21:29:07 +03:00
Dmitry Petrov
9e7222906d Generate (possibly empty) file classes for files with type aliases. 2016-06-06 13:50:37 +03:00
Dmitry Petrov
872b3e8a52 DeclarationsChecker runs checks on type alias declarations.
TYPEALIAS_SHOULD_EXPAND_TO_CLASS diagnostics
(implemented for type aliases expanded to type parameters).
2016-06-06 13:50:37 +03:00
Dmitry Petrov
ea249244c5 'where' clause in type alias declaration is a syntax error
(type alias parameters can't have bounds)
2016-06-06 13:50:37 +03:00
Alexander Udalov
390b78b7f7 Minor, make CapturedParamInfo#skipInConstructor immutable 2016-06-06 13:26:31 +03:00
Alexander Udalov
b370ac0b37 Minor, delete CapturedParamOwner 2016-06-06 13:26:29 +03:00
Alexander Udalov
e148dcdee7 Cleanup inline codegen classes
Fix warnings, typos, formatting, break long lines, remove unused, add
nullability annotations, inline small methods used only once
2016-06-06 13:26:10 +03:00
Dmitry Jemerov
6a1ffc865d don't quote empty package name 2016-06-03 16:24:24 +02:00
Dmitry Petrov
7e64054af7 typeConstraintAdditionalResolve:
do not throw CCE for incorrect code with type parameter bounds on type alias parameters
2016-06-03 16:07:21 +03:00
Dmitry Petrov
aede318fd5 Protobuf diff: do not throw exception on TYPE_ALIAS_LIST 2016-06-03 16:07:21 +03:00
Dmitry Petrov
772fe5badb Treat unsupported or malformed type alias as a type alias with error types. 2016-06-03 16:07:20 +03:00
Dmitry Petrov
3500f5a96b Type alias: resolve type alias RHS during force-resolve. 2016-06-03 16:07:20 +03:00
Dmitry Petrov
df335b9e8d Type aliases: do not reparse RHS of type alias declaration in expanded type resolution 2016-06-03 16:07:20 +03:00
Dmitry Petrov
79ce614591 KT-11588 Type aliases: Fix EA-1117340 2016-06-03 16:07:20 +03:00
Dmitry Jemerov
8b30e7ef4e change implementation of 'new file' action to support escaping the package name and creating directory/package hierarchy
#KT-8362 Fixed
 #KT-11328 Fixed
2016-06-03 14:18:11 +02:00
Dmitry Jemerov
5f89274259 de-i18n 2016-06-03 14:18:11 +02:00
Dmitry Jemerov
28100be46b NewKotlinFileAction: J2K 2016-06-03 14:18:11 +02:00
Dmitry Jemerov
2ee03a71f9 NewKotlinFileAction: rename to .kt 2016-06-03 14:18:11 +02:00
Dmitry Jemerov
349376c4ec show new icon for Kotlin annotations in structure view (KT-12516) 2016-06-03 14:18:11 +02:00
Dmitry Jemerov
987b48dcfd can't close contents in Kotlin Bytecode toolwindow (KT-9797) 2016-06-03 14:18:11 +02:00
Mikhail Glukhikh
31cdc917d7 Source code cleanup: leaking this quick fixes applied 2016-06-03 14:46:11 +03:00
Mikhail Glukhikh
de3fbe38f1 KT-12152: quick fix "make final" for member / containing class 2016-06-03 14:46:07 +03:00
Mikhail Glukhikh
a22e7d3bcf KT-12152 : leaking this inspection: accessing non-final member / this in non-final class 2016-06-03 14:45:58 +03:00
Mikhail Glukhikh
3d6bd81933 KT-12152 : constructor consistency: non-final function calls 2016-06-03 09:45:52 +03:00
Mikhail Glukhikh
be40cf8138 KT-12152 : constructor consistency: distinguish properties with and w/o backing fields, with default / custom accessors 2016-06-03 09:45:49 +03:00
Mikhail Glukhikh
422ea4c6cb KT-12152 : constructor consistency: handle open property accessing 2016-06-03 09:45:45 +03:00
Mikhail Glukhikh
f7b5d67543 KT-12152 : constructor consistency: handle non-final classes 2016-06-03 09:45:41 +03:00
Mikhail Glukhikh
8e18165065 KT-12152 : constructor consistency analysis, base cases 2016-06-03 09:45:37 +03:00
Andrey Breslav
8544b9a1d6 Rule for function literals fixed: parameter types are allowed 2016-06-02 20:09:28 +03:00
Pavel V. Talanov
6ff0af1253 Update changelog for 1.0.3 2016-06-02 19:21:56 +03:00
Mikhael Bogdanov
092be8ca8e Don't generate unnecessary checkcast to java.lang.Number 2016-06-02 16:01:05 +03:00
Mikhael Bogdanov
a6cf169646 Fix for KT-12582: "VerifyError: Bad local variable type" caused by explicit loop variable type
#KT-12582 Fixed
2016-06-02 16:01:05 +03:00
Mikhael Bogdanov
e7f9d3417f Disabled several tests on android 2016-06-02 16:01:04 +03:00
Mikhael Bogdanov
c7d97c63a8 Small refactoring in constant processing 2016-06-02 16:01:03 +03:00
Alexey Sedunov
9b3f40ee76 Minor: Drop obsolete code 2016-06-02 15:28:36 +03:00
Alexey Sedunov
cf8cf37d69 Light Classes: Drop obsolete constraint which prevents generation of light methods for local class members
#KT-8892 Fixed
2016-06-02 15:28:34 +03:00
Alexey Sedunov
d27f3c0189 Rename: Do not replace Java references to synthetic component functions when renaming constructor parameter
#KT-9241 Fixed
2016-06-02 15:28:31 +03:00
Alexey Sedunov
958b402e42 Rename: Allow typing any identifier without backquotes in Rename dialog
#KT-9444 Fixed
2016-06-02 15:28:30 +03:00
Alexey Sedunov
96132fa61a Rename: @JvmName support
#KT-8044 Fixed
 #KT-9432 Fixed
2016-06-02 15:28:27 +03:00
Alexey Sedunov
ff4c16d342 Rename: Allow renaming class by constructor delegation call referencing primary constructor
#KT-8860 Fixed
2016-06-02 15:28:22 +03:00
Alexey Sedunov
e89e809dc7 Rename: Respect naming conventions in automatic variable rename
#KT-7851 Fixed
2016-06-02 15:28:19 +03:00
Alexey Sedunov
400d6b5aa0 Rename: Skip read-only declarations when renaming parameters
#KT-10713 Fixed
2016-06-02 15:28:16 +03:00
Alexey Sedunov
566ed0112f Rename: Fixed in-place rename of Kotlin expression referring Java declaration
#KT-9157 Fixed
2016-06-02 15:28:14 +03:00
Alexey Sedunov
691de677b3 Rename: Quote non-identifier names in Kotlin references
#KT-9156 Fixed
2016-06-02 15:28:11 +03:00
Alexey Sedunov
a743098aba Refactoring: Move quoteIfNeeded function to idea-core 2016-06-02 15:28:09 +03:00
Nikolay Krasko
3f4cde3d25 NoSuchFieldError in Evaluate Expression on a property of a derived class (KT-12206)
#KT-12206 Fixed
2016-06-02 14:39:51 +03:00
Nikolay Krasko
2c6d28c65f Refactoring: use drop instead subList 2016-06-02 14:38:47 +03:00
Nikolay Krasko
9ef0bf422c Minor: reveal nullability problem in generateSyntheticParts() 2016-06-02 14:38:46 +03:00
Nikolay Krasko
a6b16f6d00 Move uast dependency modules before idea module that now contains uast too. 2016-06-02 14:38:44 +03:00
Kirill Rakhman
c24960f8d9 Formatter: handle spaces between class name and type parameters (#875)
Fixes #KT-12446
2016-06-01 21:20:56 +03:00
Mikhail Glukhikh
33b6780ce2 Quick fix "add !!" for SMARTCAST_IMPOSSIBLE in certain situations 2016-06-01 19:48:26 +03:00
Alexander Udalov
7eafae1936 Drop isAbsoluteInRootPackage from stubs 2016-06-01 19:30:04 +03:00
Alexander Udalov
1339286261 Drop undocumented absolute name specification feature with 'package.' 2016-06-01 19:30:03 +03:00
Mikhail Glukhikh
9f819b1c03 Convert to expression body: take nested whens into account 2016-06-01 16:19:55 +03:00
Mikhail Glukhikh
2350caf177 Convert to expression body is forbidden on single non-exhaustive when statement with Unit result #KT-12502 Fixed 2016-06-01 16:02:15 +03:00
Mikhail Glukhikh
91ce8cc612 "Make abstract" is no longer applicable to object / enum entry members #KT-3797 Fixed 2016-06-01 16:02:11 +03:00
Dmitry Petrov
bce96baf20 KT-11588 Type aliases
- Fix ISE in LazyDeclarationResolver
2016-06-01 14:32:46 +03:00
Dmitry Petrov
0319d5a5aa KT-11588 Type aliases
- Nested type aliases
- UNSUPPORTED_TYPEALIAS error (language level < 1.1)
- tests for is/as/as? with type alias
2016-06-01 14:32:46 +03:00
Dmitry Petrov
e979300579 KT-11588 Type aliases
Diagnostics for type arguments substitution in type alias expansion
(initial implementation; TODO: refactor).
2016-06-01 14:32:46 +03:00
Dmitry Petrov
9cf8ef287e KT-11588 Type aliases
Additional tests for generic type alias arguments.
Small refactoring in TowerLevels.
2016-06-01 14:32:45 +03:00
Dmitry Petrov
62f8d00f89 KT-11588 Type aliases
Create substituted constructor descriptors for generic type aliases.
2016-06-01 14:32:45 +03:00
Dmitry Petrov
c63166047c KT-11588 Type aliases
Additional tests for type alias constructor & companion object:
- codegen
- error diagnostics
2016-06-01 14:32:45 +03:00
Dmitry Petrov
1329a43d89 KT-11588 Type aliases
Type alias constructor
2016-06-01 14:32:44 +03:00
Dmitry Petrov
4a9507b3ab KT-11588 Type aliases
Type alias companion object
2016-06-01 14:32:44 +03:00
Dmitry Petrov
8c2e80f9eb KT-11588 Type aliases
Fix protoDifferenceUtils.
2016-06-01 14:32:44 +03:00
Mikhael Bogdanov
0f1589fd50 Fix for KT-12200: initial property assignment ignored
#KT-12200 Fixed
2016-05-31 15:27:55 +03:00
Mikhael Bogdanov
bdc0b6b308 Local delegated properties moved to language feature option 2016-05-31 15:27:55 +03:00
Alexey Andreev
2bd807bb4e KT-11960: add test for case of instantiating inner class of a local class 2016-05-31 15:24:30 +03:00
Alexey Andreev
acc5303731 KT-11960 Fix case of instantiation of local class via its inner class or via nested lambda. Move tests to more appropriate location. Fix bug in blackbox codegen generator for JVM, which does not allow to suppress tests. 2016-05-31 15:24:29 +03:00
Alexey Andreev
bb8a3aa262 KT-11960 Minor code style fixes 2016-05-31 15:24:29 +03:00
Alexey Andreev
6f363a71be KT-11960 Fix for data classes 2016-05-31 15:24:29 +03:00
Alexey Andreev
170a671a1b KT-11960 Fix for case when class instantiates itself 2016-05-31 15:24:28 +03:00
Alexander Udalov
a300dee61f Keep Native2AsciiCharsetProvider from being stripped by proguard
#KT-12549 Fixed
2016-05-31 14:28:25 +03:00
Kirill Rakhman
93ebb3da65 Formatter: handle spaces around 'is' keyword (#874)
Fixes #KT-12548
2016-05-30 20:35:33 +03:00
Alexander Udalov
fbd671c158 Minor, update ChangeLog with '-language-version' 2016-05-30 13:52:04 +03:00
Mikhail Glukhikh
7a24429b53 Simplify for intention: apply name validator to prevent conflicts 2016-05-30 12:15:13 +03:00
Mikhail Glukhikh
792b37bce4 Simplify for intention: applicable of any numbers of properties used #KT-10779 Fixed 2016-05-30 12:15:09 +03:00
Alexander Udalov
68c5e8e190 Minor, add comments on declarations used in Eclipse plugin 2016-05-27 19:40:50 +03:00
Alexander Udalov
a95568eedf Minor, make Services#get return type nullable 2016-05-27 19:40:50 +03:00
Alexander Udalov
57849c9dfd Fix project compilation after introduction of bound references
`java` in the package name inside an extension to KClass is now resolved to the
extension property `KClass#java`. So `java.X::class` is now equivalent to
`this.java.X::class`
2016-05-27 19:38:39 +03:00
Mikhail Glukhikh
c26d7e0eba Attach "add remaining branches" and "add else branch" fixes to NON_EXHAUSTIVE_WHEN warning #KT-12503 Fixed 2016-05-27 18:08:20 +03:00
Mikhail Glukhikh
8713190e33 Back-end JVM: more accurate handling of when expressions with Unit result #KT-12192 Fixed 2016-05-27 18:08:15 +03:00
Pavel V. Talanov
3a3e145de2 KtLightMethod: Wrap return type so it resolves to light method's type parameter as opposed to delegate's
Affects java type inference in IDEA

  #KT-12090 Fixed
  #KT-11095 Fixed
2016-05-27 13:13:01 +03:00
Alexander Udalov
e1a21abd72 Report error on bare types in LHS of callable reference expressions 2016-05-26 22:22:41 +03:00
Alexander Udalov
76efeb4e14 Remove obsolete assertion about expressions on LHS of '::' 2016-05-26 22:22:41 +03:00
Alexander Udalov
da42023dd9 Support new callable reference expressions in UAST
Manually mute the class literal test in apiCheck.kt; support for new class
literal expressions is postponed because it's not straightforward to combine
both unbound (Type::class) and bound (instance::class) class literals in one
UClassLiteralExpression: in Java they're two very different expressions
(Type.class and instance.getClass())
2016-05-26 22:22:41 +03:00
Alexander Udalov
ca76e4d426 Support new double colon expressions in IDE code 2016-05-26 22:22:41 +03:00
Alexander Udalov
a3b38cf6ed Extract method to fully or partially resolve callable reference
Reuse it in the main type-checking path in DoubleColonExpressionResolver, as
well as in ArgumentTypeResolver which handles the case when a callable
reference appears as an argument to another call
2016-05-26 22:22:41 +03:00
Alexander Udalov
693c753988 Support for new double colon expressions in type checker
Despite the fact that the LHS of a double colon expression is now KtExpression
instead of KtUserType, we must still consider it a type for callable references
to work. Extract and reuse relevant parts of QualifiedExpressionResolver and
TypeResolver to support this behavior
2016-05-26 22:22:41 +03:00
Alexander Udalov
b5388d6a43 Parse expressions on LHS of '::'
See https://github.com/Kotlin/KEEP/issues/5
2016-05-26 22:22:41 +03:00
Alexander Udalov
7cb61b81ab Minor, capitalize language feature names in tests
To simplify textual search across the codebase
2016-05-26 22:21:22 +03:00
Pavel V. Talanov
76971eca70 Refactor LanguageFeatureSettings: Add LanguageVersion and LanguageFeature entities 2016-05-26 22:16:47 +03:00
Alexander Udalov
9bdf8f1082 Minor, update javac2 annotation filter for kotlin-build-common-test 2016-05-26 22:15:39 +03:00
Alexander Udalov
2c516f18a0 Add tests on "-language-version" usage from Ant, Maven, Gradle 2016-05-26 22:15:39 +03:00
Alexander Udalov
bc5202a4d7 Validate "-language-version" argument value, add tests 2016-05-26 22:15:39 +03:00
Alexander Udalov
331a6ee414 Use LanguageFeatureSettings instead of JVM option for top level sealed classes 2016-05-26 22:15:39 +03:00
Alexander Udalov
98c3e030a1 Support enabling/disabling language features in diagnostic tests 2016-05-26 22:15:39 +03:00
Alexander Udalov
e1ba4480d7 Support "-language-version" CLI option for compatibility with older releases
Introduce LanguageFeatureSettings, instance of which should be injected by the
container and be accessible everywhere during the compilation (front-end and
back-end).

Parameters of LanguageFeatureSettings are unused in this commit, will be used
later
2016-05-26 22:15:39 +03:00
Alexey Sedunov
ec0f21c887 Spring Support: Fixed rename of custom-named beans specified with Kotlin annotation
#KT-12096 Fixed
2016-05-26 20:59:09 +03:00
Alexey Sedunov
076e31c0f8 Spring Support: Automatic configuration by @Import and @ComponentScan ("basePackages"/"basePackageClasses")
#KT-12135 Fixed
 #KT-12139 Fixed
2016-05-26 20:59:07 +03:00
Alexey Sedunov
781a1e0694 Spring Support: Implement @ComponentScan inspection
#KT-12465 Fixed
2016-05-26 20:59:05 +03:00
Alexey Sedunov
d69140b7fe Code Insight: Implement package references inside of string literals
#KT-12136 In Progress
2016-05-26 20:59:03 +03:00
Alexey Sedunov
d52e62b20d Light Classes: Consider FakeFileForLightClass instances equivalent if they correspond to the light classes with common KtFile
#KT-12117 Fixed
2016-05-26 20:59:01 +03:00
Alexander Udalov
9a762e0fa2 Prevent META-INF/INDEX.LIST from jsr166e.jar to be packed into compiler
INDEX.LIST contains a list of jars with the information about what packages
does each of those jars have (this feature is called JarIndex, see
http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html). In case of
ideaSDK/core/jsr166e.jar, it only has one entry -- jsr166e.jar itself. When the
compiler is started, the class loading mechanism reads this file and assumes
that there are no other jars nearby. But the compiler depends on other jars,
namely kotlin-runtime.jar and kotlin-reflect.jar, thus we get
ClassNotFoundException when trying to load almost any Kotlin bytecode from
kotlin-compiler.jar.

Note that, fortunately, release builds are not affected because:
1) proguard helpfully strips this file from the final kotlin-compiler.jar;
2) we use a custom class loader (Preloader) which ignores JarIndex.
This only affects local setup with proguard disabled, where one test
(CompilerDaemonTest) was failing because it was trying to invoke the compiler
directly via "java -jar ..."

To implement this, it was necessary to exclude this one file from the compiler
jar, however the "zipgroupfileset" Ant task does not support exclusion of one
file from a particular archive, so we pack all idea core libraries into one jar
beforehand and use "zipfileset" which supports exclusion of one file
(http://stackoverflow.com/a/2426245/288456).

(cherry picked from commit c3f1afee626502470dbe27a1343c777e5cade789)
2016-05-26 14:14:41 +03:00
Alexander Udalov
e5d64d316d Fix kotlin-maven-plugin compilation 2016-05-26 14:14:17 +03:00
Alexander Udalov
d89e907f00 Minor, comment out ignored test 2016-05-26 11:48:00 +03:00
Alexander Udalov
159d88102f Use MODULE_NAME configuration key in JS instead of MODULE_ID 2016-05-26 11:47:30 +03:00
Alexander Udalov
05f8836f46 Move some configuration keys to JVM or to CommonConfigurationKeys
Move CONTENT_ROOTS and SCRIPT_DEFINITIONS_KEY to JVMConfigurationKeys because
they are only used on JVM, rename the latter to SCRIPT_DEFINITIONS.

Move MODULE_NAME to CommonConfigurationKeys to be combined with MODULE_ID in
JSConfigurationKeys in the future
2016-05-26 11:47:30 +03:00
Alexander Udalov
6674412079 Rename compilerConfigurationForTests -> newConfiguration 2016-05-26 11:47:30 +03:00
Alexander Udalov
d04624cfe9 Minor, refactor KotlinToJVMBytecodeCompiler#compileModules 2016-05-26 11:47:30 +03:00
Alexander Udalov
cad4b6973c Introduce and use JSConfigurationKeys similar to JVMConfigurationKeys
Use type-safe keys in CompilerConfiguration instead of multiple parameters,
duplicated in the base class (JsConfig), derived class (LibrarySourcesConfig)
and its builder (LibrarySourcesConfig.Builder)
2016-05-26 11:47:30 +03:00
Alexander Udalov
b65980f3b7 Drop JsConfig#inlineEnabled flag
Use CommonConfigurationKeys#DISABLE_INLINE flag (moved from
JVMConfigurationKeys) in CompilerConfiguration instead, similarly to the JVM
compiler
2016-05-26 11:47:30 +03:00
Alexander Udalov
6889bdbef8 Add CompilerConfiguration to JsConfig
Will be used to store common compiler options (such as source version, inline
disabled, etc) as well as JS-specific options, to unify the logic of compiler
option initialization between JS and JVM compilers
2016-05-26 11:47:30 +03:00
Alexander Udalov
116e4a5ced Rename Config -> JsConfig 2016-05-26 11:47:30 +03:00
Alexander Udalov
2bd3211ba8 Get rid of unnecessary exceptions in JS translator
Before this commit, an internal error during JS translation resulted in the
actual exception wrapped in TranslationRuntimeException wrapped in
TranslationInternalException wrapped in RuntimeException being thrown. This
change gets rid of the two latter wrappings.

Also delete unthrown MainFunctionNotFoundException and related unused
constructors in TranslationException
2016-05-26 11:47:30 +03:00
Alexander Udalov
9418311bda Pass CompilerConfiguration to CLICompiler#doExecute
Extract common CompilerConfiguration setup code to a separate method
2016-05-26 11:47:30 +03:00
Alexander Udalov
3c81bb4bfc Add MessageCollector#hasErrors, get rid of MessageSeverityCollector
Also fix duplicated wrapping of a message collector into a message severity
collector (in CLICompiler and in the beginning of doExecute in
K2JVMCompiler/K2JSCompiler)
2016-05-26 11:47:30 +03:00
Alexander Udalov
c5e2f55ea7 Get rid of getModuleName(), pass configuration to createContextWithSealedModule
Add KotlinTestUtils.newConfiguration() which creates a configuration and sets
the module name to the default test one ("test-module")
2016-05-26 11:47:30 +03:00
Alexander Udalov
69343549b7 Move TEST_MODULE_NAME to KotlinTestUtils and change value to "test-module"
This name is more generic and thus can be used everywhere, not only in Java
integration tests
2016-05-26 11:47:30 +03:00
Alexander Udalov
3ca77de924 Remove traces of old compiler plugin architecture
It was retired with the deprecation and subsequent removal of the old KDoc, and
is now unused
2016-05-26 11:47:30 +03:00
Alexander Udalov
0fe39a186e Simplify public methods of KotlinToJVMBytecodeCompiler
Pass as much as possible in the single CompilerConfiguration instance instead
of in separate function parameters. Add corresponding keys to
JVMConfigurationKeys.

Re changes in compileModules: since output directory (stored now under the key
OUTPUT_DIRECTORY) is different for each module, the configuration of the whole
project is no longer applicable when compiling individual modules. Thus we copy
the project configuration for each module and add the output directory value
2016-05-26 11:47:30 +03:00
Alexander Udalov
8c0f78db50 Introduce CompilerConfiguration#getNotNull and getBoolean
To reduce boilerplate at call sites
2016-05-26 11:47:30 +03:00
Alexander Udalov
81a0fa5f47 Minor, fix warnings and improve style in KotlinToJVMBytecodeCompiler 2016-05-26 11:47:30 +03:00
Dmitry Jemerov
495a3e9432 cleanup after code review 2016-05-25 21:05:59 +02:00
Dmitry Jemerov
b37ac4f783 fix PsiCheckerTestGenerated according to removed "property with backing field" highlighting 2016-05-25 20:10:01 +02:00
Dmitry Jemerov
14559bfae0 inherit Kotlin TYPE_PARAMETER from Java TYPE_PARAMETER
#KT-11465 Fixed
2016-05-25 20:00:49 +02:00
Dmitry Jemerov
76178c531e specify base color for ANNOTATION and LABEL
#KT-9410 Fixed
2016-05-25 20:00:49 +02:00
Dmitry Jemerov
49335fa6eb highlight infix function calls
#KT-6540 Fixed
2016-05-25 20:00:49 +02:00
Dmitry Jemerov
a448af5d17 remove CLASS highlight on top of CONSTRUCTOR_CALL for constructor calls
#KT-2919 Fixed
2016-05-25 20:00:49 +02:00
Dmitry Jemerov
e7cb256e81 TypeKindHighlightingVisitor: J2K 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
e07e16abf6 TypeKindHighlightingVisitor: rename to .kt 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
e9cefd9ece remove PARAMETER highlight on top of INSTANCE_PROPERTY for primary constructor parameters 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
b51637d49f remove LOCAL_VARIABLE highlight on top of BACKING_FIELD_VARIABLE 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
4261e4a5cc VariablesHighlightingVisitor: cleanup after J2K 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
77a48c1d10 VariablesHighlightingVisitor: J2K 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
4ddbe9828a VariablesHighlightingVisitor: rename to .kt 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
c7cd86f1ed PropertiesHighlightingVisitor: cleanup after J2K, remove "property has backing field" highlighting, don't layer other highlights 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
b76585e03f PropertiesHighlightingVisitor: j2K 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
41cd55b281 PropertiesHighlightingVisitor: rename to .kt 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
5512043ed4 FunctionsHighlightingVisitor: cleanup after J2K, remove overlaid highlighting of function calls 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
c515740e38 FunctionsHighlightingVisitor: J2K 2016-05-25 20:00:49 +02:00
Dmitry Jemerov
83b5028ac2 FunctionsHighlightingVisitor: rename to .kt 2016-05-25 20:00:49 +02:00
Ilya Gorbunov
9c91b120c9 Force garbage finalization and another gc run in gradle tests. 2016-05-25 17:12:46 +03:00
Dmitry Jemerov
855ddf96fd Kotlin with Gradle: generate 'repositories' call, use kotlin_version property
#KT-11841 Fixed
2016-05-25 15:41:25 +02:00
Dmitry Jemerov
636bbd026c test for KT-9454 2016-05-25 15:41:25 +02:00
Dmitry Jemerov
ccbb3d055b call BuildManager.clearState(project) in apply() method of Kotlin Compiler Settings configurable
#KT-10255 Fixed
2016-05-25 15:41:25 +02:00
Dmitry Jemerov
1865750606 add icon for Kotlin annotation classes
#KT-11814 Fixed
2016-05-25 15:41:25 +02:00
Dmitry Jemerov
22d378997c always show current plugin version in update check dialog
#KT-12076 Fixed
2016-05-25 15:41:25 +02:00
Dmitry Jemerov
b8eb1dae2b "Configure Kotlin plugin updates" is a dumb-aware action
#KT-12075 Fixed
2016-05-25 15:41:25 +02:00
Dmitry Jemerov
83798f54c1 help ID for compiler configuration page
#KT-12110 Fixed
2016-05-25 15:41:25 +02:00
Dmitry Jemerov
e920c35883 remove unnecessary ? from 'serr' live template
#KT-12289 Fixed
2016-05-25 15:41:25 +02:00
Stanislav Erokhin
4b9aac6318 Replace not debug usages of DescriptorRenderer.DEBUG_TEXT to DescriptorRenderer.FQ_NAMES_IN_TYPES. 2016-05-25 16:31:34 +03:00
Pavel V. Talanov
710e920df7 lightClassUtils: Fix CCE when trying to obtain KtLightTypeParameter
#KT-12259 Fixed
2016-05-25 15:58:11 +03:00
Pavel V. Talanov
62421bbf7b 'const val' are now considered constants by Java in IDEA
#KT-12026 Fixed
2016-05-25 15:58:09 +03:00
Pavel V. Talanov
3cb38e7f02 Implement getLanguageLevel for FakeFileForLightClass
#KT-12006 Fixed
2016-05-25 15:58:07 +03:00
Pavel V. Talanov
695653c447 Replace usages of blocking lazy to LazyThreadSafetyMode.PUBLICATION in light classes to prevent potential deadlocks 2016-05-25 15:44:19 +03:00
Pavel V. Talanov
65e55f045f Fix deadlock: synchronized lazy in KtLightModifierListWithExplicitModifiers 2016-05-25 15:44:18 +03:00
Alexander Udalov
7fd2a016e7 Fix Android codegen tests: use full JDK only when needed
This was accidentally broken in 8a00cabce6
2016-05-25 10:29:50 +03:00
Pavel V. Talanov
85200e1f8a REPL UI: fix history pane not showing latest command after command execution 2016-05-24 17:33:24 +03:00
Nikolay Krasko
181a11a1d7 Update to idea 2016.1.2 2016-05-24 17:22:56 +03:00
Nikolay Krasko
eee9431a6d More write action requirement remove
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock
2016-05-24 17:22:56 +03:00
Nikolay Krasko
98060d28a8 Don't request write action for ChangeParameterTypeFix because it's based on refactoring
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock
2016-05-24 17:22:56 +03:00
Nikolay Krasko
e3f85653e9 Don't request write action for RemoveUnusedFunctionParameterFix because it's based on refactoring (KT-12440)
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock

 #KT-12440 Fixed
2016-05-24 17:22:56 +03:00
Nikolay Krasko
01a6ce930e Don't request write action for ReplaceExplicitFunctionLiteralParamWithItIntention because it's based on refactoring (KT-12436)
Workaround for exception: Refactorings should not be started inside write action because they start progress inside and any read action from the progress task would cause the deadlock

 #KT-12436 Fixed
2016-05-24 17:22:56 +03:00
Pavel V. Talanov
6b001c608b ProjectRootsUtil: accept directories and jar roots if "includeClassFiles == true" 2016-05-24 15:42:11 +03:00
Pavel V. Talanov
c7cefad7d5 Implement IdeReplCompletionTest to test completion of entities declared in already evaluated lines 2016-05-24 15:42:09 +03:00
Pavel V. Talanov
f59638d60f Minor: prettify ReplState 2016-05-24 15:42:08 +03:00
Pavel V. Talanov
9cff590366 Use ReplState to implement completion in IDE REPL
Consider sucessfully evaluated lines as previous lines when analyzing console file
2016-05-24 15:42:06 +03:00
Pavel V. Talanov
08ef1749b6 Limit resolve scope when completing in module sources 2016-05-24 15:42:04 +03:00
Pavel V. Talanov
4ec4d6ec66 implicitReceiversUtils: Script descriptors are implicit receivers
This fixes completion in repl
2016-05-24 15:42:02 +03:00
Pavel V. Talanov
dcd7e6d767 Move ReplState to frontend 2016-05-24 15:42:00 +03:00
Pavel V. Talanov
4d75355cf2 Minor: Rename KotlinReplTest 2016-05-24 15:41:58 +03:00
Pavel V. Talanov
5058e9b4e6 Fix import resolution in Repl
#KT-11428 Fixed

 Refactor ReplState to be a component
2016-05-24 15:41:56 +03:00
Pavel V. Talanov
9f67072098 Minor: ScopeUtils: avoid wrapping lexical scopes several times 2016-05-24 15:41:55 +03:00
Pavel V. Talanov
27bd74f4c5 Refactor: replace LastLineScopeProvider with ReplState, extract FileScopeFactory from FileScopeProviderImpl 2016-05-24 15:41:30 +03:00
Pavel V. Talanov
3b4ade2ca0 Refactor: extract resolve related code from ReplInterpreter to CliReplAnalyzerEngine 2016-05-24 15:36:12 +03:00
Alexander Udalov
68f1cf5f52 Fix typo in inspection description name: RedundantlIf.html -> RedundantIf.html 2016-05-24 15:03:04 +03:00
Mikhail Glukhikh
9e487a6326 Minor refactoring: convert to block body 2016-05-24 14:31:51 +03:00
Mikhail Glukhikh
fa5e284bf8 Convert to block body: when expression with Unit result is now handled as "return needed" #KT-12193 Fixed 2016-05-24 14:29:01 +03:00
Mikhail Glukhikh
9a69b8b7b5 REDUNDANT_OPEN_FOR_INTERFACE warning: reported for open members without implementation #KT-12452 Fixed 2016-05-24 14:25:27 +03:00
Mikhail Glukhikh
e66acd8101 Default modality is abstract for interface. REDUNDANT_MODIFIER_FOR_TARGET applicability reduced #KT-12302 Fixed 2016-05-24 14:25:22 +03:00
Mikhail Glukhikh
93defed324 KT-12302: ABSTRACT_MODIFIER_IN_INTERFACE warning is removed as obsolete 2016-05-24 14:25:18 +03:00
Dmitry Jemerov
3542834fa1 fix tests for RedundantIfInspection 2016-05-23 20:21:46 +02:00
Vladislav Golub
bb32c2d350 KT-12019 Highlighting of redundant 'if' statements (#871) 2016-05-23 21:02:38 +03:00
Vladislav Golub
cf56ac0305 Simplify method (#873) 2016-05-23 20:53:42 +03:00
Alexander Udalov
5bf14c106a Delete unused ParentLastURLClassLoader 2016-05-23 20:00:51 +03:00
Alexander Udalov
b9fb6c0d84 Remove dangerous readKotlinHeader() in inlineUtil.kt
It was creating a phantom FileBasedKotlinClass which was not based on any file
2016-05-23 20:00:50 +03:00
Alexander Udalov
cf19166eca Move IC-related initialization logic to GenerationState
To further reduce number of parameters of GenerationState's constructor
2016-05-23 14:50:06 +03:00
Alexander Udalov
29c5e655ab Drop several more parameters of GenerationState's constructor
INCREMENTAL_COMPILATION_COMPONENTS and DECLARATIONS_JSON_PATH are already in
the configuration, and Progress was unused
2016-05-23 14:50:06 +03:00
Alexander Udalov
f8816b5d67 Pass CompilerConfiguration to GenerationState instead of ton of parameters 2016-05-23 14:49:26 +03:00
Alexander Udalov
1492c71e88 Refactor old test utility in LoadDescriptorUtil
Also make USE_TYPE_TABLE a flag in CompilerConfiguration instead of an extra
boolean parameter in numerous methods
2016-05-23 14:47:00 +03:00
Alexander Udalov
76d78ba666 Remove LazyResolveTestUtil, refactor usages to use JvmResolveUtil
LazyResolveTestUtil.resolve by now had almost exactly the same code as
JvmResolveUtil.analyze.

LazyResolveTestUtil.resolveLazily with 3 parameters was only used in
LoadBuiltinsTest, inline it there.

Move LazyResolveTestUtil.getTopLevelPackagesFromFileList to
AbstractDiagnosticsTest, the only place where it was used
2016-05-23 14:47:00 +03:00
Alexander Udalov
a85e98a078 Minor, inline unnecessary method of TopDownAnalyzerFacadeForJVM
The TopDownAnalysisMode parameter was TopLevelDeclarations everywhere
2016-05-23 14:47:00 +03:00
Alexander Udalov
0124cb64f0 Cleanup test utilities in JvmResolveUtil and GenerationUtils
Simplify usages and fix some warnings along the way.

Rename:
- analyzeFilesWithJavaIntegration, analyzeOneFileWithJavaIntegration -> analyze
- analyzeFilesWithJavaIntegrationAndCheckForErrors,
  analyzeOneFileWithJavaIntegrationAndCheckForErrors -> analyzeAndCheckForErrors
- compileFilesGetGenerationState, compileManyFilesGetGenerationStateForTest ->
  compileFiles
- compileFileGetGenerationStateForTest -> compileFile
- compileFileGetClassFileFactoryForTest -> compileFileTo
2016-05-23 14:47:00 +03:00
Alexander Udalov
8a00cabce6 Minor, do not copy CompilerConfiguration in Android codegen tests
This is needed to avoid passing a custom configuration to
GenerationUtils.compileManyFilesGetGenerationStateForTest, but rather take it
from the environment in a future commit
2016-05-23 14:47:00 +03:00
Alexander Udalov
6d6488e795 Pass CompilerConfiguration to TopDownAnalyzerFacadeForJVM
In most cases, the configuration can be loaded from KotlinCoreEnvironment. In
other cases, such as IDE tests, there's no environment, so we pass EMPTY. Since
currently the configuration is only used to load incremental compilation
components and module information, it's fine to pass EMPTY
2016-05-23 14:47:00 +03:00
Alexander Udalov
6c0ff40197 Move JVMConfigurationKeys to frontend.java
Similarly to K2JVMCompilerArguments, they will soon be needed in the IDE code.
Move COMPILER_JAR_LOCATOR to CLIConfigurationKeys because it's used both in JVM
and JS, and only in CLI. Other keys, non-relevant in the IDE, may be moved out
soon as well, such as incremental compilation components
2016-05-23 14:47:00 +03:00
Alexander Udalov
dcb2d7b4f6 Minor, break the line in "kotlinc -help" if it's too long
To improve description of the "pluginOptions" flag
2016-05-23 14:47:00 +03:00
Mikhail Glukhikh
1a8181bdc4 Only private constructors for sealed / enum classes #KT-12377 Fixed
Also #KT-8497 Fixed
2016-05-23 13:08:57 +03:00
Mikhail Glukhikh
cffdce908e Annotation parameters now cannot be mutable #KT-12367 Fixed 2016-05-23 13:04:00 +03:00
Alexey Andreev
81bdd6b4bb JS: improve performance of Hashtable-based collections 2016-05-23 12:23:27 +03:00
Alexey Andreev
f0ee52faaf KT-11086 Treat initializer of a companion object as a class initializer 2016-05-23 12:22:50 +03:00
Alexey Andreev
c5eaea846d KT-7424: add test to show that inlining works for anonymous functions 2016-05-23 12:22:50 +03:00
Alexey Andreev
db5baf7fa7 KT-8386: pass mutable list to JsInvocation from intrinsic generator, so that inliner had a chance to replace arguments 2016-05-23 12:22:50 +03:00
Pavel V. Talanov
d03fedde74 Implement "Decompile Kotlin to Java" action
Add this action to "Attach sources" notification panel if present
 #KT-11657 Fixed
2016-05-23 12:12:13 +03:00
Pavel V. Talanov
68dd176d66 Minor: typo in changeLog 2016-05-23 11:54:16 +03:00
Pavel V. Talanov
6e9a35b432 Minor, missed '#' 2016-05-23 11:54:14 +03:00
Pavel V. Talanov
7606b4c69d Update ChangeLog for 1.0.3
Improve ticket number presentation for 1.0.3
2016-05-23 11:54:12 +03:00
Dmitry Petrov
968ed3f091 KT-5068: Introduce a special diagnostic message for TYPE_MISMATCH cases such as 'fun f(): Int = { 1 }'. 2016-05-23 09:50:41 +03:00
Nikolay Krasko
8b06d919b4 Restore packing plugin-api module output to plugin 2016-05-20 19:40:07 +03:00
Nikolay Krasko
58d24d76c4 Check there's no direct usages of asm (org.objectweb.asm) library in project
Such usages should be replaced with asm from idea (org.jetbrains.org.objectweb.asm)
2016-05-20 15:51:57 +03:00
Nikolay Krasko
a801d8fa6f Don't use reference to asm directly. Use asm from Idea instead. 2016-05-20 15:51:55 +03:00
Nikolay Krasko
4e0d4681ed Remove kotlin-for-upsource target. Upsource doesn't use this artifact anymore. 2016-05-20 15:51:54 +03:00
Stanislav Erokhin
db64d9c528 Fixed visibility checks for annotation usage on top-level declarations
#KT-12429 Fixed
2016-05-20 14:58:18 +03:00
Stanislav Erokhin
a42b8d56b4 Minor. Removed redundant field for several anonymous objects. 2016-05-20 14:58:18 +03:00
Alexander Udalov
b5355358a5 Remove SAFE_CALL_IN_QUALIFIER diagnostic which was never reported
See UNEXPECTED_SAFE_CALL which is reported instead
2016-05-20 14:53:07 +03:00
Alexander Udalov
ca7e4496c7 Refactor and improve class literal type checking code
Infer something sensible instead of error types when an error is reported, such
as absence of a type argument for Array or presence of type arguments for other
types
2016-05-20 14:53:07 +03:00
Alexander Udalov
1b79770121 Do not produce trailing space when rendering root package header 2016-05-20 14:53:07 +03:00
Dmitry Petrov
dd12c018ca KT-8990: private member can't be overridden, even if it is visible in the current context 2016-05-20 14:32:48 +03:00
Dmitry Petrov
15c47ead97 (minor) KT-11588 Type aliases: fix conflicts after rebase. 2016-05-20 14:17:26 +03:00
Dmitry Petrov
a2ec580119 KT-11588 Type aliases
Type alias stubs indexing (required for index-based declaration providers)
2016-05-20 14:17:26 +03:00
Dmitry Petrov
8bf87a9a4f KT-11588 Type aliases
Proper abbreviated type for '<type-alias>?'
2016-05-20 14:17:26 +03:00
Dmitry Petrov
440e02016b KT-11588 Type aliases
Fix diagnostic tests (renamed diagnostic message)
2016-05-20 14:17:25 +03:00
Dmitry Petrov
32f61c3918 KT-11588 Type aliases
Deserialization
2016-05-20 14:17:25 +03:00
Dmitry Petrov
f296b17861 KT-11588 Type aliases
Additional test(s)
2016-05-20 14:17:25 +03:00
Dmitry Petrov
75e08ace17 KT-11588 Type aliases
Make type alias expansion PSI-independent
2016-05-20 14:17:25 +03:00
Dmitry Petrov
65293008fd KT-11588 Type aliases
Type alias descriptor serialization
Types with type aliases serialization
2016-05-20 14:17:24 +03:00
Dmitry Petrov
59472927cd KT-11588 Type aliases
Light class generation: do not fail on type aliases
TODO: actual binary representation for type aliases
2016-05-20 14:17:24 +03:00
Dmitry Petrov
a4406687f1 KT-11588 Type aliases
Resolution & expansion for type aliases.
NB: Nested type aliases capturing type parameters of outer classes are not supported yet.
2016-05-20 14:17:24 +03:00
Dmitry Petrov
ec94893189 KT-11588 Type aliases
Parse type aliases as top-level, member, and local declarations.
2016-05-20 14:17:24 +03:00
Mikhail Glukhikh
ceb4aa7ac0 Cleanup: simplify for 2016-05-20 13:38:46 +03:00
Mikhail Glukhikh
ebd57fafd7 Cleanup: val can be parameter 2016-05-20 13:38:42 +03:00
Dmitry Petrov
b86fb64008 KT-12358: fake override of a method of 'Any' in an interface is not an "implementation". 2016-05-20 13:02:29 +03:00
Stanislav Erokhin
74bddcfb70 Refactoring. Convert Annotated to kotlin. 2016-05-20 09:32:55 +03:00
Stanislav Erokhin
450ea78b1d Refactoring. Convert KotlinType to kotlin. 2016-05-20 09:32:54 +03:00
Stanislav Erokhin
8c2d68fff0 Refactoring. Move specificity relations into TypeSpecificityComparator component. 2016-05-20 09:32:53 +03:00
Stanislav Erokhin
921eb8402c Transform OverloadUtil into OverloadChecker component. 2016-05-20 09:32:53 +03:00
Stanislav Erokhin
c4778bfe5a Fixed type checking recursive problem.
#KT-11995 Fixed
2016-05-20 09:26:56 +03:00
Alexander Udalov
1c8272d3f1 Simplify data class function generation and signature lookup code
- change prerequisites for generating equals/hashCode/toString in a data class:
  previously they were generated if the corresponding method is trivial (i.e.
  it comes from kotlin.Any), now we're generating it always unless it'll cause
  a JVM signature clash error (see KT-6206)
- use static KotlinBuiltIns.isXxx methods to compare types instead of checking
  against descriptors loaded from certain built-ins instance, this is quicker
  and more correct in environments where several built-ins are possible
- don't use isOrOverridesSynthesized, it's not relevant for
  equals/hashCode/toString because functions with these names are never
  synthesized

 #KT-6206 Fixed
2016-05-20 00:54:19 +03:00
Alexander Udalov
2200bfcc85 Simplify ImplementationBodyCodegen#generateToArray
- don't do anything for interfaces because there's no point in generating
  abstract methods which are already abstract in supertypes
- don't use getDeclaredFunctionByRawSignature, check function signature
  manually instead
- don't use isOrOverridesSynthesized because 'toArray' is never synthesized
2016-05-20 00:54:18 +03:00
Alexander Udalov
b208995d73 Render different class kinds differently in bytecode listing test 2016-05-20 00:36:56 +03:00
Alexander Udalov
c1c2651988 J2K backend-common classes: convert
Also merge CodegenUtilKt into CodegenUtil
2016-05-20 00:36:56 +03:00
Alexander Udalov
27ed0dd25f J2K backend-common classes: rename .java -> .kt 2016-05-20 00:36:56 +03:00
Ilya Gorbunov
bf2576e25c Change snapshot version in gradle configurator and AddKotlinLib quick fixes. 2016-05-19 18:10:57 +03:00
Denis Zharkov
4cbd2fbe62 Compute cached-value under common storage manager
Before this commit it was calculated under separate lock, so it could turn into dead-lock

 #KT-12396 Fixed
2016-05-19 17:55:38 +03:00
Dmitry Petrov
a25ba5baf1 KT-12156: for the purposes of inline-related diagnostics
treat function declaration as final if it is a member of a final class
2016-05-19 17:43:29 +03:00
Stanislav Erokhin
7332032bb6 Support sealed class inheritors in the same file
#KT-11573 Fixed
2016-05-19 16:22:40 +03:00
Alexey Sedunov
26be254fbe Spring Support: Show autowiring candidates line markers for @Autowired-annotated constructors and constructor parameters
#KT-12120 Fixed
2016-05-19 13:56:12 +03:00
Alexey Sedunov
2bd03fe9b0 Spring Support: Fixed bean references in factory method calls
#KT-12384 Fixed
2016-05-19 13:56:11 +03:00
Alexey Sedunov
417995b569 Spring Support: Fixed "Spring Facet Code Configuration (Kotlin)" inspection description
#KT-12143 Fixed
2016-05-19 13:56:10 +03:00
Alexey Sedunov
53b08a1d33 Spring Support: Report object declarations in "Final Kotlin class or function with Spring annotation" inspection
#KT-12148 Fixed
2016-05-19 13:56:09 +03:00
Alexey Sedunov
aaa42e872a Spring Support: Fixed "Autowired members defined in invalid Spring bean (Kotlin)" inspection description
#KT-12363 Fixed
2016-05-19 13:56:07 +03:00
Alexey Sedunov
85d07e5f6d Spring Support: Implement Spring @Autowired inspection
#KT-12278 Fixed
 #KT-12147 Fixed
 #KT-12366 Fixed
 #KT-12122 Fixed
2016-05-19 13:56:06 +03:00
Alexey Sedunov
36f3d30250 Refactoring: Extract registerWithElementsUnwrapped() function 2016-05-19 13:56:04 +03:00
Alexey Andreev
cb36b61f7f KT-12254 Prevent JsEmptyExpression from getting into initializer JS when compiling code like val x = throw Exception() 2016-05-19 11:41:50 +03:00
Alexey Andreev
4387c31939 KT-8005 Add test to prove the issue is no more reproducible 2016-05-19 11:37:02 +03:00
Alexey Andreev
3cd7dcdb26 KT-8299 Make proper access to private fields in generated methods of data classes 2016-05-19 11:32:22 +03:00
Ilya Gorbunov
fda9797dc4 Do not deploy anymore kotlin maven plugin tests and build common test utilities to maven central 2016-05-19 05:31:18 +03:00
Ilya Gorbunov
bdf80ec747 Sanitize escape sequences when verifying maven output 2016-05-19 05:31:15 +03:00
Ilya Gorbunov
7f5b586e3f Specify kotlin snapshot version in maven plugin integration tests only once. 2016-05-19 05:31:08 +03:00
Mikhail Glukhikh
f81192d48f Simplify for: take into account two or more possible local variables for the same loop parameter property 2016-05-18 19:56:19 +03:00
Mikhail Glukhikh
9108ab1923 Simplify for: take into account local property mutability 2016-05-18 19:56:14 +03:00
Mikhail Glukhikh
d0fd3dea67 Simplify for: take into account loop parameter nullability 2016-05-18 19:56:10 +03:00
Mikhail Glukhikh
a56248a11a Simplify for now works even if no variables are declared inside loop #KT-12145 Fixed 2016-05-18 19:56:06 +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
Mikhail Glukhikh
c95e11cc7e Import as alias with another name is now counted as usage itself #KT-11933 Fixed 2016-05-18 17:46:18 +03:00
Mikhail Glukhikh
0cf61b1b5b Cleanup: simplify for 2016-05-18 17:46:13 +03:00
Mikhail Glukhikh
d366da5cd6 Simplify for intention: now is not active if map / data class properties aren't used in a loop #KT-11716 Fixed 2016-05-18 17:46:09 +03:00
Mikhail Glukhikh
3930184f1f Can be parameter inspection: usage in secondary constructor is now handled as property use 2016-05-18 17:46:05 +03:00
Mikhail Glukhikh
bc7fbdc0a2 Can be parameter inspection: minor test correction 2016-05-18 17:46:01 +03:00
Mikhail Glukhikh
b026969144 Can be parameter inspection: handle usage in super call; again #KT-10819 Fixed 2016-05-18 17:45:57 +03:00
Zalim Bashorov
7b1afd4e6a JS backend: use ResolvedCall when translate super expression and remove some heuristics when translate receivers; generate right receiver when reference to super of outer class; 2016-05-18 17:34:18 +03:00
Alexey Tsvetkov
07adf65f70 Minor: add repository path for android test 2016-05-18 15:24:27 +03:00
Alexey Tsvetkov
a36e3a47ed Keep order of parsed annotations 2016-05-18 15:24:21 +03:00
Alexey Tsvetkov
65df1debe0 Minor: fix downloading sdk in test 2016-05-18 15:24:17 +03:00
Alexey Tsvetkov
b4d47df52b Avoid cache corruption on compile error
#KT-11874 fixed
2016-05-18 15:24:13 +03:00
Sergey Mashkov
09caa65806 KT-12074 Building Kotlin maven projects using a parent pom will silently fail
integration tests
2016-05-18 14:47:17 +03:00
Sergey Mashkov
2d03a5a106 Maven: add maven plugin multimodule test 2016-05-18 14:47:16 +03:00
Sergey Mashkov
77df2e07ad KT-12074 Building Kotlin maven projects using a parent pom will silently fail
We should consider module's basedir if there is relative source directory specified for the execution
2016-05-18 14:47:16 +03:00
Nikolay Krasko
add07ad1a5 Remove unused import 2016-05-18 13:33:18 +03:00
Ilya Gorbunov
5ba8046b48 Change memory growth assertions in testKotlinOnlyDaemonMemory: ensure that the maximum of the used memory established after several first builds doesn't raise significantly in the subsequent builds. Current constraint is 500K per 10 builds which gives 50K per build at average. 2016-05-18 01:45:37 +03:00
Nikolay Krasko
89a10578f4 Remove unused method that causes compatibility problem in update AS plugin 2016-05-17 21:34:00 +03:00
Dmitry Jemerov
fd78424056 remove duplicate source root; update testdata according to the appearance of decompiler in dependencies 2016-05-17 19:53:47 +02:00
Sergey Mashkov
3710520549 Maven: fix integration tests 2016-05-17 18:17:43 +03:00
Mikhail Glukhikh
20bff9f121 Unused symbol inspection refactoring: no use of bundled unused.* 2016-05-17 14:29:05 +03:00
Mikhail Glukhikh
a4ad995f31 Overridden functions using default arguments in recursive call are no more considered tail recursive #KT-4285 Fixed 2016-05-17 14:29:01 +03:00
Mikhail Glukhikh
f35fd32a25 Exhaustive when with 'Unit' result now also generates an exception in else branch #KT-12192 Fixed 2016-05-17 14:28:57 +03:00
Alexey Andreev
23a4184e48 Minor style and formatting improvements of CallArgumentsTranslator 2016-05-17 10:33:16 +03:00
Alexey Andreev
2f42f3bdf6 KT-12305 Fix passing single argument to native vararg function 2016-05-17 10:33:15 +03:00
Ilya Gorbunov
a0e8ed7186 Revert: Disable check for "Access to tree elements not allowed in tests" in completion tests. 2016-05-16 20:54:00 +03:00
Stanislav Erokhin
f376c418dc Fix SOE related exact annotation and completion 2016-05-16 18:32:16 +03:00
Mikhael Bogdanov
2d185dc7cf Public api update after adding LocalVariableReference and MutableLocalVariableReference 2016-05-16 17:36:35 +03:00
Dmitry Jemerov
1653f9f480 add "Decompile" button to Kotlin Bytecode toolwindow 2016-05-16 16:03:01 +02:00
Denis Zharkov
9dc47d9a11 Move java/util/List.sort to MutableList 2016-05-16 15:38:13 +03:00
Denis Zharkov
d0acb3674a Fix rendered testData
New members in enum member scope
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
Mikhail Glukhikh
79852e9912 Do not return primary constructor as an analyzable parent, probably #EA-73679 Fixed 2016-05-16 15:12:28 +03:00
Alexey Sedunov
60f23e9a7e Minor: Move META-INF to "resources" source root 2016-05-16 02:52:24 +03:00
Alexey Sedunov
29310b5ca8 Code Insight: Suppress file reference completion on typing. Disable file references on string literals with escape sequences 2016-05-16 02:52:23 +03:00
Alexey Sedunov
edb3fd8f00 Spring Support: Replace light elements bound to line markers with their originals
#KT-12091 Fixed
2016-05-16 02:52:22 +03:00
Yaroslav Ulanovych
de94d5c414 Fix KT-11839 maven goal to execute kotlin script 2016-05-15 16:08:55 +02:00
Valentin Kipyatkov
e8d518a28f KT-9166 Code completion does not work for synthetic extensions on typing "g"
#KT-9166 Fixed
2016-05-14 12:19:42 +03:00
Valentin Kipyatkov
e04c6d1f5c KT-12299 Completion: incorrect priority of property foo over method getFoo in Kotlin-only code
#KT-12299 Fixed
2016-05-14 12:19:42 +03:00
Valentin Kipyatkov
97ad0d5c86 KT-12124 No code completion for a java property in a specific position
#KT-12124 Fixed
2016-05-14 12:19:41 +03:00
Valentin Kipyatkov
f6c8ac70fc Moved method getSmartCastVariantsWithLessSpecificExcluded() into IDE 2016-05-14 12:19:41 +03:00
Valentin Kipyatkov
b6c54ac314 Minor code improvements after conversion 2016-05-14 12:19:41 +03:00
Valentin Kipyatkov
83714ae9c9 Conversion to Kotlin (step 2) 2016-05-14 12:19:41 +03:00
Valentin Kipyatkov
ccd7ae901c Conversion to Kotlin (step 1) 2016-05-14 12:19:40 +03:00
Valentin Kipyatkov
fe2953090e Added test for KT-12124 2016-05-14 12:19:40 +03:00
Mikhail Glukhikh
182ade19e9 'Long' type is now stored for 'Long' literal #KT-12267 Fixed 2016-05-13 19:51:30 +03:00
Mikhael Bogdanov
48c8678281 Extracted logic of obtaining delegated local variable metadata 2016-05-13 19:11:24 +03:00
Mikhael Bogdanov
c06b51c1d1 Allow top-level local delegated properties in scripts 2016-05-13 19:11:23 +03:00
Mikhael Bogdanov
6ece2b41d6 Box inline test for local delegated property 2016-05-13 19:11:23 +03:00
Mikhael Bogdanov
5e933b7acd localVariableReferences.kt moved from reflection.jvm to runtime.jvm 2016-05-13 19:11:22 +03:00
Mikhael Bogdanov
93b342c936 TODO: reuse tests for local delegated properties from JVM backend in JS one 2016-05-13 19:11:22 +03:00
Mikhael Bogdanov
e207b56009 Support increment and '+=' on local delegated properties in JS backend 2016-05-13 19:11:21 +03:00
Mikhael Bogdanov
ec632c37ab Support increment and '+=' on local delegated properties 2016-05-13 19:11:21 +03:00
Mikhael Bogdanov
6ae511b253 LocalVariableDescriptor.withAccessors renamed to isDelegated, added getter 2016-05-13 19:11:20 +03:00
Dotlin
0e071b4748 Delegated Properties: Code generation for local properties (JS) 2016-05-13 19:11:20 +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
Ilya Gorbunov
9bfb226948 Drop inline-only extensions and hide non-inline-only ones that are available now as mapped methods of mapped builtins.
#KT-10887 Fixed
2016-05-13 18:14:52 +03:00
Mikhail Glukhikh
9bd3be68f7 Code cleanup: protected is effectively private 2016-05-13 17:57:17 +03:00
Mikhail Glukhikh
e31806e2b5 Code cleanup: redundant modality (minor) 2016-05-13 17:57:12 +03:00
Mikhail Glukhikh
1301d9047d Code cleanup: redundant visibility (minor) 2016-05-13 17:57:08 +03:00
Mikhail Glukhikh
733f3e8025 Code cleanup: type parameters can have in / out variance 2016-05-13 17:57:02 +03:00
Valentin Kipyatkov
9afb0d5f59 KT-12284 "Add braces to else" has too wide range
#KT-12284 Fixed
2016-05-13 17:44:01 +03:00
Valentin Kipyatkov
618b1b9a2a Refactored replace with safe/dot call fixes 2016-05-13 17:44:01 +03:00
Valentin Kipyatkov
3f82cc9b39 KT-12260 ISE while replacing an operator with safe call
#KT-12260 Fixed
2016-05-13 17:44:01 +03:00
Natalia Ukhorskaya
6e28c381c4 Update icon for "New -> Kotlin Activity" Action
Assets were taken from DSGN-2829
2016-05-13 16:43:32 +03:00
Mikhail Glukhikh
6da8ab7a97 Unused symbol: take into account possible JUnit static method annotations #KT-11320 Fixed 2016-05-13 14:08:30 +03:00
phx402@gmail.com
75e9e35669 Fixed incorrect "No cast needed" warning when casting from extension function to regular one and vise versa
#KT-11780 Fixed
2016-05-13 13:40:14 +03:00
Mikhail Glukhikh
8920e67c5a Unused symbol: secondary constructors are also under analysis #KT-10812 Fixed 2016-05-13 13:22:25 +03:00
Alexander Udalov
b7581b35c9 Add empty source jars to kotlin-build-common Maven artifacts
Maven Central requires all artifacts to have sources and javadocs
2016-05-12 23:48:03 +03:00
Valentin Kipyatkov
dd16eb14e5 KT-12080 Move parameter names higher up in code completion
#KT-12080 Fixed
2016-05-12 22:22:46 +03:00
Ilya Gorbunov
15dcd3d9f9 Add tests for deserialization of collections persisted with kotlin 1.0 2016-05-12 21:20:54 +03:00
Ilya Gorbunov
6a07d5f89c Fix serialVersionUID for EmptyList after introducing RandomAccess interface. #KT-10794 2016-05-12 21:20:54 +03:00
Dmitry Jemerov
be8c953be6 workaround for KT-9407: don't use qualified name in Pattern class link
#KT-12129 Fixed
2016-05-12 17:53:30 +02:00
Dmitry Jemerov
11c0b30394 specify github revision number in build parameters 2016-05-12 16:56:19 +02:00
Nikolay Krasko
b107bc401c Formatter: Don't enforce empty line between secondary constructors without body (KT-12175)
#KT-12175 Fixed
2016-05-12 17:26:54 +03:00
Nikolay Krasko
52cd7109c7 Use left bound element types to tight empty delegation contructor call to declaration
CONSTRUCTOR_DELEGATION_CALL and CONSTRUCTOR_DELEGATION_REFERENCE types were modified.
2016-05-12 17:25:19 +03:00
Nikolay Krasko
1a1c10251a Make code fragments files non-physical with event system disabled (KT-12232)
Fix "File copy should be non-physical and non-event-system-enabled! Language=Language:
kotlin; file=JetFile: fragment.kt of class org.jetbrains.kotlin.psi.KtExpressionCodeFragment" assert.

Inspired by Java fragment files

 #KT-12232 Fixed
2016-05-12 17:24:54 +03:00
Nikolay Krasko
9c2ceca4b8 Revert "Additional simple test for variable initialize in secondary constructor"
This reverts commit 147f170f80.
2016-05-12 17:22:16 +03:00
Nikolay Krasko
f015a27fd0 Revert "Make code fragments files non-physical with event system disabled"
This reverts commit d02b89a7a0.
2016-05-12 17:21:21 +03:00
Nikolay Krasko
147f170f80 Additional simple test for variable initialize in secondary constructor 2016-05-12 17:13:24 +03:00
Nikolay Krasko
d02b89a7a0 Make code fragments files non-physical with event system disabled
As a side effect it will disable write checks for fragments files

This allows completion work without write action.
Inspired by Java fragment files
2016-05-12 17:13:24 +03:00
Alexey Sedunov
df46a8c67a Spring Support: Implement bean references in @Qualifier annotations
#KT-12092 Fixed
2016-05-12 13:03:04 +03:00
Alexey Sedunov
4a65b1c65c Code Insight: Support file path references inside of Kotlin string literals
#KT-11704 Fixed
2016-05-12 13:03:02 +03:00
Nikolay Krasko
6a309bdb4e No more patched jflex 1.4.3 in idea repository. Download artifact from maven.
02c7c658e8
2016-05-12 10:15:30 +03:00
Nikolay Krasko
96ec8e04ef Make downloading idea sources optional 2016-05-12 10:14:19 +03:00
Yan Zhulanow
99b619497a Fix EA-81689 2016-05-11 21:37:16 +03:00
Alexey Tsvetkov
af9f6d96bb Change version to 1.1-SNAPSHOT 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
60c5c8a2cc Fix Application leak in AbstractAnnotationProcessorBoxTest 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
9214798613 Increase daemon test memory limit again
It is still more strict than it was before (before each test build could grow < 2500 kb, now < 300 kb on average of 10 runs)
2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
6f3ea01084 Refactoring: rename ClassBuilderMode entry LIGHT_CLASSES_WITH_METADATA->KAPT 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
10b9be9f51 Fix collecting source retention annotations
#KT-12187 fixed
2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
cac49b6609 Add class stubs dir to stub generation task classpath 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
f2ca788ea3 Serialize error type to proto when generating stubs 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
8d189bae55 Refactoring: rename javaAptSourceDir->hackAnnotationDir 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
cb94936e51 Refactoring: rename AnnotatedElementDescriptor->AnnotatedElement 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
6dd388d0f0 Exclude compiled files when compiling incrementally 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
fb8ed25e99 Report compiled classes when generating kapt stubs 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
4b591d2220 Include metadata in light classes for kapt 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
f7a665d0d2 Fix incremental compilation with kapt generating stubs
Changes:
* map incremental property to compile kotlin after java task
* when generating stubs compile kotlin task should not remove or copy classfiles
2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
853b15ee98 Add kapt incremental tests 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
fe6e69ff89 Update kapt annotations file incrementally 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
c21693b0d0 Serialize KotlinAnnotationProvider 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
33dc792bf9 Minor: extract constant 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
3ef21a941c Refactoring: make AnnotatedElementDescriptor hierarchy sealed 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
26781bc139 Pass reader as param 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
e0afb94628 Make fun local since it's bound to outer function semantics 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
3340731c71 Read annotations during construction of KotlinAnnotationsProvider
The rationale is to access kotlinClassesInternal and annotatedKotlinElementsInternal
in any order
2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
69a8654e91 Minor: add const 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
28abc73f22 Pass reader in constructor to KotlinAnnotationProvider 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
12531c4a90 Make annotation collector tests more thorough 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
e84ae5117d Refactoring: move kapt tests to separate class 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
93117ed637 Prevent compile tasks from running when nothing changes
#KT-10932 fixed
2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
0bbd2f38dc Minor: use more recent version of gradle in test 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
fe43e1ae79 Minor: do not print output in assertion message 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov
10396ecc84 Refactoring: extract properties for gradle task's properties access in plugin 2016-05-11 20:41:48 +03:00
Valentin Kipyatkov
0c367c6e08 Added missing test data 2016-05-11 19:52:31 +03:00
Mikhail Glukhikh
be2b37db5e Unused symbol inspection: properties declared in primary constructor are now checked on 'Used' annotations #KT-11120 Fixed 2016-05-11 19:08:42 +03:00
Mikhail Glukhikh
a098977c54 Do not try to make object's containing class abstract #KT-11466 Fixed 2016-05-11 19:08:37 +03:00
Mikhael Bogdanov
af2cf715be Disabled dexInProcess and incremental compilation in test android module, explicitly set Xmx for dex process cause of teamcity memory allocation fails 2016-05-11 18:07:27 +03:00
Mikhael Bogdanov
1d2a83e182 Added support for 'JVM.INHERIT_MULTIFILE_PARTS' flag in android tests 2016-05-11 18:07:26 +03:00
Mikhael Bogdanov
ed60cf8c55 Added support for reflection tests on android 2016-05-11 18:07:26 +03:00
Mikhael Bogdanov
d6a64af929 Fix for KT-12125: Wrong increment/decrement on Byte/Char/Short.MAX_VALUE/MIN_VALUE
#KT-12125 Fixed
2016-05-11 18:07:25 +03:00
Ilya Gorbunov
8425304866 Advance snapshot version to 1.1-SNAPSHOT 2016-05-11 17:28:38 +03:00
Alexander Udalov
6b1f3e679f Update ChangeLog for 1.0.2 2016-05-11 12:21:32 +03:00
Alexey Sedunov
44f565e600 Spring Support: Support "Autowired members defined in invalid Spring bean" inspection on Kotlin declarations
#KT-12079 Fixed
2016-05-10 19:41:35 +03:00
Alexey Sedunov
d4aa179336 Change Signature: Do not force substitution of error types
#EA-81021 Fixed
2016-05-10 19:41:33 +03:00
Valentin Kipyatkov
962223159a Do not use setting specifyFieldTypeByDefault for locals 2016-05-10 18:26:04 +03:00
Valentin Kipyatkov
bf9e4a3d84 Better code 2016-05-10 18:26:04 +03:00
Valentin Kipyatkov
07c961d99d Moved local method out 2016-05-10 18:26:04 +03:00
Valentin Kipyatkov
bdd425c1a0 KT-11952 J2K: Assertion failed in PropertyDetectionCache.get on conversion of access to Java constant of anonymous type
#KT-11952 Fixed
2016-05-10 18:26:04 +03:00
Valentin Kipyatkov
de02b56354 Fixed test data 2016-05-10 18:26:03 +03:00
Valentin Kipyatkov
70a5540c00 Minor changes after code review 2016-05-10 18:24:22 +03:00
Valentin Kipyatkov
cca3237e46 KT-4727 J2K: Convert Java code copied from browser or other sources
#KT-4727 Fixed
2016-05-10 18:24:21 +03:00
Valentin Kipyatkov
4cbb098671 Renamed class 2016-05-10 18:24:21 +03:00
Alexey Andreev
826cee58bd KT-11996 Fix issue with referencing outer class in case of inner class constructors and members/properties. Fix issue with referencing outer classes from secondary constructors. Remove unnecessary tests. 2016-05-10 17:41:21 +03:00
Alexey Andreev
1764000bf4 KT-11823 Generate proper argument for closure constructor for this as a free variable. Give some explanation for function that generates closure arguments as well as a clear name. Give explanation to some code in UsageTracker.isSingletonReceiver, augmented by a test case. 2016-05-10 17:41:21 +03:00
Nikolay Krasko
ab79deacbd Remove write action from refactoring start (KT-11486)
#KT-11486 Fixed
2016-05-10 16:06:01 +03:00
Nikolay Krasko
5c1e5b3cdc Make KtLightModifierList behave like light element and check it in tests 2016-05-10 16:06:00 +03:00
Dmitry Jemerov
42ba14328c move KDoc-related logic shared between IDEA and Dokka to ide-common module 2016-05-10 15:00:15 +02:00
Valentin Kipyatkov
07207949ba Support of KT-11255 Support Move Element Left/Right actions for Kotlin (except for enum entries)
#KT-11255 Fixed
2016-05-10 15:48:40 +03:00
Valentin Kipyatkov
7e99a6bb45 Refactored AbstractCodeMoverTest 2016-05-10 15:41:33 +03:00
Valentin Kipyatkov
06db49bab7 Restored lost tests 2016-05-10 15:41:33 +03:00
Valentin Kipyatkov
b6301e819a Converted to Kotlin 2016-05-10 15:41:32 +03:00
Valentin Kipyatkov
8da5af3a10 KT-11974 Invert if-condition intention loses comments
#KT-11974 Fixed
2016-05-10 15:40:51 +03:00
Valentin Kipyatkov
7b1bf4c7dd Fixed dialog with suggestion to process external code shown even when there is nothing to process 2016-05-10 15:00:57 +03:00
Mikhail Glukhikh
48ba63fa27 Can be parameter inspection: usages in all functions are now handled as property usage 2016-05-10 10:53:34 +03:00
Ilya Gorbunov
d646afabb2 Document functions which return set or map preserving the order of elements/entries.
#KT-11632 Fixed
2016-05-08 03:24:03 +03:00
Dmitry Jemerov
b5e5c6f4d0 generate correct HTML for code blocks 2016-05-06 22:11:53 +02:00
Dmitry Jemerov
94c241443b support @receiver KDoc tag; somewhat more precise tag name completion 2016-05-06 22:11:50 +02:00
Dmitry Jemerov
3b57b78ddc KDocKnownTag: J2K 2016-05-06 22:11:49 +02:00
Dmitry Jemerov
6935cfeafa KDocKnownTag: rename to .kt 2016-05-06 22:11:48 +02:00
Dmitry Jemerov
992817e70c don't trim whitespace when converting whitespace to HTML
#KT-10998 Fixed
2016-05-06 22:11:46 +02:00
Dmitry Jemerov
d7b1526cd5 preserve leading indentation in KDoc code blocks
#KT-9933 Fixed
2016-05-06 22:11:38 +02:00
Dmitry Jemerov
721629f8e0 integrate Ingo Kegel's Dokka fix for rendering standalone * and _ characters 2016-05-06 22:11:34 +02:00
Dmitry Jemerov
6cbf1de170 render markdown inside link texts
#KT-11791 Fixed
2016-05-06 22:11:32 +02:00
Dmitry Jemerov
c967cc8a23 resolve references from @param to type parameters of functions
#KT-12001 Fixed
2016-05-06 22:11:31 +02:00
Kirill Rakhman
97c3c633a7 Add quickfix for UNUSED_LAMBDA_EXPRESSION (#867)
Fixes #KT-9757
2016-05-06 18:46:12 +03:00
Mikhael Bogdanov
ca31ce8d88 Support new tests on android, disabled not applicable ones 2016-05-06 17:31:53 +03:00
Kirill
5b6a8dcfd3 Don't mark magic Serializable methods as unused
Fixes #KT-10635
2016-05-06 15:33:55 +02:00
Ilya Chernikov
d77923af47 minor: fix after review 2016-05-06 13:06:39 +02:00
Ilya Chernikov
22283be1b7 minor: Make term "canceled" uniformly spelled in identifiers and strings in the daemon 2016-05-06 13:06:38 +02:00
Ilya Chernikov
1614aca48e Implement graceful connection failure behavior on daemon connect and cancellation check
Should fix (or actually - behave gracefully on) #EA-74003, #EA-74493, #EA-76032, #EA-76529, #EA-81295
Tests added
2016-05-06 13:06:38 +02:00
Ilya Chernikov
336226ac9e minor: Switch to simpler descending sort, reduce dependency 2016-05-06 13:06:37 +02:00
Nikolay Chashnikov
551aa7047e run configuration: use default logic of creating new run configurations to avoid sharing RunConfigurationModule instances between different run configurations (KT-12204) (#869) 2016-05-06 12:01:12 +03:00
Zalim Bashorov
c11d504a26 Minor: add test for KT-11993 "NoSuchMethodError when testing internal symbols" 2016-05-05 20:45:29 +03:00
Nikolay Krasko
6cafa51b07 Description for AddJvmOverloadsIntention 2016-05-05 17:27:48 +03:00
Nikolay Krasko
527907635d Enable JDK 8 level in some tests for correct convert for method references 2016-05-05 17:27:47 +03:00
Alexey Andreev
12c9a97587 JS/RTTI: minor refactoring of expandInCalls 2016-05-05 17:24:27 +03:00
Alexey Andreev
7ff658414f JS/RTTI: if it's known that T <: X & Y, where T is non-reified type variable, for each a is T check that a is X && a is Y 2016-05-05 17:24:26 +03:00
Alexey Andreev
6454613b51 JS/RTTI: in expressions like a as T when inferred type for a is S, where S <: T, don't generate type checking 2016-05-05 17:24:25 +03:00
Alexey Andreev
0f6a6a3ba4 JS/RTTI. Fix runtime checking against kotlin.CharSequence 2016-05-05 17:24:25 +03:00
Alexey Andreev
f52b836f0e JS/RTTI: fix withInlineTurnedOff test 2016-05-05 17:24:24 +03:00
Alexey Andreev
75015f6bfa JS/RTTI: fix compiler crashing when translating expressions like (continue as T) 2016-05-05 17:24:23 +03:00
Zalim Bashorov
3a87049359 JS/RTTI. Fix build and tests 2016-05-05 17:24:23 +03:00
Alexey Tsvetkov
9bb60b48b2 JS/RTTI. Fix run-time type checking against Comparable 2016-05-05 17:24:22 +03:00
Alexey Tsvetkov
390d71ac8d JS/RTTI. Fix RegExpMatch 2016-05-05 17:24:21 +03:00
Alexey Tsvetkov
fcd941ad49 JS/RTTI: removed Kotlin.orNull(Kotlin.isAny) optimization 2016-05-05 17:24:21 +03:00
Alexey Tsvetkov
f7af868d4f JS/RTTI: added another cast to reified test 2016-05-05 17:24:20 +03:00
Alexey Tsvetkov
a9d5c74ff7 JS/RTTI: Added cast to Array test 2016-05-05 17:24:19 +03:00
Alexey Tsvetkov
c99fd179e1 JS/RTTI: simplify cast to Any test 2016-05-05 17:24:19 +03:00
Alexey Tsvetkov
cd60a8d207 JS/RTTI: fixed cast to generic type parameter with upper bound different than Any 2016-05-05 17:24:18 +03:00
Alexey Tsvetkov
d42cbde74d JS/RTTI: (minor) fixed typo 2016-05-05 17:24:17 +03:00
Alexey Tsvetkov
57fbab9f7c JS/RTTI: (minor) escape code fragments in comments 2016-05-05 17:24:17 +03:00
Alexey Tsvetkov
87659bd95b JS/RTTI: fix nullability check 2016-05-05 17:24:16 +03:00
Alexey Tsvetkov
7a5b4650ad JS/RTTI: use Array.isArray to check array instance 2016-05-05 17:24:16 +03:00
Alexey Tsvetkov
ae9a5523e0 JS/RTTI: use typeof f === 'function' to check function instance 2016-05-05 17:24:15 +03:00
Alexey Tsvetkov
7cfe1433c5 JS/RTTI: cast to generic type parameter as to Any 2016-05-05 17:24:15 +03:00
Alexey Tsvetkov
38b0effe15 JS/RTTI: fix cast to Any 2016-05-05 17:24:14 +03:00
Alexey Tsvetkov
2b3ebc7e9f JS/RTTI: support safe casts 2016-05-05 17:24:13 +03:00
Alexey Tsvetkov
3fd387d4a6 JS/RTTI: support unsafe casts
#KT-2670 fixed
2016-05-05 17:24:13 +03:00
Alexey Tsvetkov
1d2da9729e JS/RTTI: made cast test generated 2016-05-05 17:24:12 +03:00
Alexey Tsvetkov
427b95f821 JS/RTTI: test that reified is-check works when inline turned off 2016-05-05 17:24:12 +03:00
Alexey Tsvetkov
dce0971c52 JS/RTTI: fixed double testing for null for reified 2016-05-05 17:24:11 +03:00
Alexey Tsvetkov
5fdede74a3 JS/RTTI: avoid possible side-effect for is-check on nullable type
#KT-7038 fixed
2016-05-05 17:24:10 +03:00
Alexey Tsvetkov
c6cf6a0df7 JS/RTTI: use generation for rtti test 2016-05-05 17:24:10 +03:00
Alexey Tsvetkov
0b9c041d0a JS/RTTI: fixed is-check on nullable reified parameters
#KT-7016 fixed
    #KT-8012 fixed
2016-05-05 17:24:09 +03:00
Natalia Ukhorskaya
e1d10abfa1 Debugger: do not use forceResolveScope for codeFragments in completion and AutoImportFix.
#KT-12137 Fixed
2016-05-05 06:29:36 +03:00
Valentin Kipyatkov
c45bee5327 KT-12040 "Replace when with if" produce invalid code for first entry which has comment
#KT-12040 Fixed
2016-05-04 18:25:26 +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
Valentin Kipyatkov
16c38a2415 KT-12138 Do not show "::error" in smart completion when any function type accepting one argument is expected
(actually made them lowest priority)

 #KT-12138 Fixed
2016-05-04 17:28:30 +03:00
Valentin Kipyatkov
81e4114c5a Minor 2016-05-04 17:28:29 +03:00
Valentin Kipyatkov
941b415981 KT-12150 Smart completion suggests to compare non-nullable with null
#KT-12150 Fixed
2016-05-04 17:28:29 +03:00
Valentin Kipyatkov
40900b0050 No explicit runWriteAction required 2016-05-04 17:28:29 +03:00
Valentin Kipyatkov
0769c5453f KT-12103 Smart completion for nested SAM-adapter produces short unresolved name
#KT-12103 Fixed
2016-05-04 17:28:29 +03:00
Mikhael Bogdanov
cd6b709ef5 'bytecodeText' test for synthetic accessor generic signature converted to 'writeSignature' test 2016-05-04 17:07:48 +03:00
Mikhael Bogdanov
ee7bbbf530 Fix for KT-12127: Undeclared type variable on delegated property backing field
#KT-12127 Fixed
2016-05-04 17:07:48 +03:00
Valentin Kipyatkov
bac5c4d70b Fixed test data after commit: 602de317d6 2016-05-04 16:26:44 +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
Mikhael Bogdanov
09509b6d18 Update android test dependency to android 4.4.2 cause of missed test result problem on 4.1.2 2016-05-03 09:11:37 +03:00
Ilya Gorbunov
249d08a66e Handle special cases of drop, take, takeLast when it is known in advance that the result is a single-item list. #KT-9990 2016-04-29 22:21:19 +03:00
Ilya Gorbunov
d70b46fd37 Change evaluation test data not to encounter special implementation of single element list. 2016-04-29 22:21:19 +03:00
Ilya Gorbunov
a665b2183c Optimize operations to return special collection implementations when result is empty or has single element.
#KT-9990
2016-04-29 22:21:19 +03:00
Ilya Gorbunov
2d12ed68c8 Remove runtime specialization in inline last and lastOrNull to prevent double inlining of predicate body. 2016-04-29 22:21:19 +03:00
Ilya Gorbunov
09c1ff1233 Do not use indexed access for lists not supporting RandomAccess
Add RandomAccess specialization.
2016-04-29 22:21:19 +03:00
Ilya Gorbunov
f4f82656f7 Use list iterators instead of indexed access in operations on lists taking a lambda.
Related to #KT-9607
2016-04-29 22:21:19 +03:00
Nikolay Krasko
b743e71cfc Do not request write action for MoveDeclarationToSeparateFileIntention (EA-81511)
There's nothing but delegation to move refactoring. This started to fail in br146 because of this commit:
334772b7a8
2016-04-29 21:24:56 +03:00
Nikolay Krasko
4a5c298897 Revert another class of ComparisonFailure
Idea throws this class but not org.junit.ComparisonFailure
2016-04-29 21:24:56 +03:00
Nikolay Krasko
31043f43e3 Fix path replacement in reference tests
The commit fixes ReferenceResolveInJavaTestGenerated$BinaryAndSource.testFileFacade.
2016-04-29 21:24:56 +03:00
Michael Bogdanov
e2ae2f313c Support test with self imports, kotlin multifile tests 2016-04-29 16:33:04 +03:00
Michael Bogdanov
0f110b049b Fix for "adb: Syntax error: ")" unexpected" 2016-04-29 16:21:15 +03:00
Zalim Bashorov
ed0fa2c26c Fix NoSuchMethodError when try to access in test to internal member from production for gradle projects imported into IDEA 16 or higher
#KT-11993 Fixed
2016-04-29 18:23:26 +03:00
Valentin Kipyatkov
74b41cff0e Minor changes on code review 2016-04-29 18:13:53 +03:00
Valentin Kipyatkov
92af610322 KT-12045 J2K: creating Object() instance could be converted to Any()
#KT-12045 Fixed
2016-04-29 18:13:53 +03:00
Valentin Kipyatkov
76e067c43a KT-12054 J2K generates obj is Type<Any> instead of obj is Type<*>
#KT-12054 Fixed
2016-04-29 18:13:53 +03:00
Valentin Kipyatkov
a8eef5effc KT-12039 Convert Java to Kotlin -- static imports are imported as Class.CONST (missing .Companion)
#KT-12039 Fixed
2016-04-29 18:13:52 +03:00
Valentin Kipyatkov
a80d36e8eb Minor simplification 2016-04-29 18:13:52 +03:00
Valentin Kipyatkov
569483af5d Moved import conversion out of "ast" package 2016-04-29 18:13:52 +03:00
Valentin Kipyatkov
83442db408 Do not duplicate list of default imports 2016-04-29 18:13:52 +03:00
Valentin Kipyatkov
08a37b3acc Extracted methods 2016-04-29 18:13:52 +03:00
Valentin Kipyatkov
a9eadcbaf4 KT-12046 Java to Kotlin dangerous conversion (recursive property set)
#KT-12046 Fixed
2016-04-29 18:13:51 +03:00
Valentin Kipyatkov
9c0e1204ea Minor 2016-04-29 18:13:51 +03:00
Valentin Kipyatkov
b0e6bf3965 Deleted inspection profile 2016-04-29 17:06:28 +03:00
Alexander Udalov
384c32b63f Update ChangeLog for 1.0.2 2016-04-29 15:45: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
Kirill Rakhman
8e5481b5d5 Implement Intention to add @JvmOverloads (#860)
Implement Intention to add @JvmOverloads
Fixes #KT-11523
2016-04-29 14:32:00 +03:00
Kirill Rakhman
f309920af8 Add quickfix to make referenced primary constructor parameter a property
Fixes #KT-12089
2016-04-29 12:14:42 +02:00
Kirill Rakhman
1c5322bae4 Quick fix for SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE (#858)
* Quick fix for SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE
Fixes #KT-11876

* Revert accidental change

* Remove period

* ConvertExtensionToFunctionTypeFix: more tests
2016-04-29 12:47:38 +03:00
Valentin Kipyatkov
b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Valentin Kipyatkov
e1d8c72aa7 KT-10770 IDEA cannot keep import if a type is only referenced by kdoc.
#KT-10770 Fixed
2016-04-29 11:23:23 +03:00
Valentin Kipyatkov
cd2161b37d KT-12069 Specify language for all Kotlin code inspections
#KT-12069 Fixed
2016-04-29 11:23:23 +03:00
Valentin Kipyatkov
306edef23c Highlighting of redundant semicolons
#KT-5010 Fixed
2016-04-29 11:23:22 +03:00
Valentin Kipyatkov
77033f52ee ConvertPropertyInitializerToGetterIntention to not be available inside lambda initializer 2016-04-29 11:23:22 +03:00
Kirill Rakhman
4a619db721 Add intrinsic for KCallable.name property Fixes #KT-11531 2016-04-28 23:03:00 +03:00
Nikolay Krasko
b8e2533b58 Check that injection with annotation on parameter doesn't trigger not-stubbed psi 2016-04-28 16:11:35 +03:00
Nikolay Krasko
dd8b667360 Don't analyze function body if only parameter analyze is requested 2016-04-28 16:11:33 +03:00
Nikolay Krasko
faa2745731 Missing new line in error message (KT-12070)
#KT-12070 Fixed
2016-04-28 16:11:27 +03:00
Nikolay Krasko
018622e552 Use partial resolve for annotation search 2016-04-28 16:06:35 +03:00
Nikolay Krasko
3d8abd874b Use kotlin specific methods for pattern creation 2016-04-28 16:06:34 +03:00
Nikolay Krasko
73024429dc Refactoring: use language injection in ResolveElementCache.kt 2016-04-28 16:06:32 +03:00
Nikolay Krasko
62ede15241 Refactoring: return injection tests to single test-class 2016-04-28 16:06:30 +03:00
Michael Bogdanov
adda3ef69d Ability to run tests via adb 2016-04-28 15:02:33 +03:00
Michael Bogdanov
d4a7e36722 Android tests exclusion 2016-04-28 15:02:33 +03:00
Michael Bogdanov
896429a959 Switch to gradle from gradle wrapper, use https instead of http to download files 2016-04-28 15:02:32 +03:00
Michael Bogdanov
309348c9be Code clean 2016-04-28 15:02:32 +03:00
Michael Bogdanov
7d77f9171c Wait some time before emulator stop, diabled emulator log redirection (otherise result reports would be inconsistent)
~emulator
2016-04-28 15:02:31 +03:00
Michael Bogdanov
be1cb406d2 More logging on adb server start 2016-04-28 15:02:31 +03:00
Michael Bogdanov
db6c72d886 Support WITH_REFLECT and 'Class.forName' android tests 2016-04-28 15:02:30 +03:00
Michael Bogdanov
ed3d874f88 Wait until emulator booted 2016-04-28 15:02:30 +03:00
Michael Bogdanov
2992e23508 Use gradle build instead of ant one for android test module 2016-04-28 15:02:29 +03:00
Michael Bogdanov
3ad8b5be91 Ecluded test from compilation: android report bad class file cause of missed generic parameter definition 2016-04-28 15:02:29 +03:00
Michael Bogdanov
0abdc75477 Temporary disable lint checks cause of problem with implicit 'stream' import 2016-04-28 15:02:28 +03:00
Michael Bogdanov
3cebb7c804 Added support for tests with 'JvmName' annotation 2016-04-28 15:02:28 +03:00
Michael Bogdanov
11e42c6472 Call 'invokeBox' with proper class instance (not try to find it via reflection) 2016-04-28 15:02:27 +03:00
Michael Bogdanov
1eb3d2ec1d Added gradle android test project 2016-04-28 15:02:27 +03:00
Michael Bogdanov
1f84ff7fa6 Writing android sdk to local.properties 2016-04-28 15:02:26 +03:00
Kirill Rakhman
2629d23576 Add quickfix to add 'toString' (#866)
Fixes #KT-12121
2016-04-28 12:15:39 +03:00
Valentin Kipyatkov
a51fe9a9b0 Minor change on code review 2016-04-27 23:47:35 +03:00
Valentin Kipyatkov
45d460a5fa Dropped redundant code which was required for lambda signature completion when the syntax was different
#KT-12033 Fixed
2016-04-27 23:47:34 +03:00
Valentin Kipyatkov
40022e8f7a KT-12068 Special completion item for "[]" get-operator access
#KT-12068 Fixed
2016-04-27 23:47:34 +03:00
Valentin Kipyatkov
deb75b3f18 Completion to complete non-imported classes on the first invocation
#KT-8527 Fixed
2016-04-27 23:47:33 +03:00
Valentin Kipyatkov
f0dd70d94c KT-11680 Code completion of label for existing return with value inserts redundant whitespace
#KT-11680 Fixed
 #KT-9993 Fixed
2016-04-27 23:46:26 +03:00
Sergey Mashkov
e9758099ce Maven: rebase to master 2016-04-27 19:40:58 +03:00
Sergey Mashkov
d9dabeed76 Maven: review 2016-04-27 19:40:57 +03:00
Sergey Mashkov
072ec26452 Maven: convert to Kotlin 2016-04-27 19:40:57 +03:00
Sergey Mashkov
78d0f83f71 Maven: reorganize code: move classes across packages 2016-04-27 19:40:57 +03:00
Sergey Mashkov
eb789304b6 Maven: inspection maven plugin and ide plugin should have the same version 2016-04-27 19:40:56 +03:00
Sergey Mashkov
aa156c08c6 Maven: versions inspection: kotlin plugin and library should have the same version 2016-04-27 19:40:56 +03:00
Sergey Mashkov
6caef7716f Maven: kotlin-maven-plugin configuration source dirs completion 2016-04-27 19:40:55 +03:00
Sergey Mashkov
d097c3e9f1 KT-11743 Intention to replace kotlin-test with kotlin-test-junit 2016-04-27 19:40:55 +03:00
Sergey Mashkov
b8327f19b8 Maven: never generate JUnit (but keep code so we will be able to introduce checkbox in configurator to optionally add junit and chose version) 2016-04-27 19:40:55 +03:00
Sergey Mashkov
c30fc78f8e KT-11731 Default maven integration doesn't include documentation
trigger sources download for stdlib/runtime/test at project import
2016-04-27 19:40:54 +03:00
Sergey Mashkov
fc197cd616 Maven: extract maven support to the separate module 2016-04-27 19:40:54 +03:00
Sergey Mashkov
dfaba1d0aa KT-11556 "Kotlin not configured" in Kotlin/JS project 2016-04-27 19:40:54 +03:00
Sergey Mashkov
64a63476f7 KT-11701 Add Maven Dependency quick fix could be supported in Kotlin sources
~ initial draft
2016-04-27 19:40:53 +03:00
Sergey Mashkov
01fa6d5718 KT-11436 "Choose Configurator" control opens dialogs with inconsistent modality (linux) 2016-04-27 19:40:53 +03:00
Sergey Mashkov
addc73dba5 KT-11643 Inspections and intentions to fix misconfigured Maven pom
make misconfigured maven project configurable
2016-04-27 19:40:52 +03:00
Sergey Mashkov
0834435248 KT-11643 Inspections and intentions to fix misconfigured Maven pom 2016-04-27 19:40:52 +03:00
Sergey Mashkov
7d649b4327 KT-9492 Configuring multiple Maven Modules
- kotlin mavne configurator shouldn't configure child modules but parents as children inherit everything
2016-04-27 19:40:52 +03:00
Sergey Mashkov
7da92872a8 KT-11642 Kotlin Maven configurator tags order 2016-04-27 19:40:51 +03:00
Mikhail Glukhikh
918f843cd0 Correct handling of empty super type list while adding an entry #KT-12011 Fixed 2016-04-27 18:44:42 +03:00
Mikhail Glukhikh
5c9d6fd460 UAST: unnecessary 'val' removed from constructor 2016-04-27 18:42:08 +03:00
Mikhail Glukhikh
a4be89e5fd JS: unnecessary 'val' removed from constructor 2016-04-27 18:42:04 +03:00
Mikhail Glukhikh
ee46c34a5e Android: unnecessary 'val's removed from constructors 2016-04-27 18:42:00 +03:00
Mikhail Glukhikh
5a66ef2126 Core & compiler: unnecessary 'val's removed from constructors 2016-04-27 18:41:56 +03:00
Mikhail Glukhikh
84a3f729ca IDEA: unnecessary 'val's removed from constructors 2016-04-27 18:41:52 +03:00
Mikhail Glukhikh
1744897561 Can be parameter inspection: use inside object literals is now handled as "property use" 2016-04-27 18:41:48 +03:00
Mikhail Glukhikh
64ae9af3a4 Can be parameter inspection: use in selector position is now always handled as "property use" 2016-04-27 18:41:45 +03:00
Mikhail Glukhikh
795b92461e Can be parameter inspection: use inside function literals is now handled as "property use" #KT-11949 Fixed 2016-04-27 18:41:41 +03:00
Ilya Gorbunov
ae2e3f1811 kotlin-test: add assertFails overload with message. 2016-04-27 18:22:20 +03:00
Ilya Gorbunov
4b533b297e reified assertFailsWith available in kotlin-test for JS
#KT-11346
2016-04-27 18:22:20 +03:00
Ilya Gorbunov
409094f0f7 Make stdlib functions dependent on reified is checks available in JS.
#KT-11346 Fixed
2016-04-27 18:22:20 +03:00
Ilya Gorbunov
a5fd95c7d9 JS: Make AbstractList.size pure abstract.
#KT-7228 Fixed
2016-04-27 18:22:20 +03:00
Mikhail Glukhikh
6b945ba103 Regular checkType() is now called during condition analysis, TYPE_MISMATCH_IN_CONDITION removed #KT-11998 Fixed 2016-04-27 18:12:28 +03:00
Alexey Sedunov
e6ab2f1c2d Change Signature: Do not use local declaration as a context for a type code fragment 2016-04-27 15:48:42 +03:00
Stanislav Erokhin
c6cb5175a4 Minor. Use capability instead of capabilities. 2016-04-27 14:13:59 +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
Alexander Udalov
922f133d75 Perform version override earlier and only on teamcity 2016-04-27 10:55:33 +03:00
Mikhail Zarechenskiy
69b4837830 Move part of code that related to 'Optimize imports' action to ide-common module 2016-04-26 20:46:06 +03:00
Mikhail Zarechenskiy
b677e9d2ea Get rid of guava's collections and dependency on Idea's settings from util function
This commit prepares 'prepareOptimizedImports' function to
move to the ide-common module to reuse it in the Eclipse plugin
2016-04-26 20:46:06 +03:00
Nikolay Krasko
09af830476 Do no analyze for annotation search if no annotation entries present 2016-04-26 20:43:26 +03:00
Nikolay Krasko
dbdea86d78 Add note about fixing deadlock in debugger (KT-12067) 2016-04-26 20:43:26 +03:00
Nikolay Krasko
2b51b526ba Enable injection in injection tests 2016-04-26 20:43:26 +03:00
Nikolay Krasko
64c46a33c4 Make parameter injection work for Java methods 2016-04-26 20:43:26 +03:00
Nikolay Krasko
3e35c60406 First version of injection with annotation on parameter 2016-04-26 20:43:26 +03:00
Nikolay Krasko
6ca9ba9e30 Implement withAnnotation() pattern for parameter pattern 2016-04-26 20:43:26 +03:00
Nikolay Krasko
8eda5e0ea5 Refactoring replace trimMargin() with trimIndent(). This is preparation for injection bootstrapping in tests. 2016-04-26 20:43:26 +03:00
Nikolay Krasko
a6d129b006 Add write action for shorten references in finish template after building call (KT-12056)
Write action was removed in idea 146

#KT-12056 Fixed
2016-04-26 20:43:26 +03:00
Nikolay Krasko
30e8c67d01 Add write action for shortening references in templates (KT-11418)
Write action was removed in idea 146.

#KT-11418 Fixed
2016-04-26 20:43:26 +03:00
Nikolay Krasko
cae366f97e Revert write actions in utility code (EA-81892)
Revert commits:
ab0fe0a900
97a97614b5
2016-04-26 20:43:26 +03:00
Nikolay Krasko
7327275bf4 Auto-test running intention isApplicable() from pooled thread 2016-04-26 20:43:26 +03:00
Alexey Sedunov
9858b178c0 Change Signature: Fix context element for type code fragments to avoid bogus "Type can not be resolved" warnings
#KT-11862 Fixed
2016-04-26 20:11:59 +03:00
Zalim Bashorov
3048c293d0 Minor: fix tests 2016-04-26 19:11:05 +03:00
Alexey Andreev
76cfe8cabc KT-11100 Fix generation of name of FakeCallableDescriptorForObject that is presumably used to express invoke operator on (companion) objects 2016-04-26 17:04:09 +03:00
Alexey Sedunov
12987de156 Spring Support: Replace accessor name with property name when processing usages in Kotlin files
#KT-11880 Fixed
2016-04-26 16:15:32 +03:00
Kirill
6e08f06bfd Format spaces in infix call (KT-12018)
#KT-12018 Fixed
2016-04-26 15:21:33 +03:00
Kirill
01b754b318 Format spaces in cast expression (KT-12035)
#KT-12035 Fixed
2016-04-26 15:21:33 +03:00
Alexey Sedunov
a00c524074 Move: Optimize imports after applying "Move declaration to separate file" intention
#KT-10174 Fixed
2016-04-26 13:59:11 +03:00
Alexey Sedunov
676000cdf7 Move: Keep original file package name when moving top-level declarations to separate file (provided it's not ambiguous)
#KT-10950 Fixed
2016-04-26 13:59:10 +03:00
Alexey Sedunov
332fe29e94 Move: Allow choosing source root in "Move file to directory" intention
#KT-11512 Fixed
2016-04-26 13:59:08 +03:00
Alexey Sedunov
aaa873f227 Move: Convert implicit receiver to this when moving class member to companion object
#KT-11483 Fixed
2016-04-26 13:59:07 +03:00
Alexey Sedunov
6faedc1adc Move: Add missing write action
#KT-11482 Fixed
2016-04-26 13:59:05 +03:00
Nikolay Krasko
6b7aa98980 Test data modification: Don't compute compiled bytecode for same expression twice
Result of dc9fa6d9ac commit.
Previously computation were saved into the map that were invalidated by the computation. Now map is recreated after computation and result is saved into it.
2016-04-25 19:50:22 +03:00
Zalim Bashorov
658eac2d12 Add Unit to compiled part of Kotlin JS stdlib and don't show "Kotlin not configured" for Kotlin JS projects
#KT-11556 Fixed
2016-04-25 17:58:51 +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
0d4a132be5 Minor. Regenerate tests 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
a1d4214a39 Use fq-names instead of descriptors when computing ambigious names
Because there can be different descriptors that are essentially equal
(from different modules)

See J2K test: testNullableField
2016-04-25 17:41:08 +03:00
Denis Zharkov
28e33aaf56 Use weak-reference based SLRU cache for module resolvers
Create new module resolver iff it's weak reference is collected,
but at the same time keep hot modules in SLRU map not to give them be collected
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
193dd06f50 Use different names for mockJDK and fullJDK
It's needed because they both used in one project in some tests,
while IDEA model relies on assumption that JDK's names are unique
2016-04-25 17:41:08 +03:00
Denis Zharkov
adff42add3 Minor. Add absent dependency: J2K -> tests-common 2016-04-25 17:41:08 +03:00
Denis Zharkov
de228da077 Add library invalidation in IDE tests setUp 2016-04-25 17:41:08 +03:00
Denis Zharkov
8d697395cd Minor. Replace for-loop with 'single' call 2016-04-25 17:41:08 +03:00
Denis Zharkov
7960561c4b Minor. Use SAM-constructor to overcome overload ambiguity
There is an ambiguity since 'forEach' method appeared at Iterable,
that is supertype of Query
2016-04-25 17:41:08 +03:00
Denis Zharkov
b94baede38 Minor. Fix rendered Throwable member scope 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
128dd43dbd Minor. Move LoadBuiltinsTest testData to separate directory 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
dbc8830acd Fix ResolveTest
Compare descriptors by their FQ-names instead of references
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
Denis Zharkov
5bf39689e9 Replace irrelevant usages of JvmBuiltIns.Instance with DefaultBuiltIns.Instance 2016-04-25 17:41:08 +03:00
Denis Zharkov
c667f50741 Delete TargetPlatform.builtins
Replace it's usages with relevant singleton reference
2016-04-25 17:41:08 +03:00
Denis Zharkov
ef18d64931 Parametrize module creation by platform with built-ins 2016-04-25 17:41:08 +03:00
Denis Zharkov
7f860fa051 Manually set up built-ins for decompiler 2016-04-25 17:41:08 +03:00
Denis Zharkov
c4a899d9a4 Get rid of some targetPlatform.builtIns usages
Retrieve builtIns from module itself when adding dependencies on them
2016-04-25 17:41:08 +03:00
Denis Zharkov
e97fa929ea Minor. Replace '== JvmPlatform' with 'is JvmPlatform' 2016-04-25 17:41:08 +03:00
Denis Zharkov
e2db5d9a01 Get rid of TargetPlatform.builtIns usages in IDE
Retrieve them through resolution facade instead of platform
2016-04-25 17:41:08 +03:00
Michael Bogdanov
3858515e44 Added kotlin-test.jar to android module dependency 2016-04-25 17:39:13 +03:00
Michael Bogdanov
b092c04145 Removed debug counter 2016-04-25 17:39:13 +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
Stanislav Erokhin
feec3566a4 Refactoring. Minor refactoring and cleanup in FlexibleTypes. 2016-04-25 15:28:47 +03:00
Stanislav Erokhin
a1d052b8fa Refactoring. Remove FlexibleTypeFactory.DEFAULT and refactor flexible type creation by special fq-name for tests. 2016-04-25 15:28:46 +03:00
Stanislav Erokhin
0a4ad3f267 Refactoring. Rename FlexibleTypeCapabilities -> FlexibleTypeFactory. Also use factory.create instead of DelegatingFlexibleType.create. 2016-04-25 15:28:46 +03:00
Stanislav Erokhin
c25e2e34a2 Optimization. Do not create objects for flexible type capabilities. 2016-04-25 15:28:45 +03:00
Michael Bogdanov
75d7390a94 Rollback: set permissions via 'chmod' 2016-04-25 14:33:22 +03:00
Michael Bogdanov
18f90a331c Run android test configuration with java 8 2016-04-25 14:33:21 +03:00
Michael Bogdanov
4e95a52152 'generators' dependency replaced with 'descriptors.loader.java' in 'android-test' module 2016-04-25 14:33:21 +03:00
Michael Bogdanov
af2a3b14c7 Temporary exclude 'box' test with self imports 2016-04-25 14:33:20 +03:00
Michael Bogdanov
9238b7ba80 Use mock jdk for tests that not require full one 2016-04-25 14:33:20 +03:00
Michael Bogdanov
bc16be9735 Support for WITH_RUNTIME test on android 2016-04-25 14:33:19 +03:00
Michael Bogdanov
6228b11048 Properly patch package name in case of file annotations on default package 2016-04-25 14:33:19 +03:00
Alexey Sedunov
797465a06b Rename: Do not use Change Signature for parameter renaming 2016-04-25 10:38:40 +03:00
Alexey Sedunov
d456aa6ba8 Rename: Fix Find Usages/Rename for parameter references in XML files
#KT-11967 Fixed
2016-04-25 10:38:39 +03:00
Alexey Sedunov
6a1387b9b9 Safe Delete: Delete interface reference from super-type list when applying Safe Delete to Java interface
#KT-11282 Fixed
2016-04-25 10:38:38 +03:00
Alexey Sedunov
613a274c90 Safe Delete: Fixed usages search when applied to simple enum entries
#KT-11816 Fixed
2016-04-25 10:38:37 +03:00
Alexey Sedunov
b35834dd18 Rename: Fixed rename of Kotlin enum constants/@JvmField properties through Java references
#KT-11817 Fixed
2016-04-25 10:38:35 +03:00
Alexey Sedunov
070923f03a Introduce Parameter: Fixed title of declaration chooser
#KT-11617 Fixed
2016-04-25 10:38:34 +03:00
Alexey Sedunov
cc5c3c2353 Rename: Fixed rename of Java getters/setters through synthetic property references in Kotlin
#KT-8817 Fixed
2016-04-25 10:38:33 +03:00
Mikhail Glukhikh
a45165838a Build fix: quick fix multi file test 2016-04-24 13:09:37 +03:00
Mikhail Glukhikh
cac986baf7 Refactoring: change visibility on exposure 2016-04-23 20:48:25 +03:00
Mikhail Glukhikh
b1195fc519 Change to private fix made high priority action 2016-04-23 20:48:00 +03:00
Mikhail Glukhikh
d8e47bd520 Change visibility fix message (quotes) + list of available actions in tests 2016-04-23 20:25:18 +03:00
Mikhail Glukhikh
7e80575a08 Minor refactoring: MakeVisibleFactory 2016-04-23 12:57:47 +03:00
Mikhail Glukhikh
e6a7cd97ff Change visibility on exposure now reports all possible visibilities 2016-04-23 10:01:10 +03:00
Mikhail Glukhikh
a2501463a8 Minor refactoring: change visibility on exposure (exposing -> user) 2016-04-23 10:01:08 +03:00
Mikhail Glukhikh
0217e6104f Refactoring: IncreaseExposed + DecreaseExposing = ChangeVisibilityOnExposure 2016-04-23 10:01:05 +03:00
Mikhail Glukhikh
8938752cf9 Make visible now suggests all possible visibilities 2016-04-23 10:01:02 +03:00
Mikhail Glukhikh
d5b9a336a3 Decrease visibility fix is now active for exposed visibility errors #KT-11920 Fixed 2016-04-23 10:00:59 +03:00
Mikhail Glukhikh
934c374030 Refactoring: IncreaseVisibilityFix --> ChangeVisibilityFix + MakeVisibleFactory + IncreaseExposedVisibilityFactory 2016-04-23 10:00:56 +03:00
Mikhail Glukhikh
fe44671b6a KT-11920: Increase visibility fix is now active for exposed visibility errors 2016-04-23 10:00:53 +03:00
Alexander Udalov
04db491dd4 Update ChangeLog for 1.0.2 2016-04-22 21:22:57 +03:00
Yan Zhulanow
d478b90fb8 Lint: Fix KT-12009: IAE at JavaContext.getLocation() 2016-04-22 19:48:28 +03:00
Yan Zhulanow
9ea7a4f112 Lint: run inspections only for Kotlin 2016-04-22 19:48:28 +03:00
Yan Zhulanow
04ed20c574 Lint: Remove AssertDetector (unrelated to Kotlin) 2016-04-22 19:48:28 +03:00
Yan Zhulanow
cbe21ab568 Minor: Fix Uast blinking tests 2016-04-22 19:48:28 +03:00
Yan Zhulanow
16b831196a Fix EA-81689 2016-04-22 19:48:28 +03:00
Yan Zhulanow
4298559858 Minor: fix sparam -> setparam 2016-04-22 19:48:28 +03:00
Michael Bogdanov
ba1aab7e3e Temporary use ARMV7 target to run emulator 2016-04-22 18:22:52 +03:00
Michael Bogdanov
18b879102a Do nothing if there is no files to write 2016-04-22 18:22:52 +03:00
Michael Bogdanov
1b9fa25ac6 Temporary skip multi-file box tests and box tests with stdlib/reflection 2016-04-22 18:22:51 +03:00
Michael Bogdanov
82786bb97e Temporary exclude 'box' test with imports 2016-04-22 18:22:51 +03:00
Michael Bogdanov
518cc7aa7f Workaround for wrong recognized exception in result log 2016-04-22 18:22:50 +03:00
Michael Bogdanov
a9a917a99e Use 'kill -s 9' to finish process 2016-04-22 18:22:50 +03:00
Michael Bogdanov
a9ce6f71f6 Firstly try to stop emulator via adb then via kill process 2016-04-22 18:22:49 +03:00
Michael Bogdanov
10f557105b File name to package class mapping updated to new single file facade scheme 2016-04-22 18:22:48 +03:00
Michael Bogdanov
e9a2b8628c Added x86 abi to android tests 2016-04-22 18:22:48 +03:00
Michael Bogdanov
fbbb614e80 PermissionManager updated to new android tools structure 2016-04-22 18:22:47 +03:00
Michael Bogdanov
a17c2c5c0e SdkDownloader refactoring, updated to last android tools 2016-04-22 18:22:46 +03:00
Dmitry Petrov
f3c006a5f5 RedundantCoercionToUnitTransformer: do not create individual objects for each transformation. 2016-04-22 17:38:44 +03:00
Mikhail Glukhikh
6980d28eb0 Refactoring: ControlFlowInstructionsGenerator.handleJumpInsideTryFinally 2016-04-22 15:17:01 +03:00
Mikhail Glukhikh
d24528f6bb Control flow analysis: nested finally blocks now appear in correct order in CFG #KT-4764 Fixed 2016-04-22 15:16:57 +03:00
Mikhail Glukhikh
a5b428d9ce Refactoring: CFG.LexicalScope --> CFG.BlockScope #KT-11965 Fixed 2016-04-22 15:16:54 +03:00
Mikhail Glukhikh
cda4d2dcce CFG.LexicalScope minor refactoring 2016-04-22 15:16:50 +03:00
Nikolay Krasko
5f7f46ff6c Remove MaxPermSize parameter 2016-04-22 14:17:52 +03:00
Nikolay Krasko
dc9fa6d9ac Don't compute cached values under lock - this can cause a deadlock
Three threads needed to reproduce:
 - Thread 1. Doesn't hold RW lock, starts computation and locks the cached lock (L)
 - Thread 2. Holds R lock and want to get same computation result. It's now locked on (L)
 - Thread 3. Any thread that want to get W lock. It's now locked on because of Thread 2

If Thread 1. wants to get R lock it will be stacked because of Thread 3. It's sometimes not possible to get a read lock
while some thread is already waiting on W.
2016-04-22 14:17:52 +03:00
Nikolay Krasko
aafd009cbe More information in changelog about injection 2016-04-22 14:17:52 +03:00
Alexey Andreev
0869eb7ef3 KT-6201 KT-6203 KT-6326 KT-6777 Add test cases to prove that issues are no longer reproducible 2016-04-22 10:16:58 +03:00
Yan Zhulanow
33f9a0c798 Lint: Review changes 2016-04-21 20:08:46 +03:00
Yan Zhulanow
d7faef63b6 Lint: Fix KT-11922: ClassCastException: org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl cannot be cast to org.jetbrains.kotlin.descriptors.ClassDescriptor 2016-04-21 20:08:46 +03:00
Yan Zhulanow
a2b1eb7ee8 Lint: Fix KT-11919 ("Missing Parcelable CREATOR field" rule is not accurate) 2016-04-21 20:08:46 +03:00
Yan Zhulanow
33434a3c5b Lint: Fix KT-11939 (@SuppressLint("PrivateResource") doesn't work) 2016-04-21 20:08:46 +03:00
Yan Zhulanow
574aa5debe Lint: Fix KT-11924 (False positive on beginTransaction() should be completed with a commit() call) 2016-04-21 20:08:46 +03:00
Yan Zhulanow
35fca9171c Lint, Minor: Fix compilation 2016-04-21 20:08:46 +03:00
Yan Zhulanow
5008c6d8fc Lint, Uast: Fix Java function descriptor calculation KT-11923 2016-04-21 20:08:46 +03:00
Yan Zhulanow
aa06cd8f7d Lint: Fix EA-81466 2016-04-21 20:08:46 +03:00
Yan Zhulanow
64dbba8e2c Lint: Fix EA-81613, EA-81468 2016-04-21 20:08:46 +03:00
Michael Bogdanov
7335f2394b Sort result ranges in SMAP class 2016-04-21 17:32:03 +03:00
Michael Bogdanov
d945c47b63 Skip line numbers that couldn't be mapped by SourceMappers 2016-04-21 17:32:03 +03:00
Alexey Sedunov
021c88e5ff Find Usages: Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions
#KT-11736 Fixed
2016-04-21 16:40:19 +03:00
Alexey Sedunov
1635018fe7 Override/Implement: Use function body template when generating functions with default body
#KT-11807 Fixed
2016-04-21 16:40:17 +03:00
Alexey Sedunov
df07554764 Find Usages: Start read action for derived class search
#KT-11845 Fixed
2016-04-21 16:39:18 +03:00
Nikolay Krasko
39e6b893a7 Teach getOwnerFunction() in KtParamter work with stubs 2016-04-21 15:25:10 +03:00
Nikolay Krasko
c62d906d5c Minor: test methods rename 2016-04-21 15:25:09 +03:00
Nikolay Krasko
b0433b2904 Prevent stepping through indirect assignments in injection search 2016-04-21 15:25:08 +03:00
Nikolay Krasko
505c6624a7 Inject predefined places through usages 2016-04-21 15:25:06 +03:00
Nikolay Krasko
62ff67c2b0 Disable complex injection search in DFA == OFF mode 2016-04-21 15:25:05 +03:00
Nikolay Krasko
9590c9a10b Add note about injection feature to ChangeLog 2016-04-21 15:25:04 +03:00
Nikolay Krasko
d69d1f2c53 Support toRegex() standard function
#KT-8088 Fixed
2016-04-21 15:25:02 +03:00
Nikolay Krasko
6bea3923f5 Injection test refactoring 2016-04-21 15:25:01 +03:00
Nikolay Krasko
42084b0529 Allow injection for all Regex constructors
#KT-8088 In Progress
2016-04-21 15:25:00 +03:00
Nikolay Krasko
c6e48d8e59 First version of Kotlin patterns in injection
#KT-8088 In Progress
2016-04-21 15:24:58 +03:00
Mikhail Glukhikh
a12faf5baf KtDeclaration.containingClassOrObject now works correctly for primary constructor and its parameters #KT-11982 Fixed 2016-04-21 14:21:40 +03:00
Nikolay Krasko
454a8474f1 Write Action: Add write action for template finish processor (KT-11418) 2016-04-21 13:14:51 +03:00
Nikolay Krasko
97a97614b5 Write Action: Wrap import insertion with write action 2016-04-21 13:14:50 +03:00
Nikolay Krasko
ab0fe0a900 Write Action: Add write action for deleting qualifier in shortenReferences
Problem revealed after template listners are executed without write action
5c2c946265
2016-04-21 13:14:48 +03:00
Nikolay Krasko
143fd4ee08 Update until version for new idea build numbering 2016-04-21 13:14:47 +03:00
Alexey Andreev
7b76fa6103 KT-11030 Remove tests for diagnostics for local classes in JS backend 2016-04-20 18:12:25 +03:00
Alexey Andreev
ade5477c33 KT-11030 Initialization order of enum entries in JS now conforms to JVM backend 2016-04-20 18:12:25 +03:00
Alexey Andreev
87ea0bd0cb KT-11030 Minor code improvements 2016-04-20 18:12:25 +03:00
Alexey Andreev
166b985fca KT-11028 Add test for the issue 2016-04-20 18:12:24 +03:00
Alexey Andreev
4ac730e5ed KT-11030 Fix referencing wrong field generated for captured variable when this captured variable referenced both from constructor and non-constructor method. Avoid duplicate generation of call to delegated constructor. 2016-04-20 18:12:24 +03:00
Alexey Andreev
a5e0c70988 KT-11611 Prevent duplicate generation of default values of secondary constructor parameters 2016-04-20 18:12:23 +03:00
Alexey Andreev
7afca74b94 KT-11030 When constructor of object expression calls super constructor, place this call at object creation instead of object's constructor. This allows to capture outer this reference properly in certain cases. JVM backend uses the same approach 2016-04-20 18:12:23 +03:00
Alexey Andreev
03dc9c0fa4 KT-11030 Refactor translation of class to support secondary constructors of local classes 2016-04-20 18:12:23 +03:00
Alexey Andreev
e305898f84 KT-11030 Simplify code and refactor generation of object expressions 2016-04-20 18:12:22 +03:00
Alexey Andreev
c1c57a06bb KT-11030 Refactoring code to properly implement secondary constructors in local classes 2016-04-20 18:12:22 +03:00
Alexey Andreev
b39c16cb6c KT-11030 Fix translation of secondary constructors of inner classes 2016-04-20 18:12:22 +03:00
Alexey Andreev
7af4b2fdb2 KT-11030 Fix subclassing of local class by local class 2016-04-20 18:12:21 +03:00
Alexey Andreev
d9504dfe2b KT-11030 When local function is declared inside constructor, capture this into this function 2016-04-20 18:12:21 +03:00
Alexey Andreev
a74c613ec5 KT-11030 Make copy method of local data classes to copy captured variables 2016-04-20 18:12:21 +03:00
Alexey Andreev
a21b5ad4e6 KT-11030 Fix capturing of local variables via by expression, i.e. object : ClassName by v where v is local variable 2016-04-20 18:12:20 +03:00
Alexey Andreev
af0280ca7a KT-11030 Repair support of enums. Minor refactoring of ClassTranslator 2016-04-20 18:12:20 +03:00
Alexey Andreev
47dde9520d KT-11030 Don't capture companion objects into closure 2016-04-20 18:12:15 +03:00
Alexey Andreev
1bded9d66f KT-11030 Fix translation of FQN of native companion objects 2016-04-20 18:01:08 +03:00
Alexey Andreev
6967ebcc8c KT-11030 Copy static properties of object's class to instance of object (think about moving local functions to member methods in objects) 2016-04-20 18:01:08 +03:00
Alexey Andreev
00292f4125 KT-11030 Avoid name clash between member fields and fields that store closure of local classes 2016-04-20 18:01:07 +03:00
Alexey Andreev
337078faf3 KT-11030 Unify concept of objects and companion objects. Fix order of initialization of nested objects. 2016-04-20 18:01:07 +03:00
Alexey Andreev
8e7d949dd4 KT-11030 Implements closures in classes. Represent local object literals as classes 2016-04-20 18:01:07 +03:00
Alexey Andreev
1f8c3375fe KT-11030 Implements local classes that don't have closure 2016-04-20 18:01:06 +03:00
Alexey Andreev
7ca6102cac KT-11030 Disable error reporting of local classes in JS backend 2016-04-20 18:01:06 +03:00
Alexey Andreev
3e11209d8a KT-11030 Borrow test for local classes from JVM backend 2016-04-20 17:49:03 +03:00
Michael Bogdanov
9a8474392d Code clean 2016-04-20 17:07:17 +03:00
Michael Bogdanov
2cec779c14 'visitLineNumber' replaced with 'mapLineNumber' in SourceMapper 2016-04-20 17:07:16 +03:00
Michael Bogdanov
c70e1c6065 SourceMappers refactoring 2016-04-20 17:07:15 +03:00
Michael Bogdanov
bb5c24eae5 Old SourceMappers replaced with new ones 2016-04-20 17:07:15 +03:00
Michael Bogdanov
68f5e4d10e Added debug strata to test data 2016-04-20 17:07:14 +03:00
Michael Bogdanov
9fe9a1742b Debugger navigation strata processing update 2016-04-20 17:07:14 +03:00
Natalia Ukhorskaya
02c5e005fe Debugger: navigate to call site of inline function
#KT-11438 Fixed
2016-04-20 17:07:13 +03:00
Michael Bogdanov
bdd24cfa7d Temporary rollback change cause of merge conflict 2016-04-20 17:07:12 +03:00
Michael Bogdanov
af68f3d019 Added additional strata for stacktraces 2016-04-20 17:07:12 +03:00
Michael Bogdanov
f6edf311d7 Optimization in NestedSourceMapper 2016-04-20 17:07:11 +03:00
Michael Bogdanov
636c13adde Small optimization in InlineLambdaSourceMapper 2016-04-20 17:07:11 +03:00
Michael Bogdanov
0a46cea799 TODO: optimize smap - do preproccessing 2016-04-20 17:07:10 +03:00
Michael Bogdanov
faca68297c Updated line numbers tests 2016-04-20 17:07:09 +03:00
Michael Bogdanov
ab2d3665a4 SourceMapper api refactoring 2016-04-20 17:07:08 +03:00
Michael Bogdanov
225e90bbdf Removed redundant cache, small rename refactoring after removing 2016-04-20 17:07:08 +03:00
Michael Bogdanov
286da1fc5f Properly calculate maxUsedValue 2016-04-20 17:07:07 +03:00
Michael Bogdanov
dfabad324b Additional checker for smap 2016-04-20 17:07:07 +03:00
Michael Bogdanov
ff820bddc0 New source mapping 2016-04-20 17:07:06 +03:00
Valentin Kipyatkov
cb615c557a Minor change on code review 2016-04-20 14:30:54 +03:00
Valentin Kipyatkov
e6580b0cdb Simplified code 2016-04-20 14:30:54 +03:00
Valentin Kipyatkov
1535e8ad90 KT-11955 Copy/Paste inserts FQ-name
#KT-11955 Fixed
2016-04-20 14:30:54 +03:00
Valentin Kipyatkov
364a8801a3 Correct keyword completion after try in assignment 2016-04-20 14:30:54 +03:00
Valentin Kipyatkov
4f9f5c205f Added flags "runForWholeFile" for inspections into XML because overriding method does not work 2016-04-20 14:30:53 +03:00
Valentin Kipyatkov
a68dbe78d8 KT-11594 "Add non-null asserted (!!) call" applied to unsafe cast to nullable type causes AE at KtPsiFactory.createExpression()
#KT-11594 Fixed
2016-04-20 14:30:53 +03:00
Valentin Kipyatkov
b5e89713cd KT-11275 Inconsistent behaviour when using lambda calls with function arguments without parens
#KT-11275 Fixed
2016-04-20 14:30:53 +03:00
Valentin Kipyatkov
50e7079efc Better message for CanBeValInspection 2016-04-20 14:30:53 +03:00
Valentin Kipyatkov
ecdaaea88d Never report companion object as unused
#KT-11366 Fixed
2016-04-20 14:30:52 +03:00
Alexey Tsvetkov
f2ba83adf2 Minor: slightly increase memory limit for gradle daemon test 2016-04-20 13:44:51 +03:00
Mikhail Glukhikh
771fb0ace2 Compiler warning on identical enum constant / is type entries #KT-4829 Fixed 2016-04-20 12:21:31 +03:00
Mikhail Glukhikh
d7ecd12737 Minor refactoring: PatternMatchingTypingVisitor 2016-04-20 12:21:27 +03:00
Mikhail Glukhikh
5ec7b5bef0 Minor refactoring: WhenChecker 2016-04-20 12:21:22 +03:00
Dmitry Petrov
420c7a0285 KT-11111:
- override by a final inline fun is a warning
- override by a fun with reified type parameters is an error
2016-04-20 11:59:03 +03:00
Dmitry Petrov
ef0f512201 java 2 kt: InlineAnalyzerExtension, convert 2016-04-20 11:59:03 +03:00
Dmitry Petrov
4c1694493a java 2 kt: InlineAnalyzerExtension, rename 2016-04-20 11:59:02 +03:00
Nikolay Krasko
2e993a0e1e Reformat template after end 2016-04-19 21:28:02 +03:00
Nikolay Krasko
f2a17bc4c2 Formatter doesn't handle space before angle bracket in method definition (KT-11961)
#KT-11961 Fixed
2016-04-19 21:28:00 +03:00
Nikolay Krasko
1baed30ef6 Remove outdated plugin configuration
The idea was to run idea with JRE 1.7 instead of 1.6, but now main IDEA run configuration executes under JRE 1.8.
2016-04-19 21:27:59 +03:00
Alexey Sedunov
548d0cd4e5 Spring Support: Model diagram support for Kotlin classes
#KT-11692 In Progress
2016-04-19 20:27:42 +03:00
Alexey Sedunov
38522b09ce Code Insight: Allow properties with custom setters to be used in generated equals/hashCode/toString
#KT-11908 Fixed
2016-04-19 20:27:41 +03:00
Alexey Sedunov
beb5d5e271 Create from Usage: Suggest "Create secondary constructor" on NONE_APPLICABLE error
#KT-11866 Fixed
2016-04-19 20:27:39 +03:00
Alexey Sedunov
aa4bfadfb1 Intentions: Implement "Introduce local variable" intention
#KT-11768 Fixed
2016-04-19 20:27:37 +03:00
Alexey Sedunov
d75edb9876 Override/Implement Action: Generate abstract overrides for Any members inside of Kotlin interfaces
#KT-11659 Fixed
2016-04-19 20:27:35 +03:00
Alexey Sedunov
3c79eab2fd Line Markers: Show recursion line markers for extension function calls with different receivers
#KT-11495 Fixed
2016-04-19 20:27:33 +03:00
Alexey Sedunov
c93e13e28d JUnit Support: Allow running multiple Kotlin classes as well as running mixtures of Kotlin and Java classes
#KT-11155 Fixed
2016-04-19 20:27:32 +03:00
Alexey Sedunov
a65026f584 Introduce Parameter: Run usages search under progress manager
#KT-11145 Fixed
2016-04-19 20:27:29 +03:00
Alexey Sedunov
754e7cac52 Light Classes: Replace accessor with property name when renaming KtProperty/KtParameter through its light methods
#KT-11880 Fixed
2016-04-19 20:27:28 +03:00
Alexey Sedunov
c21dff66aa Spring Support: Allow injection of SpEL into string literals with escape sequences
#KT-11904 Fixed
2016-04-19 20:27:26 +03:00
Alexey Sedunov
68776be186 Find Usages: Drop obsolete assertion
#KT-11895 Fixed
2016-04-19 20:27:23 +03:00
Yan Zhulanow
9b1402d804 Fix "No error on increment or augmented assignment when 'get' is an operator but 'set' is not" #KT-11300 2016-04-19 19:24:38 +03:00
Yan Zhulanow
371e80bcba Android Extensions: Do not upcast ViewStub to View (KT-10321) 2016-04-19 18:47:51 +03:00
Yan Zhulanow
6e14c11280 Android Extensions: handle layout file rename 2016-04-19 18:47:51 +03:00
Yan Zhulanow
47b3394f62 Android Extensions: regenerate properties when layout is renamed/deleted/added (KT-11944) 2016-04-19 18:47:51 +03:00
Yan Zhulanow
9e33b7d3bc Android Extensions: support identifiers with packages (KT-10841) 2016-04-19 18:47:51 +03:00
Alexander Udalov
0494e1d258 Minor, add KtDoubleColonExpression#isEmptyLHS utility 2016-04-19 18:37:21 +03:00
Alexander Udalov
fa31994442 J2K KtQualifiedExpression and subclasses: convert
Also merge KtQualifiedExpressionImpl into KtQualifiedExpression and remove
calls from subclasses
2016-04-19 18:37:20 +03:00
Alexander Udalov
093c2f63d4 J2K KtQualifiedExpression and subclasses: rename .java -> .kt 2016-04-19 18:37:19 +03:00
Alexander Udalov
9c99152126 Do not consider error results successful in '::' LHS resolution
Fixes EA-81649
2016-04-19 18:37:02 +03:00
Alexander Udalov
be62caf335 Extract '::' type-checking code to DoubleColonExpressionResolver 2016-04-19 18:28:25 +03:00
Alexander Udalov
4706d4eaea Minor, restructure parsing test case for '::' 2016-04-19 18:28:24 +03:00
Valentin Kipyatkov
3dc32fb5db Minor change on code review 2016-04-19 15:22:06 +03:00
Valentin Kipyatkov
bade304bf3 Better presentation 2016-04-19 15:22:06 +03:00
Valentin Kipyatkov
022075995b KT-11957 No "catch" and "finally" keywords in completion
#KT-11957 Fixed
2016-04-19 15:22:06 +03:00
Valentin Kipyatkov
c7a96401da Refactoring 2016-04-19 15:22:06 +03:00
Valentin Kipyatkov
2a3b87f783 KT-11784 Completion for 'if' statement should add parentheses automatically
#KT-11784 Fixed
2016-04-19 15:22:06 +03:00
Valentin Kipyatkov
bf4a376831 Use CommentSaver instead of manual comment handling 2016-04-19 15:22:05 +03:00
Valentin Kipyatkov
e72e6bf7db KT-11870 "Replace with Elvis" refactoring doesn't change the variable type from T? to T
#KT-11870 Fixed
2016-04-19 15:22:05 +03:00
Valentin Kipyatkov
6bdf3622ed KT-11890 Completion for callable references does not propose static Java members
#KT-11890 Fixed
2016-04-19 15:22:05 +03:00
Valentin Kipyatkov
f3bb3e9c6e KT-11912 String interpolation is not converted to ${} form when accessing this.property
#KT-11912 Fixed
2016-04-19 15:22:05 +03:00
Dmitry Petrov
e441f0509f KT-11943 Do not use intrinsic 'java' property if receiver type is not acceptable 2016-04-19 10:31:30 +03:00
Valentin Kipyatkov
120bced842 Fixing build 2016-04-18 23:05:59 +03:00
Alexey Tsvetkov
23c21396f7 Make Kotlin2JsGradlePluginIT test compatible with gradle 2.x 2016-04-18 22:12:08 +03:00
Alexey Tsvetkov
51104a5c2b Make gradle daemon thread leak test more thorough
Former test made the following assertion:
for any of 3 sequent builds on the same gradle daemon
the difference in used memory between build start and finish
should not exceed 2500 kb.

Current test makes the following assertion:
the difference of used memory after first and last
of 10 sequent builds on the same daemon should not exceed 200 kb.
2016-04-18 21:31:41 +03:00
Alexey Tsvetkov
d446e60e70 Remove ThreadTracker from gradle plugin
ThreadTracker was introduced to detect memory leaks
when using gradle daemon. However, it makes
quite strong assumption about build lifecycle:
there should not be any builds started after
kotlin plugin is configured that are alive when
buildFinished callback is called.

This assumption can be broken by some gradle configurations
namely our android tests and gradle 2.13-rc.

Since we already have daemon memory leak test (KotlinGradlePluginIT#testKotlinOnlyDaemonMemory),
after some discussion it was decided to remove ThreadTracker
2016-04-18 21:31:41 +03:00
Alexander Udalov
2df8e56b94 Do not store project in JPS tests after they're executed
This saves a couple dozen megabytes currently
2016-04-18 17:26:59 +03:00
Alexander Udalov
e941ba761a Minor, fix case in test data file name 2016-04-18 17:26:58 +03:00
Valentin Kipyatkov
bd5af61879 Moved ShortenReferences from idea-analysis to idea-core, added dependency from idea-analysis to idea-core 2016-04-18 17:15:52 +03:00
Valentin Kipyatkov
da4dee3716 Moved generateUtil.kt into idea-core 2016-04-18 17:15:52 +03:00
Valentin Kipyatkov
b32859cf68 KT-11633 Kotlin code editor applies wrong indentation after completing a statement in data class
#KT-11633 Fixed
2016-04-18 17:15:52 +03:00
Ilya Chernikov
6b3a691367 Fix KT-10507 - "missing extension point" with parallel compilation 2016-04-18 15:16:48 +02:00
Mikhail Glukhikh
3f266647f0 Does not replace explicit lambda parameter with 'it' if conflicting nested literal available #KT-11849 Fixed 2016-04-18 15:26:42 +03:00
Nikolay Krasko
2e1a2fa8d1 Fallback to default source provider for non-gradle projects 2016-04-18 14:06:45 +03:00
Mikhail Glukhikh
c7b2042b77 Do not suggest to add variance modifier if both in and out are possible 2016-04-18 13:40:55 +03:00
Mikhail Glukhikh
e60930d5ce Add variance modifier fix corrected: primary constructor parameters are taken into account 2016-04-18 13:40:50 +03:00
Alexander Udalov
027cc898e7 Minor, fix warnings in core/ modules 2016-04-17 13:35:17 +03:00
Mikhail Zarechenskiy
f773966458 Create artifact with 'formatter' module output to share it with Eclipse plugin 2016-04-15 18:15:13 +03:00
Mikhail Zarechenskiy
37e0b71584 Split KotlinBlock on two clases to share independent logic about
formatting  between Idea and Eclipse

 Also make 'formatter' module depend on fewer dependencies
2016-04-15 18:15:13 +03:00
Mikhail Zarechenskiy
4c006300ef Move files related to formatting to module 'formatter' as is 2016-04-15 18:15:13 +03:00
Mikhail Zarechenskiy
a7c397fe84 Create 'formatter' module
Purpose of this module is to extract common code  about formatting and reuse it in Eclipse
2016-04-15 18:15:13 +03:00
Mikhail Zarechenskiy
ac1ca890fd J2K KotlinBlock: convert and prettify
Also get rid of ContainerUtil
2016-04-15 18:15:13 +03:00
Mikhail Zarechenskiy
22289cf337 J2K KotlinBlock: rename 2016-04-15 18:15:13 +03:00
Natalia Ukhorskaya
e8f46f5315 Debugger: 'Step Over' unexpectedly resume if condition of 'while' loop contains inline function call
#KT-11932 Fixed
2016-04-15 18:11:36 +03:00
Natalia Ukhorskaya
f0badb05ea Debugger: fix step over for inline argument with non-local return 2016-04-15 18:11:36 +03:00
Natalia Ukhorskaya
f0cfd450e5 Debugger: fix step over inside inline function (do not step into function literal argument) 2016-04-15 18:11:36 +03:00
Alexey Andreev
8ad339836d KT-11875 Moves code that uncovers the following JS function:
```
function foo (closureParam, closureParam2, ...) {
    return function() {
        // function body
    }
}
```

from FunctionContext to FunctionInlineMutator. The old code causes bug when calling this function like this: `foo(this, ...)`, since first `closureParam` is replaced with `this`. Later, FunctionInlineMutator can't make difference between original `this` inside *function body* and former `closureParam` reference that became `this` after replacement. So, let FunctionInlineMutator replace `this` in *function body* and then substitute closure parameters.

KT-11875 Fixed
2016-04-15 17:35:30 +03:00
Natalia Ukhorskaya
8129901d82 Minor: clarify exception messages during Evaluate Expression 2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
316057873b Fix EA-72969 - assert: ExtractFunctionForDebuggerUtilKt$getFunctionForExtractedFragment$.invoke : ERROR_TYPES
Context element for codeFragment can be a KtFile (not  only KtExpression) ex. in case when file was changed after debugger starts and there is no expression at line with breakpoint
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
7fb3099206 Fix EA-80854 - IOOBE: KotlinLineBreakpointType.getLambdaByOrdinal.
This could happen when breakpoint in lambda was set but than the code changed and there is no lambdas at this line anymore
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
a929df6fa1 Debugger, minor: do not throw NPE when receiverTypes are null in completion 2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
d42823d4ee Debugger: cannot evaluate expression with raw types
#KT-11831 Fixed
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
070ee10872 Debugger: do not insert ambiguous imports inside codeFragments
#KT-11927 Fixed
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
d7a87b2ff0 Debugger: fix breakpoints inside generic crossinline argument body
#KT-11848 Fixed
2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
7a5ab93f9e Debugger: write line number for catch clause declaration 2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
8e3ec5b7f0 Debugger: fix breakpoints inside inline functions in libraries sources 2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
3ef51159b8 Debugger: remove unnecessary whitespaces in presentation of line breakpoint variants 2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
e55a1ad49c Get correct target platform for codeFragments 2016-04-15 15:58:07 +03:00
Natalia Ukhorskaya
0d4fa46cfa Debugger: correct scope for runtime type calculation 2016-04-15 15:58:07 +03:00
Mikhail Glukhikh
e806341cdc Increase visibility: make not available in case of potential exposed visibility problems (see KT-11920) 2016-04-15 15:20:35 +03:00
Mikhail Glukhikh
6acd4bc21d Refactoring: ExposedVisibilityChecker extracted from DeclarationsChecker 2016-04-15 15:20:30 +03:00
Mikhail Glukhikh
ed4ccc6a19 Minor refactoring: EffectiveVisibility 2016-04-15 15:20:26 +03:00
Mikhail Glukhikh
80e41c5298 KT-11806: increase visibility quick fix: private / internal -> public #KT-11806 Fixed 2016-04-15 15:20:21 +03:00
Mikhail Glukhikh
f12a9b7b95 KT-11806: increase visibility quick fix, private --> internal, also for members 2016-04-15 15:20:16 +03:00
Mikhail Glukhikh
2098bed86d Quick fix renamed: ChangePrivateTopLevelToInternal --> IncreaseVisibility 2016-04-15 15:20:12 +03:00
Alexander Udalov
a94ebcdeb4 Update ChangeLog for 1.0.2 2016-04-15 11:54:23 +03:00
Alexander Udalov
07c229e94b Exclude InlineOnly from kotlin-test
It's already present in kotlin-stdlib and that causes
com.android.dex.DexException

 #KT-11505 Fixed
2016-04-15 11:33:23 +03:00
Nikolay Krasko
fab05620b4 Reference test common and place plugins after idea libs 2016-04-15 00:36:54 +03:00
Alexander Udalov
48664a2ba7 Refactor AbstractBinaryClassAnnotationAndConstantLoader#findClassWithAnnotationsAndInitializers
Extract all special cases to getSpecialCaseContainerClass
2016-04-14 21:08:36 +03:00
Alexander Udalov
d571512f47 Remove unnecessary fields in DeserializedClassDescriptor 2016-04-14 21:08:36 +03:00
Alexander Udalov
e0dd60c57a Expand code for boolean fields in Flags
Push flag index computation logic from FlagField down to subclasses
(BooleanFlagField and EnumLiteFlagField) because in the case of
BooleanFlagField it's trivial
2016-04-14 21:08:36 +03:00
Alexander Udalov
1f3850da6e Store outer class in ProtoContainer instead of only its kind 2016-04-14 21:08:36 +03:00
Alexander Udalov
8ee278d02f Fix SourceElement for classes loaded in decompiler 2016-04-14 21:08:36 +03:00
Alexander Udalov
88106bb13b Get rid of BinarySource interface, use SourceElement instead 2016-04-14 21:08:36 +03:00
Alexander Udalov
ad068ed4ac Do not call findKotlinClass when loading class annotations
The main change is in AbstractBinaryClassAnnotationAndConstantLoader, where we
no longer perform unnecessary IO operations for classes which are already
loaded to memory
2016-04-14 21:08:36 +03:00
Alexander Udalov
7620d66019 Minor, rename PackagePartSource -> BinarySource 2016-04-14 21:08:36 +03:00
Alexander Udalov
ac92be12c6 Minor, take ProtoContainer in AnnotationAndConstantLoader#loadClassAnnotations 2016-04-14 21:08:36 +03:00
Alexander Udalov
2ab68d53fa J2K KotlinJvmBinaryClass & AnnotationAndConstantLoader: convert 2016-04-14 21:08:36 +03:00
Alexander Udalov
9c7e4f3dcc J2K KotlinJvmBinaryClass & AnnotationAndConstantLoader: rename .java -> .kt 2016-04-14 21:08:36 +03:00
Alexander Udalov
c091bb990b Make LazyJavaPackageFragment#javaScope private 2016-04-14 21:08:36 +03:00
Alexander Udalov
a34aaa5955 Move package part-related code from LazyJavaPackageScope to LazyJavaPackageFragment 2016-04-14 21:08:36 +03:00
Alexander Udalov
e516b695ae Minor, do not store FqName in LazyJavaClassDescriptor 2016-04-14 21:08:36 +03:00
Alexander Udalov
836a62d4b3 Minor, move resolveKotlinBinaryClass closer to single usage 2016-04-14 21:08:36 +03:00
Ilya Gorbunov
a2db8f9090 Performance: move the state out of multifile class parts to avoid synchronization. 2016-04-14 19:03:39 +03:00
Yan Zhulanow
8304c85f4f Lint: support both IJ 15 and Android Studio 2.0 (different Android plugins)
Dirty hack :(
2016-04-14 17:20:23 +03:00
Natalia Ukhorskaya
b782d2cd11 J2K: do not invoke visitChildrenRecursively in Action.update
#KT-11160 Fixed
2016-04-14 17:05:14 +03:00
Natalia Ukhorskaya
495be06fc5 J2K: do not generate super call to abstract property 2016-04-14 17:04:50 +03:00
Natalia Ukhorskaya
72019a1b4e J2K: Insert !! for expression only if NotNull expected (not for Default nullability) 2016-04-14 17:04:32 +03:00
Natalia Ukhorskaya
98c3b39f7e J2K: Get nullability from variable initializer when converting call
#KT-11534 In Progress
2016-04-14 17:04:20 +03:00
Natalia Ukhorskaya
f3a3c0886f J2K: Remove unnecessary casts of non-nullable expression to nullable type after conversion
#KT-11543 Fixed
2016-04-14 17:04:14 +03:00
Natalia Ukhorskaya
c864b67550 Add regression test: parameter from lambda is removed 2016-04-14 17:03:44 +03:00
Natalia Ukhorskaya
29f385a713 J2K, minor: fix testData 2016-04-14 17:03:42 +03:00
Natalia Ukhorskaya
1108fbfbeb J2K: convert scratch files correctly
#KT-10604 Fixed
2016-04-14 17:03:35 +03:00
Nikolay Krasko
5396a68e71 Enable tests in generators module 2016-04-14 14:40:30 +03:00
Denis Zharkov
2f0b052540 Fix infinite loop in CanBeValInspection
Obviously there should be 'return' instead of 'continue'
Otherwise the loop will not end

 #KT-11891 Fixed
2016-04-14 14:01:39 +03:00
Dmitry Petrov
583733be8d KT-11645 properly handle private property getter name mangling in reflection 2016-04-14 09:31:29 +03:00
Dmitry Petrov
511a7e0072 KT-11645 generate backing field for 'private const val' in part implementation class 2016-04-14 09:31:29 +03:00
Yan Zhulanow
76e5657a99 Minor: add Javadoc for UastContext/UastLanguagePlugin 2016-04-13 18:05:51 +03:00
Dmitry Petrov
82946437d8 EA-81358: use volatile store / volatile load to guarantee publication of deferred clinit results 2016-04-13 16:19:10 +03:00
Kirill Rakhman
9495257de3 Add QuickFix to add 'crossinline' to parameter (#852)
Fixes #KT-10844
2016-04-13 13:25:35 +02:00
Kirill Rakhman
56fd2d28b8 Let Implement Quickfix: Launch "Implement Members" dialog after applying #KT-11836 Fixed 2016-04-13 12:50:45 +03:00
Alexey Sedunov
9bf395a4cd Light Classes: Skip irrelevant overloads when looking for light parameter
#KT-11868 Fixed
2016-04-13 12:20:20 +03:00
Nikolay Krasko
c6b6e9f18b Note about EAP-repository configuration added to changelo 2016-04-13 12:39:12 +04:00
Nikolay Krasko
46eed6fa4d Configuration for EAP versions 2016-04-13 08:15:01 +03:00
Nikolay Krasko
c5ef562f54 Add eap version to maven versions combobox if working with eap plugin 2016-04-13 00:14:54 +03:00
Nikolay Krasko
441fb7ff28 Use correct version detection for developer versions
#KT-11213 Fixed
2016-04-13 00:14:52 +03:00
Alexander Udalov
aff1226e47 Update ChangeLog with issues fixed since 1.0.2-eap-15 2016-04-12 21:22:00 +03:00
Alexander Udalov
59d73e716c Fix memory leak in StdlibTest 2016-04-12 20:03:51 +03:00
Alexander Udalov
11d875ca17 Fix deadlock in StaticScopeForKotlinEnum
Also fix possible deadlock in ReflectionTypes

 #KT-11869 Fixed
2016-04-12 20:03:51 +03:00
Alexander Udalov
a8629b3836 Do not fail on unknown -X flags
For better compatibility if we add experimental stuff in 1.0.X compilers
2016-04-12 20:03:51 +03:00
Alexander Udalov
37d612d346 Update cli-parser 1.1.1 -> 1.1.2 2016-04-12 20:03:51 +03:00
Alexander Udalov
114713995f Cleanup CandidateResolver 2016-04-12 20:03:51 +03:00
Alexander Udalov
76d3246514 Fix type of member references without explicit class on LHS
Type of '::foo' for a function foo in a class A should be KFunction0<Unit>, not
KFunction1<A, Unit>. Continue to report an error in this case, to be maybe
supported in the future
2016-04-12 20:03:51 +03:00
Alexander Udalov
d8263eb0b8 Assert that callable references cannot have expression on LHS 2016-04-12 20:03:51 +03:00
Nikolay Krasko
92f3795a11 New idea works with relative paths in configureByFiles() 2016-04-12 18:30:42 +03:00
Nikolay Krasko
8a227baf00 Add dependency to uast-kotlin 2016-04-12 18:19:08 +03:00
Michael Bogdanov
be999ca4cb Write proper start label for parameters of inline function default implementation 2016-04-12 15:31:49 +03:00
Michael Bogdanov
c52c0e2c2d Write proper start label for inlined constructor parameters (start label was shifted by additional captured parameters injection) 2016-04-12 15:23:14 +03:00
Nikolay Krasko
0cf1c8d900 Workaround for building against jars from both JDK 6 and JDK 8 on TeamCity 2016-04-12 14:53:20 +03:00
Nikolay Krasko
598f48a8cf Add tests for checking dependant modules for compiler-tests 2016-04-12 14:53:18 +03:00
Nikolay Krasko
354db68f21 Remove dependency on compiler-tests from uast-kotlin 2016-04-12 14:53:17 +03:00
Nikolay Krasko
7c6b7994ad Remove jdk 8 compiler tests from non-compiler-tests 2016-04-12 14:53:16 +03:00
Stanislav Erokhin
3b41fcb5ba Refactoring. Add type safety to resolution. 2016-04-12 03:22:45 +03:00
Zalim Bashorov
51c6abdbed IC: take into account added and removed classes when calculate affected names 2016-04-11 19:26:18 +03:00
Mikhail Glukhikh
1b2deb8a8a Message corrected for warning "some modifier is redundant because another is present" 2016-04-11 16:32:50 +03:00
Mikhail Glukhikh
d79e3f322f Redundant modality modifier inspection #KT-11450 Fixed 2016-04-11 16:32:43 +03:00
Mikhail Glukhikh
8a0641a639 Warning about override / open redundancy is no more reported 2016-04-11 16:32:36 +03:00
Mikhail Glukhikh
1d83a1a97c Can be parameter inspection #KT-10819 Fixed 2016-04-11 16:32:26 +03:00
Alexander Udalov
8ace253559 Minor, remove paragraph symbols from comments
This character seems to cause problems on some build agents
2016-04-11 16:11:25 +03:00
Nikolay Krasko
233635e0d8 Enable injecting predefined and custom Java places in Kotlin 2016-04-11 15:04:04 +03:00
Mikhail Glukhikh
fff4aa8f12 Minor: cleanup of RemoveValVarFromParameterFix 2016-04-11 12:28:09 +03:00
Dmitry Petrov
1f3323ed32 KT-11750 Do not report REDECLARATION on descriptors which are not available in sources. 2016-04-11 09:13:07 +03:00
Alexey Sedunov
905ca21799 Spring Support: Support @Transactional annotation in "Make annotated declaration open" inspection 2016-04-09 21:13:34 +03:00
Alexey Sedunov
119cf0f0cd Spring Support: Support Find Usages/Rename (on both declarations and
references) of Kotlin declarations referenced in the XML config
 #KT-11719 Fixed
 #KT-11652 Fixed
2016-04-09 21:13:30 +03:00
Alexey Sedunov
a553f67744 Minor: Extract SpringTestFixtureExtension.loadConfigByMainFilePath() function 2016-04-09 21:13:25 +03:00
Alexey Sedunov
afecb09b6f Spring Support: Fix renaming of Spring bean declarations via SpEL references
#KT-11720 Fixed
 #KT-11725 Fixed
2016-04-09 21:13:21 +03:00
Alexey Sedunov
5203f62655 Minor: Remove /*rename*/ marker in Rename tests 2016-04-09 21:13:16 +03:00
Alexey Sedunov
b8905645ae Light Classes: Navigate to KtFile from light class containing file
#KT-11689 Fixed
2016-04-09 21:13:11 +03:00
Alexey Sedunov
eeac739f69 Spring Support: Fixed computation of values in Java annotations referred by Kotlin annotation entries
#KT-11702 Fixed
2016-04-09 21:13:07 +03:00
Alexey Sedunov
a818d4714e Misc: Extract kotlin-ultimate project 2016-04-09 21:13:01 +03:00
Alexey Sedunov
1a4a7406fe Misc: Extract properties "dependencies" and "generators" from update_dependencies.xml 2016-04-08 21:12:38 +03:00
Alexey Sedunov
843e2bc135 Spring Support: "Generate @Autowired Dependency..." action
#KT-11408 Fixed
2016-04-08 21:11:30 +03:00
Alexey Sedunov
233f2b468d Spring Support: "Generate Dependency..." actions
#KT-11407 Fixed
2016-04-08 21:11:28 +03:00
Alexey Sedunov
4ed1c3d448 Minor: Generify KtClassOrObject.addDeclarationXXX() 2016-04-08 21:11:25 +03:00
Alexey Sedunov
81298e57f2 [RESTORED] Misc: Fetch Spring libraries to dependencies directory 2016-04-08 21:11:24 +03:00
Alexey Sedunov
9aeca98b82 [RESTORED] Spring Support: Inspection for Spring configuration 2016-04-08 21:11:22 +03:00
Alexey Sedunov
236654aa7e [RESTORED] Spring Support: SpEL injections
#KT-11406 Fixed
2016-04-08 21:11:20 +03:00
Alexey Sedunov
a89dbfcfd4 [RESTORED] Spring Support: Show Spring line markers for Kotlin classes
#KT-3741 Fixed
2016-04-08 21:11:19 +03:00
Alexey Sedunov
962b312fb7 [RESTORED] Light Classes: Constant expression evaluator for light annotation arguments 2016-04-08 21:11:16 +03:00
Alexey Sedunov
f2e2220560 [RESTORED] Spring Support: Implement Spring-specific references 2016-04-08 21:11:15 +03:00
Alexey Sedunov
196b484cd7 [RESTORED] Spring Support: Inspection for final Spring-annotated classes/functions
#KT-11098 Fixed
2016-04-08 21:11:14 +03:00
Alexey Sedunov
e4a64e7980 [RESTORED] Spring Support: Test framework 2016-04-08 21:09:28 +03:00
Alexey Sedunov
b5ac464305 [RESTORED] Misc: Configure dependency on Spring support and related plugins: J2EE, JSP, persistence, database tools, CSS 2016-04-08 21:07:24 +03:00
Alexey Sedunov
a30b4140de [RESTORED] Misc: Configure IDEA Ultimate dependencies 2016-04-08 21:07:23 +03:00
Nikolay Krasko
10206ef0d0 Restore tests-common dependency in idea module 2016-04-08 18:36:34 +03:00
Nikolay Krasko
8ccb442009 Do not guard downloading artifacts for compiler tests with dependencies.properties 2016-04-08 17:40:38 +03:00
Nikolay Krasko
47c7181f2a Extract tests-common module without any actual tests
The main reasoning for the module is to avoid running any compiler tests while executing run configuration that searches tests across module dependencies.
2016-04-08 17:40:38 +03:00
Yan Zhulanow
c45bdef0c2 Minor: Add idea -> lint_idea dependency (fixes IDEA tests), change lint sdk to 1.8 2016-04-08 16:27:50 +03:00
Yan Zhulanow
29412693db Uast: add "strict" parameter to getParentOfType() 2016-04-08 15:39:58 +03:00
Yan Zhulanow
c13c24becc Uast, Lint: Update and fix tests 2016-04-08 15:39:58 +03:00
Yan Zhulanow
21a2115501 Uast: Add Uast visitor extensions instead of additional checkers 2016-04-08 15:39:58 +03:00
Yan Zhulanow
6b30b8ce1f Other code review changes 2016-04-08 15:39:58 +03:00
Yan Zhulanow
991e783ccf Lint: Make lint run normally on both older and newer versions of IDEA (IdeaAndroidProject was replaced by AndroidGradleModel) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
726bfca540 Change semantics of getObjectKeyword() function 2016-04-08 15:39:58 +03:00
Yan Zhulanow
41979de71e Uast: Rewrite visitor 2016-04-08 15:39:58 +03:00
Yan Zhulanow
04e8161f1d Code review changes 2016-04-08 15:39:58 +03:00
Yan Zhulanow
7ed5b6c10b Minor: rename NoTraverse to LeafUElement 2016-04-08 15:39:58 +03:00
Yan Zhulanow
c1e59e4957 Code review changes 2016-04-08 15:39:58 +03:00
Yan Zhulanow
7007261d7b Rename UastHandler to UastCallback 2016-04-08 15:39:58 +03:00
Yan Zhulanow
3484f92d10 Uast: Update tests, make the tests a bit more readable (provide toString() methods for Uast kinds) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
109c76c87d Minor: remove @author comments 2016-04-08 15:39:58 +03:00
Yan Zhulanow
0f01303f0c Lint: Add Kotlin Lint tests 2016-04-08 15:39:58 +03:00
Yan Zhulanow
65da1edb56 Download full copy of the Android SDK (needed to run the all Android Lint tests) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
984f10ddff Lint: fix some more detectors 2016-04-08 15:39:58 +03:00
Yan Zhulanow
aa4f2e426b Lint: Remove lint suppress quickfix (does not work currently with Kotlin) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
5be2b90c6d Uast, Minor: Group binary operators 2016-04-08 15:39:58 +03:00
Yan Zhulanow
cdd98592e4 Uast, Minor: UAnnotated is now always an UElement 2016-04-08 15:39:58 +03:00
Yan Zhulanow
2c003d16f2 Uast: support 'override' modifier in Java and Kotlin 2016-04-08 15:39:58 +03:00
Yan Zhulanow
da5e6c4092 Kotlin Uast, Minor: support PsiElementBacked in KotlinUType 2016-04-08 15:39:58 +03:00
Yan Zhulanow
1ac6c0f2e9 Kotlin Uast: support class literal expressions.
Ability to get type of class of class literal expressions.
2016-04-08 15:39:58 +03:00
Yan Zhulanow
6172f23d9b Uast: support new elements in UastVisitor 2016-04-08 15:39:58 +03:00
Yan Zhulanow
5cf5024d08 Lint: fix Lint additional checkers with the custom handlers 2016-04-08 15:39:58 +03:00
Yan Zhulanow
37a4d78347 Lint: resolve via the accessor descriptor in PropertyAsCAllAndroidUastAdditionalChecker 2016-04-08 15:39:58 +03:00
Yan Zhulanow
3dc091d92c Uast: support internal class names in Java and method signatures in Java and Kotlin 2016-04-08 15:39:58 +03:00
Yan Zhulanow
5bc31112c1 Lint: Remove IntellijApiDetector 2016-04-08 15:39:58 +03:00
Yan Zhulanow
3258ebae39 Java Uast: Support try-with-resources 2016-04-08 15:39:58 +03:00
Yan Zhulanow
9d34df2475 Java Uast: Support static imports 2016-04-08 15:39:58 +03:00
Yan Zhulanow
06a88f417c Uast: support beforeVisit() and afterVisit() in visitor 2016-04-08 15:39:58 +03:00
Yan Zhulanow
3a7f29bfc5 Lint: Support visitResourceReference() in Uast 2016-04-08 15:39:58 +03:00
Yan Zhulanow
514e3859da Uast: Rename JavaPsiElemenStub -> JavaDumbUElement, KotlinPsiElementStub -> KotlinDumbUElement.
Use it everywhere in `nameElement`
2016-04-08 15:39:58 +03:00
Yan Zhulanow
6c40fda7b7 Support equals() on UElements (comparation by psi) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
985c8660b7 Uast Java, Kotlin: Support all binary operators in Uast 2016-04-08 15:39:58 +03:00
Yan Zhulanow
3f6796f0c2 Uast: Support all basic Java types needed for Lint 2016-04-08 15:39:58 +03:00
Yan Zhulanow
862f824bcc Kotlin Uast: Support object literals 2016-04-08 15:39:58 +03:00
Yan Zhulanow
78ce025ca3 Uast: Ability to get the default class type from UClass 2016-04-08 15:39:58 +03:00
Yan Zhulanow
5c07e6de9d Kotlin Uast, Refactoring: Extract toSource() function 2016-04-08 15:39:58 +03:00
Yan Zhulanow
ed1e1c6a2b Uast, Minor: make lateinit mutable propertiy setters internal 2016-04-08 15:39:58 +03:00
Yan Zhulanow
18e963422b Lint: Remove diagnostics unrelated to uast.
All these diagnostics are already present in the Android plugin, so there's no need in them here.
2016-04-08 15:39:58 +03:00
Yan Zhulanow
ed10829091 Uast: Allow to search for a static members (in Kotlin static members are located inside the companion objects).
Companion objects support.
2016-04-08 15:39:58 +03:00
Yan Zhulanow
f1e5c85ba3 Uast: Support Kotlin anonymous initializers 2016-04-08 15:39:58 +03:00
Yan Zhulanow
335712141d Java Uast, Minor: Convert Java Uast properties with backing field to properties with getter (optimization) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
f130dc96f7 Lint: Implement Kotlin Java synthetic property calls as Java method calls via the additional checker 2016-04-08 15:39:58 +03:00
Yan Zhulanow
d1939d52bc Replace UastConverter with UastLanguagePlugin, allow additional checkers 2016-04-08 15:39:58 +03:00
Yan Zhulanow
4ef6016ee8 Lint: Rename all Lint inspections to KLint to provide unique short names 2016-04-08 15:39:58 +03:00
Yan Zhulanow
f4422b3b19 Kotlin Uast: Support type parameters on functions 2016-04-08 15:39:58 +03:00
Yan Zhulanow
668172d68e Lint, Minor: Group lint-related modules 2016-04-08 15:39:58 +03:00
Yan Zhulanow
4df9e9261e Lint: Rewrite Lint diagnostics using Uast. 2016-04-08 15:39:58 +03:00
Yan Zhulanow
126cc778e4 Lint: copy diagnostics from IDEA (br143) 2016-04-08 15:39:58 +03:00
Yan Zhulanow
92d2e7a0a9 Kotlin Uast: Initial implementation 2016-04-08 15:39:58 +03:00
Yan Zhulanow
a13a1e1e4a Java Uast: Initial implementation 2016-04-08 15:39:58 +03:00
Yan Zhulanow
16de31aebe Uast: Unified AST (Kotlin, Java) interfaces set.
Goal: support Android Lint diagnostics in Kotlin by switching Lint scanners from the Java Lombok AST to the abstract AST (uast) with Java and Kotlin PsiElement-backed implementations.
2016-04-08 15:39:58 +03:00
Dmitry Petrov
aca7050656 KT-11499 Normalize stacks on return from an inline function when the function is inlined at call site. 2016-04-08 14:52:55 +03:00
Michael Bogdanov
a6044c81ff Write proper start label for loop parameter 2016-04-08 14:32:51 +03:00
Zalim Bashorov
441a442f34 Minor: update testdata 2016-04-08 13:45:37 +03:00
Zalim Bashorov
f5ca949f2c IC: improve logging in tests and fix DataContainerVersionChangedTestGenerated#testWithError
Test logging improvements:
  * print which chunk building in the round for multimodule projects
  * print actions after cache changed
2016-04-08 13:45:37 +03:00
Kirill Rakhman
da5c963a43 Fix let implement quickfix label for object expressions
Fixes #KT-11782
2016-04-08 10:37:25 +03:00
Valentin Kipyatkov
cdab9d5103 KT-11710 "Replace 'if' with elvis operator": incorrect code generated for 'if' expression
#KT-11710 Fixed
2016-04-07 18:50:32 +03:00
Valentin Kipyatkov
6a65442095 KT-11811 There is no intention "Make protected" for a val declared in parameters of constructor
#KT-11811 Fixed
2016-04-07 18:50:32 +03:00
Valentin Kipyatkov
a9fe999e0e Fixed StackOverflow in CanBeValInspection.kt 2016-04-07 18:50:31 +03:00
Valentin Kipyatkov
22a4bbe1aa KT-11805 Invert if-condition intention breaks code in case of end of line comment
#KT-11805 Fixed
2016-04-07 18:50:30 +03:00
Valentin Kipyatkov
b258af5288 KT-11724 False suggestion to replace with compound assignment
#KT-11724 Fixed
2016-04-07 18:50:30 +03:00
Alexander Udalov
7c90fbe4de Compute return type for property getters more safely
Do not call `isError()` on property's type right after creation of
PropertyGetterDescriptor because the property has no getter yet (it's created
but not yet stored to the property, that happens a bit later), and `isError()`
leads to computation of the delegate type, which for delegated properties
performs some complex resolution (see `VariableTypeResolver#process`) which
relies on the fact that the property already has a getter.

Since the purpose of the original change (883e2e4d) was to support a quick fix
which would add the type to a property in an expression like "val x get() =
...", check the type (or initializer) presence in the PSI instead, this is
safer and is still suitable for the quick fix.

Also fix arguments to "wrong getter type" diagnostic: previously something
useless like "expected Int, actual Int" was reported

 #KT-11809 Fixed
2016-04-07 15:35:58 +03:00
Dmitry Petrov
f1b061d662 Optimize coercion to Unit.
POP operations are backward-propagated.

Operation can't be transformed if its result is moved within stack
(by DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, or SWAP).

Unnecessary operations are replaced with NOPs (for debugger).
Unnecessary NOPs are removed.

KT-9922 Suboptimal generation for simple safe call with unused return value
KT-11116 Optimize methods returning Unit
2016-04-07 11:40:58 +03:00
Alexander Udalov
c4a568efff Minor, add test cases for obsolete protected-related issues 2016-04-07 00:07:11 +03:00
Alexander Udalov
9eec5daf51 Minor, fix a few typos in NameResolution.adoc 2016-04-06 23:21:13 +03:00
Nikolay Krasko
9e88db7e58 Fix bad test modification 2016-04-06 21:46:02 +03:00
Nikolay Krasko
46a1028494 Temporary ad-hock jps-tests enable with testdata modification 2016-04-06 21:46:00 +03:00
Alexey Andreev
9fd19dd7fd KT-7819 Add test to ensure that lambda capturing this literal can be inlined 2016-04-06 16:16:56 +03:00
Alexey Andreev
05887f45f7 KT-7819 Implement non-local returns 2016-04-06 16:16:55 +03:00
Alexey Andreev
a6e1bd1d89 KT-7819 Borrow tests for non-local returns from JVM backend 2016-04-06 16:16:55 +03:00
Pavel V. Talanov
f7db1f934c IDELightClassGenerationSupport#getContextForClassOrObject: do not rely on resolution facade being unchanged
ResolutionFacade should only recompute its underlying structures in case of psi change (which is ok) or some exception, but relying on it being unchanged has led to numerous exceptions in backend when building light classes (EA-70985, EA-80756)
Changing this code may not be the solution but it can possibly move failures to other parts of the system, where they can be easier diagnosed
2016-04-06 16:09:17 +03:00
Nikolay Krasko
74091a12cf Update since to IDEA 2016.1 2016-04-06 14:20:55 +03:00
Nikolay Krasko
4b22685dc5 Change asm library path 2016-04-06 14:20:53 +03:00
Nikolay Krasko
f648fddb84 Create repository for openapi.jar and idea_rt.jar on teamcity to avoid full idea download 2016-04-06 14:20:51 +03:00
Stanislav Erokhin
187c0d4dd0 Refactoring. Change Key for TAIL_RECURSION_CALL from ResolvedCall to Call. 2016-04-06 13:55:36 +03:00
Stanislav Erokhin
516d4df834 Refactoring. Remove isSafeCall from ResolvedCall. 2016-04-06 13:55:35 +03:00
Stanislav Erokhin
bf08341ee4 Refactoring. Change type of ResolvedCall#extensionReceiver from Receiver to ReceiverValue 2016-04-06 13:55:35 +03:00
Stanislav Erokhin
63a2d8a416 Refactoring. Remove receiverArgument from ResolutionCandidate. 2016-04-06 13:55:34 +03:00
Valentin Kipyatkov
602de317d6 Minor improvement in convert to string template inspection: no highlighting when the expression is split onto multiple lines 2016-04-06 10:45:28 +03:00
Mikhail Glukhikh
c32881e41b Fix: test renamed 2016-04-06 10:39:50 +03:00
Dmitry Petrov
8377eb4613 KT-11777: no parts for '<root>' 2016-04-06 10:01:01 +03:00
Nikolay Krasko
d8a2cab708 Bad merge in AbstactIntentionTest that made tests useless 2016-04-05 22:12:31 +03:00
Dmitry Jemerov
01b0cfb552 don't parse lines starting with @ as KDoc tags if they're inside a Markdown code fence
#KT-11789 Fixed
2016-04-05 19:48:51 +02:00
Stanislav Erokhin
ad002c4f09 Minor. Fix file name & regenerate tests. 2016-04-05 20:45:27 +03:00
Kirill Rakhman
a895a3e3de ConvertToForEachFunctionCallIntention: convert 'continue' to 'return@forEach'
Fixed #KT-11764
2016-04-05 18:48:02 +02:00
Valentin Kipyatkov
d5182ffe16 Minor change on code review 2016-04-05 19:33:08 +03:00
Valentin Kipyatkov
e7fa0bec9a Ctrl-Q and other PsiElement-based features to work for synthetic java properties
#KT-11676 Fixed
2016-04-05 19:33:07 +03:00
Valentin Kipyatkov
2aba11abb8 Added test for generic operator 2016-04-05 19:33:07 +03:00
Valentin Kipyatkov
3aff4d4c17 Smart completion to use super type for override if no explicit type specified 2016-04-05 19:33:06 +03:00
Valentin Kipyatkov
7af67da4ac Better smart completion after "by" for override property with no explicit type specified 2016-04-05 19:33:06 +03:00
Valentin Kipyatkov
f85de3aac7 Added better way to construct FuzzyType 2016-04-05 19:33:05 +03:00
Valentin Kipyatkov
e18fb20d5a Completion after "by" for top-level properties 2016-04-05 19:33:05 +03:00
Valentin Kipyatkov
fe9d6aca9a More correct test data 2016-04-05 19:33:04 +03:00
Valentin Kipyatkov
24764ed865 Checking for conflicting substitutors in completion after "by" 2016-04-05 19:33:04 +03:00
Valentin Kipyatkov
e05d6a7056 Smart completion after "by" works for getValue/setValue in generic class 2016-04-05 19:33:03 +03:00
Valentin Kipyatkov
4dde458e84 Smart completion after "by" works for generic properties too 2016-04-05 19:33:02 +03:00
Valentin Kipyatkov
20ac76fe3a Member functions of enum should not be in smart completion 2016-04-05 19:33:02 +03:00
Valentin Kipyatkov
9c6fed1622 Enabled old test 2016-04-05 19:33:01 +03:00
Valentin Kipyatkov
3e09a6902a Renamed test 2016-04-05 19:33:01 +03:00
Valentin Kipyatkov
7b4f26d1b5 Minor changes on code review 2016-04-05 19:33:00 +03:00
Valentin Kipyatkov
9ebf94b4cf KT-11609 No named arguments completion should be after dot
#KT-11609 Fixed
2016-04-05 19:32:59 +03:00
Valentin Kipyatkov
471b673bdd Dropped HeuristicSignatures because there are supported by the language already 2016-04-05 19:32:59 +03:00
Valentin Kipyatkov
88bdf88bbb "Delegates" members in smart completion after "by"
#KT-6231 Fixed
2016-04-05 19:32:58 +03:00
Valentin Kipyatkov
ae0d840aab "Static members" completion after "by" 2016-04-05 19:32:58 +03:00
Valentin Kipyatkov
6fa230311c Show substituted type arguments for type instantiation items 2016-04-05 19:32:57 +03:00
Valentin Kipyatkov
074c6c8dcd Minor 2016-04-05 19:32:57 +03:00
Valentin Kipyatkov
0edc5c15e2 Complete type instantiation items after "by" 2016-04-05 19:32:56 +03:00
Valentin Kipyatkov
ba6accd5f9 Correct substitutions for smart completion after "by" and "in" 2016-04-05 19:32:55 +03:00
Valentin Kipyatkov
7d3229538e One more test 2016-04-05 19:32:55 +03:00
Valentin Kipyatkov
e8c35e16e0 Smart completion after "by" and "in": non-imported operators supported 2016-04-05 19:32:54 +03:00
Valentin Kipyatkov
cda539d769 Initial implementation of smart completion after "by"
#KT-11787 Fixed
2016-04-05 19:32:37 +03:00
Valentin Kipyatkov
c2065c1856 "contains" now requires to be marked as operator + no heuristic signature for contains needed anymore 2016-04-05 18:44:06 +03:00
Mikhail Glukhikh
1b9c6e0ea2 Add variance (in / out) modifier inspection #KT-11090 Fixed 2016-04-05 17:47:29 +03:00
Mikhail Glukhikh
7c02a1eaad Refactoring: VarianceChecker / VarianceCheckerCore, check variance for a separate class 2016-04-05 17:47:20 +03:00
Mikhail Glukhikh
78a898651b Code cleanup: VarianceChecker 2016-04-05 17:45:51 +03:00
Mikhail Glukhikh
c1cbd26eb9 Minor refactoring: let implement interface 2016-04-05 17:45:47 +03:00
Pavel V. Talanov
8fe14b7ba5 KT-11765 Analyze code in anonymous initializer of inteface
#KT-11765 Fixed
2016-04-05 15:04:07 +03:00
Alexey Andreev
40dc5f24d5 Generalize pattern that matches JS module declaration to accept unicode characters
(cherry picked from commit eb44819)
2016-04-05 14:40:27 +03:00
Alexey Andreev
20c0f62d8b Speed-up looking up modules in JS files. This reduces the time needed for JS backend tests to pass
(cherry picked from commit 951ec82)
2016-04-05 14:40:27 +03:00
Alexey Andreev
b3698b1177 Rename JsAstUtils.fqn to fqnWithoutSideEffects. Move PropertyTranslator to appropriate package 2016-04-05 14:40:26 +03:00
Alexey Andreev
0caff1e504 Refactor JS optimizer to use RecursiveJsVisitor where possible and introduce more self-descriptive names in TemporaryAssignmentElimination. Add TODOs and comments for code pieces with non-obvious meaning. 2016-04-05 14:40:26 +03:00
Alexey Andreev
4d126096a1 Invert MetadataProperties.withoutSideEffects to sideEffects 2016-04-05 14:40:26 +03:00
Alexey Andreev
b053c54933 Add more hints about property access that is provable has no side effect. Refactor namer 2016-04-05 14:40:25 +03:00
Alexey Andreev
4a53f5c0b8 Don't relocate temporary variable which receives property access, unless it's provable that this property don't have side effects 2016-04-05 14:40:25 +03:00
Alexey Andreev
cfdce8eaca Rewrite temporary variable elimination 2016-04-05 14:40:25 +03:00
Alexey Andreev
8709289b0a Prohibit from eliminating non-local temporary variables 2016-04-05 14:40:24 +03:00
Alexey Andreev
af7ddb4572 Adds test infrastructure for JS optimizer. Adds simple tests 2016-04-05 14:40:24 +03:00
Alexey Andreev
a7fcbb614d Some cleanup in JS optimizer 2016-04-05 14:40:24 +03:00
Alexey Andreev
3571201e9c Prevent JS optimizer from inserting duplicate variable declarations 2016-04-05 14:40:23 +03:00
Alexey Andreev
4d7906fe44 Prevent temporary variable from substituting to branches of ternary conditional expression, since it can sometimes violate evaluation order 2016-04-05 14:40:23 +03:00
Alexey Andreev
e6e3275906 Implement reduction of if statement to ternary conditional expression 2016-04-05 14:40:23 +03:00
Alexey Andreev
33baa1d774 Implement dead code elimination in JS AST. Repeat optimizations until it's not possible to optimize anything 2016-04-05 14:40:22 +03:00
Alexey Andreev
b5ab8f8488 Make JS optimizations respect nested functions 2016-04-05 14:40:22 +03:00
Alexey Andreev
3ceea68859 Remove optimizations performed during JS inlining. Implement several optimizations as a separate pass 2016-04-05 14:40:22 +03:00
Natalia Ukhorskaya
3301f1f614 Configure Kotlin: do not show notification when apply directive contains double quotes 2016-04-05 14:12:01 +03:00
Natalia Ukhorskaya
e2f464ccc6 Configure kotlin: fix NPE for Idea 145 of higher
#KT-11772 Fixed
2016-04-05 14:12:01 +03:00
Michael Bogdanov
dec53c8d6c Fix for KT-11762: "VerifyError: Bad local variable type" caused by explicit loop variable type
#KT-11762 Fixed
2016-04-05 13:37:10 +03:00
Zalim Bashorov
f2237f675d Don't use invalid entries (including disposed libraries) when crete module infos to avoid exceptions in the future (see #EA-81326) 2016-04-05 12:44:46 +03:00
Zalim Bashorov
88da3fe44d Check that library isn't already disposed before use to avoid exceptions like in #EA-79154 2016-04-05 12:44:46 +03:00
Zalim Bashorov
7dad1831e9 Generate stubs only for files from jar
#EA-78399 fixed
2016-04-05 12:44:46 +03:00
Dmitry Petrov
fe7f7ceed5 Do not generate postponed initialization method for part class as synchronized. 2016-04-05 11:44:36 +03:00
Kirill Rakhman
f9bef68e10 Fix handling of nullable types in LetImplementInterfaceFix #KT-11404 2016-04-05 09:49:02 +03:00
Nikolay Krasko
3056e0b54c Make java8 tests depend on Java 8 JDK 2016-04-05 00:42:09 +03:00
Nikolay Krasko
9c43ff281c Remove stopping JobSchedule executor. It now fails on shutdown attempt. 2016-04-05 00:42:08 +03:00
Nikolay Krasko
554b7d9618 Reset application to null after test in KotlinTestWithEnvironment 2016-04-05 00:42:06 +03:00
Nikolay Krasko
7dcf8ae570 Refactoring: replace custom function to FileUtil.delete 2016-04-05 00:42:05 +03:00
Nikolay Krasko
4104d8632d Fix AS API change 2016-04-05 00:41:28 +03:00
Nikolay Krasko
9cd8c2b7bd Fix compilation against new version of Android plugin 2016-04-05 00:39:46 +03:00
Nikolay Krasko
66bef7c740 Introduce compound run configuration with all compiler tests 2016-04-05 00:39:46 +03:00
Nikolay Krasko
9afd9db5c9 Rename "All compiler tests" to "Compiler tests" as it now doesn't include js tests 2016-04-05 00:39:46 +03:00
Nikolay Krasko
fdf7a3325d Clean up copied code. Remove comments and unused code. 2016-04-05 00:39:46 +03:00
Nikolay Krasko
9fd5568425 Uncomment and move AntTaskJsTest test to js module 2016-04-05 00:39:46 +03:00
Nikolay Krasko
4f7257ab66 Remove dependency to idea.jar in compiler tets to continue running them with JDK 1.6 2016-04-05 00:39:46 +03:00
Nikolay Krasko
a642a15947 "Run Test" line markers now wrap the function names. Additional marker on abstract class. 2016-04-05 00:39:46 +03:00
Nikolay Krasko
ee9962ed70 Template for Junit4 framework doesn't have test prefix anymore 2016-04-05 00:39:46 +03:00
Nikolay Krasko
ed6aaa1138 Remove temp directories in tests
There's new algo for temp file creation that starting to fail after ~1000 files have been created.
2016-04-05 00:39:46 +03:00
Nikolay Krasko
835c8f2c10 Build compiler-tests with 1.6 jdk 2016-04-05 00:39:46 +03:00
Nikolay Krasko
5a88b19b24 Update to idea 2016.1 2016-04-05 00:39:46 +03:00
Nikolay Krasko
6291bb92bd Create own disposable for building separated modules
There's a new check that assert disposer hasn't be disposed yet.
2016-04-05 00:39:46 +03:00
Nikolay Krasko
04cea0993c Make idea-analysis depend on Java 8 2016-04-05 00:39:46 +03:00
Nikolay Krasko
aa2fe9576b Build jps-plugin with java 1.6 2016-04-05 00:39:46 +03:00
Nikolay Krasko
4c81cc802b Remove duplicate build-common dependency 2016-04-05 00:39:46 +03:00
Nikolay Krasko
5a3712f737 Add read action to definition searcher 2016-04-05 00:39:46 +03:00
Nikolay Krasko
00d06fccb6 Fix tests by using relative paths
LightTempDirTestFixtureImpl.findOrCreateChildDir can work only with relative paths
2016-04-05 00:39:46 +03:00
Nikolay Krasko
2081d8f458 Fixes after LightPlatformCodeInsightTestCase stopped execution test under write action by default
See 1d1025401ffb7a06b3340069e06dad14a2e73ddd in intellij-community
1d1025401f
2016-04-05 00:39:46 +03:00
Nikolay Krasko
8325c1a2df Setup proguard rules for new xstream library 2016-04-05 00:39:46 +03:00
Nikolay Krasko
900cc58f01 xstream-1.4.3.jar -> xstream-1.4.8.jar in idea 2016-04-05 00:39:46 +03:00
Nikolay Krasko
f80aaa97a6 Extract plugins tests to separate module with JDK 1.8 2016-04-05 00:39:46 +03:00
Nikolay Krasko
46b5305666 Extract jps-tests to separate module
Remove dependency to idea-full to build jps-plugin with Java 1.6
2016-04-05 00:39:46 +03:00
Nikolay Krasko
fca9a84db8 Set compile target to 1.8 2016-04-05 00:39:46 +03:00
Nikolay Krasko
c576f9272e Remove explicit target 2016-04-05 00:39:46 +03:00
Nikolay Krasko
ef13e8f5bb Prepare building plugins modules against 1.8 JDK 2016-04-05 00:39:46 +03:00
Nikolay Krasko
24a54e2933 Write action for AbstractKotlinExceptionFilterTest 2016-04-05 00:39:46 +03:00
Nikolay Krasko
37b6849d31 Update test data in debugger tests 2016-04-05 00:39:46 +03:00
Nikolay Krasko
4dffacfd1b Fix evaluation tests - create views in gui thread 2016-04-05 00:39:46 +03:00
Nikolay Krasko
139964bf31 Fix repl tests: do modification in write action, avoid hang in closed console 2016-04-05 00:39:46 +03:00
Nikolay Krasko
ae05c04d98 Update maven test: shutdown maven process 2016-04-05 00:39:46 +03:00
Nikolay Krasko
f4fa567409 Can't change file for checkResultByFile by simple assignment to myFile anymore 2016-04-05 00:39:46 +03:00
Nikolay Krasko
a71d1c24ff Mass test data update: find usages doesn't contain column anymore 2016-04-05 00:39:46 +03:00
Nikolay Krasko
b6f3bf9869 Update undroid test clean up 2016-04-05 00:39:46 +03:00
Nikolay Krasko
31484784bb Suppress warnings from PsiClassUtil for findModulesWithClass method 2016-04-05 00:39:46 +03:00
Nikolay Krasko
aa6def5b86 Suppress warnings from SVGLoader 2016-04-05 00:39:46 +03:00
Nikolay Krasko
31da7662c5 Set-up usage for kotlin-test lib 2016-04-05 00:39:46 +03:00
Nikolay Krasko
84af26d342 Fix compile error in KotlinExcludeFromCompletionLookupActionProvider 2016-04-05 00:39:46 +03:00
Nikolay Krasko
0d9e586628 Fix compile errors in AbstractKotlinEvaluateExpressionTest.kt 2016-04-05 00:39:46 +03:00
Nikolay Krasko
02fb9a4063 Update to idea16 EAP (145.184.1) 2016-04-05 00:39:46 +03:00
Stanislav Erokhin
693461e2ee Minor. Remove failed tests for KT-8116. 2016-04-04 23:12:38 +03:00
Stanislav Erokhin
40d3d2c592 Minor. Mute testdata. 2016-04-04 23:12:38 +03:00
Stanislav Erokhin
1c05308c05 Minor. Fix testdata. 2016-04-04 23:12:37 +03:00
Alexander Udalov
c1bcc76dda ChangeLog: add some missing issues fixed in 1.0.1 2016-04-04 21:42:45 +03:00
Alexander Udalov
0e3d2fb38e ChangeLog for 1.0.2 2016-04-04 21:39:34 +03:00
Pavel V. Talanov
3f62b6c495 Typecheck call arguments if callee is resolved to variable
#KT-11579 Fixed
2016-04-04 21:13:22 +03:00
Pavel V. Talanov
e46d713bba KtLightClassForFacade is no longer valid if some of the files have changed their name
#KT-11580 Fixed
2016-04-04 21:10:04 +03:00
Stanislav Erokhin
832f468b13 KT-11733 Cannot infer type parameter in SAM with nullability annotations
#KT-11733 Fixed
2016-04-04 15:31:30 +03:00
Natalia Ukhorskaya
c6fe1b715d Minor: fix test on java 6 2016-04-04 15:27:14 +03:00
Natalia Ukhorskaya
3a0caed148 Avoid 1s delay in completion in debugger fields if session is not stopped on a breakpoint 2016-04-04 15:27:14 +03:00
Nikolay Krasko
473a05b456 Fix too frequent check for compiler modification 2016-04-04 15:25:49 +03:00
Mikhail Glukhikh
b55610b1f0 KT-11404 (let type implement interface): indirect inheritance with generics fixed 2016-04-04 14:17:56 +03:00
Mikhail Glukhikh
640ae60a6b KT-11404: additional test to cover indirect inheritance 2016-04-04 13:58:45 +03:00
Kirill Rakhman
1e6f507f5e Implement quick-fix "let type implement interface" #KT-11404 Fixed 2016-04-04 13:46:47 +03:00
Kirill Rakhman
2198a8c8d0 cleanup KtClassOrObject and KtClass 2016-04-04 13:45:30 +03:00
Mikhail Glukhikh
214e1d3015 Simplify comparison fix introduced #KT-10509 Fixed 2016-04-04 13:41:48 +03:00
hedgehog
02d4376b85 #KT-10797 Fixed 2016-04-04 12:21:11 +02:00
Dmitry Jemerov
62212e7da9 Merge pull request #845 from yarulan/KT-11675
Fix #KT-11675 Fixed - Add Smart Enter processor for 'init'
2016-04-04 12:09:41 +02:00
Natalia Ukhorskaya
de60e6d5b7 Minor: count lambdaOrdinal in tests from 1 instead of 0 2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
09faec9ed7 Debugger: Smart Step Into inside lambda suggests methods from outer context
#KT-10148 Fixed
2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
8b6a447e68 Do not highlight completion variants from nullable receiver with grey in Evaluate Expression Dialog
#KT-11578 Fixed
2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
4d8673d097 Smart step into skips methods from subclasses
#KT-11705 Fixed
2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
c91026f0c0 Configure Kotlin action fails for Idea 145 or higher
#KT-11593 Fixed
2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
cba7c85c36 Minor: rearrange test data 2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
102edd5a0e Debugger: do not insert array in imports 2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
2ce9783214 Debugger: remove useless casts from expressions converted from java 2016-04-04 12:30:46 +03:00
Natalia Ukhorskaya
a93db70995 Debugger: Convert java expression to kotlin when open EE dialog from Variables View
#KT-6805 Fixed
2016-04-04 12:30:46 +03:00
Michael Bogdanov
e0adfd453f Fix for KT-11677: Generic type signatures for local classes in inlined lambdas are not written properly
#KT-11677 Fixed
2016-04-04 12:07:47 +03:00
Michael Bogdanov
f5166b7aef Support test directives in inline tests 2016-04-04 12:07:46 +03:00
Michael Bogdanov
d319811101 Added test for obsolete KT-11631: Couldn't inline method call
#KT-11631 Obsolete
2016-04-03 14:18:13 +03:00
Ilya Gorbunov
f3f1aa8a15 Change String.subSequence parameter names to match those of CharSequence.subSequence. 2016-04-01 21:39:09 +03:00
Sergey Mashkov
c64b59ed82 KT-11261 Implement MavenArchetypesProvider extension point 2016-04-01 18:24:14 +03:00
Alexander Udalov
f2ddc83f86 Reorder and prettify existing ChangeLog entries for 1.0.2 2016-04-01 17:46:18 +03:00
Alexander Udalov
f149e2ca6e Configure Kotlin in project: list only modules with Kotlin files
This was initially done in d07d34af but reverted in 8f2dd2c8, possibly due to
incorrect rebase

 #KT-10831 Fixed
2016-04-01 14:08:32 +03:00
Svetlana Isakova
860a2741d9 Minor 2016-04-01 11:41:53 +03:00
Svetlana Isakova
f1ccf6b133 Restructuring in "invoke" description 2016-04-01 11:39:59 +03:00
Dmitry Petrov
1d87595dc9 binary compat validator: update testData for changes related to new facade generation 2016-04-01 10:13:22 +03:00
Dmitry Petrov
92ddbb271a KT-11410: generate light classes from multifile class parts in binaries
if explicitly requested by fqName
2016-04-01 10:13:22 +03:00
Dmitry Petrov
4c4141ea49 KT-11410: write multifile class code generation scheme to extra field (xi) in kotlin.Metadata. 2016-04-01 10:13:22 +03:00
Dmitry Petrov
d30ab50532 KT-11410: Build stdlib with new part/facade inheritance scheme. 2016-04-01 10:13:22 +03:00
Dmitry Petrov
db58ebc4b2 KT-11410: Class hierarchy for parts/facade of multi-file class.
Preserve static initialization semantics for parts by introducing a special "clinit trigger" class.
Insert "static initialization trigger" call to every method of a part class, remove this call on inline.
Always mangle names for private functions in multifile class parts to avoid resolution clashes on inheritance.

NB in codegen tests initializers for all non-const vals are wrapped in 'run { ... }',
so that the initializer is not a constant expression, and some static initialization code should be generated.
2016-04-01 10:13:22 +03:00
Dmitry Petrov
0ccaf43e2c KT-11410: Add Xmultifile-parts-inherit CLI option. 2016-04-01 10:13:21 +03:00
Dmitry Petrov
095cbea125 KOTLIN_CONFIGURATION_FLAGS directive for passing compiler configuration parameters to tests.
So far, only boolean flags are supported.
2016-04-01 10:13:21 +03:00
Sergey Mashkov
cb4702c406 KT-11261 Implement MavenArchetypesProvider extension point 2016-03-31 23:04:51 +02:00
Sergey Mashkov
14ca0f4aac KT-2917 maven archetype for kotlin projects 2016-03-31 23:04:50 +02:00
Ilya Gorbunov
f35dc47b4e Optimize snapshot operations to return special collection implementations when result is empty or has single element.
#KT-9990 Fixed
2016-03-31 21:30:59 +03:00
Alexey Tsvetkov
0a5db2fea4 Load kotlin.incremental from local.properties file too 2016-03-31 19:40:51 +03:00
Pavel V. Talanov
781bc13941 ExceptionTracker: do not increment counter on ReenteringLazyValueComputationException
ReenteringLazyValueComputationException is in fact correct behaviour which does not indicate a problem we should try to recover from
This led to an obscure bug when resolve sessions were invalidated multiple times during light class construction (see KT-11635)
 #KT-11635 Fixed
2016-03-31 19:33:05 +03:00
Pavel V. Talanov
d7dc122298 KT-11721 Wrong "Typechecker has run into recursive problem" on calling kotlin get function as synthetic property
#KT-11721 Fixed
2016-03-31 19:33:04 +03:00
Ilya Gorbunov
d5d19f5595 Make Map.plus accept Map out-projected by key type as either operand (receiver or parameter).
#KT-11301 Fixed
2016-03-31 17:20:58 +03:00
Ilya Gorbunov
0332217b70 Remove implementations of intrinsic array creation functions (arrayOf, primitiveArrayOf)
#KT-11485 Fixed
2016-03-31 17:15:10 +03:00
Ilya Gorbunov
9caa17dc74 Minor: Make internal monitorEnter/monitorExit functions private to remove them from the public API
#KT-11485
2016-03-31 17:15:10 +03:00
Nikolay Krasko
bbd6417d3c Add plugin-api dependency of android-extension-compiler to plugin classpath
Add it to kotlin-plugin.jar but not to kotlin-android-extensions-plugin.jar because frontend depends on the module plugin-api too.
2016-03-31 16:07:22 +03:00
Nikolay Krasko
c0481ca598 Move injection to optional dependency 2016-03-31 16:07:22 +03:00
Pavel V. Talanov
7de171efda Improve message clarity for WRONG_NUMBER_OF_TYPE_ARGUMENTS diagnostics
#KT-9887 Fixed
2016-03-31 16:06:48 +03:00
Alexey Tsvetkov
d6cd46e079 Build non-incrementally when input class-file is changed 2016-03-31 15:08:14 +03:00
Denis Zharkov
1511a03027 Fix SAM adapters substitution
Approximate sourceFunction types if it's needed

 #KT-11696 Fixed
2016-03-31 14:52:12 +03:00
Denis Zharkov
bc1b34a989 Add additional visibility check for synthetic extensions
Use extension receiver as dispatch one, because it is effectively dispatch
(after some desugaring)
2016-03-31 14:51:57 +03:00
Denis Zharkov
b5c9523e4b Minor. Adjust JS test to protected visibility changes 2016-03-31 14:51:57 +03:00
Denis Zharkov
1bc45fb9cf Adjust J2K to latest protected visibility fixes 2016-03-31 14:51:57 +03:00
Denis Zharkov
92be4aee9c Prohibit protected constructor calls that are not super-calls in subtypes
#KT-11649 Fixed
2016-03-31 14:51:57 +03:00
Denis Zharkov
816f14a927 Minor. Covariantly override ClassDescriptor.original 2016-03-31 14:51:57 +03:00
Denis Zharkov
5056c43975 Do not check receiver for protected constructor calls
Checks for protected constructors should be performed manually,
because they are rather complex
2016-03-31 14:51:57 +03:00
Denis Zharkov
5bf336474d Respect receiver-dependent visibility when selecting smart-cast type 2016-03-31 14:51:57 +03:00
Denis Zharkov
d3b7eb81fa Make PositioningStrategy.mark public
Because it's used with receivers of types different from call site ones.
2016-03-31 14:51:57 +03:00
Denis Zharkov
935355ad2f Refine isVisible for protected visibility
#KT-7437 Fixed
 #KT-7971 Fixed
 #KT-7051 Fixed
 #KT-6125 Fixed
 #KT-6186 Fixed
2016-03-31 14:51:57 +03:00
Denis Zharkov
182b349492 Clarify Visibility.isVisible contract for null as receiverValue
See comment
2016-03-31 14:51:57 +03:00
Mikhail Glukhikh
60511f010a Build fix: evaluationErrors.repl 2016-03-31 14:34:56 +03:00
Svetlana Isakova
4c30bcfca0 Added separate notes for name resolution motivation
Addressed some comments on the main article
2016-03-31 13:23:55 +03:00
Mikhail Glukhikh
56ef98ee29 Refactoring: DeclarationsChecker checkClassOrObjectMembers / checkFunction 2016-03-31 12:19:15 +03:00
Mikhail Glukhikh
8c131f4790 KT-11666: Implicit nothing is allowed for overridden function / properties 2016-03-31 12:00:22 +03:00
Mikhail Glukhikh
4c03aaabd4 Implicit nothing / intersection types are now checked also for member functions #KT-11666 Fixed 2016-03-31 11:59:17 +03:00
Yaroslav Ulanovych
242a44e477 Fix #KT-11675 Fixed - Add Smart Enter processor for 'init' 2016-03-30 23:25:47 +03:00
Alexander Udalov
0ea3b4ade4 Fix multiple resource leaks by closing InputStream instances
The main fix is in BuiltInsPackageFragment, the rest is the improvement of
other usages of getResourceAsStream

 #KT-11433 Fixed
2016-03-30 21:41:43 +03:00
Alexander Udalov
8316953259 Fix double quotes in diagnostic messages
For diagnostics without any parameters, the given text is simply rendered as a
String, so no symbols should be escaped.

For diagnostics with parameters, the format in java.text.MessageFormat is used,
so one single quote is erased and two single quotes become one single quote in
the rendered text.
2016-03-30 21:41:43 +03:00
Pavel V. Talanov
484167e9d9 KtLightModifierList* is created only for light classes build for sources
This is a hacky solution to avoid calling lightMemberOrigin.originalElement inside
Moreover it needs to resolve descriptor for sources inside computeAnnotations and it is used only for kotlin sources so this will have to do for now
2016-03-30 21:35:24 +03:00
Pavel V. Talanov
e19cc04c63 KT-11678 Support navigation from Java source to Kotlin binaries
Introduce LightMemberOriginForCompiledElement which holds logic for finding corresponding decompiled declaration
ByJvmSignatureIndexer stores the required information while building decompiled text

Some are unsolved in this commit:
   - constructors
   - @Jvm* and other unregular generated members
   - annotation methods

 #KT-11678 Fixed
2016-03-30 21:35:23 +03:00
Pavel V. Talanov
f9fa365059 LightElements: avoid computation of LightMemberOrigin.originalElement on common api calls 2016-03-30 21:35:23 +03:00
Pavel V. Talanov
f40a04c5a2 Refactor light elements
KtLightElement#delegate -> clsDelegate, KtLightElement#origin -> kotlinOrigin and make them properties
KtLightClassForDecompiledDeclaration stores KtClsFile
KtLightField stores LightMemberOrigin
2016-03-30 21:35:22 +03:00
Pavel V. Talanov
02543295f9 Refactor: Make LightMemberOrigin an interface, extract one implementation 2016-03-30 21:35:21 +03:00
Pavel V. Talanov
3977508c2c Improve AbstractReferenceResolveTest 2016-03-30 21:35:20 +03:00
Pavel V. Talanov
4824d4b880 Refactor: abstract over decompiled text indexing
Move navigation-related code from KtDecompiledFile
2016-03-30 21:35:19 +03:00
Pavel V. Talanov
ef25b14eab Drop non-generated NavigateToDecompiledLibraryTest
It relies on internal data structure
2016-03-30 21:35:19 +03:00
Pavel V. Talanov
68c0bb9dc2 Generate navigateToDecompiledLibraryTest from the same test data as navigateToLibrarySourceTest
Change test data format
2016-03-30 21:35:18 +03:00
Pavel V. Talanov
f74e8ee7f8 Generate tests for resolving references to kotlin binaries from java in IDE 2016-03-30 21:35:17 +03:00
Ilya Gorbunov
ab68b49a70 Introduce RandomAccess to JS.
Make EmptyList support RandomAccess.
#KT-10794
2016-03-30 21:06:18 +03:00
Ilya Gorbunov
6ba98f7fe6 Binary compatibility validator: filter out empty facades *after* members are flattened from non-public part superclasses.
Use stable member sort order for members flattened from non-public superclasses, rewrite test to make order matter.
2016-03-30 20:44:44 +03:00
Svetlana Isakova
8e7f259beb Added an article describing name resolution 2016-03-30 19:34:54 +03:00
Mikhail Glukhikh
b7e8f71367 Fix of getCorrespondingLoop for complex loop / try-finally trees #KT-8246 Fixed 2016-03-30 18:49:23 +03:00
Alexander Udalov
f385c85672 Rename Changelog.md -> ChangeLog.md 2016-03-30 18:29:17 +03:00
Nikolay Krasko
193f5e9720 Find problem test in injection 2016-03-30 16:42:37 +03:00
Nikolay Krasko
b4f5f0e10e Add initial support for injecting languages with comment or annotation
#KT-11472 Fixed
2016-03-30 16:42:37 +03:00
Nikolay Krasko
4819c07c95 Extract function for adding annotation to KtModifierListOwner 2016-03-30 16:42:37 +03:00
Valentin Kipyatkov
97311b56fe Minor changes on code review 2016-03-30 15:58:09 +03:00
Valentin Kipyatkov
99c232df84 Checking that no quickfix reference KotlinType 2016-03-30 15:58:09 +03:00
Valentin Kipyatkov
2ac627efd3 No KotlinType reference in ConvertClassToKClassFix 2016-03-30 15:58:09 +03:00
Valentin Kipyatkov
40e69318b8 Renames + parameter to receiver 2016-03-30 15:58:08 +03:00
Valentin Kipyatkov
1f39511950 No i18n 2016-03-30 15:58:08 +03:00
Valentin Kipyatkov
9e5bbc5ef4 No KotlinType reference in ChangeParameterTypeFix 2016-03-30 15:58:08 +03:00
Valentin Kipyatkov
d8993069c0 Do not rely on KotlinType.toString() 2016-03-30 15:58:08 +03:00
Valentin Kipyatkov
1754b58e37 No KotlinType reference in AddArrayOfTypeFix 2016-03-30 15:58:08 +03:00
Valentin Kipyatkov
3905344530 No KotlinType reference in NumberConversionFix 2016-03-30 15:58:07 +03:00
Valentin Kipyatkov
3ad292697a No KotlinType reference in ChangeFunctionLiteralReturnTypeFix 2016-03-30 15:58:07 +03:00
Valentin Kipyatkov
9bbeaa3c03 Minor code improvements 2016-03-30 15:58:07 +03:00
Valentin Kipyatkov
74f9f89728 Converting to Kotlin (step 2) 2016-03-30 15:58:07 +03:00
Valentin Kipyatkov
f18db1f88e Converting to Kotlin (step 1) 2016-03-30 15:58:07 +03:00
Valentin Kipyatkov
e00e94e8c6 No KotlinType reference in CastExpressionFix 2016-03-30 15:58:06 +03:00
Valentin Kipyatkov
3467ac7438 No KotlinType reference in ChangeFunctionReturnTypeFix 2016-03-30 15:58:06 +03:00
Valentin Kipyatkov
41c09700e8 Minor code improvements 2016-03-30 15:58:06 +03:00
Valentin Kipyatkov
e0ba2e8395 Converting to Kotlin (step 2) 2016-03-30 15:58:06 +03:00
Valentin Kipyatkov
6afd88bf07 Converting to Kotlin (step 1) 2016-03-30 15:58:06 +03:00
Valentin Kipyatkov
54a69bf21d ChangeVariableTypeFix to not hold KotlinType 2016-03-30 15:58:05 +03:00
Valentin Kipyatkov
d5a8d8c393 Functions to objects 2016-03-30 15:58:05 +03:00
Valentin Kipyatkov
3f022377f3 Minor code improvements 2016-03-30 15:58:05 +03:00
Valentin Kipyatkov
eb918db3af Converting to Kotlin (step 2) 2016-03-30 15:58:05 +03:00
Valentin Kipyatkov
9c18409966 Converting to Kotlin (step 1) 2016-03-30 15:58:05 +03:00
Valentin Kipyatkov
1f0679e103 Converting to Kotlin (step 2) 2016-03-30 15:58:04 +03:00
Valentin Kipyatkov
2ffde5db43 Converting to Kotlin (step 1) 2016-03-30 15:58:04 +03:00
Valentin Kipyatkov
210626a6e1 Merged code into one visitor 2016-03-30 15:58:04 +03:00
Valentin Kipyatkov
f4e3e33bd3 Renamed class 2016-03-30 15:58:04 +03:00
Valentin Kipyatkov
93e170325e KT-11612 Highlight named arguments in the editor somehow
#KT-11612 Fixed
2016-03-30 15:58:04 +03:00
Valentin Kipyatkov
b9865c7225 Minor 2016-03-30 15:58:04 +03:00
Valentin Kipyatkov
2625c6bc29 Converted to Kotlin 2016-03-30 15:58:03 +03:00
Alexander Udalov
ae263dd70c Add KClass.equals/hashCode to public API of Kotlin runtime
See be4b432
2016-03-30 15:01:07 +03:00
Alexey Tsvetkov
71135b9528 Minor: rename property AbstractKotlinCompile.experimentalIncremental->incremental 2016-03-30 04:42:30 +03:00
Alexey Tsvetkov
61814eb23f Test: override build.log in gradle IC tests 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
c1a61b17c7 Test: use one function to find test's build log for jps and gradle 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
3d8ec118cb Remove class files when building non-incrementally 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
c8b7764576 Add gradle IC version file 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
ede900ca87 Use separate cache directory for each kotlin gradle task 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
4c782dbfcc Refactor: move allVersions() to jps-plugin since it is jps specific 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
5d2d827772 Test: change log dump format in gradle tests so it could be parsed again 2016-03-30 03:40:53 +03:00
Alexey Tsvetkov
b050722249 Test: add android incremental compilation test project 2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
bafa9dca48 Test: pass android-build-tools version using project property
The reason is to test the same project with different android-build-tools versions
2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
157c5009f0 Test: download android sdk using sdk-manager-plugin 2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
c686c7fb91 Minor: print subprocess output immediately in tests 2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
da3897536a Minor: format android gradle test 2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
5d89f1fb0a Minor: remove assertion from test
Asserted task does not exist
2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
ae53183d72 Fix java build when kotlin is changed
See SimpleKotlinGradleIT#testSimpleCompile

    #KT-11350 fixed
2016-03-30 03:40:52 +03:00
Alexey Tsvetkov
4e64d46105 Add kotlin.incremental project property to gradle
Allows turning on incremental compilation by passing
'-Pkotlin.incremental=true' in command line
or specifying it in a 'local.properties' file
2016-03-30 03:40:51 +03:00
Alexey Tsvetkov
274b7bb0b0 Test: turn off thread leaks assertion for android gradle tests
ThreadTracker compares active threads before and after compilation.
In test mode if those sets are different, it was throwing an exception.
By some reason that is not obviously linked with kotlin,
the exception was thrown for every android test.

As a temporary solution I added a property 'kotlin.gradle.test.assertThreadLeaks'
that controls this assertion and turned it off for android tests only.
2016-03-30 03:39:44 +03:00
Ilya Gorbunov
cbf8dca28d Add deprecated extension MutableList.remove.
#KT-11648 Fixed
2016-03-29 19:56:03 +03:00
Alexey Sedunov
90487e9aa1 Misc: Replace Ultimate SDK with Community during dependency update 2016-03-29 19:26:27 +03:00
Alexey Sedunov
3603d873cd [REVERTED] 8e7e3a3 Alexey Sedunov on 3/10/2016 at 16:58 (committed on 3/24/2016 at 18:42)
Misc: Configure IDEA Ultimate dependencies
2016-03-29 19:17:12 +03:00
Alexey Sedunov
1e50cc5d00 [REVERTED] d8a033e Alexey Sedunov on 3/11/2016 at 15:56 (committed on 3/24/2016 at 18:42)
Misc: Configure dependency on Spring support and related plugins: J2EE, JSP, persistence, database tools, CSS
2016-03-29 19:17:11 +03:00
Alexey Sedunov
9070aa882d [REVERTED] 161d11d Alexey Sedunov on 3/18/2016 at 14:00 (committed on 3/24/2016 at 18:42)
Spring Support: Test framework
2016-03-29 19:17:10 +03:00
Alexey Sedunov
e11e27ff55 [REVERTED] 72a17b0 Alexey Sedunov on 2/21/2016 at 00:01 (committed on 3/24/2016 at 18:42)
Spring Support: Inspection for final Spring-annotated classes/functions
2016-03-29 19:17:09 +03:00
Alexey Sedunov
ed9b1ac151 [REVERTED] 0a71eb7 Alexey Sedunov on 2/25/2016 at 14:02 (committed on 3/24/2016 at 18:42)
Spring Support: Implement Spring-specific references
2016-03-29 19:17:07 +03:00
Alexey Sedunov
95f6acdddf [REVERTED] 8c72b02 Alexey Sedunov on 3/21/2016 at 19:14 (committed on 3/24/2016 at 18:42)
Light Classes: Constant expression evaluator for light annotation arguments
2016-03-29 19:17:05 +03:00
Alexey Sedunov
4896d90c79 [REVERTED] 28b8cfc Alexey Sedunov on 3/22/2016 at 21:26 (committed on 3/24/2016 at 18:42)
Spring Support: Show Spring line markers for Kotlin classes
2016-03-29 19:17:04 +03:00
Alexey Sedunov
bad1794577 [REVERTED] 0eda1f3 Alexey Sedunov on 3/14/2016 at 18:54 (committed on 3/24/2016 at 18:42)
Spring Support: SpEL injections
2016-03-29 19:17:02 +03:00
Alexey Sedunov
1970582dd8 [REVERTED] 2692a7d Alexey Sedunov on 2/21/2016 at 00:50 (committed on 3/24/2016 at 18:42)
Spring Support: Inspection for Spring configuration
2016-03-29 19:17:00 +03:00
Alexey Sedunov
124776643e [REVERTED] 86c551b Alexey Sedunov on 3/24/2016 at 19:21 (committed on 3/24/2016 at 19:23)
Misc: Сhangelog update
2016-03-29 19:16:59 +03:00
Alexey Sedunov
bfcf7d2b1e [REVERTED] 2dd83b1 Alexey Sedunov on 3/25/2016 at 16:08 (committed on 3/25/2016 at 16:21)
Misc: Fetch Spring libraries to dependencies directory
2016-03-29 19:16:58 +03:00
Alexander Udalov
4a533168d9 Rework const val generation in multifile classes
Do not query MultifileClassCodegen#classBuilder early on: this causes the class
file for the facade to be prematurely dumped to the disk in some cases, when
that class file is not yet completely generated. Instead fork the logic in
PropertyCodegen#generateSyntheticMethodIfNeeded: save metadata in parts,
generate method in the facade
2016-03-29 17:53:32 +03:00
Alexander Udalov
f31dca32a4 Flush stdout and stderr before shutdown in scripts
Although a test is present, it doesn't check the behavior because it seems that
in the test environment both streams are necessarily flushed

 #KT-9546 Fixed
2016-03-29 17:53:18 +03:00
Alexander Udalov
be4b432778 Clarify KClass equality
#KT-11502 Fixed
2016-03-29 17:14:51 +03:00
Alexey Sedunov
cbb6f7ed63 Generate equals()/hashCode(): Fix hashCode() implementation
#KT-11638 Fixed
2016-03-29 15:21:17 +03:00
Ilya Gorbunov
768da05ba9 Update dump declaration mappings tests to reflect new constant generation in multifile facades. 2016-03-29 14:34:32 +03:00
Ilya Gorbunov
ce09612804 Write ReadMe about what constitutes the public API and what is an incompatible change 2016-03-29 13:50:08 +03:00
Ilya Gorbunov
8888537137 Reference dump of kotlin-runtime and kotlin-stdlib of 1.0.2-dev
New public implementation methods 'renderLambdaToString' which are called only from the same module.
2016-03-29 13:50:06 +03:00
Ilya Gorbunov
26e905e90e Reference dump of kotlin-runtime and kotlin-stdlib of 1.0.0 and 1.0.1 2016-03-29 13:50:04 +03:00
Ilya Gorbunov
4c113ad882 Prettify dump output format: indent members and enclose them in { }, space before : in supertypes. 2016-03-29 13:50:02 +03:00
Ilya Gorbunov
ff0a24a750 Move test output files closer to test data.
Move reference dump out of test directory.
2016-03-29 13:50:01 +03:00
Ilya Gorbunov
2e87a08c8d Ignore kotlin visibilities for classes in effectively public package kotlin.jvm.internal 2016-03-29 13:49:59 +03:00
Ilya Gorbunov
ce4b161df4 Find single jar file with binaries in target folders without knowning its version in advance. 2016-03-29 13:49:57 +03:00
Ilya Gorbunov
a75093650c Add JvmField and const tests for exposed fields visibility 2016-03-29 13:49:55 +03:00
Ilya Gorbunov
0d12d60e8a Infer lateinit-exposed field effective visibility from its setter visibility. 2016-03-29 13:49:53 +03:00
Ilya Gorbunov
f2cb5edf1a Do not consider protected members in final class as public API 2016-03-29 13:49:51 +03:00
Ilya Gorbunov
4e250e4dd1 Refactor data structures 2016-03-29 13:49:49 +03:00
Ilya Gorbunov
10792de4c1 Treat inline-exposed internal API as effectively public.
Comment out unsupported cases.
2016-03-29 13:49:48 +03:00
Ilya Gorbunov
0aaf0ba60f Take into account field kotlin visibility 2016-03-29 13:49:46 +03:00
Ilya Gorbunov
bd8c83bee2 Merge public static API of non-public base supertypes into public subtype 2016-03-29 13:49:44 +03:00
Ilya Gorbunov
472b386101 Tests for public API dump tool. 2016-03-29 13:49:43 +03:00
Ilya Gorbunov
da032e371a Minor: refactoring 2016-03-29 13:49:41 +03:00
Ilya Gorbunov
88a038a0df Filter out nested classes in non-public outer classes. 2016-03-29 13:49:39 +03:00
Ilya Gorbunov
a9fd1de263 Tool to dump binary API signatures from compiled JAR.
Incorporate declaration mappings output from the compiler to take into account kotlin visibilities.
2016-03-29 13:49:38 +03:00
Ilya Gorbunov
25abdf9fdb Tests for declaration mappings dumping from compiler 2016-03-29 13:49:36 +03:00
Ilya Gorbunov
e7d75fccd6 Introduce compiler option to dump declaration mapping. 2016-03-29 13:49:34 +03:00
Ilya Gorbunov
4e49187549 Dump declaration mapping during codegen process. 2016-03-29 13:49:33 +03:00
Natalia Ukhorskaya
68907d05c3 J2K produces unresolved 'toArray' calls for java Collection#toArray(T[])
#KT-11600 Fixed
2016-03-29 11:26:18 +03:00
Alexander Udalov
a8bebeb48d Load annotations of const properties from multifile classes
Rework backing field generation logic in PropertyCodegen to switch the
ClassBuilder instance for a multifile part to that of the corresponding facade
class. This became needed because multifile parts, and their metadata, are
generated _before_ the multifile facade class and otherwise we would never
record that there's a synthetic '$annotations' method for a const val and would
not write that to the protobuf message for the property.

See also bad83200

 #KT-10892 Fixed
2016-03-28 21:11:14 +03:00
Alexander Udalov
6924d883eb Support reflection calls to multifile class members
#KT-11447 Fixed
2016-03-28 21:11:14 +03:00
Mikhail Glukhikh
9fa101b3fe Changelog: 1.0.1-2 added 2016-03-28 20:22:36 +03:00
Mikhail Glukhikh
a541aaafd8 Protected in final inspection: protected modifier is effectively private in final classes #KT-6674 Fixed 2016-03-28 19:03:16 +03:00
Mikhail Glukhikh
20bac6178c Array in data class inspection: warning on array properties in data classes #KT-10299 Fixed 2016-03-28 19:00:16 +03:00
Yan Zhulanow
047828bd6d Fix EA-79598: getNode() in JspxImportListImpl returns null 2016-03-28 14:43:07 +03:00
Alexander Udalov
a6610d1b0c Drop obsolete JVM intrinsics, rename JavaClassArray -> ArrayOf 2016-03-28 14:24:23 +03:00
Alexander Udalov
d62535c388 Minor, drop unnecessary workaround of obsolete issue 2016-03-28 14:14:56 +03:00
Alexander Udalov
a8e6a9c828 Minor, add JDK to multi-module Java analysis test 2016-03-28 14:14:55 +03:00
Alexander Udalov
2dab56db8e Do not report "incomplete hierarchy" in decompiler
It's fine if the decompiler can't find some classes; it won't do anything
except render their FQ names which are fully available
2016-03-28 14:13:59 +03:00
Alexander Udalov
8d64ed7f3f Do not produce error classes for not found annotations 2016-03-28 14:13:59 +03:00
Alexander Udalov
e915e1548c Fix multiple 'unresolved java classifier' errors
Use the same component (NotFoundClasses) as in loading of compiled Kotlin
symbols.

Some tests were changed to avoid a diagnostic that is now reported when a
non-found class is encountered in a signature (e.g. staticMethod.1.java where
JDK seems to be not configured)

 #KT-10493 Fixed
 #KT-10820 Fixed
 #KT-11368 Fixed
2016-03-28 14:13:59 +03:00
Alexander Udalov
873cf439de Drop MissingDependencyErrorClass and related code
No longer needed because of the proper support for missing classes in
deserialization (see NotFoundClasses.kt)
2016-03-28 14:13:59 +03:00
Alexander Udalov
db5e00bcc0 Report error if some deserialized classes are missing in dependencies
Technically we often can compile code which uses missing classes (as long as
nothing is called on them) but it seems better to let the user know something's
wrong in their setup before the error manifests itself at runtime. Also the
Java compiler does the same

 #KT-4328 Fixed
2016-03-28 14:13:59 +03:00
Alexander Udalov
accf80a624 Do not create error types in deserialization on not found classes
For a class which cannot be resolved in the current deserialization session,
create a special ClassDescriptor instance with an empty scope and put in the
correct package under the current module. Codegen will perfectly map such class
to its JVM signature (because only the precise FQ name is needed, which is
available). For more details on this approach, see the issue description.

 #KT-4328 Fixed
 #KT-11497 Fixed
2016-03-28 14:13:59 +03:00
Alexander Udalov
3944d56ac2 Minor, remove unnecessary type parameter in CallChecker#check 2016-03-28 14:13:59 +03:00
Alexander Udalov
2c81824689 Rework and prettify CompileKotlinAgainstCustomBinariesTest
Do not use MockLibraryUtil to compile Kotlin code: this allows to avoid
rebuilding kotlin-compiler.jar every time before running a test. Also extract a
few utilities, use Kotlin stdlib where possible
2016-03-28 14:13:59 +03:00
Zalim Bashorov
9f069843e8 Minor: precise incremental compilation no longer experimental 2016-03-28 12:57:04 +03:00
Ilya Gorbunov
3779fb2521 Minor: Do not recompile markdown every time. 2016-03-26 01:02:53 +03:00
Natalia Ukhorskaya
470027bfd8 J2K: specify type for variables with anonymous type if they have write accesses 2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
23908fb8f3 J2K produces unresolved 'toArray' calls for java Collection#toArray()
#KT-11600 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
79bac598bf J2K breaks code if applied to a java class with static field which is accessed from another java class
#KT-11587 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
c7ae9981cb J2K: Quote '$' symbols in converted strings
#KT-6800 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
4bc4f0bce7 J2K: not initialized field of non-primitive type should have null initializer
#KT-11544 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
8616c9588d J2K, minor: pass nullability as additional parameter for more flexibility 2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
59930c32c4 Debugger, refactoring in tests: add ability to skip some variables in printFrame 2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya
a09814961f Debugger: more precise context expression in codeFragment
#KT-11380 Fixed
2016-03-25 20:27:19 +03:00
Yan Zhulanow
77b7b46542 Kapt: fix sequential build with kapt when Kotlin source file was modified 2016-03-25 19:32:18 +03:00
hansenji
100252b18b Handle elements in two different classes with the same name annotated with the same annotation. 2016-03-25 19:32:18 +03:00
hansenji
b9dc92d7cf Removed Test for deprecated annotation 2016-03-25 19:32:18 +03:00
Valentin Kipyatkov
e62c8a0860 Unescape single quote when converting to string template 2016-03-25 18:11:34 +03:00
Valentin Kipyatkov
7f2ccb5613 KT-11295 AssertionError in ConvertToStringTemplateIntention.fold
#KT-11295 Fixed
2016-03-25 18:11:34 +03:00
Valentin Kipyatkov
c1499e7cb6 KT-11576 Unused symbol warning: add quickfix for annotated declarations
#KT-11576 Fixed
2016-03-25 18:11:34 +03:00
Valentin Kipyatkov
03d7c5764d Moved confusing utility from KtPsiUtil (but the code in KtLightClassForExplicitDeclaration is still incorrect!) 2016-03-25 18:11:34 +03:00
Valentin Kipyatkov
02d309c9cf KT-11481 "Add import" intention is not available for 'is' branches in when
#KT-11481 Fixed
2016-03-25 18:11:34 +03:00
Nikolay Krasko
f93bf9fbb4 Fix generating folder for java8 tests 2016-03-25 17:33:32 +03:00
Alexey Sedunov
c4eb8ceb53 Compiler Daemon: Use clearHandlersCache() method instead of Reflection API
(old code may fail in IDEA Ultimate due to field obfuscation)
2016-03-25 16:00:08 +03:00
Alexey Sedunov
2d0b06dc2d Project Configuration: Do not rely on field names when reflecting on LibraryOptionsPanel (they can differ due to Ultimate obfuscation) 2016-03-25 15:56:28 +03:00
Alexey Sedunov
2dd83b12d3 Misc: Fetch Spring libraries to dependencies directory 2016-03-25 15:21:16 +03:00
Nikolay Krasko
00239914fa Minor: refactoring 2016-03-25 14:10:41 +03:00
Nikolay Krasko
0f6e7cc277 Minor: add contract annotation 2016-03-25 14:10:41 +03:00
Nikolay Krasko
1524f099b3 Rewrite KotlinCliJavaFileManagerTest with KotlinTestWithEnvironment 2016-03-25 14:10:41 +03:00
Nikolay Krasko
5fb7b1be80 Move java8 tests 2016-03-25 14:10:41 +03:00
Nikolay Krasko
3a747e0c38 Refactoring: move utility methods to idea module 2016-03-25 14:10:41 +03:00
Zalim Bashorov
4b8c9c8b39 Minor: fix testdata 2016-03-24 22:28:40 +03:00
Zalim Bashorov
9a9b863c9d IC: add tests with moving files
Additionally added the ability to use directories in IC tests.

 #KT-8002 Obsolete
2016-03-24 22:28:40 +03:00
Kirill Rakhman
d230afe726 Reuse BindingContext and perform quickfix directly on PSI instead of the editor 2016-03-24 19:39:57 +01:00
Kirill Rakhman
cc730c36ad Implement quickfix to remove '.java' when KClass is expected
Fixes #KT-11078
2016-03-24 19:39:57 +01:00
Alexey Sedunov
5b272921e6 Misc: Favor intellij-core over idea-full in the idea-completion dependencies (to prevent loading of scambled PsiFileImpl from Ultimate SDK) 2016-03-24 20:49:09 +03:00
Valentin Kipyatkov
384183ad7b Intention to convert raw string literal to ordinary one
#KT-5208 Fixed
2016-03-24 19:05:56 +03:00
Valentin Kipyatkov
ecebb80bbe Added intention description 2016-03-24 19:05:55 +03:00
Valentin Kipyatkov
3d422b47cb Intention action to convert string to raw string
(half of KT-5208)
2016-03-24 19:05:55 +03:00
Alexey Sedunov
86c551b27b Misc: Сhangelog update 2016-03-24 18:23:34 +03:00
Michael Bogdanov
6547fa1d4c Replace hashes in bytecode listing tests with 'HASH' 2016-03-24 16:17:58 +01:00
Alexey Sedunov
2692a7d35c Spring Support: Inspection for Spring configuration 2016-03-24 17:42:13 +03:00
Alexey Sedunov
0eda1f3969 Spring Support: SpEL injections
#KT-11406 Fixed
2016-03-24 17:42:12 +03:00
Alexey Sedunov
28b8cfc3d5 Spring Support: Show Spring line markers for Kotlin classes
#KT-3741 Fixed
2016-03-24 17:42:11 +03:00
Alexey Sedunov
8c72b02c9b Light Classes: Constant expression evaluator for light annotation arguments 2016-03-24 17:42:10 +03:00
Alexey Sedunov
0a71eb777e Spring Support: Implement Spring-specific references 2016-03-24 17:42:08 +03:00
Alexey Sedunov
72a17b0671 Spring Support: Inspection for final Spring-annotated classes/functions
#KT-11098 Fixed
2016-03-24 17:42:07 +03:00
Alexey Sedunov
161d11d9ec Spring Support: Test framework 2016-03-24 17:42:06 +03:00
Alexey Sedunov
d8a033e8a5 Misc: Configure dependency on Spring support and related plugins: J2EE,
JSP, persistence, database tools, CSS
2016-03-24 17:42:05 +03:00
Alexey Sedunov
8e7e3a3b99 Misc: Configure IDEA Ultimate dependencies 2016-03-24 17:42:04 +03:00
Alexey Sedunov
d76e8f2d67 Light Classes: Generate light wrappers for name identifiers 2016-03-24 17:42:01 +03:00
Alexey Sedunov
fefa0baeee Light Classes: Generate light wrappers for annotation entries 2016-03-24 17:41:58 +03:00
Alexey Sedunov
4debf0cc45 Java To Kotlin: KtLightModifierList 2016-03-24 17:41:57 +03:00
Alexey Sedunov
19850ffb86 Java To Kotlin: KtLightModifierList.java (rename to .kt) 2016-03-24 17:41:56 +03:00
Michael Bogdanov
6737bc12f1 Fix for KT-11519: Version 1.0.1 fails with NPE in com.sun.beans.TypeResolver.resolve() where v1.0.0 works fine
#KT-11519 Fixed
2016-03-24 15:18:31 +01:00
Valentin Kipyatkov
f0ef04a6a8 Changed highlighting range for unresolved annotation name to not include '@'
#KT-11529 Fixed
2016-03-24 16:44:58 +03:00
Michael Bogdanov
0fdba49315 Test for KT-11514: Platform Double is converted to Int when comparing to Int literal
#KT-11514 Fixed
2016-03-24 14:11:25 +01:00
Michael Bogdanov
d0aac74e72 Fix for KT-11590: IllegalAccessError: SAM adapter generated with invalid accessibility for inline function
#KT-11590 Fixed
2016-03-24 14:11:25 +01:00
Alexey Tsvetkov
33cd661aad Minor: removed experimental-ic-build.log duplicating build.log 2016-03-24 14:57:17 +03:00
Alexey Tsvetkov
f3ee255436 Normalize output for windows tests 2016-03-24 14:55:27 +03:00
Michael Bogdanov
a851bb0fff Fix for KT-11584: Regression in 1.0.1: incorrect comparison of Long! with integer constant
#KT-11584 Fixed
2016-03-24 08:51:43 +01:00
Denis Zharkov
628f9050fb Report UNUSED_EXPRESSION on anonymous functions 2016-03-23 20:11:51 +03:00
Denis Zharkov
16736e3a0e Resolve anonymous functions in block as expression
#KT-7265 Fixed
2016-03-23 20:08:15 +03:00
Mikhail Glukhikh
77e37ff75d Changelog from 1.0.1 added 2016-03-23 15:27:13 +03:00
Mikhail Glukhikh
46290798ca Refactoring (same logic in ControlFlowInformationProvider / DataFlowValueFactory) 2016-03-23 15:04:13 +03:00
Mikhail Glukhikh
32e7f9e58f Correct handling of local class / anonymous object cases for KT-10445 / KT-10042 2016-03-23 15:04:09 +03:00
Mikhail Glukhikh
b975b7d26e More accurate CFG for local class constructors (now they are not considered unconditionally executed) #KT-10042 Fixed 2016-03-23 15:04:05 +03:00
Mikhail Glukhikh
8756cba2f5 Minor: test renamed 2016-03-23 15:04:01 +03:00
Mikhail Glukhikh
bc4ec97043 Captured value initialization is no more allowed #KT-10445 Fixed 2016-03-23 15:03:50 +03:00
Anton Sukhonosenko
e8b665f600 #KT-10883 Fixed 2016-03-22 17:23:16 +01:00
Alexander Udalov
348125acb3 Fix visibility of protected classes in bytecode
Protected should be translated to public as in Java so that everything would
work at runtime. The real visibility is still saved to an InnerClasses
attribute

 #KT-8269 Fixed
 #KT-9246 Fixed
 #KT-10143 Fixed
2016-03-22 18:42:34 +03:00
Valentin Kipyatkov
28c5dde875 KT-7715 Highlight var's that can be replaced by val's
#KT-7715 Fixed
2016-03-22 18:01:52 +03:00
Ilya Chernikov
e5b5a8db42 Rollback partially a commit that dropped removePerfOutput functionality, fixes CompilerDaemonTest.testHelloApp
The commit was done by @yole in assumption that the function only affects PARF lines generated by compiler, but similar lines generated
by daemon infrastructure were affected as well, the mentioned test was failing since. CliBaseTest class was refactored, I place the removePerfOutput
function into AbstractCliTest class.
2016-03-22 11:15:38 +01:00
Michael Bogdanov
00cb2705da Add a test verifying anonymous object transform is performed correctly with ClassBuilder. 2016-03-21 18:37:28 +03:00
Ilya Gorbunov
1ae0040ca3 Minor: make variables initialized in defineClass lateinit instead of nullable. 2016-03-21 18:37:27 +03:00
Ilya Gorbunov
d9329456b5 ClassBuilder-to-ClassVisitor adapters should invoke methods of adapted ClassBuilder.
Call classBuilder.defineClass instead of ClassVisitor.visit.
Call classBuilder.newField instead of ClassVisitor.visitField.
2016-03-21 18:37:27 +03:00
Kirill Rakhman
146dca2cd6 Formatter: Remove spaces between expression and parentheses
#KT-11476 Fixed
2016-03-21 17:56:04 +03:00
Denis Zharkov
56477f0af8 Fix loading container type from Java
Load immutable flexible upper bound for 'Iterable<? super T>'

We load 'Collection<? super CharSequence>' as 'MutableCollection<in CharSequence>'
instead of 'MutableCollection<in CharSequence>..Collection<*>'
because it's obviously not typesafe to use any 'Collection<*>'
as argument for such type.

But there'se nothing bad with loading 'Iterable<? super CharSequence>'
as 'MutableIterable<*>..Collection<*>'. Same for other declarations that have
covariant mutable representation (currently Iterator, ListIterator).

Also there are useful use-cases when it's neccessary to use 'Iterable<*>'
as an argument for parameter with type 'Iterable<? super T>' (see matchers.kt test).

NB: Star-projections appear in examples because types like 'Collection<in CharSequence>'
with conflicting use-site projections are invalid in Kotlin, but they are valid in Java.
2016-03-21 16:46:46 +03:00
Denis Zharkov
c3e44ec199 Fix loading Java type arguments
Type arguments with use variance in java contradicting to Kotlin declaration-site variance should be loaded as star-projections

 #KT-11492 Fixed
2016-03-18 19:07:27 +03:00
Denis Zharkov
838fcf9a57 Load contavariantly projected collections in Java as mutable
#KT-3068 Fixed
2016-03-18 19:07:27 +03:00
Denis Zharkov
e54b25a35a Fix StackOverflowError while mapping recursive intersection-type
#KT-10972 Fixed
2016-03-18 19:07:27 +03:00
Denis Zharkov
67b59fa72f Prohibit nested intersection types in return position
#KT-11490 Fixed
2016-03-18 19:07:27 +03:00
Mikhail Glukhikh
90b5d3b9f5 Minor if-to-when refactoring 2016-03-18 18:54:01 +03:00
Mikhail Glukhikh
fa069214fd if to when intention now detects effectively else branches in subsequent code + performs more accurate comment handling #KT-10750 Fixed
Also #KT-11424 Fixed
2016-03-18 18:47:32 +03:00
Michael Bogdanov
c3d450f050 Fix for KT-11479: 1.0.2 Snapshot: CompilationException: Back-end (JVM) Internal error: Couldn't inline method call
#KT-11479 Fixed
2016-03-18 15:43:18 +01:00
Natalia Ukhorskaya
dde11b7f50 Report more info for errors from jdi 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya
6b4ea1ff19 Debugger: do not report errors from context file
#KT-11455 Fixed
2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya
6752d0f180 Descriptors from library source should be visible from descriptors from libraries class files 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya
5b489d1986 Debugger: use StackFrameProxy from IDEA instead of StackFrame from JDI to show error message when debug info in corrupted
#EA-76187 - IE: FrameVisitor.findLocalVariable Fixed
2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya
589d7007fc Skip additional visibility check for java classes in debug mode 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya
b79aa13242 Complete private members from libraries in Evaluate Expression dialog 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya
26c153639a Skip visibility check when resolving class in debug mode
#KT-11326 Fixed
2016-03-18 15:19:03 +03:00
Alexander Udalov
0fd8bec2ef Convert Java model to Kotlin, put in several files
Also move JavaPropertyInitializerEvaluator to ../components/
2016-03-18 14:48:58 +03:00
Alexander Udalov
0d74fc2290 Minor cleanup in Java model: fix warnings, remove unused 2016-03-18 14:48:57 +03:00
Alexander Udalov
0a54464420 Minor, JavaClass#getOriginKind -> isKotlinLightClass 2016-03-18 14:48:56 +03:00
Alexander Udalov
0ba0e2b10d Delete JavaTypeSubstitutorImpl, use PsiSubstitutor in JavaClassImpl
Also delete related tests
2016-03-18 14:48:56 +03:00
Alexander Udalov
291c713d8b Cleanup JavaElement model from methods used only in substitutor
Downcast everything used in JavaTypeSubstitutorImpl to *Impl, remove methods
from interfaces, inline/move some of them
2016-03-18 14:48:55 +03:00
Alexander Udalov
26bf0dca13 Remove interface JavaTypeSubstitutor, use implementation
After 151e55b JavaTypeSubstitutor is only used from inside PSI-based
implementation of Java structure
2016-03-18 14:48:55 +03:00
Alexander Udalov
e42cb2af40 Render 'annotation class not found' for error types in tests
After 13ae3d9 it became unclear whether an annotation mentioned in test data is
resolved or not, this change fixes that
2016-03-18 14:48:54 +03:00
Alexander Udalov
70dd79d7e4 Minor, rename TypeConstructorImpl -> ClassTypeConstructorImpl 2016-03-18 14:20:43 +03:00
Alexander Udalov
13ae3d96ab Simplify TypeConstructorImpl, extend it from AbstractClassTypeConstructor 2016-03-18 14:20:43 +03:00
Michael Bogdanov
b95e27fd87 Fix for KT-11478: "Couldn't inline method call" error
#KT-11478 Fixed
2016-03-18 11:07:47 +01:00
Denis Zharkov
ce8add2802 Fix common supertype calculation
Use star-projections instead of 'out Any?' in corner cases

 #KT-11468 Fixed
2016-03-18 10:12:00 +03:00
Mikhail Glukhikh
bace881463 Quick fix to make var with private setter final #KT-10859 Fixed 2016-03-17 18:18:07 +03:00
Mikhail Glukhikh
efdf6b9569 Minor 2016-03-17 17:47:10 +03:00
Alexey Tsvetkov
d1a8c0d09b Enable default incremental compilation by default in IDEA
#KT-11360 fixed
2016-03-17 15:47:51 +03:00
Denis Zharkov
fecb64560b Minor. Decrease method visibility 2016-03-16 20:23:42 +03:00
Denis Zharkov
d9a6d15fe4 Add tests for obsolete issues
#KT-4628 Obsolete
 #KT-3897 Obsolete
 #KT-3898 Obsolete
 #KT-7523 Obsolete
2016-03-16 20:23:36 +03:00
Denis Zharkov
bfa0b69ba9 Simplify SamCodegenUtil.getOriginalIfSamAdapter
At the monent adapters are either:
- synthetic extensions (no overrides)
- static members:
fake override always has one overridden from super class,
that should be created as a result of SamAdapterDescriptor.createSubsitutedCopy(),
hence should be instance of SamAdapterDescriptor
2016-03-16 20:23:01 +03:00
Denis Zharkov
1d0c37ff20 Cache read classes and method nodes for inline
It decrease GENERATE phase nearly for 10%
2016-03-16 20:23:01 +03:00
Denis Zharkov
26081bf817 Support loading Java annotations with TYPE_PARAMETER target 2016-03-16 20:23:01 +03:00
Denis Zharkov
04eb5ff4f7 Move test loading Java TYPE_USE annotation to Java8 module
#KT-11454 Fixed
2016-03-16 20:23:00 +03:00
Denis Zharkov
85329e59ca Remove nullability annotations attached to TYPE_USE position in tests
They do not work anyway by many reasons:
- 'org.jetbrains.annotations.*' are not TYPE_USE targeted
- raw type with annotated arguments is something very weird and should be
investigated
2016-03-16 20:23:00 +03:00
Denis Zharkov
e96024017f Move and fix tests on typeEnhancement with TYPE_USE annotations 2016-03-16 20:22:59 +03:00
Denis Zharkov
a644dd3ae9 Create tests for TYPE_USE nullability annotations
- tests and declarations for checkerframework has been moved,
because they only Java 8 targeted
- tests for eclipse annotations has been just copied,
because there are two jars: one for Java 8 and other for earlier versions
2016-03-16 20:22:59 +03:00
Denis Zharkov
3f3c2bb272 Minor. Update eclipse nullability annotation sources
Accordingly to their repository
2016-03-16 20:22:58 +03:00
Denis Zharkov
c9c9f7ff38 Minor. Simplify LazyJavaClassMemberScope.getFunctionsFromSupertypes 2016-03-16 20:22:58 +03:00
Denis Zharkov
78c9dffe00 Refine return type of MemberScope.getContributedFunctions 2016-03-16 20:22:58 +03:00
Denis Zharkov
50d258e7f4 Optimize CF merge operations
Return incoming value if it's single
2016-03-16 19:27:28 +03:00
Denis Zharkov
4bea054e4b Optimize TowerResolver.run implementation
- run `processor` at each level instead of list construction
- make it as lazy as possible

Speed up analysis time nearly for 2-5%
2016-03-16 19:27:28 +03:00
Nikolay Krasko
ee50aec734 Don't add a blank line between one line class and object (KT-10965) 2016-03-16 18:41:28 +03:00
Alexey Tsvetkov
61090d7027 Refactoring: optimize createDefaultSourceDirectorySet 2016-03-16 16:43:25 +03:00
Alexey Tsvetkov
d1abc87857 Fix NoSuchMethodError with Gradle 2.12
#KT-11351 fixed
2016-03-16 16:43:24 +03:00
Alexey Tsvetkov
d6c2f77125 Fix Process.waitFor freeze on windows when gradle daemon is stopped during tests 2016-03-16 16:43:24 +03:00
Alexander Udalov
b2cffeeb24 Fix 'IDE' scope file pattern by including 'src' recursively
See b328f37
2016-03-16 16:10:26 +03:00
NitroG42
c66f4450d8 Add new expressions to template
Added two missing expressions for live-templates, the className(), and
the functionName()
2016-03-16 13:40:33 +01:00
Zalim Bashorov
f00615c00b Minor: source sources of SourceToOutputMap when dump it to make IC tests more stable 2016-03-16 14:42:13 +03:00
Kirill Rakhman
48310d66da Implement quick fix for converting primitive types
#KT-10476 Fixed
2016-03-16 10:58:29 +01:00
Alexander Udalov
b328f37495 Add all IDE modules to scope 'IDE', exclude tests
Exclude test roots (add only src/* and testData/*) to prevent clash with the
built-in "Tests" scope
2016-03-16 12:52:20 +03:00
Nikolay Krasko
94e8ba7c4b "Code formatter doesn't remove spaces in single line properties" fixed (KT-11076)
#KT-11076 Fixed
2016-03-16 12:38:26 +03:00
Nikolay Krasko
2db888a646 Accurate work with adding/removing context of tests.
Need this because of KEEP_FIRST_COLUMN_COMMENT setting. Comments accidentally left on first
collumn cause the bad formatting.

 #KT-4175 Fixed
2016-03-16 12:38:24 +03:00
Nikolay Krasko
8ad0c1ac01 Force new line if the whitespace between comments doesn't have a line break
Tweeking KEEP_FIRST_COLUMN_COMMENT setting and one-line comments generated on the same line.

 #KT-4175 In Progress
2016-03-16 12:38:23 +03:00
Nikolay Krasko
85bc32a884 Adjust move code tests for KEEP_FIRST_COLUMN_COMMENT option
#KT-4175 In Progress
2016-03-16 12:38:21 +03:00
Nikolay Krasko
085deec717 Make J2K pay more attention to original formatting of comments. Better support for KEEP_FIRST_COLUMN_COMMENT
#KT-4175 In Progress
2016-03-16 12:38:20 +03:00
Nikolay Krasko
a9f11d2c64 Always add new line space with space before to deal with KEEP_FIRST_COLUMN_COMMENT option
InvertIfConditionIntention, RemoveBracesIntention tests are affected

 #KT-4175 In Progress
2016-03-16 12:38:19 +03:00
Nikolay Krasko
6193987d0d Reformat code should not align comments (KT-4175)
#KT-4175 In Progress
2016-03-16 12:38:17 +03:00
Natalia Ukhorskaya
334c6ba71a Refactoring: rename kotlin-android-plugin to idea-android 2016-03-15 20:26:14 +03:00
Natalia Ukhorskaya
d2de74226e Refactoring: rearrange dependencies in android modules 2016-03-15 20:25:54 +03:00
Natalia Ukhorskaya
ec9a6aacd5 Refactoring: move android-extensions-* module under separate module group 2016-03-15 20:25:52 +03:00
Natalia Ukhorskaya
78d4860215 Refactoring: rename android-jps-plugin to android-extensions-jps 2016-03-15 20:25:50 +03:00
Natalia Ukhorskaya
bf4c92d903 Refactoring: rename android-idea-plugin to android-extensions-idea 2016-03-15 20:25:48 +03:00
Natalia Ukhorskaya
7e6fa8ef17 Refactoring: rename android-compiler-plugin to android-extensions-compiler 2016-03-15 20:25:45 +03:00
Natalia Ukhorskaya
93161be199 Configure Kotlin: restore all changed files in undo action 2016-03-15 20:25:42 +03:00
Natalia Ukhorskaya
e31202ff7c Show only changed files in notification "Kotlin not configured" 2016-03-15 20:25:36 +03:00
Natalia Ukhorskaya
7c3dd3e139 Minor: fix warnings 2016-03-15 20:21:21 +03:00
Natalia Ukhorskaya
6b48eae03e Configure Kotlin for Android: add kotlin plugin to project build.gradle file.
Do not add mavenCentral dependency if jcenter is present
2016-03-15 20:20:24 +03:00
Natalia Ukhorskaya
e611154580 Minor: fix testData after e2d2d696c0d8b24ebe310fd880a912d6eb428872s 2016-03-15 14:53:03 +03:00
Ilya Gorbunov
02bb7f2f0d Remove the compiler option "Xmultifile-facades-open" 2016-03-15 14:10:33 +03:00
Natalia Ukhorskaya
e2d2d696c0 Add function name to fake local variable for inline argument 2016-03-15 13:25:49 +03:00
Mikhail Glukhikh
a830d80dac Values equality no more provides guarantee for their types equality (for open types or types with overridden equals) #KT-11280 Fixed 2016-03-15 11:01:39 +03:00
Michael Bogdanov
3eb6749377 Call done on when mapping transformation end 2016-03-15 10:04:28 +03:00
Alexander Udalov
4f77b02a58 Rename 'ins' -> 'Ins' in BuiltinsPackageFragment and related classes 2016-03-14 20:41:46 +03:00
Alexander Udalov
777ef32d65 Move AnnotationsImpl to frontend, delete unused DefaultAnnotationArgumentVisitor 2016-03-14 20:05:19 +03:00
Alexander Udalov
11409ec6cf Move some function type utilities from descriptors to frontend 2016-03-14 19:45:09 +03:00
Alexander Udalov
63eb6712eb Rename getParameterTypeProjectionsFromFunctionType -> getValueParameterTypesFromFunctionType
Also add getValueParametersCountFromFunctionType which doesn't create a new
list every time but only returns the number of value parameters
2016-03-14 19:45:08 +03:00
Alexander Udalov
5b7115dc38 Minor, drop deprecated KotlinBuiltIns.getExtensionFunction 2016-03-14 19:45:08 +03:00
Alexander Udalov
516484c905 Use DFS in isFunctionTypeOrSubtype
To prevent exponential working time on weird hierarchies
2016-03-14 19:24:18 +03:00
Alexander Udalov
117d0bcf03 Fix multiple exceptions related to subtypes of function types
The main change is in FunctionsTypingVisitor#visitLambdaExpression, where we
incorrectly allowed subtypes of function types to be expected type during
resolution of lambdas

Also see EA-70485

 #KT-9820 Fixed
2016-03-14 19:24:17 +03:00
Alexander Udalov
33ff1e1e29 Use correct function to check for function type in InlineParameterChecker
There's no use of noinline/crossinline modifiers on parameters of _subtypes_ of
function types

 #KT-11411 Fixed
2016-03-14 19:24:08 +03:00
Alexander Udalov
c18fab82e5 Simplify and rename function type utilities
- isFunctionType -> change the only usage in TracingStrategyForInvoke to check
  for exact function type
- isExtensionFunctionType -> change all usages to check for exact extension
  function type because extension function types are uninheritable in Kotlin
- isExactFunctionType -> isNonExtensionFunctionType
- isExactExtensionFunctionType -> isExtensionFunctionType
- isExactFunctionOrExtensionFunctionType -> isFunctionType
- isFunctionOrExtensionFunctionType -> isFunctionTypeOrSubtype
2016-03-14 19:24:07 +03:00
Alexander Udalov
e308f2acdb Minor, fix warnings and remove weird comments in KotlinBuiltIns 2016-03-14 19:24:07 +03:00
Alexander Udalov
2ce661af98 Rename KotlinBuiltIns.getFunctionType -> createFunctionType, move to functionTypes.kt 2016-03-14 19:24:06 +03:00
Alexander Udalov
fd344561fc Move static function type utilities from KotlinBuiltIns to functionTypes.kt 2016-03-14 19:24:05 +03:00
Mikhail Glukhikh
569a5888ff do...while (true) is now considered infinite loop in CFA #KT-3896 Fixed
Also #KT-3883 Fixed
Also #KT-4986 Fixed
2016-03-14 16:13:14 +03:00
Mikhail Glukhikh
4cf3ec3df2 Minor: ControlFlowInformationProvider cleanup 2016-03-14 16:13:05 +03:00
Mikhail Glukhikh
7232c5ccc1 Minor: FILE directives fixed in two tests 2016-03-14 15:49:50 +03:00
Michael Bogdanov
92f1a20d5f New name generation for transformed when classes 2016-03-14 12:22:06 +03:00
Michael Bogdanov
a72636afb8 Code clean 2016-03-14 11:26:51 +03:00
Michael Bogdanov
bec6126b06 Support when mapping transformation on inlining 2016-03-14 11:24:39 +03:00
Michael Bogdanov
b88260b4f9 RegenerationInfo renamed to TransformationInfo 2016-03-14 10:45:39 +03:00
Michael Bogdanov
c062fff633 All regeneration infos moved to one file 2016-03-14 10:45:38 +03:00
Michael Bogdanov
56d8e4d170 Old/NewClassName funs in RefenerationInfo converted to properties 2016-03-14 10:45:38 +03:00
Michael Bogdanov
bbb838765c Obtain regenerated class name through RegeneratedInfo 2016-03-14 10:45:37 +03:00
Michael Bogdanov
ddd992d3dd AnonymousObjectRegenerationInfo java->kotlin convertion 2016-03-14 10:45:37 +03:00
Michael Bogdanov
da76bf7b03 AnonymousObjectRegenerationInfo.java->AnonymousObjectRegenerationInfo.kt 2016-03-14 10:45:36 +03:00
Michael Bogdanov
7e3e1554fa Added canRemoveAfterTransformation method 2016-03-14 10:45:36 +03:00
Michael Bogdanov
8c9d8778eb Introduced base class for AnonymousObjectGeneration 2016-03-14 10:45:35 +03:00
Michael Bogdanov
c6007c91f7 AnonymousObjectGeneration refactoring 2016-03-14 10:45:35 +03:00
Michael Bogdanov
a0f050fc69 Removed AnonymousObjectGeneration from RegeneratedClassContext 2016-03-14 10:45:34 +03:00
Nikolay Krasko
60ee5441cf Update links in Editing Kotlin section 2016-03-13 19:53:18 +03:00
Mikhail Glukhikh
f76efb68f2 Strictfp on a class is now a warning #KT-11109 Fixed 2016-03-12 13:17:11 +03:00
Alexander Udalov
173a838f8c Minor, improve some usages of function type utilities
Re change in FunctionsHighlightingVisitor:
KBI#isFunctionOrExtensionFunctionType already takes care of supertypes, no need
to do additional loop
2016-03-11 21:11:25 +03:00
Alexander Udalov
52309cd10e Minor, drop handling of deprecated kotlin.Extension annotation 2016-03-11 21:11:24 +03:00
Alexander Udalov
90a48d3b35 Minor, move some utilities out of FunctionDescriptorUtil 2016-03-11 21:11:24 +03:00
Alexander Udalov
994dc46bcd Write nullability annotations on extension receiver parameters
#KT-5429 Fixed
2016-03-11 15:20:32 +03:00
Pavel V. Talanov
597c571f25 Fix diagnostic range when some qualifier is unresolved in "@a.b.c.Anno"
#KT-7747 Fixed
2016-03-11 15:00:02 +03:00
Natalia Ukhorskaya
35271af07c Do not convert invalid files to Kotlin 2016-03-11 13:56:10 +03:00
Natalia Ukhorskaya
468c869c0c Show notification for files converted to Kotlin after project sync 2016-03-11 13:56:07 +03:00
Natalia Ukhorskaya
ebaf9899b0 Convert Java Activity to Kotlin after gradle sync finished 2016-03-11 13:56:05 +03:00
Natalia Ukhorskaya
40e89c76a9 Android: add action to create new activity on Kotlin
#KT-11264 Fixed
2016-03-11 13:56:02 +03:00
Natalia Ukhorskaya
b50f2dc6e5 J2K: Use parameters nullability for method call 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya
c1df0e4aeb Minor: include AbstractJavaToKotlinCopyPasteConversionTest from idea module to J2K Tests run configuration 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya
c928237699 J2K: drop line breaks in some polyadic expressions 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya
f1b6bf7817 J2K: convert comments inside qualified expression correctly 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya
405b0b1df6 J2K: convert annotations in annotations parameters correctly
#KT-11126 Fixed
2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya
7d594970ff J2K: convert protected member used outside of inheritors as public 2016-03-11 12:08:10 +03:00
Alexey Tsvetkov
52be775f28 Minor: add two accidentally deleted files to test case 2016-03-11 02:43:31 +03:00
Alexey Tsvetkov
d352905a72 Add incremental tests for parameters with default values 2016-03-10 23:36:40 +03:00
Ilya Gorbunov
d6506d9770 Minor: reformat code in JS stdlib 2016-03-10 23:24:29 +03:00
Alexey Tsvetkov
d7cda17d2a Minor: make it possible to run gradle incremental tests on CI
* Rename test so it won't be run by maven's integration-test phase
* Adjust allocated heap size
2016-03-10 23:00:11 +03:00
Pavel V. Talanov
5de4ce6f57 Minor, FunctionCodegen: add additional logging on missing function descriptor
Trying to diagnose light class building failures
2016-03-10 19:49:04 +03:00
Pavel V. Talanov
fc16d7c4fd Refactor, minor: extract exception logging to an util object 2016-03-10 19:49:03 +03:00
Pavel V. Talanov
9a5650a045 Add KtPsiFactory#createFileWithLightClassSupport
Allows to create light classes for KtFile built from text
2016-03-10 19:41:59 +03:00
Pavel V. Talanov
4246c7f326 Refactor: Provide API to create KtLightClassForFacade by synthetic file 2016-03-10 19:41:57 +03:00
Pavel V. Talanov
725f128b64 Minor: remove obsolete properties from KtLightClassForFacade 2016-03-10 19:41:55 +03:00
Michael Bogdanov
c38f28fb08 Restore last inline function call site line number on lambda inlining into @InlineOnly function 2016-03-10 17:08:17 +03:00
Denis Zharkov
2e9075115b Minor. Specify type arguments explicitly
Otherwise strange compilation error appears (see KT-11323)
2016-03-10 16:49:00 +03:00
Denis Zharkov
151e55b2fa Use descriptors for building SAM constructors
It helps to get rid of semantics duplicating and fixes known bugs

- SOE in OnlyAbstractMethodFinder.find
- type enhancement for SAM constructors

 #KT-11287 Fixed
 #KT-11322 Fixed
 EA-77989 Fixed
2016-03-10 16:49:00 +03:00
Denis Zharkov
b8b48c5f98 Extract common logic into AbstractTypeConstructor
Mostly it's about detecting loops in supertypes

Test data changes:
- Loops are being disconnected in Java classes too
- functions.kt: loops disconnection mechanism runs supertypes calculation,
so when we start check T it forces F' supertypes calculation, that ends
with CYCLIC_GENERIC_UPPER_BOUND reported on F

 #KT-11287 In Progress
2016-03-10 16:49:00 +03:00
Denis Zharkov
ea9f1b5649 Minor. Pull up method 2016-03-10 16:49:00 +03:00
Nikolay Krasko
d45fc3bad7 Avoid warnings from idea core during file system initialization on Windows.
Do not use idea custom file system for now.
See FileSystemUtil.java and IdeaWin32.java files for details.
2016-03-10 13:32:08 +03:00
Nikolay Krasko
518bd76f35 Don't write false values in SetSlice to binding context
Optimization is significant for USED_AS_RESULT_OF_LAMBDA slice
2016-03-10 13:30:02 +03:00
Nikolay Krasko
71f91c5ce7 Attempt to drop debug name for traces 2016-03-10 13:30:01 +03:00
Michael Bogdanov
1a5bf33190 Fix for KT-11034: Private set with @JvmStatic lateinit var doesn't compile
#KT-11034 Fixed
2016-03-10 10:17:27 +03:00
Ilya Gorbunov
856dd7d909 Minor: make AbstractBackspaceHandlerTest really abstract.
#KT-5728
2016-03-10 05:54:03 +03:00
Ilya Gorbunov
92003f626b kotlin.test: Make inline methods 'todo' and 'currentStackTrace' @InlineOnly not to loose stack trace.
Move related tests to separate file and verify the line numbers.
#KT-11348 Fixed
2016-03-10 04:28:24 +03:00
Pavel V. Talanov
c3a1643c6c Add test for obsolete KT-6481 Mark deprecated constructor calls with strikethrough 2016-03-09 18:41:00 +03:00
Alexey Tsvetkov
df3f163ee2 JS: inline safe calls
#KT-6912 fixed
2016-03-09 16:25:01 +03:00
Dmitry Jemerov
956e9f3847 Merge pull request #828 from cypressious/smart_lambda_param
Implement Smart Enter Processor for adding a lambda block
2016-03-09 12:39:19 +01:00
Kirill Rakhman
828a7de980 Simplify logic for last lambda fixer and set caret directly in first pass 2016-03-09 12:35:48 +01:00
Dmitry Jemerov
9cb980b211 Merge pull request #825 from mcgee/KT-5728
#KT-5728 Fixed
2016-03-09 12:27:36 +01:00
Alexander Udalov
8f7047817f Fix debugger testData after improving toString() of lambdas 2016-03-09 13:41:00 +03:00
Alexander Udalov
eef3631b8a Improve toString() for lambdas and function expressions
#KT-9952 Fixed
2016-03-09 10:49:26 +03:00
Alexander Udalov
bab127ad33 Remove some legacy codegen tests, move some to generated 2016-03-09 10:25:38 +03:00
Alexander Udalov
f8dfaf4599 Merge boxWithJava testData into box, delete BoxWithJava test 2016-03-09 10:25:38 +03:00
Alexander Udalov
16a0ddd2fb Merge boxMultiFile testData into box, delete BoxMultiFile test 2016-03-09 10:25:38 +03:00
Alexander Udalov
e115f80d6c Remove traces of 'boxWithStdlib' directory in other tests 2016-03-09 10:25:38 +03:00
Alexander Udalov
06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00
Alexander Udalov
22bfc9786a Add WITH_RUNTIME or WITH_REFLECT to boxWithStdlib testData 2016-03-09 10:25:38 +03:00
Alexander Udalov
2564a2f91f Do not include kotlin-reflect at runtime by default in codegen tests
Change some tests to either include reflection or to avoid using it
2016-03-09 10:25:38 +03:00
Alexander Udalov
20e36438e2 Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
2016-03-09 10:25:38 +03:00
Alexander Udalov
54a615fcd3 Support inlining 'arrayOf' and 'emptyArray' with no stdlib in classpath
Previously an exception was thrown on trying to inline arrayOf/emptyArray when
compiling with "-no-stdlib" (or in tests without a dependency on the stdlib),
because these functions were found in a built-in package fragment which does
not have the bytecode associated with it
2016-03-09 10:25:38 +03:00
Kirill Rakhman
f7af927e8f Don't set parameter names and register unresolved error correctly 2016-03-08 22:44:13 +01:00
Anton Sukhonosenko
5bb8bf7381 #KT-5728 Fixed
Code review fixes
2016-03-08 22:30:14 +03:00
Anton Sukhonosenko
31fea1d2b7 #KT-5728 Fixed 2016-03-08 22:30:07 +03:00
Dmitry Jemerov
bb4397612d fix tests: add inspection description 2016-03-08 19:04:23 +01:00
Dmitry Jemerov
649517be3a disable inspection by default 2016-03-08 17:43:25 +01:00
Manas Chaudhari
f54f56d86b Add quickfix for adding documentation 2016-03-08 17:43:16 +01:00
Manas Chaudhari
88fcad02a9 Implement Missing Documentation Inspection
#KT-1494 Fixed
2016-03-08 17:41:18 +01:00
Dmitry Jemerov
3626e90788 use Kotlin icon for Gradle framework support provider 2016-03-08 17:20:39 +01:00
Dmitry Jemerov
bfbd76cc14 KotlinIconProvider: J2K and cleanup 2016-03-08 17:20:36 +01:00
Dmitry Jemerov
26ebc075f4 KotlinIconProvider: rename to .kt 2016-03-08 17:20:32 +01:00
Dmitry Jemerov
ad48ff6a9e use regular Kotlin icon to represent Kotlin run configurations, leave old LAUNCH icon only for REPL
#KT-11041 Fixed
2016-03-08 17:20:30 +01:00
Dmitry Jemerov
94fc58885a use 16x16 icons for framework types and library presentations 2016-03-08 17:20:28 +01:00
Denis Zharkov
68f411395a Fix bridge generation for special builtin override
Use method itself signature as common bridge delegate

 #KT-11285 Fixed
2016-03-07 09:26:02 +03:00
Stanislav Erokhin
11f05005f6 Minor. Update run configuration Update-Dist-Run. 2016-03-07 06:14:21 +03:00
Kirill Rakhman
12237c3cba test lambda parameter smart enter processor 2016-03-05 00:49:26 +01:00
Ilya Gorbunov
9233d5a825 Minor: do not throw error immediately, return error message to 'require' who shall throw an IllegalArgumentException by itself. 2016-03-04 20:28:07 +03:00
Nikolay Krasko
79c00e14ca Restore structure of sources roots 2016-03-04 19:11:19 +03:00
Nikolay Krasko
2e7ac5e4bf Comment target to make changes more noticeable 2016-03-04 19:11:18 +03:00
Nikolay Krasko
ea340f2392 Do not depend on MOVE_SEARCH_FOR_REFERENCES_FOR_FILE global setting
Always search for references if something is under source root and disable search otherwise.

 #KT-11277 Fixed
2016-03-04 19:10:59 +03:00
Nikolay Krasko
8397a4cb5b Don't intercept move when there're no kotlin files
#KT-11277 Fixed
2016-03-04 19:10:05 +03:00
Mikhail Glukhikh
f9034fccb4 Changelog file 2016-03-04 17:09:46 +03:00
Pavel V. Talanov
1affb05b7b Fix typechecker in case of "for ((a, b) in) { }"
Fixes NDFDE
2016-03-04 16:52:34 +03:00
Pavel V. Talanov
363d545bd5 Parameters of function types are always considered local 2016-03-04 16:52:33 +03:00
Pavel V. Talanov
e121ef0fdc Add additional check to AbstractPsiCheckerTest
Check that KtDeclaration.resolveToDescriptor() utility does not throw
2016-03-04 16:52:32 +03:00
Pavel V. Talanov
37500e2cd5 Throw ISE earlier on passing certain types of declaration to ResolveSession#resolveToDescriptor() 2016-03-04 16:52:31 +03:00
Valentin Kipyatkov
5757a306aa Should fix EA-75417 2016-03-04 16:30:25 +03:00
Valentin Kipyatkov
7ba39bd8cf J2K: refactoring - AccessorBodyToExpression processing can be expressed as intention-based 2016-03-04 16:30:25 +03:00
Valentin Kipyatkov
05dc4c1c48 ResolutionFacade for synthetic files should be invalidated on changes in these synthetic files
Fixed EA-77017
2016-03-04 16:30:24 +03:00
Nikolay Krasko
28e85517eb Update project icon 2016-03-04 15:32:44 +03:00
Nikolay Krasko
bee13cd246 Update to IDEA 15.0.4 (143.2287.1) 2016-03-04 15:32:42 +03:00
Alexey Tsvetkov
a3893a3c2e Test IC for adding private inline function
#KT-9681 fixed
2016-03-04 15:11:27 +03:00
Alexey Tsvetkov
9523a8b88d Add missing enum entry added/removed tests
#KT-6200 fixed
2016-03-04 14:43:52 +03:00
Dmitry Petrov
3bbd8979e4 KT-9670: optimize Class <-> KClass wrapping/unwrapping as a special case of boxing/unboxing.
NB doesn't work for arrays of classes.
2016-03-04 10:14:21 +03:00
Dmitry Petrov
2ecb8896cc Converting optimization.boxing to Kotlin: convert & simplify 2016-03-04 10:14:21 +03:00
Dmitry Petrov
0555464a3b Converting optimization.boxing to Kotlin: rename files 2016-03-04 10:14:21 +03:00
Kirill Rakhman
a7ac01ee6f Implement Smart Enter Processor for the last function call argument being a lambda
Fixes #KT-6785
2016-03-03 23:48:29 +01:00
Dmitry Petrov
8660800af7 Constraint system builder shouldn't drop nullability when comparing signatures for specificity. 2016-03-03 19:23:43 +03:00
Dmitry Petrov
8a2b80fe3f Generalize signature comparison: checking for conflicting overloads.
Also, vararg parameter no longer conflicts with Array<out T>
(CONFLICTING_JVM_DECLARATIONS is reported, can be avoided using @JvmName).
2016-03-03 18:26:10 +03:00
Dmitry Petrov
4ac05f1cd8 Generalize signature comparison: callable references overloading conflict resolution. 2016-03-03 18:26:10 +03:00
Dmitry Petrov
c5f3cbc645 Generalize signature comparison: make it work for regular call overloading conflict resolution. 2016-03-03 18:26:10 +03:00
Dmitry Petrov
022162322d Introduce "flat signature" - a generalized abstraction for a (call) signatures that can be compared for specificity. 2016-03-03 18:26:10 +03:00
Dmitry Petrov
77b7128689 Check conflicting overloads for generic signatures. 2016-03-03 18:26:09 +03:00
Nikolay Krasko
ab962d9bae New project wizard with Gradle and Kotlin creates build.gradle with absent version (KT-11213)
#KT-11213 Fixed
2016-03-03 17:19:21 +03:00
Nikolay Krasko
b8ac6e27f5 Cache and postpone requests for plugin update status from UnsupportedAbiVersion notification 2016-03-03 17:19:21 +03:00
Nikolay Krasko
33b65ec692 Refactoring: remove updateHighlightingResult() method as all usages called it with false 2016-03-03 17:19:21 +03:00
Nikolay Krasko
d09139e53a Minor: add private modifiers 2016-03-03 17:19:21 +03:00
Nikolay Krasko
7e39c2321a Show the hint how to resolve incompatible ABI library problem (KT-11024) 2016-03-03 17:19:21 +03:00
Alexander Udalov
04eea69a82 Fix Java 8 codegen box tests 2016-03-03 17:08:47 +03:00
Alexey Tsvetkov
4aa171c1b3 Minor: wait for gradle daemon to stop in tests
KT-8487
2016-03-03 16:45:20 +03:00
Alexey Tsvetkov
2140c270d7 Minor: replace warning with an assert
KT-8487
2016-03-03 16:45:20 +03:00
Alexey Tsvetkov
6ab868ae33 Print file paths relative to project root in gradle incremental compilation logs
KT-8487
2016-03-03 16:45:20 +03:00
Alexey Tsvetkov
8a0bd9446b Minor: remove duplicated daemon stop in tests
KT-8487
2016-03-03 16:45:20 +03:00
Alexey Tsvetkov
6574f60730 Minor: ignore some incremental tests for gradle
KT-8487
2016-03-03 16:45:20 +03:00
Alexey Tsvetkov
ba386f031b Pass isPackage = false when processing class proto
KT-8487
2016-03-03 16:45:20 +03:00
Alexey Tsvetkov
eff972d613 Recompile files with errors next time
KT-8487
2016-03-03 16:45:19 +03:00
Alexey Tsvetkov
7dc35aa343 Always call after compile hook
KT-8487
2016-03-03 16:45:19 +03:00
Alexey Tsvetkov
402436f3eb Add dummy files to fix gradle incremental tests
Gradle won't call kotlin task if source directory is empty

KT-8487
2016-03-03 16:45:19 +03:00
Alexey Tsvetkov
be44db7bd3 Rebuild and compare output class files in gradle incremental tests
KT-8487
2016-03-03 16:45:19 +03:00
Alexey Tsvetkov
9e3284ff2a Make some functions private in classFileComparison.kt
KT-8487
2016-03-03 16:45:19 +03:00
Alexey Tsvetkov
7a7562d685 Build incremental testing utils to kotlin-build-common-test.jar
KT-8487
2016-03-03 16:45:19 +03:00
Alexey Tsvetkov
239e217d19 Move DebugXProtoBuf classes to build-common
KT-8487
2016-03-03 16:45:19 +03:00
Ilya Chernikov
42cbd940c3 simple test on dependent module recompilation
KT-8487
2016-03-03 16:45:18 +03:00
Ilya Chernikov
1f83745862 Fixing destination dir handling to avoid warning from kotlin compiler
KT-8487
2016-03-03 16:45:18 +03:00
Ilya Chernikov
b470bdda23 Class added to proguard - was missing in gradle plugin when incremental compilation is on
KT-8487
2016-03-03 16:45:18 +03:00
Alexey Tsvetkov
7e6c1c75f4 Remove classfile for modified files too
KT-8487
2016-03-03 16:45:18 +03:00
Alexey Tsvetkov
af0925056e Use fresh wrapper version
KT-8487
2016-03-03 16:45:18 +03:00
Alexey Tsvetkov
d730cff88a Add new gradle wrapper to tests
KT-8487
2016-03-03 16:45:18 +03:00
Alexey Tsvetkov
3b697e8693 Minor: simplify File.isKotlinFile utility function
KT-8487
2016-03-03 16:45:18 +03:00
Alexey Tsvetkov
f2cde80aaf Minor: remove unused functions
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
df157f9db3 Reuse incremental test modification utils from build-common
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
8df209b436 Move incremental test modification utils to build-common
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
f4aed97d52 Extract incremental test modification utils
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
62dce975b3 Fix case when there are only removed kotlin files
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
7856bd5d0a Add log parser tests
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
4f2f0f0a60 Remove dependency on kotlin-test in IC test
KT-8487
2016-03-03 16:45:17 +03:00
Alexey Tsvetkov
f3079a3b75 Add kotlin test to gradle incremental build tests dependencies
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
8e4c11a1e6 Allow using more memory for gradle tests
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
9fba1a9c71 Move gradle test settings to separate files
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
a5b28ac62a Recompile subclasses in gradle
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
1893a6e15b Remove getting lookups with generated classes fq-names
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
c955a399a3 Exclude from compilation only files that were compiled at last iteration
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
f93562299c Reuse code from build-common
KT-8487
2016-03-03 16:45:16 +03:00
Alexey Tsvetkov
a5e3ca3596 Minor: change formatting, add logging
KT-8487
2016-03-03 16:45:15 +03:00
Alexey Tsvetkov
a13cf73a5b Minor: put files to set
KT-8487
2016-03-03 16:45:15 +03:00
Alexey Tsvetkov
579b49c7f3 Compile using -module xml
KT-8487
2016-03-03 16:45:15 +03:00
Alexey Tsvetkov
5028184c2a Minor: remove commented code
KT-8487
2016-03-03 16:45:15 +03:00
Alexey Tsvetkov
fa86653ddd Minor: optimize imports
KT-8487
2016-03-03 16:45:15 +03:00
Ilya Chernikov
6b9c3e5eb6 placing incremental compilation under "experimentalIncremental" option
KT-8487
2016-03-03 16:45:15 +03:00
Ilya Chernikov
819735e073 Adding extended gradle incremental cache implementation with map from sources to classfiles and some exposed functionality from parent class, using it to clean classfiles and find dirty lookups from removed files, refactoring dirty lookup calculation
KT-8487
2016-03-03 16:45:15 +03:00
Ilya Chernikov
4be395dcee Implementing weak variant of testing for jps-based tests - test passes if gradle compiles at least all expected files, but if it compiles more - it is not a failure; using this variant for parametrized tests
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
ddf3ca276b Implementing workaround for not being able to set java task classpath statically and therefore making it unable to detect changes in kotlin classes
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
df63fc30f6 (temp) disabling copying on kotlin-build-sources.jar in attempt to run maven build on TC
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
4809e8755e Implementing daemon restart mechanism to prevent problems with low memory watcher (TODO: investigate!)
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
c6fe18fbe0 Adding runtime dependency to incremental tests's build.gradle, fixes some tests from jps
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
a1ddbb3fe5 skipping tests that using "touch" modification, since gradle do not consider mere timestamp touching as a change and do not call kotlin plugin on it
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
c5617f1274 Adding automated parametrized tests for all jps-plugin tests
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
7b54751092 Implementing test infrastructure for chcking incremental builds and for importing and executing jps-lugin tests, adding several tests manually
KT-8487
2016-03-03 16:45:14 +03:00
Ilya Chernikov
cde89cb1e8 Implementing support for running gradle tests with daemon
KT-8487
2016-03-03 16:45:13 +03:00
Ilya Chernikov
9498235407 Adding cashes versios handling, refactoring sources to compile computing, minor output refactorings
KT-8487
2016-03-03 16:45:13 +03:00
Ilya Chernikov
db3b6ff10b Switching gradle plugin to incremental compilation based on build lib
KT-8487
2016-03-03 16:45:13 +03:00
Ilya Chernikov
d3d854ec7d Preparing build lib for migrating gradle plugin on it: moving ArgumentUtils from jps plugin, adding buildUtils with incremental compilation functions extracted from kotlinBuilder, minor tweak to lookup storage dump
KT-8487
2016-03-03 16:45:13 +03:00
Ilya Chernikov
6789f2ff0f adding build lib to maven part, adding it's contents to kotlin-compiler-embeddable
KT-8487
2016-03-03 16:45:13 +03:00
Ilya Chernikov
ebae665b78 Adding missing keep statement to proguard config
KT-8487
2016-03-03 16:45:13 +03:00
Ilya Chernikov
d4a86b7f6d Generate proper sources jar for compiler-embeddable, fixing problem with locating embeddable compiler jar in tests, revealed by the change
KT-8487
2016-03-03 16:45:12 +03:00
Ilya Chernikov
66f1f87757 Additional check of analyze resul, prevents a problem of passing BindingContext.EMPTY to the generation stage, fixes kapt tests in gradle plugins
KT-8487
2016-03-03 16:45:12 +03:00
Alexander Udalov
daab3db062 Add WITH_RUNTIME and WITH_REFLECT directives to box tests
Currently all tests in boxWithStdlib/ run with both runtime and reflection
included; eventually they'll be merged into box/ using these directives
2016-03-03 16:11:21 +03:00
Alexander Udalov
f47cc5ce2f Fix runtime dependency in codegen/box tests, delete old doTestWithStdlib logic
Codegen tests in "compiler/testData/codegen/box" started to run with
ConfigurationKind.ALL accidentally in 933be1e. This commit fixes it
2016-03-03 16:08:18 +03:00
Alexander Udalov
5488972b53 Minor, don't create empty tmpdir in codegen tests w/o Java 2016-03-03 16:08:18 +03:00
Alexander Udalov
d011fa8dc6 Add FULL_JDK to tests in codegen/boxWithStdlib/fullJdk/
Drop the old scheme which relied on the directory name
2016-03-03 16:08:18 +03:00
Alexander Udalov
dc085c45b7 Improve exception on creating KClass for classes which are not classes in Kotlin 2016-03-03 16:08:18 +03:00
Alexander Udalov
4553afbd0c Make PropertyAccessorDescriptor#hasBody a front-end utility 2016-03-03 16:08:18 +03:00
Alexander Udalov
ae14d185eb Support setters for Java-method-based properties in reflection
Also heuristically support the corner case of multiple properties with the same
name and signature in a Java class, see the comment in
KDeclarationContainerImpl

 #KT-11258 Fixed
2016-03-03 16:08:18 +03:00
Alexander Udalov
14b1a3a048 Don't fail on requesting members of Java collection classes
RuntimeTypeMapper assumed that JavaPropertyDescriptor was necessarily backed by
JavaField, which has changed when we started to load Java method (or a pair of
methods) overriding a Kotlin property as a property, not as a method. Another
example of this situation is special built-in properties which are mapped to
Java methods, e.g. java.util.Collection#size() <-> kotlin.Collection#size. This
change adds support for the case of a property backed by a JavaMethod.

Note that callable references or usage of any reflection API related to
built-in members is not supported anyway and will currently fail with errors

 #KT-11258 Fixed
2016-03-03 16:08:18 +03:00
Alexander Udalov
6429dd4b04 Preserve JavaPropertyDescriptor type in substitution/copy
JavaPropertyDescriptor.substitute should return JavaPropertyDescriptor,
similarly to what's happening in JavaMethodDescriptor
2016-03-03 16:08:18 +03:00
Alexander Udalov
371051b1d6 Filter out package members from other facades in KPackageImpl
#KT-10690 Fixed
2016-03-03 16:08:18 +03:00
Alexander Udalov
1c0bbcd72b Fix KProperty.javaField for fake overrides
#KT-8131 Fixed
2016-03-03 16:08:18 +03:00
Michael Bogdanov
534a3a11d6 Write additional type parameters for DefaultImpls methods, fix for KT-11121: BadClassFile exception for interface implemented generic properties
#KT-11121 Fixed
2016-03-03 16:11:31 +03:00
Valentin Kipyatkov
5aca50b4ca Enhanced constructor descriptor should not loose its source!
#KT-11256 Fixed
2016-03-02 21:43:43 +03:00
Valentin Kipyatkov
508e1937d6 More diagnostic for EA-75975 2016-03-02 21:43:42 +03:00
Valentin Kipyatkov
135ec78d7d Fixed EA-70945 2016-03-02 21:43:42 +03:00
Alexander Udalov
65662d7c99 Remove incorrect test, to be reconsidered in the future
Before 3ca4097, 'set' signature was not checked at all in this case

 #KT-11272 Open
2016-03-02 20:44:23 +03:00
Dmitry Jemerov
386f22480f don't crash on startup in case of corrupted plugin installation
#KT-11230 Fixed
2016-03-02 18:17:36 +01:00
Alexander Udalov
e849792712 Minor, add KCallableImpl#container 2016-03-02 19:01:10 +03:00
Alexander Udalov
4779e3e9cf Drop traces of old annotations from kotlin.jvm.internal 2016-03-02 19:01:04 +03:00
Alexander Udalov
c93517bc2f Minor, fix test data 2016-03-02 19:00:50 +03:00
Dmitry Jemerov
661c87e464 minor: rename "jet" to "kotlin" in a couple of variable names 2016-03-02 16:47:43 +01:00
Stanislav Erokhin
5141d95a88 Refactoring. Remove dependence intellij-core from resolution module 2016-03-02 18:07:41 +03:00
Stanislav Erokhin
9338aa5633 Refactoring. Copy SmartList from IDEA to util.runtime module. 2016-03-02 18:07:40 +03:00
Alexander Udalov
8e77e16bbd Remove leftovers of platformName and platformStatic in test data
Drop unnecessary imports, rename some tests
2016-03-02 16:47:04 +03:00
Alexander Udalov
beb11e7ac1 Minor, don't create unnecessary class loader in OuterClassGenTest
Read the bytes from the file instead
2016-03-02 15:47:40 +03:00
Alexander Udalov
f1bb31d0a9 Minor, inline one overload of CodegenTestUtil.compileJava 2016-03-02 15:47:40 +03:00
Alexander Udalov
933be1e035 Drop single-file mode of black box codegen tests
Add regression test for #KT-5190
2016-03-02 15:47:39 +03:00
Alexander Udalov
2de7f38427 Migrate boxWithJava tests to multi-file framework 2016-03-02 15:47:38 +03:00
Alexander Udalov
0801ae5364 Minor, delete weird intermediate git files 2016-03-02 15:47:38 +03:00
Alexander Udalov
e7371d2c1a Minor, move boxAgainstJava logic to a separate test class 2016-03-02 15:47:37 +03:00
Alexander Udalov
280ad195ee Migrate boxAgainstJava tests to multi-file framework 2016-03-02 15:47:36 +03:00
Alexander Udalov
26de87d792 Minor, make CodegenTestUtil.compileJava take absolute paths of files 2016-03-02 15:47:36 +03:00
Alexander Udalov
12cf70ac38 Delete legacy codegen tests with Java on annotations
After cleanup, these tests are now duplicated with those in
boxAgainstJava/annotations/
2016-03-02 15:47:35 +03:00
Alexander Udalov
9f67fe2fe3 Adapt CompileKotlinAgainstKotlin test to black box format
Rename/remove some obsolete test cases
2016-03-02 15:47:35 +03:00
Alexander Udalov
0b26e749f6 Improve multi-file test framework in CodegenTestCase
Instead of inheriting from KotlinMultiFileTestWithJava, invoke
KotlinTestUtils.createTestFiles directly. This helps to avoid constructing
unnecessary environment (createEnvironment() was called in setUp, but codegen
tests ignored the created environment because it's not possible to do
generically in codegen tests; the environment kind depends on the source file
usually)
2016-03-02 15:44:28 +03:00
Alexander Udalov
4b96a8131b Inline KotlinLiteFixture 2016-03-02 15:44:28 +03:00
Alexander Udalov
12b6a4ede4 Obsolete KotlinLiteFixture, move utilities to CheckerTestUtilTest 2016-03-02 15:44:28 +03:00
Alexander Udalov
647e188a08 Migrate bytecode text tests to multi-file framework
Get rid of BytecodeTextMultifileTestGenerated
2016-03-02 15:44:28 +03:00
Dmitry Jemerov
fbc2fe74ad Merge pull request #826 from cypressious/catch_fixer
Implement smart enter processors for try, catch (parameters and body) and finally
2016-03-02 13:21:32 +01:00
Dmitry Petrov
9244ef9b81 Do not use 'dup' for postfix increment/decrement: can't do it with collection element in general.
KT-11190, KT-11191, KT-11192, KT-11200, KT-11206
2016-03-02 14:28:06 +03:00
Dmitry Petrov
3ca4097bcc KT-11203: report errors on read-write operations for elements of collections with inconsistent get&set signatures 2016-03-02 14:28:06 +03:00
Mikhail Glukhikh
cd91e44451 Minor fix: intention description directory renamed 2016-03-02 14:13:02 +03:00
Denis Zharkov
eb2c584578 Rename JetTypeMapper 2016-03-02 13:38:46 +03:00
Denis Zharkov
56a2561ab9 Extract JvmMethodGenericSignature from JvmMethodSignature 2016-03-02 13:38:46 +03:00
Denis Zharkov
7bd8fa0b48 Optimize signature propagation
Do not collect super function with trivial signature
2016-03-02 13:38:46 +03:00
Denis Zharkov
d66b9a08dd Do not map generic signature if it's unnecessary 2016-03-02 13:38:46 +03:00
Denis Zharkov
5690d58fd0 Memoize package views in module 2016-03-02 13:38:46 +03:00
Denis Zharkov
4583283515 Search classes by JavaClass through package scope 2016-03-02 13:38:46 +03:00
Denis Zharkov
26ebf46e3e Do not read module mappings more than once 2016-03-02 13:38:46 +03:00
Denis Zharkov
3652cd9c18 Optimize top level class searching in LazyJavaPackageScope
Do not try to search something, that is known not to exist
2016-03-02 13:38:46 +03:00
Denis Zharkov
beb24af5ef Devirtualize calls to PackageFragmentDescriptorImpl.fqName
1. Replace INVOKEINTERFACE with INVOKEVIRTUAL
2. Make callee function final

It helps to decrease one module compilation time by 1-2 seconds
2016-03-02 13:38:46 +03:00
Dmitry Jemerov
3cc3b3fce2 cleanup: remove dead code from ProjectStructureUtil, move code used only during project configuration to ConfigureKotlinInProjectUtils; move function from KotlinRuntimeLibraryCoreUtil into KotlinRuntimeLibraryUtil 2016-03-02 11:15:06 +01:00
Dmitry Jemerov
828e53ce82 reuse Gradle external system ID 2016-03-02 11:15:05 +01:00
Dmitry Jemerov
13f4053950 detect Kotlin source roots
#KT-8592 Fixed
2016-03-02 11:15:03 +01:00
Dmitry Jemerov
8f2dd2c821 better presentation for the list of modules with Kotlin files
#KT-9025 Fixed
2016-03-02 11:15:02 +01:00
Dmitry Jemerov
d994e442da support new IDEA API to allow configuring a Java/JS runtime without prompting the user 2016-03-02 11:15:01 +01:00
Dmitry Jemerov
4ea05354c7 move the calculation of configure kotlin notification out of EDT
#KT-10541 Fixed
2016-03-02 11:15:00 +01:00
Dmitry Jemerov
1976e5f3b0 ConfigureKotlinNotification: J2K and cleanup 2016-03-02 11:14:59 +01:00
Dmitry Jemerov
a6716d9160 ConfigureKotlinNotification: rename to .kt 2016-03-02 11:14:58 +01:00
Dmitry Jemerov
207c5e188b correctly detect Gradle modules (previous code, besides being crazy overcomplicated, didn't always work because module.getModuleFile() returns null immediately after a project has been imported from Gradle and before it has been saved) 2016-03-02 11:14:56 +01:00
Dmitry Jemerov
edcd469e44 API for configuring Kotlin without notification
#KT-11089 Fixed
2016-03-02 11:14:54 +01:00
Dmitry Jemerov
28406bb1fb update URL for Gradle documentation 2016-03-02 11:14:53 +01:00
Dmitry Jemerov
c081a0c758 don't show pre-1.0 versions of Kotlin in "Configure Kotlin in project" action 2016-03-02 11:14:51 +01:00
Alexey Andreev
550c8b12d1 KT-10667 Fix building qualified references to nested type of built-ins, e.g. Map.Entry 2016-03-02 10:31:05 +03:00
Mikhail Glukhikh
96a7febd09 Smart cast is performed now inside 'x as? Type ?: return' safe as / elvis combination #KT-10992 Fixed 2016-03-02 10:07:33 +03:00
Mikhail Glukhikh
c7f3a31517 Create subclass intention implemented #KT-8473 Fixed
Can be used for implementing interfaces / abstract classes / sealed classes or extending open classes
2016-03-02 10:05:27 +03:00
Mikhail Glukhikh
7fa9ca8e9f Minor: potential NPE fix 2016-03-02 10:05:23 +03:00
Nikolay Krasko
247185735a Refactoring: rename file 2016-03-01 16:04:06 +03:00
Nikolay Krasko
59e2449d4e Refactoring: extract methods from JSLibraryStdPresentationProvider 2016-03-01 16:04:05 +03:00
Nikolay Krasko
a21a6c9906 Refactoring: extract methods from JavaRuntimePresentationProvider 2016-03-01 16:04:03 +03:00
Nikolay Krasko
0594abbad6 J2K: LibraryPresentationProviderUtil convert 2016-03-01 16:04:02 +03:00
Nikolay Krasko
6349285b06 J2K: LibraryPresentationProviderUtil rename 2016-03-01 16:03:56 +03:00
Nikolay Krasko
97837e6315 Don't detect libraries in maven, gradle and ide systems as runtime libraries
#KT-11072 Fixed
 #KT-10918 Fixed
2016-03-01 15:55:16 +03:00
Nikolay Krasko
b70d0f8c28 Minor: drop deprecated methods and remove warnings in library presentation providers 2016-03-01 15:55:16 +03:00
Nikolay Krasko
d07d34af93 Configure Kotlin in Project: "All modules containing Kotlin files" lists modules even not containing those files (KT-10831)
#KT-10831 Fixed
2016-03-01 15:55:16 +03:00
Ilya Gorbunov
0cd0554078 JS: Remove unsupported Enumeration declaration.
Relates to #KT-7480
2016-03-01 14:01:39 +03:00
Ilya Gorbunov
e5dbb65ff7 JS: Remove declarations of unsupported SortedSet and TreeSet, make toSortedSet() jvm-only.
Fix completion test.

Relates to #KT-7480
2016-03-01 14:01:38 +03:00
Dmitry Petrov
eb7cf92fbd Minor. Add a test for KT-10732: no redeclaration for
fun <T> List<T>?.foo()
fun <T> List<T>.foo()
2016-03-01 13:54:03 +03:00
Michael Bogdanov
16afe74dc1 Fix for KT-11117: Android Kotlin DEX transformation error when I use arrayOf as an anonymous object property
#KT-11117 Fixed
2016-02-29 12:53:58 +03:00
Kirill Rakhman
ed152bccfa Implement smart enter processors for try, catch (parameters and body) and finally with tests
Fixes #KT-10013
2016-02-28 14:31:59 +01:00
Alexander Udalov
2d5b7a8768 Minor, move CompileKotlinAgainstKotlin tests to codegen/ 2016-02-27 16:31:46 +03:00
Alexander Udalov
c4b4a23cb1 Minor, move abstract codegen tests out of 'generated'
Delete unused AbstractBlackBoxCodegenJava8Test
2016-02-27 16:22:25 +03:00
Alexander Udalov
ea522fe606 Minor, rename AbstractSMAPBaseTest -> SMAPTestUtil
Remove unnecessary inheritance
2016-02-27 16:09:27 +03:00
Alexander Udalov
c72f29b13a Move KotlinTestWithEnvironment to org.jetbrains.kotlin.test
It's not really related to lazy-resolve and should be also probably located
near KotlinTestWithEnvironmentManagement
2016-02-27 15:40:07 +03:00
Alexander Udalov
25cebe03e9 Fix inline codegen tests after regroup and rename 2016-02-27 15:40:06 +03:00
Alexander Udalov
f7958edf21 Improve test data format for SMAP codegen tests
Instead of comments in a Kotlin source file, add a .smap with the contents of
the source mapping data (and possible comments)
2016-02-27 15:40:06 +03:00
Alexander Udalov
cc84aabdcf Migrate boxInline tests to new multi-file framework 2016-02-27 15:40:05 +03:00
Alexander Udalov
fa1f7d988e Get rid of CompileKotlinAgainstMultifileKotlinTestGenerated and boxMultifileClasses/
Merge tests in boxMultifileClasses/calls to one test case; copy the two
resulting tests (+ change box to main) to compileKotlinAgainstKotlin
2016-02-27 15:40:05 +03:00
Alexander Udalov
cc8af573f9 Migrate CompileKotlinAgainstKotlin test to multi-file framework 2016-02-27 15:40:04 +03:00
Alexander Udalov
5884d4be79 Get rid of code duplication in kt-against-kt tests 2016-02-27 15:40:03 +03:00
Alexander Udalov
e0b6f12737 Migrate boxMultiFile and boxMultifileClass tests to new multi-file tests
AbstractCompileKotlinAgainstMultifileKotlinTest is broken in this commit; will
be fixed later
2016-02-27 15:40:03 +03:00
Alexander Udalov
4fb0453cea Introduce multi-file test framework to codegen tests
Currently still only single-file tests are supported; this will be fixed in
subsequent commits
2016-02-27 15:40:01 +03:00
Alexander Udalov
adea547d8a Inline KotlinLiteFixture#loadFile, refactor surroundings 2016-02-27 15:40:00 +03:00
Alexander Udalov
1be6046fc2 Minor refactorings in legacy codegen tests
Use loadFile() + getPrefix() instead of loadFile(String)
2016-02-27 15:40:00 +03:00
Alexander Udalov
5f7bc601a8 Refactor/simplify KotlinMultiFileTestWithJava and subclasses 2016-02-27 15:39:59 +03:00
Ilya Gorbunov
06af22b2c1 JS: Remove LinkedList declaration since the implementation is missing.
#KT-7480 Fixed
2016-02-27 02:49:05 +03:00
Ilya Gorbunov
f9e97882fc Minor: remove obsolete TODO. 2016-02-27 00:52:31 +03:00
Ilya Gorbunov
19fa2f51ea Review and correct exception messages. 2016-02-27 00:52:30 +03:00
Ilya Gorbunov
00e30e417f Cleanup: suppress warnings where appropriate. 2016-02-26 21:54:57 +03:00
Ilya Gorbunov
f025a3b8c4 Cleanup: rename parameters to match overriden method (in private implementations).
Remove some redundancy.
2016-02-26 21:54:55 +03:00
Kirill Rakhman
19130cdd71 Clean up KotlinMissingIfBranchFixer 2016-02-26 18:52:07 +01:00
Ilya Gorbunov
b19c0363fd Clarify parameter order of lambda function parameter of *Indexed functions.
#KT-10953 Fixed
2016-02-26 20:47:26 +03:00
Ilya Gorbunov
0e0455daeb Improve the documentation of binarySearch functions.
#KT-10198 Fixed
2016-02-26 20:31:05 +03:00
Dmitry Jemerov
103f8300fb don't show "Change type arguments" fix when there's nothing to change
#KT-11178 Fixed
2016-02-26 16:11:24 +01:00
Pavel V. Talanov
a4c005fefd Update existing test data depending on diagnostic parameter rendering 2016-02-26 14:45:11 +03:00
Pavel V. Talanov
5304ddfca3 DelegatedPropertyResolver: Use SHORT_NAMES_IN_TYPES for ad-hoc diagnostics parameter rendering 2016-02-26 14:45:11 +03:00
Pavel V. Talanov
48094db9dc DefaultErrorMessages: remove hardcoced fq names for built-in types 2016-02-26 14:45:10 +03:00
Pavel V. Talanov
e397544aee Improve NONE_APPLICABLE ide renderer 2016-02-26 14:45:10 +03:00
Pavel V. Talanov
8cbc9eee3e Improve AMBIGUOUS_CALLS renderer 2016-02-26 14:45:09 +03:00
Pavel V. Talanov
b399bbffd7 Improve JvmConflictingDeclarations diagnostics rendering 2016-02-26 14:45:08 +03:00
Pavel V. Talanov
d0b27a5fe2 Update test data for diagnostics test 2016-02-26 14:45:07 +03:00
Pavel V. Talanov
5dcfdb3996 Test return type mismatch on override diagnostic rendering 2016-02-26 14:45:07 +03:00
Pavel V. Talanov
7ba4adf006 Add tests for diagnostics rendering 2016-02-26 14:45:06 +03:00
Pavel V. Talanov
4ab5aabfa0 Adjust existing test data for diagnostic messages 2016-02-26 14:45:06 +03:00
Pavel V. Talanov
e4cf090720 Adjust diagnostics rendering so that short classifier names are rendered unless the name is ambiguous in corresponding RenderingContext 2016-02-26 14:45:05 +03:00
Pavel V. Talanov
c7cb596f74 Rename: NameShortness -> ClassifierNamePolicy 2016-02-26 14:45:05 +03:00
Pavel V. Talanov
ced5a6c917 Introduce RenderingContext and add as parameter to DiagnosticParameterRenderer#render
RenderingContext holds data about the whole diagnostics allowing to adjust rendering of its parameters
2016-02-26 14:45:04 +03:00
Pavel V. Talanov
4f18b3da53 Rename: Renderer -> DiagnosticParameterRenderer and move it out of descriptors module
DescriptorRenderer is no longer a renderer
DescriptorRenderers should not be used to render diagnostic parameters explicitly
2016-02-26 14:45:02 +03:00
Pavel V. Talanov
41f5b5e8b1 Minor: expose DescriptorRender#renderMessage 2016-02-26 14:45:01 +03:00
Pavel V. Talanov
a3bab638eb Move MultiRenderer to a more suitable package 2016-02-26 14:45:00 +03:00
Pavel V. Talanov
40d538731b Move NameShortness to a separate file and refactor it to be an interface 2016-02-26 14:45:00 +03:00
Pavel V. Talanov
77f74a929a Revert 06215ca932
It led to parameter names missing in parameter info and completion for compiled java code used from kotlin
See KT-11039
2016-02-26 14:05:47 +03:00
Natalia Ukhorskaya
7b1afa1e01 Rearrange Colors page for Kotlin 2016-02-26 12:34:24 +03:00
Natalia Ukhorskaya
e0cb0eb1de Highlight super and this as keywords 2016-02-26 12:34:24 +03:00
Natalia Ukhorskaya
d361aca0fb Change some colors in Darcula after refactoring of colors in IDEA 2016-02-26 12:34:24 +03:00
Alexander Udalov
63db41a712 Minor, refactor BuiltInDefinitionFile.read to get rid of isInternalBuiltInFile 2016-02-26 11:29:10 +03:00
Alexander Udalov
5f39f628c9 Fix and test built-ins decompiler for incompatible version 2016-02-26 11:29:10 +03:00
Alexander Udalov
440b23ddf6 Minor, extract createIncompatibleAbiVersionDecompiledText to common/ 2016-02-26 11:29:10 +03:00
Alexander Udalov
f82ec6711d Remove SerializedResourcePaths and BuiltInsSerializedResourcePaths
Most of members now only make sense for JS, move the rest to
BuiltInSerializerProtocol
2016-02-26 11:29:10 +03:00
Alexander Udalov
4bacabe354 Don't read old built-in files in decompiler 2016-02-26 11:29:10 +03:00
Alexander Udalov
996c5848c2 Simplify deserialization components for built-ins and JS 2016-02-26 11:29:10 +03:00
Alexander Udalov
f130755972 Use new built-in binary format (.kotlin_builtins files) in IDE
Instead of .kotlin_class and .kotlin_package files, .kotlin_builtins files are
now supported: they are decompiled to a long file consisting of all non-real
classes (those which do not also have .class files) and members in the
corresponding package.

Unlike the old files, .kotlin_builtins files have a binary version in the
beginning, which allows us to skip decompilation and stub building in case the
file has an unsupported version. This could previously lead to exceptions, see
KT-11077, EA-79339.

The change in DecompiledTextFactory is needed because without "defined in ..."
the keys for members in the long decompiled file are not unique, as there are
multiple members with exactly the same signatures in different classes (e.g.
arithmetic operations in primitive classes).

Remove testData files with the decompiled text and stubs of built-in symbols
because now that the whole package is decompiled to a single file, it would be
painful to update these files each time something in built-in sources changes

 #KT-11077 Fixed
2016-02-26 11:29:10 +03:00
Alexander Udalov
cb490dbe4f Minor, add BuiltInsBinaryVersion.readFrom(InputStream) 2016-02-26 11:29:10 +03:00
Alexander Udalov
c81d76414f Drop serialization of old binary built-in files (.kotlin_class, .kotlin_package) 2016-02-26 11:29:10 +03:00
Ilya Chernikov
c39cec4869 Fixing daemon memory test on windows by increasing the expected threshold 2016-02-26 10:23:37 +03:00
Ilya Gorbunov
029b918ec9 Another CharSequence.repeat implementation in JS from polyfill of String.repeat.
#KT-3064
2016-02-26 01:26:05 +03:00
Ilya Gorbunov
f564adfdd4 Optimize trivial cases of CharSequence.repeat. Provide CharSequence.repeat for JS.
#KT-3064 Fixed
2016-02-26 01:23:30 +03:00
Stanislav Erokhin
7a43d62408 Move sources to resolution module 2016-02-26 00:39:37 +03:00
Stanislav Erokhin
5bb1f3b2ea Create resolution module. 2016-02-26 00:39:37 +03:00
Stanislav Erokhin
310c68f633 Removed lock level WRITING from LexicalWritableScope. 2016-02-26 00:39:36 +03:00
Stanislav Erokhin
f85abed6e6 Replace RedeclarationHandler by LocalRedeclarationChecker 2016-02-26 00:39:35 +03:00
Ilya Gorbunov
7d32fad063 Improve docs for trimIndent/trimMargin.
#KT-9786
2016-02-25 22:09:15 +03:00
Ilya Gorbunov
77f148bec6 Improve docs for substring/subsequence. 2016-02-25 22:09:14 +03:00
Ilya Gorbunov
c946d283ff Fix example for Throws annotations.
Improve code escaping and wording for JvmSuppressWildcards.
2016-02-25 22:09:14 +03:00
Ilya Gorbunov
a100ffd66b Minor: improve wording in the deprecation message. 2016-02-25 21:16:45 +03:00
Alexander Udalov
71170d32cb Exclude kotlin.reflect.jvm.internal.impl from import and completion in project 2016-02-25 20:30:00 +03:00
Nikolay Krasko
edb684fee0 Print kotlin compiler version in build script where withKotlin tag is used 2016-02-25 18:49:53 +03:00
Michael Bogdanov
1b94904684 Prohibited @Strictfp annotation on classes (it's not supported yet), Fix for KT-11109: Strictfp annotation do nothing when applied to class
#KT-11109 Fixed
2016-02-25 18:07:51 +03:00
Natalia Ukhorskaya
894c11d412 Merge pull request #820 from JakeWharton/jw/extra-source-folders
Include source folders from registered source-generating tasks.
2016-02-25 12:07:20 +03:00
Denis Zharkov
fe7393dc1a Fix testData 2016-02-25 11:15:18 +03:00
Denis Zharkov
4c88e2a0bc Use original descriptor when mapping fake override
Otherwise wrong CONFLICTING_INHERITED_JVM_DECLARATIONS were reported

 #KT-10691 Fixed
2016-02-25 11:10:48 +03:00
Michael Bogdanov
582b1c5e66 Fix for KT-11163: Incorrect codegen in case of custom compareTo on primitives
#KT-11163 Fixed
2016-02-25 10:16:09 +03:00
Denis Zharkov
36e84ff23a Minor. Add tests for obsolete issues
#KT-8900 Obsolete
 #KT-8901 Obsolete
2016-02-25 08:31:58 +03:00
Denis Zharkov
914447b7eb Do not treat uninitialized value as a reason to retain boxing
See testData/simpleUnitializedMerge.kt
On exit from `if` we merge value in variable with slot 1 (x):
- from `if` body we get BoxedBasicValue
- from outer block we get UNITIALIZED_VALUE

So we just suppose `x` is unitialized after `if`
and there's no need to mark BoxedValue as unsafe to remove
because it's anyway can't be used after `if`

 #KT-6842 Fixed
2016-02-25 08:31:19 +03:00
Denis Zharkov
2f4b8dab25 Minor. Replace 'filter' with 'any' 2016-02-25 08:31:19 +03:00
Stanislav Erokhin
226e690a86 Minor. refactoring in Qualifier. 2016-02-24 19:33:10 +03:00
Stanislav Erokhin
f130de2468 Remove scope from Qualifier 2016-02-24 19:33:10 +03:00
Stanislav Erokhin
4b3c6d52ef Remake QualifierReceiver 2016-02-24 19:33:09 +03:00
Stanislav Erokhin
8c5339cccf Minor. Remove class ClassifierQualifier and create special ClassValueReceiver 2016-02-24 19:33:09 +03:00
Stanislav Erokhin
2f0ae6f176 Minor. Remove name from Qualifier. 2016-02-24 19:33:08 +03:00
Stanislav Erokhin
5240233eda Minor. Remove HIDDEN_ANNOTATION_FQ_NAME. 2016-02-24 19:33:08 +03:00
Stanislav Erokhin
6a1664c1b3 Minor. removed explicitExtensionReceiverForInvoke from CallCandidateResolutionContext. 2016-02-24 19:33:07 +03:00
Stanislav Erokhin
1ef4a958fd Minor. removed call checked from ResolutionContext. 2016-02-24 19:33:07 +03:00
Stanislav Erokhin
6591f8a2ab Minor. removed unused method from AdditionalTypeChecker. 2016-02-24 19:33:06 +03:00
Stanislav Erokhin
24829ee3ac Minor. rename 2016-02-24 19:33:06 +03:00
Stanislav Erokhin
665e13e4ec Remove obsolete code about warnings for expressions which can be null in java(has @Nullable annotation in java) and in kotlin not marked nullable.
After introducing flexible types and signature enhancement there is no more such expressions.
2016-02-24 19:33:05 +03:00
Michael Bogdanov
b20f49a2c4 Default body compilation for inline fun extracted from InlineCodegen to separate one 2016-02-24 14:06:29 +03:00
Michael Bogdanov
f149f16882 Separately process inline function default impl body compilation (non general inline magic),
Fix for KT-10670 Debugger: Evaluate Expression/Watches fail for inline function parameter initialized with default value

 #KT-10670 Fixed
2016-02-24 14:06:29 +03:00
Michael Bogdanov
7bfb5a0c60 InliningInstructionAdapter refactoring: renamed to MethodBodyVisitor, added additional empty owerrides 2016-02-24 14:06:28 +03:00
Dmitry Jemerov
54de48604d Merge pull request #824 from cypressious/setter_smart_enter
Implement Smart Enter for Property Setters #KT-9996
2016-02-24 11:27:39 +01:00
Kirill Rakhman
f3e68fdeaa Implement smart enter processors for property setter with tests
Fixes #KT-9996
2016-02-23 17:01:02 +01:00
Kirill Rakhman
c1a2570dd4 replace null checks with elvis operator 2016-02-23 16:35:12 +01:00
Alexander Udalov
c71c344b8a Fix NCDFE on primitive iterators during boxing optimization
The real fix is in ProgressionIteratorBasicValue's constructor, other changes
are refactorings

 #KT-11153 Fixed
2016-02-22 19:49:39 +03:00
Ilya Gorbunov
3c35395cf7 Minor: refactor some tests to use nested classes. 2016-02-21 04:18:11 +03:00
Ilya Gorbunov
7997aea5c3 Make Destructured nested class of MatchResult interface in JS too. 2016-02-21 04:18:09 +03:00
Ilya Gorbunov
acc6cc539a Mark CollectionAssertions as deprecated due to their experimental status. 2016-02-21 03:33:12 +03:00
Ilya Gorbunov
bf536afe5f Mark reified assertFailsWith with InlineOnly to preserve stack traces. 2016-02-21 03:20:07 +03:00
Ilya Gorbunov
119eceb80b Minor: correct file name 2016-02-21 03:20:05 +03:00
Alexander Udalov
c0a0a8afd7 Revert "Minor, pass -Xmx256m to compiler in CompilerSmokeTestBase"
This reverts commit 61f5e2f9cf.

Causes OOM on TeamCity
2016-02-20 22:21:58 +03:00
Zalim Bashorov
82a049b319 JS: fix definition nested classes inside interfaces 2016-02-20 21:20:42 +03:00
Alexey Andreev
718c15806c KT-10785 Ensure that access to private properties from inside memeber functions of objects is performed via 'this' rather that by FQN. 2016-02-20 19:16:26 +03:00
Alexey Andreev
0a2cff9056 KT-10785 Fixed. Change predicate that decides whether to dereference assignment target as a property accessor or as a backing field. 2016-02-20 19:16:26 +03:00
Alexander Udalov
dbde566b66 Minor, fix typo in test class name 2016-02-20 19:05:40 +03:00
Alexander Udalov
1a5a077bd6 Replace map + filterNotNull -> mapNotNull in project 2016-02-20 19:05:30 +03:00
Alexander Udalov
61f5e2f9cf Minor, pass -Xmx256m to compiler in CompilerSmokeTestBase
This fixes CompilerFileLimitTest when running locally
2016-02-20 19:05:23 +03:00
Alexey Andreev
a4db14eff5 [KT-4124] Add tests for qualified labeled super access to functions and properties 2016-02-20 15:19:31 +03:00
Alexey Andreev
d83f926658 [KT-4124] Refactor super calls and fix calls to Any::equals 2016-02-20 15:19:31 +03:00
Alexey Andreev
6adcafafbb [KT-4124] Minor refactoring and cleanup 2016-02-20 15:19:30 +03:00
Alexey Andreev
d067068774 [KT-4124] Support invocation of constructor of inner class from extension method 2016-02-20 15:19:30 +03:00
Alexey Andreev
9238afc439 [KT-4124] Fix some tests from common testData 2016-02-20 15:19:29 +03:00
Alexey Andreev
f5786dd567 [KT-4124] Add test case for nested/inner classes inside native class. Add diagnostic of inner classes inside native classes. 2016-02-20 15:19:28 +03:00
Alexey Andreev
040a646174 [KT-4124] Add test case for nested native class 2016-02-20 15:19:28 +03:00
Alexey Andreev
68828317b8 [KT-4124] Suppress error reporting about native local classes 2016-02-20 15:19:27 +03:00
Alexey Andreev
e3c7cd0021 [KT-4124] Add diagnostic that reports of local classes. Remove test for diagnostic of nested types 2016-02-20 15:19:27 +03:00
Alexey Andreev
8537d327fa [KT-4124] Add diagnostic of a several cases of local classes like class in object in function. 2016-02-20 15:19:26 +03:00
Alexey Andreev
c705fafc95 [KT-4124] Add support for super<T>@Outer.functionName() case 2016-02-20 15:19:25 +03:00
Alexey Andreev
9e0e734021 [KT-4124] Add support for super<T>@Outer.propertyName case 2016-02-20 15:19:25 +03:00
Alexey Andreev
20b3361edc [KT-4124] Fix test compatibility between JS and Java backed for several tests 2016-02-20 15:19:24 +03:00
Alexey Andreev
c231ecfe50 [KT-4124] Fix the following: when test can't be compiled, sometimes JUnit reported that .js file was not found instead of reporting actual errors. 2016-02-20 15:19:24 +03:00
Alexey Andreev
3f5be335a9 [KT-4124] Fix bug when constructing like this: "A.Companion.B()" 2016-02-20 15:19:23 +03:00
Alexey Andreev
700159987b [KT-4124] Fix bug when inner A.B extends inner A.C not passing outer reference there 2016-02-20 15:19:23 +03:00
Alexey Andreev
8f74720973 [KT-4124] Add more generated tests from Java backend. Fix support of deeply nested classes (i.e. A.B.C) and nested enums. 2016-02-20 15:19:22 +03:00
Alexey Andreev
c48c6bc055 [KT-4124] Use generated test to avoid duplication of test data of inner classes. Add support of classes contained within objects. 2016-02-20 15:19:22 +03:00
Alexey Andreev
133b84160e [KT-4124] Fix case of super@labeled recever. Add names to metadata of inner classes. 2016-02-20 15:19:21 +03:00
Alexey Andreev
4efceb95e3 [KT-4124] Add less trivial tests 2016-02-20 15:19:20 +03:00
Alexey Andreev
a8014dec50 [KT-4124] Add support for simple nested classes 2016-02-20 15:19:20 +03:00
Stanislav Erokhin
ae7b048fdb Minor. rename 2016-02-20 14:55:18 +03:00
Stanislav Erokhin
3e366f6b2d Minor. cleanup 2016-02-20 14:55:18 +03:00
Stanislav Erokhin
45de06ac0c Minor. Removed generics. 2016-02-20 14:55:17 +03:00
Stanislav Erokhin
63b3cbafa4 Remove old resolution algorithm. 2016-02-20 14:55:17 +03:00
Stanislav Erokhin
acdd807e91 Support "given candidates" mode in new resolution algorithm. 2016-02-20 14:55:16 +03:00
Stanislav Erokhin
daee95f2c4 Refactoring: create separate util function for create constructors resolution candidates 2016-02-20 14:55:16 +03:00
Stanislav Erokhin
7de2013a3e KT-3856 Wrong inner class inaccessible diagnostic for extension to outer class
#KT-3856 Fixed
2016-02-20 14:55:15 +03:00
Zalim Bashorov
61cc8394e8 Minor: fix testdata 2016-02-20 13:11:23 +03:00
Alexander Udalov
1b8f934b54 Delete deprecated enum 'values' property 2016-02-19 22:28:44 +03:00
Alexander Udalov
1eeb72e073 Do not create empty static scope instances for non-enum classes 2016-02-19 22:28:44 +03:00
Alexander Udalov
60fe64dcaa Remove obsolete lazy code in LazyClassDescriptor
This was added in a072550931 when we thought
making 'annotation' an annotation instead of a modifier would be a good idea;
we weren't be able to resolve the class kind immediately then. This is no
longer the case
2016-02-19 22:28:44 +03:00
Zalim Bashorov
d832a3d290 KotlinBuilder: use proper API to update Java mappings 2016-02-19 19:11:10 +03:00
Zalim Bashorov
ae32698c78 Minor: add more sources for jps library 2016-02-19 19:11:09 +03:00
Zalim Bashorov
05eff9028f New IC: don't fail on unsupported difference kinds and process SUPERTYPE_ID_LIST correctly 2016-02-19 19:10:44 +03:00
Dmitry Petrov
90be4f8ea5 KT-6745: change message to reflect that a super qualifier should be an immediate supertype,
not just a supertype.
2016-02-19 16:49:59 +03:00
Michael Bogdanov
1d17bee6cc Don't generate source mapping on inlining 'InlineOnly' functions 2016-02-19 16:08:03 +03:00
Michael Bogdanov
6f1def9366 isInlineOnly renamed to isInlineOnlyOrReified 2016-02-19 16:08:02 +03:00
Dmitry Petrov
30c2abba3c KT-9550: distinguish signature conflict on override from signature conflict of inherited members.
Add a common OverridingStrategy class for cases where we don't care (yet) about precise diagnostics.
2016-02-19 15:59:08 +03:00
Mikhail Glukhikh
883e2e4d2b KT-9498 extension: now type can be inferred for getter with expression body 2016-02-19 14:49:25 +03:00
Michael Bogdanov
405c21a17e Fix for KT-11081: Reified type parameters are lost in anonymous object in inline function when using default value parameters
#KT-11081 Fixed
2016-02-19 14:22:29 +03:00
Mikhail Glukhikh
4c1c64fa08 Quick fix for adding arrayOf wrapper for annotation parameters #KT-10063 Fixed 2016-02-19 13:32:49 +03:00
Mikhail Glukhikh
c9c391e688 Specify property type by accessor type (preliminary) #KT-9498 Fixed 2016-02-19 13:32:46 +03:00
Alexander Udalov
36de3008e3 Fix visibility flags for lambda classes in InnerClasses attribute 2016-02-19 12:52:40 +03:00
Ilya Chernikov
343735e36c fixing test after changing cleanup scheme - first it is now required to rebuild sources, and therefore consumed memory is increased 2016-02-18 21:06:38 +01:00
Ilya Chernikov
8065e490e8 performing cleanup (and memory usage reporting) only if kotlin compiler was actually called, should fix e.g. KT-10127 2016-02-18 21:06:37 +01:00
Alexey Tsvetkov
d0efd4083f Call System.gc only when when log level is debug, fixes KT-11022 2016-02-18 21:06:36 +01:00
Denis Zharkov
bc5110550a Release generated bytecode after each processed part
Part here means separate '.kt' file or multi-file facade
Now this memory optimization doesn't work with jar's,
because there is no simple way to write them incrementally.
2016-02-18 21:22:04 +03:00
Denis Zharkov
b87cc5712c Minor. Weaken value parameter types: ClassFileFactory -> OutputFileCollection 2016-02-18 21:22:04 +03:00
Denis Zharkov
fd32b8dd19 Minor. Transform method to void 2016-02-18 21:22:04 +03:00
Denis Zharkov
cecb998fd3 Simplify ClassFileFactory state
Before this change it contained maps to complex object,
after it retains only necessary information:
- sources files for package parts
- PackageParts objects grouped by package fq name

Both of them needed for writing module mappings
2016-02-18 21:22:04 +03:00
Denis Zharkov
f8f996b2f6 Minor. Move 'done()' call into MultifileClassCodegen itself 2016-02-18 21:22:03 +03:00
Natalia Ukhorskaya
0f3ecab2b4 Replace deprecated usages of CodeInsightColors 2016-02-18 18:37:03 +03:00
Ilya Gorbunov
6b1ed8fd61 JS: use slice() instead of slice(0) to copy arrays (minor). 2016-02-18 17:37:33 +03:00
Ilya Gorbunov
cbd38f007c JS: Do not create a copy of already cloned vararg array.
JVM: Do not create copy of vararg array it it's already Object[].
2016-02-18 17:37:31 +03:00
nik
c69d332db9 until-build set to 146.9999 to make Kotlin plugin compatible with new IDEA builds 2016-02-18 10:11:12 +03:00
Alexander Udalov
35a4aeeeba CLI tests: add LauncherScriptTest instead of generated 'kotlinc' script tests
The compiler behavior on test data in compiler/testData/cli is already tested
with CliTestGenerated, which is 4x faster and does not require to rebuild the
compiler jar with 'ant dist'. Leave only several simple tests to check that
'kotlinc', 'kotlinc-jvm' and 'kotlinc-js' scripts work
2016-02-17 20:52:00 +03:00
Alexander Udalov
04ccca8adc CLI tests: convert to generated 2016-02-17 20:52:00 +03:00
Alexander Udalov
a53166b732 CLI tests: rename CliBaseTest to AbstractCliTest 2016-02-17 20:51:59 +03:00
Alexander Udalov
762504d5e4 CLI tests: convert to JUnit 3 2016-02-17 20:51:58 +03:00
Alexander Udalov
f74988cbec CLI tests: get rid of CliCommonTest 2016-02-17 20:51:58 +03:00
Alexander Udalov
3b22483fb2 CLI tests: move file existance checks to config files 2016-02-17 20:51:57 +03:00
Alexander Udalov
7a6cc71454 CLI: disable colors on platforms unsupported by jansi
#KT-10605 Fixed
2016-02-17 20:51:48 +03:00
Alexander Udalov
2e13377d4a J2K ReplInterpreter: prettify 2016-02-17 20:51:11 +03:00
Alexander Udalov
5670e7f750 J2K ReplInterpreter: convert 2016-02-17 20:51:11 +03:00
Alexander Udalov
2b2c4b3610 J2K ReplInterpreter: move .java -> .kt 2016-02-17 20:51:11 +03:00
Alexey Andreev
8497931455 #EA-79158 Fix translation of empty 'when' statement 2016-02-17 19:18:25 +03:00
Alexey Andreev
133402c1ca #EA-79158 Report code fragment when translator throws an exception. It should help to get a code sample for this issues and all similar issues. 2016-02-17 19:18:24 +03:00
Michael Bogdanov
0283fea835 Optimize recursive string concatenation 2016-02-17 16:53:19 +03:00
Michael Bogdanov
8835b0599a Inline preevaluated string and primitive only constants in compilation time, don't inline const references in non-annotation context, fix for KT-11025: Don't inline const val in compare instuctions
#KT-11025 Fixed
2016-02-17 16:53:18 +03:00
Michael Bogdanov
7c2920febe Don't allow use standalone constants in complexExpressions, fix for KT-11043: Inconsisten result for class literal and string concatenation
#KT-11043 Fixed
2016-02-17 16:53:18 +03:00
Michael Bogdanov
af3437626b Properly calculate isConst for java properties 2016-02-17 16:53:17 +03:00
Natalia Ukhorskaya
c5d788d049 Debugger: do not put breakpoints at lines from another file in case of inline function 2016-02-17 15:08:56 +03:00
Natalia Ukhorskaya
42927bb078 Make function delegated to sam adapter synthetic 2016-02-17 15:08:53 +03:00
Natalia Ukhorskaya
7fb1848bd5 Minor, fix exception: do not try to get line start offset for line < 0 and line == lineCount() 2016-02-17 15:07:19 +03:00
Mikhail Glukhikh
657459ef22 Source of KNPE removed #EA-79002 Fixed 2016-02-17 11:52:49 +03:00
Alexey Sedunov
651b00c323 Pull Members Up: Always insert spaces between keywords
#KT-10971 Fixed
2016-02-17 11:31:46 +03:00
Alexey Sedunov
e1b4f45b35 Implement Abstract Members Intention: Fix EA-79052 2016-02-17 11:31:45 +03:00
Alexey Sedunov
27ea2dc6f9 Change Signature: Fix EA-77624 2016-02-17 11:31:41 +03:00
Alexey Sedunov
d587bb2ea6 Change Signature: Support Change Signature quick-fix for Java -> Kotlin case
#KT-9401 Fixed
2016-02-17 11:31:40 +03:00
Ilya Gorbunov
8761819117 StdLib generators: provide extension points for family properties specific to documentation and code. 2016-02-17 04:23:18 +03:00
Stanislav Erokhin
9781578af2 Update copyright in generated classes. 2016-02-16 20:31:15 +03:00
Stanislav Erokhin
341b251e4d Update copyright in generated tests. 2016-02-16 18:59:10 +03:00
Mikhail Glukhikh
5def6eae5b Correct handling of erroneous code during code extraction 2016-02-16 18:50:24 +03:00
Mikhail Glukhikh
eed4aa71db No assertion error in getContainingPseudocode #KT-10983 Fixed
Also #EA-72954 Fixed
2016-02-16 18:50:20 +03:00
Alexey Andreev
f6fadc4fa5 [KT-10614] Fix passing of inline.kt test 2016-02-16 16:02:17 +03:00
Alexey Andreev
79b42d7fe5 [KT-10614] Fix issue: copy array on vararg call with spread operator 2016-02-16 16:02:16 +03:00
Mikhail Glukhikh
1bbc46729c Effective visibility: concise diagnostic messages #KT-10761 Fixed
Also #KT-9760 Fixed
2016-02-16 15:58:50 +03:00
Mikhail Glukhikh
3049961b9a Revert "Implicit exhaustive when annotation / highlighting"
This reverts commit 0cc09872b6.
2016-02-16 15:57:38 +03:00
Denis Zharkov
d344b5b991 Optimize completion for overridden descriptors 2016-02-16 12:01:14 +03:00
Denis Zharkov
36606fd944 Run slow flexible type assertions only in test mode 2016-02-16 12:01:13 +03:00
Denis Zharkov
961b72682a Drop unnecessary call to substituted 'overriddenDescriptors' 2016-02-16 12:01:13 +03:00
Denis Zharkov
87497a5dc6 Do not run enhancement for fake overrides with one overridden 2016-02-16 12:01:13 +03:00
Denis Zharkov
42d451f2d1 Optimize ErasedOverridabilityCondition
Do not start substitution if some basic conditions are failed
2016-02-16 12:01:13 +03:00
Denis Zharkov
44148107ae Optimize SamAdapterOverridabilityCondition
Do not calculate it for non-static members,
because SAM adapters only exist in static scope now
2016-02-16 12:01:13 +03:00
Denis Zharkov
9f22b17918 Optimize external overridability conditions
- Skip ones that can lead only to success after first success
- And vice versa
2016-02-16 12:01:13 +03:00
Denis Zharkov
1b4b8ab5db Memoize 'JavaTypeClassifierImpl.isRaw' result 2016-02-16 12:01:12 +03:00
Denis Zharkov
d4d289c881 Optimize ResolvedCallImpl for case of empty pararameter set 2016-02-16 12:01:12 +03:00
Alexey Andreev
f1fd701d0d Remove PackageDirectoryMismatch from testData scope since it never actually matches 2016-02-16 11:46:25 +03:00
Alexey Andreev
56cb7c2677 [KT-11027] Fix the issue 2016-02-16 11:46:24 +03:00
Zalim Bashorov
c28b701ccf JS: ignore annotation on expression when its retention is SOURCE
#KT-8258
2016-02-15 21:35:30 +03:00
Mikhail Glukhikh
90927cfd19 CallExpressionResolver.getQualifiedExpressionTypeInfo refactoring 2016-02-15 16:46:24 +03:00
Dmitry Jemerov
37bd08175f K
(cherry picked from commit 8549ec7)
2016-02-15 13:36:45 +01:00
Pavel V. Talanov
1800e5a7db Remove some usages of Name.guess (and rename this utility to discourage new usages) 2016-02-15 13:32:42 +03:00
Pavel V. Talanov
47ceb106c7 Fix "<" or ">" in member name leading to exception 2016-02-15 13:32:41 +03:00
Michael Bogdanov
69afc2316d Internal visibility to TestGroup 2016-02-15 13:15:43 +03:00
Pavel V. Talanov
735b37aa7c Fix stub/ast mismatch for old binaries (rc-1036) in newer versions of plugin 2016-02-15 12:45:13 +03:00
Jake Wharton
f713adc96e Add support for AOSP's nullability annotations.
These are different than 'android.support.annotation' in that they are used on the JVM for projects within AOSP.
2016-02-15 11:32:09 +03:00
Mikhail Glukhikh
84a072b9f0 getQualifiedExpressionTypeInfo refactoring 2016-02-15 10:42:56 +03:00
Mikhail Glukhikh
88e7b728df CallExpressionResolver: converted to Kotlin, cleanup 2016-02-15 10:42:52 +03:00
Mikhail Glukhikh
bd40d59a17 CallExpressionResolver.java --> CallExpressionResolver.kt 2016-02-15 10:42:48 +03:00
Dmitry Jemerov
2a8e1af489 trim -release- from plugin version number when checking whether the runtime is outdated 2016-02-14 15:36:21 +01:00
Ilya Gorbunov
24edbc36df Create at most one wrapper sequence for adjacent drop/take operations on sequences.
Based on PR #814 by Sargun Vohra
#KT-10821 Fixed
2016-02-14 16:46:46 +03:00
Mikhail Glukhikh
a663797cb8 Refactoring: use of EffectiveVisibility class inside isEffectivelyPublic/Private API extensions 2016-02-13 10:48:17 +03:00
Mikhail Glukhikh
0f7284f83a More accurate safe call handling in GenericCandidateResolver / CallExpressionResolver
(real receiver nullability is taken into account)
2016-02-13 10:48:12 +03:00
Mikhail Glukhikh
17593e4ef6 Call completer: safe call with nullable receiver has nullable return type #KT-11007 Fixed 2016-02-13 10:48:07 +03:00
Jake Wharton
0d6ec35f7f Include source folders from registered source-generating tasks.
This includes the output directories from tasks which generate Java code which were registered with registerJavaGeneratingTask().
2016-02-13 02:34:06 -05:00
Valentin Kipyatkov
4cd7193047 KT-11018 Ctrl + Mouse Hover shows a var as val
#KT-11018 Fixed
2016-02-13 10:20:20 +03:00
Valentin Kipyatkov
c9f26de9f5 Introduce/eliminate when subject intentions to keep line breaks and comments 2016-02-13 10:20:19 +03:00
Valentin Kipyatkov
ce54a2d4bd If to when conversion preserves comments too 2016-02-13 10:20:19 +03:00
Valentin Kipyatkov
0ed8eb0512 KT-5717 "Replace 'when' with 'if'" loses a comment
#KT-5717 Fixed
2016-02-13 10:20:19 +03:00
Valentin Kipyatkov
0809be59df KT-10619 Wrong completion after package name in annotation
#KT-10619 Fixed
2016-02-13 10:20:19 +03:00
Valentin Kipyatkov
17ac168b33 KT-10621 Non-top level packages shown after "@" in completion
#KT-10621 Fixed
2016-02-13 10:20:18 +03:00
Michael Bogdanov
4f0f81155a Weaken PRIVATE_CLASS_MEMBER_FROM_INLINE diagnostic 2016-02-12 17:24:30 +03:00
Michael Bogdanov
384d2ea0d1 Use bipush, sipush for byte and short constants 2016-02-12 11:55:21 +03:00
Anton Sukhonosenko
0073257841 Fix for KT-10313: ClassCastException with Generics
#KT-10313 Fixed
2016-02-12 10:53:28 +03:00
Dmitry Petrov
edf6a2142b Check local function declarations for overload conflicts.
In PSI unifier tests, disable errors for tests on local functions (as irrelevant).
2016-02-12 09:54:21 +03:00
Ilya Gorbunov
17a95384e1 Change default buffer size to be 8K (same default as in java BufferedReader).
Rename internal constants.
2016-02-12 05:07:10 +03:00
Nikolay Krasko
faba229b11 Use single constant for doNotAnalyze message 2016-02-11 17:39:51 +03:00
Nikolay Krasko
ca0346bdae Fix forgotten test data for 10648f44ac (KT-10212) 2016-02-11 16:24:38 +03:00
Nikolay Krasko
85436de2b3 Minor: Add new lines to make failure message more readable 2016-02-11 16:20:30 +03:00
Nikolay Krasko
ae36e9c4c4 Don't show message if there were no messages
Otherwise "Notification should have content" error is logged.
2016-02-11 16:05:18 +03:00
Nikolay Krasko
e1d12af2fd Check element is valid if canRefactor() 2016-02-11 15:36:16 +03:00
Nikolay Krasko
9b44b0b1c0 Check element is valid before requesting type (EA-74737) 2016-02-11 15:36:15 +03:00
Alexey Sedunov
eabe675dbf Create from Usage: Add delegation call to secondary constructor declaration 2016-02-11 14:25:26 +03:00
Alexey Sedunov
6696d2b70a Create from Usage: Do not generate secondary constructor body by default 2016-02-11 14:25:24 +03:00
Alexey Sedunov
cc2a65e874 Create from Usage: Always insert parentheses around secondary constructor parameter list
#KT-10912 Fixed
2016-02-11 14:25:23 +03:00
Alexey Sedunov
8e81d0ce5f Change Signature: Skip implicit receiver references if extension receiver is dropped 2016-02-11 14:25:22 +03:00
Alexey Sedunov
a9ddc4da1a Change Signature: Warn about safe call receiver being transformed to value argument
#KT-8744 Fixed
2016-02-11 14:25:16 +03:00
Alexey Sedunov
b3801ffac7 Change Signature: Fix implicit receiver ->argument convertion in recusrive calls
#KT-8744 In Progress
2016-02-11 14:25:04 +03:00
Alexey Sedunov
d8c0671d94 Minor: Remove unused property 2016-02-11 14:25:02 +03:00
Pavel V. Talanov
7d98103c0c overriddenDescriptors is empty for java static property and function declarations
Fake overrides are still created for java static with non-empty overriddenDescriptors

Add tests for inheriting visibility for java static members
Add test: check that java static declarations that shadow deprecated declarations should not be deprecated
Add test for corner case where "overriding" java static constant led to incorrect type in inheritor

Fix test data for existing tests
2016-02-11 14:08:14 +03:00
Pavel V. Talanov
7e78e8d8ab Refactor: Move and rename OverridingUtil.DescriptorSink -> OverridingStrategy 2016-02-11 14:08:13 +03:00
Valentin Kipyatkov
c9bb020d6e KT-9738 Code completion of "emptyList()" after elvis operator inserts explicit type arguments
#KT-9738 Fixed
2016-02-11 12:26:23 +03:00
Valentin Kipyatkov
8da01e7952 Minor 2016-02-11 12:26:22 +03:00
Valentin Kipyatkov
377f4af369 Fixed EA-74848 + conversion was incorrect! 2016-02-11 12:26:22 +03:00
Valentin Kipyatkov
2ce06f250b Fixed EA-74166 2016-02-11 12:26:22 +03:00
Valentin Kipyatkov
8056c5182a Fixed EA-73613 2016-02-11 12:26:22 +03:00
Dmitry Petrov
aed2f2b993 Property vs classifier conflict.
TODO get rid of duplicate diagnostics
(looks like OverloadResolver and DeclarationResolver are partially redundant; refactor them).
2016-02-11 10:32:46 +03:00
Dmitry Petrov
b2eb4200af OverloadResolver.kt: convert to Kotlin & cleanup 2016-02-11 10:32:45 +03:00
Dmitry Petrov
6278459cc4 OverloadResolver.java --> .kt 2016-02-11 10:32:45 +03:00
Nikolay Krasko
d8ba52e582 Print kotlin compiler version in build script 2016-02-11 02:52:01 +03:00
Nikolay Krasko
6fe416cc4a Null name in library fix (EA-78733) 2016-02-11 02:52:00 +03:00
Nikolay Krasko
3f5f892e1b Add html escaping for declaration names in calls (KT-10763)
#KT-10763 Fixed
2016-02-11 02:49:00 +03:00
Zalim Bashorov
45f21bc7fd Minor: drop content from touch files 2016-02-10 22:56:10 +03:00
Zalim Bashorov
ced23c02bd New IC: add processing changes for constants 2016-02-10 22:56:09 +03:00
Zalim Bashorov
e33e31ad16 KotlinBuilder: don't request additional round when it's unnecessary & fix warnings 2016-02-10 21:37:12 +03:00
Zalim Bashorov
88c8f24887 Caching results of JpsUtils#isJsKotlinModule
#KT-9636 Fixed
2016-02-10 21:30:25 +03:00
Denis Zharkov
12552d2fc1 Refine special bridges generation
#KT-10958 Fixed
2016-02-10 20:18:46 +03:00
Denis Zharkov
6d98909c7a Minor. Add not-nullable upper bound 2016-02-10 20:18:46 +03:00
Denis Zharkov
45bf300144 Minor. Rename variables 2016-02-10 20:18:46 +03:00
Denis Zharkov
0fb565851f Minor. Extract function 2016-02-10 20:18:46 +03:00
Denis Zharkov
8592a57be4 Drop unnecessary check and corresponding parameter 2016-02-10 20:18:46 +03:00
Denis Zharkov
0b37d032c8 Minor. Split complicated conditions 2016-02-10 20:18:46 +03:00
Natalia Ukhorskaya
9070eff6ad KotlinPositionManager: add progress when computing classnames for inline function 2016-02-10 18:30:29 +03:00
Denis Zharkov
9ac2da8c96 Optimize 'setResultingSubstitutor'
Replace Map with plain List, use parameter's index as a key
2016-02-10 16:18:59 +03:00
Denis Zharkov
b9e677fef4 Get rid of redundant Map copy 2016-02-10 16:18:59 +03:00
Denis Zharkov
de3f507744 Add minor memory optimization
Get rid of 'unsubstitutedValueArguments' in resolved call
2016-02-10 16:18:59 +03:00
Mikhail Glukhikh
a08b8f43b2 Control flow graph for safe calls corrected #KT-10913 Fixed
Also #KT-10186 Fixed
Also #KT-5198 Fixed
2016-02-10 12:29:45 +03:00
Natalia Ukhorskaya
5ae394fec0 Optimize reference search for convention functions 2016-02-10 11:36:30 +03:00
Natalia Ukhorskaya
1f6894cdd4 EA-77626 - KNPE: AnonymousFunctionToLambdaIntention.applicabilityRange 2016-02-10 11:36:30 +03:00
Nikolay Krasko
5c6c1173a6 Aggregate configuration messages into one notification (KT-10489)
#KT-10489 Fixed
2016-02-10 01:31:38 +03:00
Nikolay Krasko
e2f1a5c092 Minor: refactoring 2016-02-10 01:31:37 +03:00
Zalim Bashorov
cf173d6963 Improve test multifilePackagePartMethodAdded: add file which should not be affected 2016-02-09 23:27:26 +03:00
Zalim Bashorov
f6e7f8c3c0 Introduce TestingContext to pass data between tests and KotlinBuilder; introduce BuildLogger to log build events (build finished, files marked as dirty) in KotlinBuilder 2016-02-09 23:27:25 +03:00
Zalim Bashorov
4ec3865830 Log final exit code instead of intermediate; change log level for build result to INFO 2016-02-09 23:27:24 +03:00
Ilya Gorbunov
1fca1cc607 Use foreach loop instead of directly taking iterator in sum and average.
Use indexed loop for arrays in reduce and reduceIndexed.
#KT-10579 Fixed
2016-02-09 22:51:39 +03:00
Ilya Gorbunov
6c7cefaae3 Use HALF_EVEN rounding mode by default for BigDecimal division operator.
#KT-10462 Fixed
2016-02-09 22:51:02 +03:00
Dmitry Jemerov
8b5e9d1685 code review; add one more missing description 2016-02-09 19:23:00 +01:00
Dmitry Jemerov
6e1705dd16 port IDEA's InspectionDescriptionTest into Kotlin
#KT-10345 Fixed
2016-02-09 19:23:00 +01:00
Dmitry Jemerov
daf26f4db3 more consistent inspection display names; add missing inspection descriptions
#KT-10908 Fixed
2016-02-09 19:22:59 +01:00
Alexey Sedunov
bb2a5b00b7 Change Signature: Fix reference substitution when default value is a single simple name reference
#KT-10954 Fixed
2016-02-09 19:18:50 +03:00
Alexey Sedunov
792d9c1ae2 Introduce Variable: Skip type in template if no resolvable/non-error types are available in the current context
#KT-10808 Fixed
2016-02-09 19:18:45 +03:00
Zalim Bashorov
eacd50c4dc FIx possible NPEs when try to use TestModuleProperties in IDEA 144.x
#EA-78931 Fixed
2016-02-09 15:55:16 +03:00
Michael Bogdanov
0f90dc1649 Code clean and some refactorings in 'getLambdaIfExistsAndMarkInstructions' 2016-02-09 10:19:16 +03:00
Michael Bogdanov
c75b514551 Get rid of InstructionsAndFrames.kt 2016-02-09 10:19:15 +03:00
Michael Bogdanov
b8ee2ecdac Support extension lambda inlining in complex stack cases (nullable receiver) 2016-02-09 10:19:15 +03:00
Ilya Gorbunov
78b7fb15f3 J2K, expected errors: for each argument of removed overloads 2016-02-09 02:58:09 +03:00
Ilya Gorbunov
b4ebaad8f5 Drop previously deprecated API. 2016-02-09 02:58:07 +03:00
Stanislav Erokhin
434bd0707d Correcting rewrite type info after compete call.
#KT-10934 Fixed
#KT-10896 Fixed
2016-02-08 20:49:31 +03:00
Zalim Bashorov
74b2c8cd31 Minor: fix method name 2016-02-08 19:31:17 +03:00
Ilya Gorbunov
17ebb36128 Test Throwable properties in JS, don't work as expected, commiting as ignored.
#KT-10911
2016-02-08 18:10:46 +03:00
Ilya Gorbunov
5361f6e941 Make Throwable properties message and cause open.
#KT-5587 Fixed
2016-02-08 18:10:46 +03:00
Pavel V. Talanov
f12c653aed KtLightClassForFacade is not valid if any of the files it was built for doesn't have top level callables
#KT-9434 Fixed
2016-02-08 16:45:47 +03:00
Pavel V. Talanov
f59a4c537e Minor: remove some dead code 2016-02-08 16:45:46 +03:00
Nikolay Krasko
909ced5fa2 Use non-local functions to avoid creating lambdas in heap 2016-02-08 16:43:55 +03:00
Nikolay Krasko
99a693a14b Too many empty ArrayList stored for arguments 2016-02-08 16:43:54 +03:00
Nikolay Krasko
ff2029035e Don't generate new empty list with TypeParameterDescriptor 2016-02-08 16:43:54 +03:00
Denis Zharkov
cd3f7df28c Create deep descriptors copy for Change signature
It's needed to prevent accesses to invalid PSI
after changes has been applied
2016-02-08 16:40:47 +03:00
Denis Zharkov
c879f83037 Fix primitive types mapping
Use boxed version if type was enhaced to not-nullable
2016-02-08 16:40:47 +03:00
Denis Zharkov
68110f5859 Add minor optimization
Do not copy overrides while creating FAKE_OVERRIDE
2016-02-08 16:40:47 +03:00
Denis Zharkov
18e7272a1e Do not force overridden descriptors computation
Currently 'overriddenDescriptors' of substituted function is lazy
and in most cases it's unnecessary to compute it
(it's enough to use the same field from 'original')
2016-02-08 16:40:47 +03:00
Denis Zharkov
9e3d381eb3 Perform computation of overridden descriptors lazy
It's makes sense in cases when descriptors are being substituted, because
in many cases their overridden are not needed.
2016-02-08 16:40:47 +03:00
Denis Zharkov
fae6de9acd Replace 'addOverriddenDescriptor' with 'setOverriddenDescriptors'
It helps to get rid of redundant SmartSets (e.g. for top-level functions)
2016-02-08 16:40:47 +03:00
Denis Zharkov
c1f57b743b Do not build enhanced descriptors if they are unchanged 2016-02-08 16:40:47 +03:00
Denis Zharkov
924d706e79 Release original Java descriptors while enhancing
It's both more correct and helps to release memory retained by
descriptor before enhancement
2016-02-08 16:40:47 +03:00
Denis Zharkov
beea2d5d10 Use source elements instead of descriptors
It's needed because resulting descriptors are different
(because they are enhanced) from ones on which load error is reported.
See where latter happens

Currently we suppose that source elements should be stable
2016-02-08 16:40:47 +03:00
Michael Bogdanov
848549dd5d Rollback "Fix for KT-10659: Debugger: Evaluate Expression and Watches fail for inline function parameter passed by reference" 2016-02-08 16:43:22 +03:00
Pavel V. Talanov
9e5c387d6c PropertyCodegen: Diagnose descriptor not found for property 2016-02-08 16:18:36 +03:00
Natalia Ukhorskaya
25b8e4f1b2 Do not compute classnames during stepping
#KT-10827 Fixed
2016-02-08 15:49:11 +03:00
Natalia Ukhorskaya
d238df8525 Debugger: add test for line breakpoint variants with inline function call. Fix testData for muted test 2016-02-08 15:49:11 +03:00
Zalim Bashorov
3c4cb54573 Allow to use internal declarations from special modules in compiler (JPS)
(e.g. IDEA 16 gradle tests loaded in separate module)

 #KT-10595 Fixed
2016-02-08 15:42:49 +03:00
Zalim Bashorov
e328c24857 J2K KotlinBuilderModuleScriptGenerator: cleanup 2016-02-08 15:42:48 +03:00
Zalim Bashorov
21e69a0a4c J2K KotlinBuilderModuleScriptGenerator: convert 2016-02-08 15:42:48 +03:00
Zalim Bashorov
d5030335b6 J2K KotlinBuilderModuleScriptGenerator: .java -> .kt 2016-02-08 15:42:48 +03:00
Zalim Bashorov
2c1d1e84a6 Allow to use internal declarations from special modules in IDEA
(e.g. IDEA 16 gradle tests loaded in separate module)

 #KT-10595 Fixed
2016-02-08 15:42:47 +03:00
Dmitry Petrov
5968ce96df KT-10939 CANNOT_COMPLETE_RESOLVE for inherited generic interface method
'original' for value parameters of fake override is not a value parameter of unsubstituted fake override.
Match value parameters by index.
2016-02-08 10:08:35 +03:00
Alexander Udalov
9f786c00a7 Fix test data after removing old annotation classes 2016-02-07 10:03:19 +05:30
Nikolay Krasko
938a435346 Allow to process return statements without parent KtDeclaration (EA-70883) 2016-02-06 17:50:17 +03:00
Nikolay Krasko
1e50847985 SOE on setEnabled(). setEnabled() changes were propagated back to action group with the request to update state (EA-71014) 2016-02-06 17:50:16 +03:00
Alexander Udalov
e82d549853 Delete old metadata annotation classes 2016-02-06 15:53:55 +05:30
Alexander Udalov
8800782c83 Move constants from JvmAnnotationNames closer to usages 2016-02-06 15:53:55 +05:30
Alexander Udalov
2f5a6ac465 Minor, add extra constant to JvmAnnotationNames, drop unneeded utility 2016-02-06 15:53:55 +05:30
Alexander Udalov
5de1cf3bb4 Do not write old metadata annotations to bytecode 2016-02-06 15:53:55 +05:30
Alexander Udalov
ba80e8ba81 Use kotlin.Metadata instead of old annotations in IDE, reflection and tests 2016-02-06 15:53:55 +05:30
Mikhail Glukhikh
7da981e12c Regression tests #KT-8168 Obsolete 2016-02-05 18:29:40 +03:00
Denis Zharkov
0efe28a12a Do not inline non-const vals
#KT-10425 Fixed
2016-02-05 17:43:55 +03:00
Yan Zhulanow
f2edcd99a8 Illegal Dalvik identifier inspection 2016-02-05 17:28:50 +03:00
Denis Zharkov
8d87800a05 Fix JVM crash
Replace inlined 'let' containing complicated control flow with common `if`
2016-02-05 17:26:10 +03:00
Valentin Kipyatkov
affbefdfbe Better diagnostic for EA-70945 2016-02-05 16:29:58 +03:00
Valentin Kipyatkov
ce8e2d7a65 Added better diagnostic for EA-75805 2016-02-05 16:29:58 +03:00
Valentin Kipyatkov
3fe6f9cad2 More correct convertation to string template when number literals involved 2016-02-05 16:29:57 +03:00
Valentin Kipyatkov
9c426e70e1 Fixed EA-75114 2016-02-05 16:29:57 +03:00
Valentin Kipyatkov
c914ca0626 Fixed EA-75251 2016-02-05 16:29:57 +03:00
Valentin Kipyatkov
eca581ef43 Fixed EA-75979 2016-02-05 16:29:56 +03:00
Valentin Kipyatkov
8b6338ce62 Fixed EA-76497 2016-02-05 16:29:56 +03:00
Michael Bogdanov
bc2077bfaf More wise lambda search during inlining 2016-02-05 15:42:46 +03:00
Denis Zharkov
16f412f993 Generate multi-files facade even if it's empty
It still contains useful information about it's parts,
that may be used while building stubs for multi-file group
containing only InlineOnly functions
2016-02-05 15:02:24 +03:00
Denis Zharkov
889b136a68 Refine multi-file facades generation
Do not generate delegation from multi-file facade to inline-only functions
because they are effectively private in bytecode

 #KT-10858 Fixed
2016-02-05 15:02:24 +03:00
Dmitry Petrov
e4583fd275 Do not report IMPLICIT_CAST_TO_ANY on last statement of lambda with Unit(?) in at least one branch. 2016-02-05 10:44:50 +03:00
Dmitry Jemerov
fa8706b46a a bit more diagnostics to track down "Cannot find package fragment for file" 2016-02-04 15:50:25 +01:00
Ilya Gorbunov
6038bde3c1 Inline-only Lazy.getValue extension 2016-02-04 17:30:12 +03:00
Yan Zhulanow
8c17c5f40b Pack actual Kotlin Android compiler plugin sources into kotlin-android-extensions-ver-sources.jar 2016-02-04 17:24:44 +03:00
Pavel V. Talanov
c600fe1dc3 Fix "Select in project view" and "autoscroll from source" not working in some cases
#KT-9278 Fixed
  #KT-8356 Fixed
2016-02-04 17:13:21 +03:00
Stanislav Erokhin
9c72a388b2 Random code change to prevent JVM crash on windows (JRE version: 6.0_45-b06)
JVM crash log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x06b1e0ae, pid=2908, tid=1656
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode windows-x86 )
# Problematic frame:
# J  org.jetbrains.kotlin.idea.formatter.KotlinPreFormatProcessor$Visitor.visitNamedDeclaration(Lorg/jetbrains/kotlin/psi/KtNamedDeclaration;)V
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x5f0bb800):  JavaThread "AWT-EventQueue-1 IDEA 15.0.4#IC-143.SNAPSHOT IDEA, eap:true, os:Windows Server 2008 R2 6.1, java-version:Sun Microsystems Inc. 1.6.0_45-b06 IDEA 15.0.4#IC-143.SNAPSHOT IDEA, eap:true, os:Windows Server 2008 R2 6.1, java-version:Sun Microsystems Inc. 1.6.0_45-b06" [_thread_in_Java, id=1656, stack(0x60520000,0x60570000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x8b8721bf

Registers:
EAX=0x0b8721c0, EBX=0x0b655c10, ECX=0x00000000, EDX=0x4789df50
ESP=0x6056d620, EBP=0x6056df7c, ESI=0x0b0b3618, EDI=0x0b8721d0
EIP=0x06b1e0ae, EFLAGS=0x00010246

Top of Stack: (sp=0x6056d620)
0x6056d620:   00000006 0b86d8b8 0afd5c68 026112bb
0x6056d630:   0b86f1a6 0b86f1dc 6056e088 05632944
0x6056d640:   00000004 00000000 6056e088 0b86f214
0x6056d650:   00000086 6056d668 6dae8209 0b86f214
0x6056d660:   0b86f074 00000086 6056d8b0 049aec30
0x6056d670:   0b872170 0b655c10 0b871c80 0b0b5210
0x6056d680:   0b0b4df8 0b8721c0 00000005 0b8705c0
0x6056d690:   0afd5c68 0b86eef8 0afd5c68 0b86d8b8

Instructions: (pc=0x06b1e0ae)
0x06b1e08e:   b9 0e 00 00 89 79 34 8b 4a 68 89 08 89 50 04 33
0x06b1e09e:   c9 89 48 08 89 48 0c 89 44 24 64 b9 00 00 00 00
0x06b1e0ae:   89 88 ff ff ff 7f f0 83 04 24 00 83 fb 00 0f 84
0x06b1e0be:   12 00 00 00 81 7b 04 60 06 0d 45 0f 85 05 00 00

Register to memory mapping:

EAX=
[error occurred during error reporting (printing register info), id 0xc0000005]

Stack: [0x60520000,0x60570000],  sp=0x6056d620,  free space=309k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J  org.jetbrains.kotlin.idea.formatter.KotlinPreFormatProcessor$Visitor.visitNamedDeclaration(Lorg/jetbrains/kotlin/psi/KtNamedDeclaration;)V
J  com.intellij.psi.impl.source.PostprocessReformattingAspect.doPostponedFormattingInner(Lcom/intellij/psi/FileViewProvider;)V
2016-02-04 15:48:18 +03:00
Nikolay Krasko
63a50ca3a9 Can't get file when event is invalid (EA-77748) 2016-02-04 15:12:02 +03:00
Pavel V. Talanov
7c84225cc4 Fix typechecker when initializer of destructuring declaration is unresolved or missing 2016-02-04 15:08:39 +03:00
Pavel V. Talanov
a4e3dd7030 Minor: refactor DestructuringDeclarationResolver 2016-02-04 15:08:39 +03:00
Zalim Bashorov
ba6c738cb5 Minor: don't init AnsiConsole when coloring is disabled 2016-02-04 14:36:31 +03:00
Dmitry Jemerov
bcc3102e05 highlight usages for parameter doesn't look at base declarations
#KT-10204 Fixed
2016-02-04 11:35:22 +01:00
Dmitry Jemerov
37976e516c postpone isJsProject() check
#KT-9026 Fixed
2016-02-04 11:31:46 +01:00
Pavel V. Talanov
abcdae8e69 Prevent recursion when computing parameter list of KtLightMethod (part 2)
Use ClsWrapperStubPsiFactory when building light classes for decompiled kotlin classes
2016-02-04 12:55:19 +03:00
Alexey Sedunov
5f037d372d Intentions: Move member of companion object to corresponding class
#KT-9697 Fixed
2016-02-04 12:26:19 +03:00
Alexey Sedunov
d13ac6b5a4 Intentions: Move class member to companion object
#KT-9697 In Progress
2016-02-04 12:26:18 +03:00
Alexey Sedunov
fe8a0ec2bc Move: Additional test for KT-10553 (private top-level property with default accessors) 2016-02-04 12:26:17 +03:00
Alexey Sedunov
48b538cebf Light Classes: Provide backing fields (if any) as one of property's light elements 2016-02-04 12:26:15 +03:00
Dmitry Petrov
b5145ea68b Use implementation part class for SMAP generation when inlining function both from binaries and sources. 2016-02-04 10:17:30 +03:00
Dmitry Jemerov
0a46033d40 ensure Kotlin's move handlers run before Java's
#KT-10703 Fixed
2016-02-03 17:44:29 +01:00
Alexey Andreev
e9d5d8f0fe [KT-7683] Implement translation of 'when .. in' clause to JS 2016-02-03 19:08:58 +03:00
Natalia Ukhorskaya
6ee4071462 Debugger: use top elements to cache classnames to minimize cache size 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
2fa00f87e0 Minor: add some clarifications 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
9b978377d0 Debugger: merge KotlinPositionManagerCache into KotlinDebuggerCaches 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
b5b2bbc9ab Minor: rename KotlinEvaluateExpressionCache 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
ccd22cd5ca KotlinPositionManager: use cache for classNames where possible 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
f28f7eaa3b ExtraSteppingFilter: do not compute classNames for inline 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
876e458c04 Add cache for library files 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
e89638f937 Move typeMappers cache to KotlinPositionManagerCache 2016-02-03 18:53:50 +03:00
Natalia Ukhorskaya
c808f4ec2a KotlinPositionManager: add cache for classNames by psiElement 2016-02-03 18:53:50 +03:00
Mikhail Glukhikh
60d56b30bf Safe call arguments are now handled as nullable in generic resolver #KT-9985 Fixed 2016-02-03 18:34:10 +03:00
Dmitry Jemerov
187694d1b0 don't veto rename of constructors
#KT-9693 Fixed
2016-02-03 15:58:05 +01:00
Stanislav Erokhin
34d8dd9127 Add optimization for fake overrides creation. 2016-02-03 17:47:40 +03:00
Stanislav Erokhin
ec991b4ced Minor. Update run configuration. 2016-02-03 17:47:39 +03:00
Zalim Bashorov
030c55ebb2 Minor: fix testdata 2016-02-03 17:35:14 +03:00
Ilya Gorbunov
805410bb19 J2K: Remove special conversion for String.format. 2016-02-03 17:14:02 +03:00
Ilya Gorbunov
c243a2bdd5 In addition to extension String.format introduce String.Companion.format(format, args) to be used like in java. 2016-02-03 17:14:01 +03:00
Ilya Gorbunov
7105c7c182 Documentation stubs for new packages. 2016-02-03 17:04:28 +03:00
Mikhail Glukhikh
0c32fab690 Type comparison: first check for star projections, then obtain constructor parameters #KT-10893 Fixed
Also #EA-78405 Fixed
2016-02-03 16:26:39 +03:00
Pavel V. Talanov
c5be8ce1d3 Prevent recursion when computing parameter list of KtLightMethod
#KT-10890 Fixed
 #KT-10851 Fixed
2016-02-03 16:08:05 +03:00
Dmitry Petrov
4afe98a0f6 Better diagnostics for conflicting overloads.
Skip declarations without sources in reporting, not when determining redeclaration groups:
this allows emitting informative diagnostics for incremental compilation.
Provide containing declaration with "kind", e.g., "package '<root>'", "class A", and so on.
2016-02-03 15:53:07 +03:00
Zalim Bashorov
130301aa27 Minor: log the content of module.xml when a source root not found on FS
Related issues: #KT-9587 #KT-10394
2016-02-03 15:28:20 +03:00
Dmitry Jemerov
e227f6fc74 use more deterministic check to determine that "Configure Kotlin in project" notification should be displayed
#KT-10898 Fixed
2016-02-03 13:18:54 +01:00
Michael Bogdanov
394221fefb Updated test data 2016-02-03 10:35:32 +03:00
Michael Bogdanov
6ae6f72156 Fix for crashed build 2016-02-03 10:35:31 +03:00
Michael Bogdanov
4b203de608 INVISIBLE_MEMBER_FROM_INLINE renamed to NON_PUBLIC_CALL_FROM_PUBLIC_INLINE 2016-02-03 10:35:29 +03:00
Michael Bogdanov
d1db404959 Error diagnostic for private classes in inline functions; Fix for KT-7545: IllegalAccessError when accessing private nested class through inlined function from different package
#KT-7545 Fixed
2016-02-03 10:32:41 +03:00
Michael Bogdanov
71c2a6e792 Generate package private visibility in bytecode for private classes 2016-02-03 10:32:41 +03:00
Ilya Gorbunov
751ac3912d IDEA version for bootstrapping (use IDEA built with kotlin rc branch) 2016-02-03 00:23:10 +03:00
Ilya Gorbunov
f19ef6e3d5 SAM-constructors for Iterable and Sequence interfaces. 2016-02-03 00:13:17 +03:00
Ilya Gorbunov
947fd84f1e Minor: reorder primitive specializations in generated code (according to the order they defined in java). 2016-02-02 22:06:34 +03:00
Ilya Gorbunov
7a50562a4e Minor: reorder families in generated code. 2016-02-02 22:06:34 +03:00
Ilya Gorbunov
477b57cdfd Rearrange stdlib, part 2: rename files to better represent their content. 2016-02-02 22:06:33 +03:00
Ilya Gorbunov
57cfa54957 Rearrange stdlib between files and folders, rename files to better represent their content.
Fix package part name in testData
2016-02-02 22:06:32 +03:00
Dmitry Jemerov
c881cd1070 use new API for excluding Kotlin plugin from update checks 2016-02-02 16:19:29 +01:00
Dmitry Jemerov
45a387668b don't show two "Rename variables" checkboxes for a Kotlin class
#KT-8509 Fixed
2016-02-02 15:55:54 +01:00
Dmitry Jemerov
db5191041f better place for J2K options
#KT-10513 Fixed
2016-02-02 14:43:26 +01:00
Mikhail Glukhikh
45298e0bad Delegated properties now cannot be used before initialization #KT-10869 Fixed 2016-02-02 16:27:20 +03:00
Dmitry Petrov
65f754ffca Fix KT-10764 IDEA doesn't show overload conflict between constructor and function...
When checking for overloads in package, consider functions and top-level class constructors as possibly conflicting between each other. NB OverloadUtil uses containing package scope from module descriptor.

Change diagnostic message for CONFLICTING_OVERLOAD: it's misleading in case of fun vs constructor conflict.

Add custom multifile test for diagnostics in IDE (probably not the best; should preprocess file content if it's required to check highlighting in multiple files, not only in the first file).

Add test for KT-10765 Incremental compilation misses overload conflict between constructor and function ...
2016-02-02 16:21:26 +03:00
Nikolay Krasko
7dd725f0a4 Failed build is good enough for version increment 2016-02-02 16:10:54 +03:00
Dmitry Jemerov
4a1d282de6 don't try to parse empty text as XML 2016-02-02 13:40:23 +01:00
Denis Zharkov
8df05c6c4c Refine 'isMoreSpecific' calculation
Choose member with better visibility, it's needed for proper calculation
of types intersection member scope

 #KT-10481 Fixed
2016-02-02 15:26:49 +03:00
Ilya Gorbunov
148b53fc62 Add UTF_32 charsets to Charsets object as lazy initialized properties.
#KT-10379 Fixed
2016-02-02 15:23:22 +03:00
Natalia Ukhorskaya
f29efc2ca2 Evaluate expression shouldn't be applicable for class name of Java class in static call
#KT-7261 Fixed
2016-02-02 15:16:14 +03:00
Natalia Ukhorskaya
893c2495fe Minor: regenerate tests 2016-02-02 15:16:14 +03:00
Natalia Ukhorskaya
51ea804d88 Debugger: do not write exception to log in some valid cases 2016-02-02 15:16:14 +03:00
Natalia Ukhorskaya
45f96f8f32 Evaluate expression shouldn't be applicable for name of named parameter in function call
#KT-7266 Fixed
2016-02-02 15:16:14 +03:00
Natalia Ukhorskaya
4f76207a27 Fix breakpoints in inline function with generic crossinline argument
#KT-10673 Fixed
2016-02-02 15:16:14 +03:00
Natalia Ukhorskaya
b19d32e4f2 Public members should have bigger priority in debugContext
#KT-10634 Fixed
2016-02-02 15:16:14 +03:00
Natalia Ukhorskaya
d60a5e65c1 Debugger: skip visibility check 2016-02-02 15:16:14 +03:00
Dmitry Petrov
bad8320038 Fix for KT-10881 Declaring constant in a mutlifile class causes an IllegalAccessError on its usage.
Generate fields for 'const' properties in facade class.

NB reading annotations for 'const' vals in multifile class doesn't work, KT-10892.
2016-02-02 15:06:21 +03:00
Dmitry Jemerov
970d6f6834 generate local variables table for @JvmOverloads-generated methods
#KT-7319 Fixed
2016-02-02 12:11:51 +01:00
Yan Zhulanow
da7acd5e73 Check annotations on default property getter/setter 2016-02-02 13:14:56 +03:00
Mikhail Glukhikh
7e528da00a Regression codegen test #KT-8344 Obsolete 2016-02-02 12:43:52 +03:00
Denis Zharkov
816c66063b Report special diagnostic when fake-call receiver is nullable
#KT-3602 Fixed
2016-02-02 08:17:49 +03:00
Denis Zharkov
829a5639f1 Rework error reporting for fake call resolution
Move diagnostic creation to one place
2016-02-02 08:17:48 +03:00
Denis Zharkov
9b3f557337 Report MEMBER_PROJECTED_OUT on calls with smart cast receiver
#KT-10856 Fixed
2016-02-02 08:17:48 +03:00
Ilya Gorbunov
05192547da Make DEFAULT_BUFFER_SIZE a constant. 2016-02-01 22:20:31 +03:00
Ilya Gorbunov
801a26a544 Fix testData 2016-02-01 22:20:30 +03:00
Ilya Gorbunov
a192915c82 Do not inline Regex.replace 2016-02-01 22:20:28 +03:00
Ilya Gorbunov
dccae6c3ff Introduce annotation InlineExposed to indicate internal members effectively public due to usage in inlined functions.
Currently, doesn't affect anything.

Make collectionSizeOrDefault and collectionSizeOrNull internal, but expose them via inlining together with mapCapacity.

Make Regex(Pattern) constructor exposed by inlined Pattern.toRegex
2016-02-01 22:20:27 +03:00
Ilya Gorbunov
dacf25fdec Make all assert inline. Field _Assertions.ENABLED instead of property ASSERTIONS_ENABLED 2016-02-01 22:09:19 +03:00
Ilya Gorbunov
c763b592a5 IDEA version for bootstrapping
Build markdown every time (again).
2016-02-01 22:09:18 +03:00
Ilya Gorbunov
1cef327880 Throw assertion when inline-only is applied without inline 2016-02-01 22:09:17 +03:00
Ilya Gorbunov
a12fe2c18a Do not use inline-only in java 2016-02-01 22:09:17 +03:00
Ilya Gorbunov
8a00db5661 Include internal annotatations in mock runtime 2016-02-01 22:09:16 +03:00
Ilya Gorbunov
fc3f98dae2 Deprecate currentThread property 2016-02-01 22:09:15 +03:00
Ilya Gorbunov
42bd8df2ca Drop CharSequence.get extension 2016-02-01 22:09:14 +03:00
Ilya Gorbunov
1eee1fa803 Swap parameters in File.forEachBlock 2016-02-01 22:09:13 +03:00
Ilya Gorbunov
abe927056b Inline-only in kotlin.comparisons 2016-02-01 22:09:13 +03:00
Ilya Gorbunov
54977ee09a Inline-only in kotlin.io 2016-02-01 22:09:12 +03:00
Ilya Gorbunov
47d580cbc5 Inline-only in kotlin.text 2016-02-01 22:09:11 +03:00
Ilya Gorbunov
56c5758db1 Inline-only in kotlin and kotlin.system packages, split Float/Double extension implementations for JVM and JS to make them inline-only in JVM. 2016-02-01 22:09:10 +03:00
Ilya Gorbunov
40fae0463f Inline-only in kotlin.concurrent, make all timer utilities inline. 2016-02-01 22:09:09 +03:00
Ilya Gorbunov
ce5fd3ee77 Inline-only in kotlin.collections 2016-02-01 22:09:08 +03:00
Ilya Gorbunov
c7bd70732c Inline-only in generated code 2016-02-01 22:09:07 +03:00
Ilya Gorbunov
8c0008aa2e StdLib Generators: support three flavors of inline 2016-02-01 22:09:07 +03:00
Dmitry Jemerov
38b58db4f9 don't apply StandardScriptDefinition in REPL 2016-02-01 19:16:31 +01:00
Dmitry Jemerov
84f9cb9bfd correctly separate stdout and stderr when parsing REPL output 2016-02-01 19:06:17 +01:00
Ilya Gorbunov
3ae4c033b6 Wrap exceptions thrown by class builders and add details about class file being generated. 2016-02-01 19:59:06 +03:00
Michael Bogdanov
5f38c1d571 Fix for KT-10729: Accessing private const field in companion object from a function in the same companion generates run-time error 2016-02-01 18:42:19 +03:00
Michael Bogdanov
9790afb1bd Idea dependency updated to 143.2072 2016-02-01 18:32:13 +03:00
Michael Bogdanov
328b9bfeda Removed old default generation 2016-02-01 18:32:12 +03:00
Pavel V. Talanov
a90f8122bd Fix NPE on trying to compile script files
(There is still no design)
2016-02-01 17:33:46 +03:00
Mikhail Glukhikh
d194af5c4e Correct report of NO_VALUE_FOR_PARAMETER when function call contains no brackets and lambda at the end #KT-7813 Fixed 2016-02-01 17:11:54 +03:00
Mikhail Glukhikh
84100abd9e Annotations on object literals are now correctly resolved #KT-9320 Fixed 2016-02-01 16:24:57 +03:00
Yan Zhulanow
a041414f35 Kapt: compile kotlinAfterJava without Jdk as well in Android projects (KT-10854) 2016-02-01 14:33:02 +03:00
Denis Zharkov
e5f644a64a Temporary disable warning about unchecked reified argument
#KT-10847 Fixed
 #KT-6484 Reopened
2016-02-01 13:36:38 +03:00
Alexey Sedunov
b0c808082f Pull Members Up: Skip visibility checking between members to move 2016-02-01 13:18:47 +03:00
Alexey Sedunov
f9632c1ad6 Pull Members Up: Use light field if property doesnt't have light methods
#KT-10552 Fixed
2016-02-01 13:18:46 +03:00
Alexey Sedunov
e386a6b0e9 Go to Test Action: Make available in the entire class text range
#KT-10757 Fixed
2016-02-01 13:18:45 +03:00
Alexey Sedunov
3e2036b6ec Convert Member to Extension Intention: Drop open/final modifiers, add imports when necessary, transform Java-site calls
#KT-8876 Fixed
2016-02-01 13:18:44 +03:00
Alexey Sedunov
99e4c8c06d Create from Usage: Add commas after enum entries
#KT-10800 Fixed
2016-02-01 13:18:43 +03:00
Alexey Sedunov
26c47cda47 Convert Object Literal to Lambda Intention: Move lambda out of parentheses when possible. Fix after-template
#KT-10778 Fixed
2016-02-01 13:18:41 +03:00
Alexey Sedunov
1c65797950 Intentions: Fix contentRange() on empty KtBlockExpression
#KT-10776 Fixed
2016-02-01 13:18:40 +03:00
Alexey Sedunov
c5b1d205a2 Initialize Property with Constructor Parameter Quick-Fix: Skip secondary constructors with this-delegation. Use containing class as a Change Signature context
#KT-10818 Fixed
2016-02-01 13:18:39 +03:00
Alexey Sedunov
fcbb18d876 Generate equals()/hashCode(): Forbid in interfaces
#KT-10815 Fixed
2016-02-01 13:18:38 +03:00
Alexey Sedunov
58963f7053 Move: Improved file chooser with search
#KT-9752 Fixed
2016-02-01 13:18:37 +03:00
Alexey Sedunov
625bfe12eb Move: Do not create target directory outside of write-action 2016-02-01 13:18:36 +03:00
Alexey Sedunov
222dfd265b Move: Forbid target annotation classes in class chooser 2016-02-01 13:18:35 +03:00
Alexey Sedunov
8e18bf647e Move: Fix refactoring command name 2016-02-01 13:18:34 +03:00
Alexey Sedunov
a05a16c1e6 Move: Fix name lengthening when moving from default package
#KT-10696 Fixed
2016-02-01 13:18:33 +03:00
Alexey Sedunov
d92bfd20d7 Move Class To Upper Level: Fix file name validation 2016-02-01 13:18:31 +03:00
Ilya Gorbunov
4f1418bb72 Verify index expectations for reduceIndexed/reduceRightIndexed 2016-01-31 02:45:05 +03:00
Ilya Gorbunov
1357c77d0b Minor: verify exception type of failed fold/reduce 2016-01-31 02:45:04 +03:00
Gabriel Borges
d58efff974 Add foldIndexed and reduceIndexed groups of functions
- foldIndexed, foldRightIndexed, reduceIndexed and reduceRightIndexed have been added, in line with filterIndexed etc.;
- Test cases added appropriately for the new functions.
2016-01-31 02:45:02 +03:00
Dmitry Petrov
b3f390abe5 Fix KT-10775 Empty when causes compilation exception.
Expression type for an empty 'when' is 'kotlin.Unit'.
2016-01-29 18:50:48 +03:00
Mikhail Glukhikh
dcc6262f47 Regression test #KT-7804 Obsolete 2016-01-29 17:23:40 +03:00
Denis Zharkov
505dc61611 Treat extension receiver as noinline parameter
#KT-9574 Fixed
2016-01-29 14:36:53 +03:00
Denis Zharkov
2cd88b8cbc Make crossinline and noinline incompatible 2016-01-29 14:36:53 +03:00
Denis Zharkov
87741e9b9f Minor. Get rid of redundant diagnostic parameters 2016-01-29 14:36:53 +03:00
Denis Zharkov
855a0b3493 Force type calculation for local function if it should be inferred
It helps to catch TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM errors
because they appear after return type calculation began

 #KT-6271 Fixed
 #KT-3272 Obsolete
2016-01-29 14:36:53 +03:00
Denis Zharkov
7d6310d88c Add test for obsolete issue
#KT-9571 Obsolete
2016-01-29 14:36:53 +03:00
Denis Zharkov
36f21932bb Approximate captured type before mapping
#KT-7415 Fixed
2016-01-29 14:36:53 +03:00
Denis Zharkov
5b0fdcb3fe Fix stack overflow caused star projection 2016-01-29 14:36:53 +03:00
Denis Zharkov
6b33e3fb67 Minor. Rename variables and add assertion 2016-01-29 14:36:53 +03:00
Mikhail Glukhikh
4691351e76 Fix for unprocessed lambda under not-null assertion #KT-10843 Fixed
Also #EA-76890 Fixed
2016-01-29 12:57:52 +03:00
Michael Bogdanov
e1fa6491c1 Test for obsolete KT-10044: "Don't know how to generate outer expression for class" with lambda in init block
#KT-10044 Obsolete
2016-01-29 12:42:37 +03:00
Michael Bogdanov
b9c30c739e Test for obsolete KT-7224: Redundant result boxing on ?. call on a primitive
#KT-7224 Obsolete
2016-01-29 12:13:16 +03:00
Michael Bogdanov
c9cc9c55cd Added assertion for super call with default arguments in function default impl body 2016-01-29 11:02:21 +03:00
Mikhail Glukhikh
767729ba2a Regression test #KT-9633 Obsolete 2016-01-29 10:55:22 +03:00
Dmitry Petrov
112e54b35a KT-10752: if (inferred) type for an expression refers to a Java class
non-accessible in the current context, it is a compiler error.
Otherwise we might generate a CHECKCAST instruction that causes IAE at run-time.
Here we are somewhat less permissive then Java
(see inaccessibleType.kt in diagnostics tests).
2016-01-29 10:30:00 +03:00
Dmitry Petrov
1b78d01ae6 Effective visibility issues in FileBasedKotlinClass.
Make exposed nested classes public.
2016-01-29 10:30:00 +03:00
Evgeny Gerashchenko
c242ad94fd Minor. Syntax error cosmetics. 2016-01-29 01:00:47 +03:00
Evgeny Gerashchenko
0d79c65d73 KT-8275 Unterminated multi-line comment should be compilation error
#KT-8275 fixed
2016-01-29 01:00:47 +03:00
Tim Steinbach
7cad65a1e7 Remove which dependency from startup scripts 2016-01-28 21:48:16 +03:00
Alexander Udalov
2a5b4d2c83 Fix annotations on Java elements in reflection
#KT-10840 Fixed
2016-01-28 21:48:16 +03:00
Alexander Udalov
b946d725d7 Filter out methods without return type to fix EA-73795 2016-01-28 21:48:16 +03:00
Alexander Udalov
7e17482698 Delete kotlin-jdk-annotations and kotlin-android-sdk-annotations
They were empty anyway for a long time
2016-01-28 21:48:16 +03:00
Ilya Gorbunov
911940d458 InlineOnly annotation suppresses NOTHING_TO_INLINE diagnostics. 2016-01-28 19:37:44 +03:00
Mikhail Glukhikh
0f1e6ba8be Refactoring: noTypeCheckingErrorsInExpression introduced 2016-01-28 19:30:25 +03:00
Mikhail Glukhikh
ed8ccdc15a Take into account data flow info changes for special call (if/when/elvis/!!) arguments #KT-10824 Fixed
Smart casts on complex expressions look as no more possible
2016-01-28 19:30:20 +03:00
Dmitry Jemerov
7c59592212 Quickfix for "Expression cannot be invoked as a function" with no arguments to remove parentheses
#KT-10825 Fixed
2016-01-28 17:04:44 +01:00
Dmitry Jemerov
6d7e1c69dc remove logic to filter perf output from compiler output 2016-01-28 16:12:56 +01:00
Dmitry Jemerov
6f7aed2601 report perf only if enabled in command line 2016-01-28 16:12:55 +01:00
Mikhail Glukhikh
7fd1f507e4 Additional catch for ReenteringLazyValueComputationException #KT-8448 Fixed
Also #EA-76264 Fixed
2016-01-28 17:52:33 +03:00
Mikhail Glukhikh
5062ce2804 Regression: correct smart cast from Type? to Type! 2016-01-28 17:08:15 +03:00
Mikhail Glukhikh
26a2319d7c ControlFlowBuilder.getExitPoint() now can return null if nothing was found #KT-10823 Fixed
Also #EA-73355 Fixed
2016-01-28 16:19:54 +03:00
Mikhail Glukhikh
c5d6e8edb4 More detailed error message for EA-77641 2016-01-28 16:19:49 +03:00
Mikhail Glukhikh
7c8cdf84fd ControlFlowProcessor: converted to Kotlin #EA-77380 Fixed 2016-01-28 16:19:45 +03:00
Mikhail Glukhikh
59c2a96eb5 ControlFlowProcessor.java --> ControlFlowProcessor.kt 2016-01-28 16:19:41 +03:00
Mikhail Glukhikh
42b6b41378 ControlFlowInstructionsGenerator: converted to Kotlin 2016-01-28 16:19:37 +03:00
Mikhail Glukhikh
80338ecb88 ControlFlowInstructionsGenerator.java --> ControlFlowInstructionsGenerator.kt 2016-01-28 16:19:33 +03:00
Mikhail Glukhikh
6ba171297c ControlFlowBuilderAdapter: converted to Kotlin 2016-01-28 16:19:29 +03:00
Mikhail Glukhikh
5a405f3ddb ControlFlowBuilderAdapter.java --> ControlFlowBuilderAdapter.kt 2016-01-28 16:19:24 +03:00
Mikhail Glukhikh
605da5b7b9 ControlFlowBuilder: converted to Kotlin 2016-01-28 16:19:20 +03:00
Mikhail Glukhikh
41eed948be ControlFlowBuilder.java --> ControlFlowBuilder.kt 2016-01-28 16:19:16 +03:00
Mikhail Glukhikh
171cdfe08a Unnecessary comments removed 2016-01-28 16:19:12 +03:00
Mikhail Glukhikh
1ddaf465cd PseudocodeImpl: converted to Kotlin 2016-01-28 16:19:08 +03:00
Mikhail Glukhikh
381c1c4bba PseudocodeImpl.java --> PseudocodeImpl.kt 2016-01-28 16:19:03 +03:00
Mikhail Glukhikh
1d6eadbd37 Pseudocode: converted to Kotlin 2016-01-28 16:18:59 +03:00
Mikhail Glukhikh
c54f8ebac7 Pseudocode.java --> Pseudocode.kt 2016-01-28 16:18:55 +03:00
Dmitry Jemerov
95683bbf38 remove old API usage inspection 2016-01-28 14:13:57 +01:00
Nikolay Krasko
e79ad386ef Parametrize maven deploy to allow pushing to bintray 2016-01-28 15:03:27 +03:00
Michael Bogdanov
dc2cb401ad KT-10670: Debugger: Evaluate Expression/Watches fail for inline function parameter initialized with default value
#KT-10670 Fixed
2016-01-28 14:23:24 +03:00
Michael Bogdanov
d4df7aaabc Fix for KT-10659: Debugger: Evaluate Expression and Watches fail for inline function parameter passed by reference
#KT-10659 Fixed
2016-01-28 14:23:24 +03:00
Mikhail Glukhikh
069282cb6e Regression test #KT-8277 Can't Reproduce 2016-01-28 13:33:29 +03:00
Mikhail Glukhikh
12b100c541 Regression test #KT-9529 Obsolete 2016-01-28 12:56:12 +03:00
Ilya Gorbunov
6ac52d19ac Move IndexedValue to kotlin.collections. 2016-01-28 12:41:36 +03:00
Natalia Ukhorskaya
54fa9eff61 Debugger: do not compute classnames for inline functions during stepping 2016-01-28 11:16:44 +03:00
Denis Zharkov
e69b115d9a Remove wrong assertion 2016-01-28 08:36:24 +03:00
Denis Zharkov
29c24267fa Fix project compilation
First parameters of `DiagnosticFactory.on` methods are annotated as 'NotNull'
2016-01-28 08:36:24 +03:00
Denis Zharkov
11a96ee8c8 Introduce not null type parameter capability
Java nullability annotations may generate types that currently are not denotable in Kotlin:
class Java {
  void <F> foo(@NotNull F f) {}
}

Type of given value parameter should be not nullable under any substitution:
String/String?/String! because of annotation contract.

NB: Currently there is no full analogues for such types in pure kotlin
2016-01-28 08:36:23 +03:00
Denis Zharkov
08dd675fcd Minor. Drop unused property 2016-01-28 08:36:23 +03:00
Denis Zharkov
8e3bdd6a0f Minor. Rename parameter and get rid of labels 2016-01-28 08:36:22 +03:00
Denis Zharkov
c26ca5e7ef Turn on inference when resolving constructor super-calls
It's only needed when one of candidates has it's own type parameters
Otherwise it does not make sense as arguments are already specified
2016-01-28 08:35:18 +03:00
Denis Zharkov
6542d091ee Support generic constructors defined in Java
#KT-10686 Fixed
 #KT-10410 Fixed
2016-01-28 08:35:18 +03:00
Alexander Udalov
a02d1b75b8 Mark array constructors with 'inline'
To allow non-local returns from lambdas passed to them
2016-01-28 03:10:40 +03:00
Alexander Udalov
70e847b794 Reimplement generation of intrinsic array constructors
Instead of relying on a class from the runtime (which thus cannot be deleted
from the runtime ever), rely on a class from the compiler instead. This has a
minor downside: that class is compiled by the bootstrap compiler, so if codegen
of 'for'-loops or something else used in that class changes, it won't
immediately have an effect on a local working copy (on the build server
everything will be fine because of a 2-step building process).

In the future it may make sense to just manually create all the bytecode
instructions and dump them into a MethodNode. Currently the amount of work
needed for that seems rather significant
2016-01-28 03:10:39 +03:00
Alexander Udalov
0e11aa098f Minor, prettify Kotlin code in source maps 2016-01-28 03:10:39 +03:00
Alexander Udalov
7d880f10ec Optimize getFqName calls in KotlinBuiltIns
Check the simple name first, and only then construct the full FqName, in all
'is*' methods
2016-01-28 03:10:38 +03:00
Alexander Udalov
04026dbe84 Make Array<T>(size, init) a constructor of Array
It's not marked as inline, this is why 'crossinline' was added in
jaggedArray.kt/jaggedDeep.kt. Will be fixed in the following commits
2016-01-28 03:10:37 +03:00
Alexander Udalov
18238bd6f3 Minor, drop DescriptorRendererOptions#prettyFunctionTypes 2016-01-28 03:10:19 +03:00
Alexander Udalov
9e8b6571f4 Make primitive array factory functions constructors 2016-01-28 03:10:19 +03:00
Alexander Udalov
4b03adaa57 Minor, improve AbstractLazyType#toString for debug 2016-01-28 03:10:19 +03:00
Alexander Udalov
0e481a4340 Minor, fix Array kdoc 2016-01-28 03:10:19 +03:00
Ilya Gorbunov
3d468aaab9 Allow call assertFailsWith<T> with default message. 2016-01-28 00:13:51 +03:00
Mikhail Glukhikh
7e26fa6002 One non-processed branch is now allowed for if statement #KT-10805 Fixed
Also #EA-64033 Fixed
2016-01-27 22:44:52 +03:00
Yan Zhulanow
43b176de7e Minor: fix typo 2016-01-27 19:31:45 +03:00
Yan Zhulanow
c6e6547559 Kapt: add Java task classpath to processorpath 2016-01-27 19:31:45 +03:00
Yan Zhulanow
203d9e150b Kapt: Add kapt.kotlin.generated to the supported options list 2016-01-27 19:31:45 +03:00
Yan Zhulanow
bfae2afdb5 Android Extensions: Remove deprecated k.a.s.<layout> convention 2016-01-27 19:31:45 +03:00
Ilya Gorbunov
d49f5b95b0 Fix deprecations in testData 2016-01-27 19:05:19 +03:00
Ilya Gorbunov
eabac9dcf6 Rename measureTimeNano to measureNanoTime 2016-01-27 18:34:33 +03:00
Ilya Gorbunov
d46501e11b Make all remaining deprecations to be errors. 2016-01-27 18:34:32 +03:00
Ilya Gorbunov
263e1b4b5d Drop deprecated mapIndexedTo on Maps. 2016-01-27 18:34:31 +03:00
Ilya Gorbunov
744a7a83f7 Cleanup RC deprecations in compiler and plugin. 2016-01-27 18:34:30 +03:00
Yan Zhulanow
c7a0375c25 Fix AndroidSubplugin applicability check (plain Java Gradle project) 2016-01-27 17:17:47 +03:00
Yan Zhulanow
16958d7a66 Android Extensions: Clear findViewById cache just before RETURN (KT-10720) 2016-01-27 17:17:47 +03:00
Yan Zhulanow
ec4f1b16de Remove obsolete Android Extensions plugin 2016-01-27 17:17:47 +03:00
Yan Zhulanow
32037fdd2e Do not remove all imports if "Optimize Imports" is executed on a file outside source dirs #KT-9925 2016-01-27 17:17:47 +03:00
Yan Zhulanow
4e82fabc7d kapt: Pass Kotlin annotations to process() 2016-01-27 17:17:47 +03:00
Dmitry Petrov
c5fd496cc9 Fix KT-10805 for 'when'. 2016-01-27 17:07:20 +03:00
Dmitry Petrov
9db3440e72 Fix type inference issues for 'if' and 'when'.
Use 'expectedType' (when present) as an explicit type argument for a special construct call.
Unfortunately, this approach can't be used for elvis due to other elvis-related inference hacks.
Fixes KT-10807, KT-10811.
This also affects KT-6189: now we can infer proper type for 'if'.

If type inference for special call failed, and we found no type errors in sub-expressions,
report TYPE_INFERENCE_FAILED_ON_SPECIAL_CONSTRUCT error.
This (and the hack above) fixes KT-10809: code no longer compiles.
2016-01-27 17:07:20 +03:00
Dmitry Jemerov
e3e463ef70 nicer UI for choosing a configurator when multiple options are available 2016-01-27 13:49:45 +01:00
Nikolay Krasko
7c8a5b0b83 Make change signature fix non-applicable for constructors (EA-76554) 2016-01-27 14:00:16 +03:00
Alexey Tsvetkov
8331442661 Fix clause that causes removing deleted files from LookupStorage 2016-01-27 12:31:14 +03:00
Alexey Tsvetkov
0a48d83176 Make LookupStorage thread safe
#KT-10792: Fixed
2016-01-27 12:31:14 +03:00
Alexey Tsvetkov
44b3159867 Move InlineFunctionsMap to IncrementalCacheImpl 2016-01-27 12:28:44 +03:00
Alexey Tsvetkov
2abc422577 Fix updating java mappings for multifile facade 2016-01-27 12:28:44 +03:00
Alexey Tsvetkov
56942930c9 Minor: remove unreachable code 2016-01-27 12:28:44 +03:00
Alexey Tsvetkov
cfc45aa763 Update incremental cache version 2016-01-27 12:28:44 +03:00
Alexey Tsvetkov
a474165a8f Recompile subtypes when class member is changed 2016-01-27 12:28:44 +03:00
Ilya Gorbunov
4296b7f882 Breaking: make copyTo return target file instead of its size. 2016-01-27 00:29:09 +03:00
Ilya Gorbunov
8d02467e6d Introduce plusElement and minusElement to disambiguate situations like List<List<T>> + List<T>
#KT-9992 Fixed
2016-01-27 00:00:01 +03:00
Zalim Bashorov
fb21ef2e1d Use interner in LookupTracker implementations to reduce memory consuming 2016-01-26 23:14:20 +03:00
Dmitry Jemerov
c83b4b3842 clean ZipHandler cache after disposing CoreApplicationEnvironment to avoid storing stale ZipHandlers referring to disposed CoreJarFileSystem instance in ZipHandler.ourFileAccessorCache 2016-01-26 19:51:59 +01:00
Yan Zhulanow
26ed1c3756 Move Android Extensions subplugin to the main kotlin-gradle-plugin artifact 2016-01-26 21:13:37 +03:00
Mikhail Glukhikh
d94930149b Warning for open members in objects 2016-01-26 19:04:17 +03:00
Mikhail Glukhikh
1b8f938260 Report EXPOSED_PROPERTY_TYPE on a property name only #KT-10760 Fixed 2016-01-26 19:04:13 +03:00
Mikhail Glukhikh
b1e3e1c32d A few forgotten checks added for objects (function members effective visibility, multiple varargs) #KT-10753 Fixed 2016-01-26 19:04:08 +03:00
Mikhail Glukhikh
0368631aa3 Source code fix: exposed visibility in object members 2016-01-26 19:04:04 +03:00
Mikhail Glukhikh
22c0ddaa48 Destructuring declaration initializer now cannot use extension componentX() on nullable #KT-7794 Fixed 2016-01-26 19:03:28 +03:00
Mikhail Glukhikh
850dc89b38 For-loop now cannot use extension iterator on a nullable #KT-7428 Fixed 2016-01-26 19:03:23 +03:00
Alexey Sedunov
218dd41a08 Move: More accurate visibility analysis
#KT-10553 Fixed
2016-01-26 18:19:20 +03:00
Alexey Sedunov
64f6c62d4f Move: Implement "Move nested class to another class" UI
#KT-9027 Fixed
2016-01-26 18:19:16 +03:00
Alexey Sedunov
e943508d87 Move: Implement "Move nested class to upper level" UI
#KT-9027 In Progress
2016-01-26 18:19:13 +03:00
Alexey Sedunov
d662b02e95 Move: Nested classes support
#KT-9027 In Progress
2016-01-26 18:19:09 +03:00
Yan Zhulanow
0304bd1dc1 More precise diagnostic messages about "operator modifier is not applicable" 2016-01-26 17:21:44 +03:00
Yan Zhulanow
3fa506fd45 "Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors 2016-01-26 17:21:44 +03:00
Denis Zharkov
f560799bb7 Support top level wildcard types
#EA-73650 Fixed
2016-01-26 16:41:29 +03:00
Nikolay Krasko
5b6f7486ce KotlinSetupEnvironmentNotificationProvider now uses indecies so it not DumbAware anymore (EA-78406) 2016-01-26 16:29:56 +03:00
Nikolay Krasko
d5768dc4ff Fix PsiInvalidElementAccessException in suppression check (EA-71132) 2016-01-26 16:29:55 +03:00
Nikolay Krasko
e7685735bb KtUnaryExpression.baseExpression may be null (EA-78379) 2016-01-26 16:29:53 +03:00
Nikolay Krasko
06939b11e4 Fix NPE in GotoSuperActionHandler.java (EA-77295) 2016-01-26 14:58:44 +03:00
Zalim Bashorov
aebf681809 Rename module "build" -> "build-common" 2016-01-26 14:32:21 +03:00
Denis Zharkov
8ec63bd4dd Use type arguments from supertype when resolving constructor delegation call
#KT-3357 Fixed
2016-01-26 13:53:45 +03:00
Denis Zharkov
8b828f1d9a Use known type substitutor if it exists 2016-01-26 13:53:45 +03:00
Natalia Ukhorskaya
b442cf9fec Debugger: check that virtual machine allows to get bytecodes 2016-01-26 13:36:39 +03:00
Ilya Gorbunov
23080f78f7 Map.getOrPut: treat nulls as missing values. 2016-01-26 11:49:18 +03:00
Ilya Gorbunov
a49db730a9 Map.getOrElse: treat nulls as missing values. 2016-01-26 11:49:17 +03:00
Ilya Gorbunov
90a239e74c Provide toMutableList as a replacement for toArrayList. 2016-01-26 11:49:15 +03:00
Ilya Gorbunov
a709ba4a6e Provide toMap with the destination mutable map to populate.
Tune type projections of map mutating operations.
2016-01-26 11:49:13 +03:00
Ilya Gorbunov
564155734b Introduce associateTo and associateByTo with the destination MutableMap to fill. 2016-01-26 11:49:12 +03:00
Ilya Gorbunov
e41bf687d9 Deprecate toLinkedMap 2016-01-26 11:49:10 +03:00
Ilya Gorbunov
8224a4e186 Rename toMap and toMapBy to associate and associateBy 2016-01-26 11:49:03 +03:00
Ilya Gorbunov
45c9cc4add Breaking: Change File.copyTo contract to be similar to Files.copy from JDK8. 2016-01-26 11:49:02 +03:00
Ilya Gorbunov
67663c43ae Introduce overwrite parameter to File.copyRecursively.
#KT-8924 Fixed
2016-01-26 02:26:33 +03:00
Ilya Gorbunov
d03c174650 Deprecate assertFailsWith with java Class<T> parameter.
#KT-10377
2016-01-26 02:26:33 +03:00
Ilya Gorbunov
28ab9eebbc minor: manual cleanup 2016-01-26 02:26:33 +03:00
Alexander Udalov
36e41554e1 Do not load old metadata annotation in check-library-abi-version.kts
Also do not force recompiling markdown since we've moved to 1.1.0 now
2016-01-25 22:41:45 +03:00
Stanislav Erokhin
e53e152f83 Removed hacks for code migration from ConstraintSystemImpl. 2016-01-25 21:53:09 +03:00
Ilya Gorbunov
7703252239 Provide groupBy and groupByTo with keySelector and valueTransform.
Rename parameters of groupBy, add type parameter for MutableMap to groupByTo.
2016-01-25 21:15:56 +03:00
Ilya Gorbunov
0eaaee8202 StdLib Generators: parse generic function parameters into primitive model 2016-01-25 21:15:19 +03:00
Stanislav Erokhin
210c9ab3db Minor. Added regression tests for: KT-3927, KT-9522, KT-10036, KT-7440, KT-9682, KT-9808, KT-9517, KT-9810, KT-9345. 2016-01-25 19:13:32 +03:00
Stanislav Erokhin
298a075381 Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
2016-01-25 19:13:31 +03:00
Stanislav Erokhin
d7438d9f2b Add mock runtime to diagnostic tests.
Mock runtime contains function from file Standard.kt
2016-01-25 19:13:30 +03:00
Nikolay Krasko
6ac73eb760 Remove blocking cache in Kotlin JavaElementFinder (KT-9811)
Attempt to remove cache completely. There's now cache in JavaPsiFacadeImpl.findClass() that probably solves the original problem.
2016-01-25 17:08:22 +03:00
Michael Bogdanov
874560df9d Fix for KT-10715: Verify error on incrementing backing field from accessor 2016-01-25 16:56:57 +03:00
Michael Bogdanov
cf09949354 Fix for KT-10590: IllegalAccessError when protected getter of Java base class is accessed from lambda using property access syntax 2016-01-25 16:56:56 +03:00
Natalia Ukhorskaya
9d66852ae2 J2K: convert method references according to special methods 2016-01-25 15:02:48 +03:00
Natalia Ukhorskaya
25b64b198c Minor: fix NPE 2016-01-25 12:47:45 +03:00
Natalia Ukhorskaya
ba323098ea Debugger: fix EE for localvariables inside inline function call
#KT-10674 Fixed
2016-01-25 12:47:45 +03:00
Natalia Ukhorskaya
203cab8d1b Debugger: fix step over for if with inline function call without lambda arguments 2016-01-25 12:47:45 +03:00
Nikolay Krasko
dbc2299cf2 Update test jar during runtime library update (KT-10773)
#KT-10773 Fixed
2016-01-25 11:37:56 +03:00
Stanislav Erokhin
aca19ed27a KT-10772 Problem with daemon on Idea 15.0.3 & 1-dev-25
# KT-10772 Fixed
2016-01-24 12:29:23 +03:00
Ilya Gorbunov
a78b08d9c7 Use generic coerceIn for nullable primitives, provide specialization for non-nullable ones.
Fix docs for coerceAtMost.
2016-01-24 06:44:13 +03:00
Alexander Udalov
7981e5aa3a Increase metadata version to 1.1, hardcode incompatibility with 1.0
Add a temporary option to suppress incompatibility errors when compiling Kotlin
against current IDEA libraries until they are migrated
2016-01-23 10:00:19 +03:00
Ilya Gorbunov
13b1e91eb5 StdLib Generators: fix type projections, do not use concat. 2016-01-23 05:13:26 +03:00
Alexander Udalov
714df7b433 Add temporary compiler option to suppress incompatibility errors
To compile Kotlin against current IDEA libraries until they are migrated to 1.1
2016-01-22 23:53:47 +03:00
Stanislav Erokhin
f688b1b786 Relax rules for type parameters in property receivers 2016-01-22 22:18:57 +03:00
Stanislav Erokhin
30bb8d4828 Minor. Optimized enhanceSignature method 2016-01-22 22:09:33 +03:00
Stanislav Erokhin
f710ba88f8 Minor. Removed TypeParameterDescriptor#getLowerBounds 2016-01-22 22:09:33 +03:00
Ilya Gorbunov
9a41e07ac0 Use IDEA 143.1960 built with master kotlin branch.
Remove tweaks required to bootstrap packages.
Restore non-star imports of kotlin.text.Charsets.
2016-01-22 22:06:22 +03:00
Alexey Tsvetkov
cfc410261b Minor: fix test data 2016-01-22 21:04:46 +03:00
Mikhail Glukhikh
0ff07af3ef DelegatingDataFlowInfo: potential concurrent modification in multi map fixed 2016-01-22 20:44:58 +03:00
Denis Zharkov
982dfa9183 Minor. Specify variables type explicitly
It's needed because 'assertEquals' has 'OnlyInputType' annotation
on type parameter, and type of 're.exec(string)!!' is 'Array<String?>',
while 'arrayOf("A5D5", "A5", "D5")' is 'Array<String>'
2016-01-22 19:17:22 +03:00
Denis Zharkov
6c0cd70a22 Introduce PureReifiable annotation
It prevents reporting unsafe substitution warning on expressions
like 'arrayOf(arrayOf(""))'
2016-01-22 19:17:22 +03:00
Denis Zharkov
32755a269c Support annotations on type parameters in stub builder 2016-01-22 19:17:22 +03:00
Denis Zharkov
d7e035fd9b Serialize annotations on type parameters in builtins 2016-01-22 19:17:22 +03:00
Denis Zharkov
4cf1393e81 Minor. Render annotations on type parameters 2016-01-22 19:17:22 +03:00
Denis Zharkov
70dc5b5403 Prohibit use of captured type as argument for reified parameter
#KT-8093 Fixed
2016-01-22 19:17:22 +03:00
Denis Zharkov
751f66c656 Report warning on generic type as argument for reified parameter
#KT-6484 Fixed
2016-01-22 19:17:22 +03:00
Denis Zharkov
ae6c62ddff Minor. Report reified-related diagnostics on arguments if possible 2016-01-22 19:17:22 +03:00
Denis Zharkov
5baa0ed4bb Minor. Rename TypeUtils.containsSpecialType -> contains 2016-01-22 19:17:22 +03:00
Denis Zharkov
a5c13ce8cf Approximate projections in SAM type when creating SAM adapter
Use the same approach as Java 8 applies to function types
(see non-wildcard parametrization in §9.9 of JLS)

 #KT-6918 Fixed
2016-01-22 19:17:22 +03:00
Denis Zharkov
d87b13931d Create special type for missing dependencies when resolving annotations
#KT-10748 Fixed
2016-01-22 19:17:22 +03:00
Nikolay Krasko
76f60294a8 Temporary revert old system of source roots for idea-full and intellij-core 2016-01-22 19:01:39 +03:00
Dmitry Jemerov
4846776242 don't show "Kotlin not configured" notification for files outside a source root 2016-01-22 16:42:58 +01:00
Mikhail Glukhikh
e9af4d25d0 Handling of try / catch / finally with 'Nothing' in all catch blocks #KT-10735 Fixed 2016-01-22 16:37:22 +03:00
Mikhail Glukhikh
60f5d9ef8b DelegatingDataFlowInfo: do not create redundant instances 2016-01-22 16:37:19 +03:00
Mikhail Glukhikh
2ee9f22242 DelegatingDataFlowInfo: never store original type or its supertypes #KT-10666 Fixed 2016-01-22 16:37:16 +03:00
Mikhail Glukhikh
e04338f4fa Minor refactoring: DelegatingDataFlowInfo.create() 2016-01-22 16:37:13 +03:00
Mikhail Glukhikh
366ab508e1 Data flow analysis: assignment of null makes variable effectively of type 'Nothing?' 2016-01-22 16:37:10 +03:00
Mikhail Glukhikh
859059d714 Bug fix: jump out of a loop inside if condition 2016-01-22 16:37:07 +03:00
Mikhail Glukhikh
b3c5760eb5 Type intersection fix: T & (final A) is no more calculated as just A #KT-7801 Fixed 2016-01-22 16:37:04 +03:00
Mikhail Glukhikh
3106a8508a Front-end and back-end test for KT-7801 2016-01-22 16:37:00 +03:00
Mikhail Glukhikh
7ac55cefcb Extra test with smart cast to 'T' 2016-01-22 16:36:57 +03:00
Mikhail Glukhikh
d5ffa0bbca DelegatingDataFlowInfo: default constructor 2016-01-22 16:36:54 +03:00
Mikhail Glukhikh
7870ad2445 DataFlowInfo converted to Kotlin, DataFlowInfoFactory introduced 2016-01-22 16:36:51 +03:00
Mikhail Glukhikh
9e1c2f396e DataFlowInfo.java --> DataFlowInfo.kt 2016-01-22 16:36:48 +03:00
Alexey Tsvetkov
f63a9ee556 Optimize adding lookups to lookup storage 2016-01-22 16:01:36 +03:00
Alexey Tsvetkov
f32ff42ba3 Recompile implicit type usages when class signature is changed 2016-01-22 16:01:36 +03:00
Alexey Tsvetkov
310a995bb1 Add lookup for every expression's type 2016-01-22 16:01:36 +03:00
Alexey Tsvetkov
1ef615e020 Add incremental compilation test with change of annotation class 2016-01-22 16:01:36 +03:00
Alexey Tsvetkov
5ce692a75c Improve proto comparison test with changes of annotation list 2016-01-22 16:01:35 +03:00
Alexey Tsvetkov
58a91b3d20 Add proto comparison tests with changes of class/member flags 2016-01-22 16:01:35 +03:00
Alexey Tsvetkov
a7c432ebe8 Add incremental compilation tests with changes of companion object 2016-01-22 16:01:35 +03:00
Alexey Sedunov
618f9f62f6 Code Insight: "Generate toString" action
#KT-10309 Fixed
2016-01-22 15:50:19 +03:00
Alexey Sedunov
77b637e238 Change Signature: Skip Java methods which can't be resolved from Kotlin (such as methods of local classes)
#KT-10432 Fixed
2016-01-22 15:50:17 +03:00
Alexey Sedunov
0104bfec86 Add val/var to Constructor Parameter: Fix caret position before starting template 2016-01-22 15:50:16 +03:00
Alexey Sedunov
8da986ff24 Add Initializer Quick-Fix: Place caret at the end of generated initializer
#KT-10704 Fixed
2016-01-22 15:50:15 +03:00
Alexey Sedunov
9081f5df52 Introduce Variable: Move caret to the end of declaration when replacing "statement" expression
#KT-10663 Fixed
2016-01-22 15:50:14 +03:00
Pavel V. Talanov
16ab4bec34 Try to diagnose NoDescriptorForDeclarationException in completion 2016-01-22 15:32:37 +03:00
Dmitry Petrov
55b7e4bbf0 Ignore special resolved calls for 'when' in PSI unifier. 2016-01-22 10:41:56 +03:00
Dmitry Petrov
a33c840939 Fix Kotlin build after fixing when-related type checking issues.
Filed: KT-10752, KT-10755.
2016-01-22 10:41:55 +03:00
Dmitry Petrov
f371e67ce8 PatternMatchingTypingVisitor:
rewrite type inference for 'when' using special constructs.
This fixes several type inference issues for 'when':
KT-9929, KT-9972, KT-10439, KT-10463
along with some other diagnostics-related issues.
2016-01-22 10:41:55 +03:00
Dmitry Petrov
b49e08fe04 PatternMatchingTypingVisitor:
separate condition data flow info analysis and exhaustiveness check
from type inference for "incomplete" (statement-like) 'when'.
2016-01-22 10:41:55 +03:00
Michael Bogdanov
a76d16931c Temporary generate old default method 2016-01-22 10:10:32 +03:00
Michael Bogdanov
829978a37d Added additional parameter for default methods 2016-01-22 10:10:32 +03:00
Ilya Gorbunov
875287574f Update testData for LoadBuiltinsTest and BuiltInDecompilerTest 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
4d5ec9be3f Drop identityEquals from builtins, compiler and tests. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
f5f5a2dcc1 Move progression final element test to stdlib tests.
Less values are tested for iteration not to timeout in js tests.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov
2a125ca92d Drop deprecated builtins: PropertyMetadata, progression internal utils, HiddenDeclaration and Extension annotations 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
31ec7bcbea Deprecate String.concat with error severity.
Fix concat j2k conversion.
Add expected deprecation errors for Java String constructors that must be converted to special Kotlin String methods.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov
2257fa36ec Drop deprecations: text and system
Fix import in testData
Fix testData: replace removed method.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov
8bf638c60f Drop deprecations: FileTreeWalk deprecated API elements. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
e9c14a02d3 Make FilePathComponents internal, temporary disable tests of internal API 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
c1ad82ff8c Harden charset-as-string taking function deprecations.
Fix usages in compiler.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov
6d5a65cac6 Minor: remove File?.readTextOrEmpty() 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
d728a1a6c7 Replace File.relativePath from stdlib with File.descendantRelativeTo in fileUtils.
IO utils: cleanup java usages.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov
b39b29dfea Drop deprecations: io and threading functions. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
25c4453dc5 Cleanup deprecated symbol usages in testData 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
eefbd72a64 Remove AddStarProjectionsFix for removed javaClass<T> function. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
cbc3a3b595 Make IndexingIterator and IndexingIterable internal. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
9142025df6 Drop deprecations: reflection utilites. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
69f884dcd3 Drop deprecations: preconditions with non-lazy message. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
768a23f7eb Drop deprecations: functions that were converted to properties. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
2813840769 Fix testData: diagnostics changed. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
ef0d998fbc Drop deprecations: *Raw functions. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
d1a5988bfc Drop deprecations: complicated map delegates and kotlin.support.AbstractIterator. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
4f1d2252f0 Make test for replacement, which requires adding import to the package with operator, independent from stdlib. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
d7f8754282 Drop deprecated classes inheriting multifile facade classes moved out of kotlin package. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
473773723b Drop deprecations in kotlin.test 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
85a02d40c6 Drop hidden declarations provided for binary compatibility 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
264c9a0fc9 Drop deprecated toGenerator and toLinkedList (again). 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
b97e436a50 Fix deprecated Range and Progression usages in testData 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
d48ec7e296 Update testData for LoadBuiltinsTest 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
91f4cf0ebc Drop Progression<T> and its deprecated properties: start, end, increment.
Drop deprecated range extensions.
Make progression constructors private.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov
6dd8470835 Drop deprecated primitive ranges and progressions: for Byte and Short 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
e8621cb738 Drop Range<T> interface and its extensions. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
face6d449b Make values in Typography constant, add dollar sign. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
6eabd1d692 Move stdlib classes between packages. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
f4822cd757 Fix testData in compiler: add collections and ranges package to fq-names. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
98e2d27c77 Resolve types from all builtin default packages in TypeUnifierTest 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
c84cbfb36a Allow to specify fq-names in expected resolve testData 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
3262a4ddc2 LoadBuiltinsTest inspects three packages: kotlin, kotlin.collections and kotlin.ranges 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
db9e458cf9 Fix imports in maven kotlin from java usage example. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
46a59b7550 Fix imports in java: temporary replace with star imports. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
0213a129ce Increment STUB_VERSION due to changed fq-names in signatures. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
26a6147a56 Minor: array constructor names formatting. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
1129cee0ff Collect nested classes from all 4 builtin packages. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
e500e4bdf4 Obtain purely implemented interface class descriptor by its fq-name. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
e485bd4909 Fix mutability-flexible types rendering. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
83ef48d0ac Refer to builtin names in HeuristicSignatures and j2k TypeVisitor 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
346291af7b Use fq-names from KotlinBuiltins.FQ_NAMES instead of hardcoded ones. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
9c0f0cad70 Packages: move collections to kotlin.collections. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
9fbbc9db98 Packages: move Ranges, Progression, ProgressionIterators to kotlin.ranges and PrimitiveIterators to kotlin.collections. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
a3efa1ea6c Temporary allow-kotlin-package for building compiler 2016-01-22 05:54:38 +03:00
Ilya Gorbunov
3176f7d06c Restore downloading IDEA from teamcity, build markdown every time (temporary) 2016-01-22 05:54:38 +03:00
Alexander Udalov
0b7d2e3a68 Do not write old callable proto flags, use only new ones 2016-01-22 05:51:14 +03:00
Ilya Gorbunov
300a4be060 Deprecate Map.minus and minusAssign operators.
Disable tests failing in JS.
2016-01-22 01:13:33 +03:00
Ilya Gorbunov
7896e58afc Rename sequence function to generateSequence 2016-01-22 01:13:31 +03:00
Ilya Gorbunov
63e8865123 Make Lazy an interface open to implementation.
#KT-9287 Fixed
2016-01-22 01:03:18 +03:00
Ilya Gorbunov
dbcad08a35 Regex: MatchResult.groupValues do not exclude zeroth group, use the same indices as in groups collection.
Provide destructured property for destructured assignment.
2016-01-22 00:59:13 +03:00
Ilya Gorbunov
3459a24b0a Regex: Introduce MatchResult.groupValues to get list of numbered group values exlcuding zeroth group with the entire match. 2016-01-22 00:56:08 +03:00
Pavel V. Talanov
1fe749c114 Refactor: get rid of LightClassUtil#getPsiClass() in favor of KtClassOrObject:toLightClass extension 2016-01-21 20:47:22 +03:00
Pavel V. Talanov
2972dbca00 Rename LightClassGenerationSupport.getPsiClass -> getLightClass and make it return KtLightClass 2016-01-21 20:47:21 +03:00
Pavel V. Talanov
06215ca932 Correctly avoid calculation of autogenerated parameter name in ClsParameterImpl.calcName() 2016-01-21 20:47:21 +03:00
Pavel V. Talanov
36d5798a2e Regression test for old issue
#KT-7656 Fixed
2016-01-21 20:47:20 +03:00
Zalim Bashorov
1e6b3c5ae1 Add own PathStringDescriptor to compare paths properly on case-insensitive filesystems 2016-01-21 19:47:10 +03:00
Ilya Chernikov
c585d91e79 Adding generation states destroying to module-based compilation, to fix kapt usage with this compilation path 2016-01-21 19:47:09 +03:00
Ilya Chernikov
3615ca5b02 build.xml: add kotlin-build target 2016-01-21 19:47:08 +03:00
Ilya Chernikov
a61e5a6736 build.xml: add manifest to kotlin-daemon-client.jar 2016-01-21 19:47:07 +03:00
Ilya Chernikov
6198d0abbc Move compiler running utils to common module 2016-01-21 19:47:06 +03:00
Ilya Chernikov
a36e6a2e07 J2K KotlinModuleXmlBuilder: convert 2016-01-21 19:47:05 +03:00
Ilya Chernikov
60892f2b9c J2K KotlinModuleXmlBuilder: rename file 2016-01-21 19:47:04 +03:00
Zalim Bashorov
cc1c5b7e10 Move back classes which used only in JPS 2016-01-21 19:47:04 +03:00
Zalim Bashorov
e2e0167880 Minor: don't override clean in SourceToClassesMap 2016-01-21 19:47:03 +03:00
Ilya Chernikov
5ead2edaa0 Creating shared module "build", copying lookup storage, tracker and incremental cache related files into it from jps plugin 2016-01-21 19:47:02 +03:00
Valentin Kipyatkov
84e530bc1a KT-6079 Show "parameter information" popup for type arguments
#KT-6079 Fixed
2016-01-21 19:07:39 +03:00
Michael Bogdanov
bf16783fb7 Fix for KT-9591: Exception on inlining
#KT-9591 Fixed
2016-01-21 18:44:05 +03:00
Valentin Kipyatkov
53fe1568c9 KT-8529 Code completion for parameter name and type together replaces wrong range on Tab
#KT-8529 Fixed
2016-01-21 18:30:09 +03:00
Valentin Kipyatkov
bc8095ce33 KT-9424 "Exclude from import and completion" with "Project" scope
#KT-9424 Fixed
2016-01-21 18:30:08 +03:00
Alexey Tsvetkov
9bb876e6da Test incremental facade to class conversion and vice versa 2016-01-21 18:16:01 +03:00
Alexey Tsvetkov
94d4dae1fe Recompile all class usages when constructor is changed 2016-01-21 18:14:56 +03:00
Nikolay Krasko
5fcb9ca2bd Add speed to perfomance output 2016-01-21 17:45:51 +03:00
Nikolay Krasko
10648f44ac Do not auto-import convention methods without 'operator' modifier (KT-10212)
#KT-10212 Fixed
2016-01-21 17:45:51 +03:00
Dmitry Jemerov
84d507b770 code review 2016-01-21 15:30:13 +01:00
Dmitry Jemerov
4910b06f2c show "kotlin not configured" editor notification 2016-01-21 15:30:11 +01:00
Dmitry Jemerov
170ba98b20 show unsupported ABI notification only when current module or its dependencies have libraries with bad ABI 2016-01-21 15:30:11 +01:00
Dmitry Jemerov
6f80f36f2e UnsupportedAbiVersionNotificationPanelProvider: fix compilation and cleanup after J2K 2016-01-21 15:30:10 +01:00
Dmitry Jemerov
b1c5d3644e UnsupportedAbiVersionNotificationPanelProvider: J2K 2016-01-21 15:30:10 +01:00
Dmitry Jemerov
e20fdac9df UnsupportedAbiVersionNotificationPanelProvider: rename to .kt 2016-01-21 15:30:09 +01:00
Dmitry Jemerov
2379fd80fc don't show "kotlin not configured" notification for modules where the runtime is outdated 2016-01-21 15:30:08 +01:00
Dmitry Jemerov
85ea295e92 OutdatedKotlinRuntimeNotification: J2K and cleanup 2016-01-21 15:30:08 +01:00
Dmitry Jemerov
ca9979f9fb OutdatedKotlinRuntimeNotification.java: rename to .kt 2016-01-21 15:30:07 +01:00
Dmitry Jemerov
2272516d09 KotlinRuntimeLibraryUtil: J2K 2016-01-21 15:30:07 +01:00
Dmitry Jemerov
f588ef2912 KotlinRuntimeLibraryUtil: rename to .kt 2016-01-21 15:30:06 +01:00
Dmitry Jemerov
6c2a2b91b4 offer "All modules" choice in "Configure Kotlin in project" dialog, allow to invoke the action when there are no Kotlin files in the project
#KT-7979 Fixed
2016-01-21 15:30:05 +01:00
Dmitry Jemerov
4ffac80710 ConfigureKotlinInProjectUtils: convert to Kotlin, cleanup 2016-01-21 15:30:05 +01:00
Dmitry Jemerov
cff06cccf7 ConfigureKotlinInProjectUtils.kt: rename 2016-01-21 15:30:04 +01:00
Dmitry Jemerov
3b4a6afe01 Kotlin-produced test run configurations replace Java-produced ones (to avoid duplicate run configuration suggestions appearing since KtFile.getClasses() was implemented) 2016-01-21 14:46:26 +01:00
Dmitry Jemerov
51799ef70e fix tests on Windows agents: report canonical paths to conflicting Kotlin runtimes 2016-01-21 11:33:32 +01:00
Denis Zharkov
ad24092fd1 Move InlineOnly to kotlin.internal package 2016-01-21 11:26:01 +03:00
Denis Zharkov
ba506170e9 Use 'mapToCallableMethod' for delegateTo signature calculation
#KT-9707 Fixed
2016-01-21 11:24:23 +03:00
Valentin Kipyatkov
3a7ed33de1 KT-10747 "Incompatible stack heights" when compiling call to Java setter with non-void return type using property syntax
#KT-10747 Fixed
2016-01-21 10:48:47 +03:00
Alexander Udalov
d2d0f399db Minor, save parameters to field in ValueArgumentsToParametersMapper 2016-01-21 00:36:35 +03:00
Alexander Udalov
8fe964f269 Resolve array access RHS always as the last argument of the call
Also do not attempt to match any of the arguments in the brackets with the last
parameter of the 'set' method

 #KT-10633 Fixed
2016-01-21 00:36:35 +03:00
Dmitry Jemerov
ccef1ad49e report presence of multiple different versions of kotlin-runtime on the classpath as compilation error if other compilation errors have occurred 2016-01-20 21:02:44 +01:00
Dmitry Jemerov
4f5b2ec4b4 AnalyzerWithCompilerReport: some more cleanup after J2K 2016-01-20 21:00:24 +01:00
Dmitry Jemerov
bf5cdcb6b4 AnalyzerWithCompilerReport: J2K 2016-01-20 21:00:24 +01:00
Dmitry Jemerov
ae1e680319 AnalyzerWithCompilerReport: rename to .kt 2016-01-20 21:00:23 +01:00
Pavel V. Talanov
b34a91eeaa Changes inside init blocks should be considered out of block modifications 2016-01-20 19:02:53 +03:00
Pavel V. Talanov
d72bc78550 Resolve annotations on parameters of function type 2016-01-20 18:06:23 +03:00
Pavel V. Talanov
7d72875227 Create descriptors for parameters inside parameter list of KtFunctionType
Do not throw when trying to resolveToDescriptor those parameters
2016-01-20 18:06:19 +03:00
Michael Bogdanov
23480a5698 Supported inline of array convention simple cases; Fix for KT-9211: M13 an extension function that is inline, and for get(v) causes an exception when called using brackets
#KT-9211 Fixed
2016-01-20 17:33:50 +03:00
Michael Bogdanov
84dbdf2ccb Get rid of ValueParameterDescriptor in 'afterParameterPut' fun 2016-01-20 17:33:49 +03:00
Dmitry Jemerov
aacf2ad68c proguard: keep all JNA methods (some of them are accessed from native code) 2016-01-20 14:34:50 +01:00
Dmitry Jemerov
f88f38f7d2 Android Studio adds Android-Gradle facet to all modules, so we need to check for Android facet and Gradle module instead
#KT-9600 Fixed
2016-01-20 14:32:10 +01:00
Dmitry Jemerov
4ab6436f93 avoid index access in KtFile.getClasses() when the file isn't part of a multi-file class (helps with KT-10684) 2016-01-20 13:45:42 +01:00
Denis Zharkov
ede4b61980 Add tests for obsolete issue
#KT-7412 Obsolete
2016-01-20 14:27:53 +03:00
Denis Zharkov
06fbc9bdd3 Support reification of arrays containing reified parameters
#KT-10555 Fixed
2016-01-20 14:27:53 +03:00
Valentin Kipyatkov
28331bca9f KT-9418 Suggest name for new declaration basing on unresolved names in code
#KT-9418 Fixed
2016-01-20 13:55:56 +03:00
Valentin Kipyatkov
83ca4b84f9 Minor optimization 2016-01-20 13:55:55 +03:00
Alexander Udalov
17e8eafe33 Pass -Xallow-kotlin-package to compiler in project
To compile the 'builtins' module
2016-01-20 00:55:43 +03:00
Valentin Kipyatkov
59fb90a5ee Dropped KtTypedef 2016-01-19 19:31:44 +03:00
Valentin Kipyatkov
808c7453a4 Added test for 'typealias' being keyword 2016-01-19 19:31:44 +03:00
Valentin Kipyatkov
68853fecc3 Removed support for "typealias" declarations from the parser
#KT-10683 Fixed
2016-01-19 19:31:44 +03:00
Valentin Kipyatkov
38d374d4b9 Added test for nested class 2016-01-19 19:30:19 +03:00
Valentin Kipyatkov
2791d99f9d Direct implementation of ImportingScope 2016-01-19 19:30:19 +03:00
Valentin Kipyatkov
d337dff5fa Minor 2016-01-19 19:30:18 +03:00
Valentin Kipyatkov
d749f85a60 Inaccessible classes from the current package to not conflict with visible classes from somewhere else 2016-01-19 19:30:18 +03:00
Valentin Kipyatkov
bfe728526a Alias imports to hide symbols by original name from the current package too 2016-01-19 19:30:18 +03:00
Valentin Kipyatkov
e83bd759e6 Minor 2016-01-19 19:30:18 +03:00
Alexander Udalov
e2f49536f5 Move OldPackageFacadeClassUtils to module light-classes 2016-01-19 18:54:08 +03:00
Alexander Udalov
c78bf6c807 Set bytecode version to 1.0.0
It was 1.0.2 only because it was introduced as a clone of the metadata version,
which is 1.0.2 at the moment
2016-01-19 18:43:07 +03:00
Alexander Udalov
27dbfc7aef Rethrow InvalidProtocolBufferException with class file location info 2016-01-19 18:39:59 +03:00
Alexander Udalov
4d93d18af7 J2K DeserializedDescriptorResolver: prettify 2016-01-19 18:39:59 +03:00
Alexander Udalov
3efa51af40 J2K DeserializedDescriptorResolver: convert 2016-01-19 18:39:59 +03:00
Alexander Udalov
432d458c02 J2K DeserializedDescriptorResolver: rename .java -> .kt 2016-01-19 18:39:59 +03:00
Alexander Udalov
b216ed99b4 Simplify UTF-8 decoding, just trivially convert bytes to 16-bit Unicode
ASM will do the rest (see ByteVector#encodeUTF8)
2016-01-19 18:39:59 +03:00
Alexander Udalov
9620893fa4 Drop synthetic class kind Function, drop Metadata#xi 2016-01-19 18:39:59 +03:00
Alexander Udalov
aef6d49b48 Drop isLocalClass, do not write KotlinLocalClass 2016-01-19 18:39:59 +03:00
Alexander Udalov
e17cd12c3c Report error on generating calls to binary incompatible classes 2016-01-19 18:39:59 +03:00
Alexander Udalov
4bd1d064bb Do not load built-ins in old format, drop class_name extension 2016-01-19 18:39:59 +03:00
Alexander Udalov
625c46d568 Delete obsolete and unused class_annotation JVM proto extension 2016-01-19 18:39:59 +03:00
Alexander Udalov
6dbd29e6a4 Support decoding of both old and new encoded metadata 2016-01-19 18:39:59 +03:00
Alexander Udalov
5585c7da7f Minor, simplify utfEncoding, add option to force using 8to7 encoding 2016-01-19 18:39:59 +03:00
Andrey Breslav
fe15984a59 Direct encoding into UTF-8 bytes, without the 8-to-7-bit conversion 2016-01-19 18:39:59 +03:00
Alexander Udalov
693a9c9453 Write new flags to proto messages for callables
This is needed to get rid of two unused bits: Flags.RESERVED_1 and
Flags.RESERVED_2. The old flags are still there temporarily because of the
bootstrap dependency on built-ins. Soon the old flags will be dropped and the
current flags will be transformed to the new format
2016-01-19 18:39:59 +03:00
Alexander Udalov
86bbc9f15b Read new Metadata annotation in check-library-abi-version.kts 2016-01-19 18:39:59 +03:00
Alexander Udalov
a4daa08e5c Write module name as proto extension instead of another annotation argument 2016-01-19 18:39:59 +03:00
Alexander Udalov
d4c4515944 Refactor BinaryVersion and subclasses, get rid of static factories 2016-01-19 18:39:59 +03:00
Alexander Udalov
e37bd4eba6 Do not write and read KotlinInterfaceDefaultImpls
This was only used in InlineTestUtil.kt and had no effect in the condition
2016-01-19 18:39:59 +03:00
Alexander Udalov
7906ac63b5 Read Metadata annotation, support option to ignore old annotations 2016-01-19 18:39:59 +03:00
Alexander Udalov
59dab0a558 Combine all metadata annotations into one kotlin/Metadata 2016-01-19 18:39:59 +03:00
Alexander Udalov
661af854fa Drop KotlinClassHeader#filePartClassNames, use 'data' instead 2016-01-19 18:39:59 +03:00
Alexander Udalov
b587d3a78d Use JvmMetadataVersion where appropriate instead of bytecode version 2016-01-19 18:39:59 +03:00
Alexander Udalov
bd47e9d47b Split JVM binary version into two: metadata and bytecode interface
Currently all code only uses the first one (JvmMetadataVersion), later the
bytecode interface version (JvmBytecodeBinaryVersion) will be used only in
codegen and reflection to avoid compiling against or calling methods with
unsupported conventions like default method naming and signature,
getters/setters naming etc.
2016-01-19 18:39:59 +03:00
Alexander Udalov
fc88a0186f Drop obsolete synthetic class kind in KotlinClassHeader 2016-01-19 18:39:59 +03:00
Alexander Udalov
9552accaec Introduce BinaryVersion.isCompatible()
To decrease the chance to mix up the receiver and the first argument when
checking version compatibility
2016-01-19 18:39:59 +03:00
Alexander Udalov
04d335db15 Move version constants to corresponding BinaryVersion subclasses 2016-01-19 18:39:59 +03:00
Alexander Udalov
2f64680b63 Add several subclasses of BinaryVersion
To simplify comparison of expected vs actual versions in the future
2016-01-19 18:39:59 +03:00
Yan Zhulanow
4cd2ff040d J2K: convert hex Java literal to hex Kotlin literal 2016-01-19 23:29:58 +09:00
Zalim Bashorov
bd9b2f9f06 Restore logging changes when process them using lookups and add assert to avoid getting parent from root FqName 2016-01-19 16:33:44 +03:00
Mikhail Glukhikh
9360bd49a6 Data flow info: correct disjunction of a type with Nothing: Type U Nothing = Type #KT-9578 Fixed 2016-01-19 16:01:10 +03:00
Mikhail Glukhikh
5d3186ac49 DelegatingDataFlowInfo: converted to Kotlin 2016-01-19 16:01:08 +03:00
Mikhail Glukhikh
4cc2450b37 DelegatingDataFlowInfo.java --> DelegatingDataFlowInfo.kt 2016-01-19 16:01:05 +03:00
Valentin Kipyatkov
a1d760fc36 KT-10631 Consider creating a synthetic property even when the setter returns 'this'
#KT-10631 Fixed
2016-01-19 15:57:20 +03:00
Dmitry Petrov
eef68e0a94 J2K: PatternMatchingTypingVisitor.kt: convert to Kotlin and cleanup 2016-01-19 15:02:45 +03:00
Dmitry Petrov
3e2d9a6a27 J2K: PatternMatchingTypingVisitor.java -> PatternMatchingTypingVisitor.kt 2016-01-19 14:24:09 +03:00
Pavel V. Talanov
ce42d47383 Resolve lambda argument types when failing to resolve call 2016-01-19 14:14:33 +03:00
Nikolay Krasko
adbf098166 Store information is file was compiled with Kotlin in attributes (KT-10312)
- Add boolean attribute for all binary files in the project
- Stop using JarUserDataManager for full file indexing
- Store full header of files compiled with Kotlin in file UserData
2016-01-19 13:33:51 +03:00
Nikolay Krasko
5431c6937f Allow to configure print accuracy and fetch temprory results from profiler 2016-01-19 13:33:51 +03:00
Nikolay Krasko
61bd0e7265 Refactoring: Remove unused class 2016-01-19 13:33:51 +03:00
Nikolay Krasko
803bd55f70 Minor: refactoring 2016-01-19 13:33:51 +03:00
Dmitry Jemerov
f85c4dd458 cleanup KotlinProjectViewProvider 2016-01-19 11:04:10 +01:00
Dmitry Jemerov
52acd34a61 fix Maven build 2016-01-19 10:54:04 +01:00
Dmitry Jemerov
b60621c428 tests fixed 2016-01-19 10:53:53 +01:00
Dmitry Jemerov
39c6e3712b add test to check that "Only the Kotlin standard library is allowed to use the 'kotlin' package" is reported in JPS builds 2016-01-19 10:53:49 +01:00
Dmitry Jemerov
39ad2b2378 return correct exit code when script execution fails 2016-01-19 10:53:48 +01:00
Dmitry Jemerov
f3faa10fcc forbid compiling code in packages with names starting with 'kotlin' unless the -Xallow-kotlin-package command line option is specified 2016-01-19 10:53:47 +01:00
Dmitry Jemerov
6b354748ba KotlinToJVMBytecodeCompiler: cleanup after J2K 2016-01-19 10:53:45 +01:00
Dmitry Jemerov
bccd64de19 KotlinToJVMBytecodeCompiler: J2K 2016-01-19 10:53:44 +01:00
Dmitry Jemerov
0d88595baf KotlinToJVMBytecodeCompiler: rename to .kt 2016-01-19 10:53:43 +01:00
Dmitry Jemerov
e4903c1a47 proguard: don't exclude native libraries when repackaging jna.jar (IDEA core code now accesses FileSystemUtil which uses JNA) 2016-01-19 10:51:21 +01:00
Mikhail Glukhikh
7f2624c9a1 Handling of annotations on delegated property in descriptor loader & stub builder 2016-01-19 11:38:58 +03:00
Mikhail Glukhikh
e4f7446bec JvmSynthetic forbidden for delegated properties (and searched for different use-site targets) 2016-01-19 11:38:53 +03:00
Mikhail Glukhikh
a2bba7c8f1 JvmField forbidden for delegated properties 2016-01-19 11:38:49 +03:00
Mikhail Glukhikh
ec909d0775 Volatile forbidden for delegated properties (and checked for other use-site targets) 2016-01-19 11:38:45 +03:00
Mikhail Glukhikh
b78d481bb1 delegate use-site targeted annotations: parser, front-end, codegen with some tests #KT-10502 Fixed 2016-01-19 11:38:41 +03:00
Mikhail Glukhikh
474076a550 Annotation use-site refactoring: field, property, getter 2016-01-19 11:38:36 +03:00
Denis Zharkov
e9693e987f Humanize type mismatch diagnostic caused by type projections
#KT-10581 Fixed
2016-01-19 11:05:41 +03:00
Dmitry Petrov
0c52960d7a KT-10706: do not report IMPLICIT_CAST_TO_ANY on expressions of type Nothing 2016-01-19 10:50:09 +03:00
Zalim Bashorov
5889ba4293 Minor: extract most of JPS (old IC) specific part from IncrementalCacheImpl 2016-01-18 22:13:29 +03:00
Dmitry Jemerov
f1b5e72b99 always add mavenCentral() as buildscript repository dependency (KT-10342)
#KT-10342 Fixed
2016-01-18 20:09:30 +01:00
Ilya Gorbunov
14f17e76e1 Deprecate dropWhileTo and takeWhileTo on CharSequences. 2016-01-18 21:46:33 +03:00
Ilya Gorbunov
5bbce7a1de Deprecate 'comparator { ... }' in favor of Comparator SAM-constructor. Provide SAM-like constructor for JS. 2016-01-18 21:46:32 +03:00
Ilya Gorbunov
67ef790abc Move comparison related functions to kotlin.comparisons, update imports in stdlib. 2016-01-18 21:46:31 +03:00
Ilya Gorbunov
c250921643 Deprecate getOrImplicitDefault to make it private later. 2016-01-18 21:46:30 +03:00
Ilya Gorbunov
aafd79078f Provide mutableSetOf and mutableMapOf
#KT-9663 Fixed
2016-01-18 21:46:29 +03:00
Ilya Gorbunov
fe8ba4d356 Provide mutableListOf.
Deprecate linkedListOf.
#KT-9663
2016-01-18 21:46:28 +03:00
Dmitry Jemerov
60ca1cbcf3 don't represent Kotlin project view nodes as light classes (KT-10703) 2016-01-18 19:07:51 +01:00
Dmitry Jemerov
8cca34a00e KotlinProjectViewProvider: J2K 2016-01-18 19:00:56 +01:00
Dmitry Jemerov
f4d4ab691b KotlinProjectViewProvider: rename to .kt 2016-01-18 18:58:52 +01:00
Stanislav Erokhin
206fecf872 Possible fix for KT-10603. 2016-01-18 19:45:34 +03:00
Valentin Kipyatkov
4c62304a1d KT-10337 Object marked as unused
#KT-10337 Fixed
2016-01-18 17:40:04 +03:00
Valentin Kipyatkov
4c2a14ff43 KT-9834 Optimizing imports with named import (kinda like static import)
#KT-9834 Fixed
2016-01-18 17:40:03 +03:00
Valentin Kipyatkov
bec16efbd7 Add/remove argument name intentions to work for super class constructor call 2016-01-18 17:40:03 +03:00
Valentin Kipyatkov
c44340a351 Corrections on code review 2016-01-18 15:34:20 +03:00
Valentin Kipyatkov
65f5dd1dd5 Got rid of special methods "applyTo" without editor parameter in intentions 2016-01-18 15:34:20 +03:00
Valentin Kipyatkov
552359ce03 KT-7443 Inspection + intention to replace assert (x != null) with "!!" or elvis
#KT-7443 Fixed
2016-01-18 15:34:20 +03:00
Mikhail Glukhikh
5ad4571ddf 'IMPLICIT_NOTHING_PROPERTY_TYPE' is now an error 2016-01-18 14:04:38 +03:00
Mikhail Glukhikh
380e2dd153 Diagnostic message fixed for 'PRIVATE_SETTER_FOR_OPEN_PROPERTY' 2016-01-18 14:04:34 +03:00
Mikhail Glukhikh
1c789f6862 minor 2016-01-18 14:04:25 +03:00
Dmitry Petrov
a073f29006 KT-10460: use unsubstituted descriptors
while comparing overloaded generic functions  for specificity.
2016-01-18 12:25:04 +03:00
Alexander Udalov
d21ce08548 Minor, remove pointless environment creation in LoadJava test 2016-01-17 22:55:55 +03:00
Alexander Udalov
f88abc5b1f Minor, cleanup InlineTestUtil.kt 2016-01-17 20:00:13 +03:00
Alexander Udalov
d50a531934 Slightly improve bytecode version check during inline
Add class name to the exception message and provide a system property to
disable the check
2016-01-17 16:28:22 +03:00
Alexander Udalov
cf7f2b762f Minor, refactor and simplify RuntimePackagePartProvider
Lazy was unnecessary because we effectively were immediately evaluating it
after creation anyway
2016-01-17 16:28:22 +03:00
Alexander Udalov
0f2befd327 Minor, fix typos in GenerateProtoBufCompare.kt 2016-01-17 16:28:22 +03:00
Alexander Udalov
f6b5c31e39 build.xml: build kotlin-test along with rest of runtime JARs 2016-01-17 16:28:22 +03:00
Alexander Udalov
8c3661c01c build.xml: add option to skip jarjar of reflect 2016-01-17 16:28:22 +03:00
Alexander Udalov
078a53e6a0 Minor, add regression test for KT-10444
#KT-10444 Obsolete
2016-01-17 16:28:22 +03:00
Alexander Udalov
4a31ad0d53 Make PropertyMetadata internal and deprecated with error
To make them inaccessible from Kotlin sources and drop them later. They're
still needed in runtime because Kotlin tests run old IDEA code (which depends
on PropertyMetadata) with our own runtime
2016-01-17 16:28:22 +03:00
Alexander Udalov
d1f2255d38 Extract JS-related LibraryUtils utilities to JsLibraryUtils 2016-01-17 16:28:22 +03:00
Alexander Udalov
f9085327e7 Minor, export kotlin-reflect in 'util'
To allow many modules which depend on 'util' not depend explicitly on
kotlin-reflect
2016-01-17 16:28:22 +03:00
Ilya Gorbunov
57dcbe0aea Cleanup in libraries and tools: use property access syntax. 2016-01-17 15:52:14 +03:00
Ilya Gorbunov
19a4f65fd1 Cleanup in libraries 2016-01-17 15:52:12 +03:00
Ilya Gorbunov
92c2d17910 Cleanup leftovers in compiler and IDE 2016-01-17 15:52:11 +03:00
Ilya Gorbunov
3d5e415c87 Annotate Iterable.forEach and Map.forEach with HidesMembers.
#KT-10538 Fixed
#KT-10479 Fixed
2016-01-16 15:33:12 +03:00
Stanislav Erokhin
133155f4cc Minor. Temporary import forEach as forEachStdLib to avoid problem with introducing HidesMembers annotation 2016-01-16 11:30:38 +03:00
Ilya Gorbunov
56ddd496c5 Hide listFiles as it's no more preferred by overload resolution over synthetic SAM invocations.
#KT-10652 Fixed
2016-01-15 23:53:44 +03:00
Stanislav Erokhin
b185316a6e Create new HidesMembers annotation 2016-01-15 23:32:34 +03:00
Dmitry Jemerov
0c995d0ae1 Merge pull request #808 from mcgee/KT-10196
KT-10196: Suggest to replace 'substring' calls by take/drop/dropLast calls when possible
2016-01-15 19:52:35 +01:00
Dmitry Jemerov
63dd0fc4ae streamlined plugin update logic 2016-01-15 19:18:26 +01:00
Dmitry Jemerov
765d58b8eb plugin autoupdate fixed: always provide plugin descriptor with new version number to plugin downloader 2016-01-15 19:18:26 +01:00
Michael Bogdanov
9cbde911ce Revert of 'Minor. workaround for KT-10679 Wrong outer after inline.' 2016-01-15 18:24:34 +03:00
Michael Bogdanov
7eec1d8e1d Skip inline lambdas in 'InlineCallSite' parameter calculation; Fix for KT-10679: Wrong outer after inline
#KT-10679 Fixed
2016-01-15 18:24:33 +03:00
Pavel V. Talanov
abf4a5cf43 Show kotlin builtIn classes in "go to symbol"
#KT-10474 Fixed
2016-01-15 18:04:59 +03:00
Pavel V. Talanov
af1e83422e Move KotlinGotoClassContributor and KotlinGotoSymbolContributor to a single Kotlin file (j2k on the fly)
Move the file to "goto" package
2016-01-15 18:04:58 +03:00
Pavel V. Talanov
db07d783a2 Member is considered deprecated if it overrides only deprecated members
Property accessor is considered deprecated when the property is
Provide IDE inspection to strikeout members overriding deprecated members (like in java)
2016-01-15 17:53:23 +03:00
Michael Bogdanov
9b3d97470f Prohibit super calls with default parameters 2016-01-15 17:50:48 +03:00
Mikhail Glukhikh
c48c3fc8ed Cleanup: DataFlowAnalyzer, ignore MethodMayBeStatic for SmartCastManager 2016-01-15 17:22:57 +03:00
Mikhail Glukhikh
6157ebe3b8 Separate UNSAFE_IMPLICIT_INVOKE_CALL diagnostics introduced (see KT-8252) 2016-01-15 17:22:54 +03:00
Mikhail Glukhikh
fe11b5a473 Minor 2016-01-15 17:22:50 +03:00
Mikhail Glukhikh
1049d4c53a Nullable function-like property call is prohibited now #KT-8252 Fixed 2016-01-15 17:22:46 +03:00
Mikhail Glukhikh
0f80df7b2e initialDataFlowInfoForArguments introduced in CallExpressionResolver methods #KT-10175 Fixed 2016-01-15 17:22:42 +03:00
Mikhail Glukhikh
16d97ab72c Get rid of MutableDataFlorInfoForArguments.setInitialDataFlowInfo 2016-01-15 17:22:38 +03:00
Mikhail Glukhikh
5ceb973ee9 Minor refactoring of getQualifiedExpressionTypeInfo 2016-01-15 17:22:35 +03:00
Alexander Udalov
bb68aacee4 Minor refactoring in TowerResolver 2016-01-15 17:15:00 +03:00
NataliaUkhorskaya
b73ce68dbd Debugger: quote package fqName properly. Fix muted tests 2016-01-15 15:57:35 +03:00
NataliaUkhorskaya
d4fcb59965 Gradle plugin: fix compatibility with android-gradle plugin 2.0.0-alpha5
#KT-10676 Fixed
2016-01-15 15:56:47 +03:00
Stanislav Erokhin
8f441a020e Minor. workaround for KT-10679 Wrong outer after inline. 2016-01-15 14:44:24 +03:00
Stanislav Erokhin
3a9ecf0bce Change resolution priority about implicit receivers and synthesized member-like descriptors.
Change resolution to consider extensions to implicit receiver before members of another implicit receiver.
Make synthesized member-like extensions resolve right after the members.

#KT-10510 Fixed
#KT-10219 Fixed
2016-01-15 13:11:38 +03:00
Stanislav Erokhin
dee040a5b5 Minor. Extract tower data creation to separate function. 2016-01-15 13:11:37 +03:00
Stanislav Erokhin
dbd6982b3a Move levels to TowerResolver 2016-01-15 13:11:36 +03:00
Denis Zharkov
a2f8ad1396 Minor. Extract constant FQ names 2016-01-15 09:46:30 +03:00
Denis Zharkov
be2f857670 Introduce inline-only functions
They have private visibility in bytecode
2016-01-15 09:46:30 +03:00
Anton Sukhonosenko
b2e98e9353 Suggest to replace 'substring' calls by take/drop/dropLast calls when possible
Code review fixes
#KT-10196 Fixed
2016-01-14 22:40:50 +03:00
Valentin Kipyatkov
15930a42b8 Fixed containingDeclaration for descriptors inside init-blocks for the case of no primary constructor
KT-10226 Wrong Imports optimization ("Unresolved reference" is being added)

 #KT-10226 Fixed
2016-01-14 21:53:41 +03:00
Denis Zharkov
f4613b8db1 Support foreign nullability annotations
#KT-10418 Fixed
 #KT-10594 Fixed
2016-01-14 19:24:10 +03:00
Denis Zharkov
fd8a718797 Get rid of duplicating annotations FQ names usages
E.g. JETBRAINS_NOT_NULL_ANNOTATION were used both in NULLABLE_ANNOTATIONS
and for ANNOTATIONS_COPIED_TO_TYPES
2016-01-14 19:24:10 +03:00
Denis Zharkov
01fd3905be Minor. Fix typo in package name: typeEnhacement -> typeEnhancement 2016-01-14 19:24:10 +03:00
Valentin Kipyatkov
7c6a33a36c KT-10664 No code completion after variable initialized with elvis
#KT-10664 Fixed
2016-01-14 19:23:01 +03:00
Valentin Kipyatkov
b41f2dcda3 KT-10655 No "in" in code completion popup after "!"
#KT-10655 Fixed
2016-01-14 19:23:01 +03:00
Valentin Kipyatkov
2f1108421e Added container information when needed 2016-01-14 19:23:01 +03:00
Denis Zharkov
23d2b87a52 Ignore redundant projections for declaration-site variance 2016-01-14 19:20:00 +03:00
Pavel V. Talanov
06d0a7c17c Avoid throwing on trying to obtain module info by some unexpected light element 2016-01-14 18:35:05 +03:00
Ilya Gorbunov
7ddac1945e Unify functional parameter name for 'let', 'run', 'with', 'apply' scope function with 'use' and 'synchronize'. 2016-01-14 18:31:57 +03:00
Ilya Gorbunov
4eb3cff129 Unify functional parameter name for 'forEachLine', 'forEachBlock', 'repeat' methods with 'forEach' 2016-01-14 18:31:56 +03:00
Ilya Gorbunov
c9ddea6d03 Breaking: File.(buffered)reader/writer now returns less specific InputStreamReader/OutputStreamReader and use UTF-8 encoding by default, allowing to specify different encoding with optional parameter.
File.printWriter supports specifying Charset and uses UTF-8 by default.
#KT-10454 Fixed
2016-01-14 18:31:55 +03:00
Ilya Gorbunov
a64c1ff0f4 Rename defaultBufferSize to DEFAULT_BUFFER_SIZE. 2016-01-14 18:31:43 +03:00
Ilya Gorbunov
d64882e19b File.useLines and Reader.readLines. 2016-01-14 18:30:45 +03:00
Ilya Gorbunov
ddcafdd9b3 J2K: Avoid to convert to deprecated String methods, namely toByteArray. 2016-01-14 18:30:44 +03:00
Ilya Gorbunov
ac15807ba4 Deprecate functions taking charset name as string. 2016-01-14 18:30:42 +03:00
Ilya Gorbunov
68971e2162 Remove redundant JvmName annotations for Array.copyOf, copyOfRange 2016-01-14 18:30:41 +03:00
Ilya Gorbunov
b99e1111f6 Do not use out projection for Array where appropriate. 2016-01-14 18:30:40 +03:00
Ilya Gorbunov
eb5b5331fb Minor: reorder invariant arrays of objects in generated code 2016-01-14 18:30:39 +03:00
Ilya Gorbunov
362e463b26 Preserve type projection for Array.requireNoNulls.
#KT-10039 Fixed
2016-01-14 18:30:37 +03:00
Ilya Gorbunov
90a33fb19c Make return type more specific for File.inputStream and File.outputStream, for String.byteInputStream 2016-01-14 18:30:20 +03:00
Ilya Gorbunov
ea3a2eefe7 File.deleteRecursively returns true even if path specified by File does not exist.
False is returned only in case of incomplete deletion.
Distinguish situations when file was not deleted because it's vanished after listing and because of some other error.
2016-01-14 18:14:12 +03:00
Ilya Gorbunov
5e6489f1a2 Minor: refactor file utils test not to use 'assert' to make test assertions. Use assertTrue, assertFalse, assertEquals, assertFailsWith instead. 2016-01-14 18:14:11 +03:00
Ilya Gorbunov
3ee9c2b9d8 Introduce exitProcess(status) returning Nothing.
#KT-10441 Fixed
2016-01-14 18:14:10 +03:00
Valentin Kipyatkov
5a079defc7 "Rename on import" hides importing of the same symbol by other imports with the original name 2016-01-14 17:05:28 +03:00
Valentin Kipyatkov
47041885ca Do not use incorrect import 2016-01-14 17:05:13 +03:00
Valentin Kipyatkov
866f3f189f Minor 2016-01-14 17:05:13 +03:00
Valentin Kipyatkov
89843685c2 Renamed class 2016-01-14 17:05:13 +03:00
Dmitry Jemerov
af66af07a0 adapt move refactoring to new behavior of KtFile.getClasses() 2016-01-14 14:20:41 +01:00
Dmitry Jemerov
1bc4420734 implement KtFile.getClasses() in plugin (required to have coverage work, among other things) 2016-01-14 14:20:35 +01:00
Michael Bogdanov
607f32615f Type uncapturing 2016-01-14 15:32:50 +03:00
Michael Bogdanov
2228cb6a9a Rollback parameter descriptor propagation to CapturedTypeConstructor 2016-01-14 15:32:50 +03:00
Alexey Sedunov
6e5a2208c0 Misc: Partially revert cleanup (44138f499e) as accessing synthetic properties leads to IllegalAccessError
#KT-10653 Fixed
2016-01-14 13:55:11 +03:00
Alexey Sedunov
1d9bafe196 PSI Unifier: Fix matching of this-expressions
#KT-8293 Fixed
2016-01-14 13:55:10 +03:00
Alexey Sedunov
ed8674c0f9 Safe Delete: Skip usages inside of overriding to-be-deleted declarations
#KT-7253 Fixed
2016-01-14 13:55:09 +03:00
Alexey Sedunov
59bacd932a Minor: Add test for KT-8295 2016-01-14 13:55:08 +03:00
Alexey Sedunov
e7de6400e5 Create from Usage: Make 'Create annotation' low-priority action
#KT-9116 Fixed
2016-01-14 13:55:07 +03:00
Alexey Sedunov
70a851fe44 Move/Change Package Directive Intention: Skip callee references to inner class constructors
#KT-10554 Fixed
2016-01-14 13:55:05 +03:00
Alexey Sedunov
73233b2e90 Change Variable Mutability Quick-Fix: Forbid on non-primary-constructor parameters
#KT-10601 Fixed
2016-01-14 13:55:03 +03:00
Alexey Sedunov
5a108c5cde Generate equals/hashCode Action: Use Arrays.equals/Arrays.hashCode for properties of array types
#KT-10514 Fixed
2016-01-14 13:55:02 +03:00
Natalia Ukhorskaya
7b67eed3dd Qoute package name if needed
#KT-10649 Fixed
2016-01-14 13:42:19 +03:00
Natalia Ukhorskaya
128440b16f Use intention to simplify for in j2k
#KT-7157 Fixed
2016-01-14 13:41:54 +03:00
Natalia Ukhorskaya
ea3ba6f534 Intention to simplify for using destructing declaration 2016-01-14 13:41:45 +03:00
Natalia Ukhorskaya
5667a92472 Debugger: add breakpoint variant for line with lambda in init block
#KT-KT-1061 Fixed
2016-01-14 13:39:01 +03:00
Natalia Ukhorskaya
2b1d60397d Object to lambda intention is inapplicable when reference to this is used
#KT-10202 In Progress
2016-01-14 13:39:00 +03:00
Natalia Ukhorskaya
41e7c3d70b Debugger: generate package parts only for debug file
#KT-10126 Fixed
2016-01-14 13:38:59 +03:00
Mikhail Zarechenskiy
29af6586f2 Get rid of ContainerUtil usages in ide-common 2016-01-14 12:06:52 +03:00
Mikhail Zarechenskiy
dd11fa9320 Move logic related to expression occurrence searching to ide-common 2016-01-14 12:06:50 +03:00
Mikhail Zarechenskiy
bd57096b66 Move AnalyzerUtil to ide-common 2016-01-14 12:06:49 +03:00
Mikhail Zarechenskiy
bde556fc10 Move QuickFixUtil to ide-common 2016-01-14 12:06:47 +03:00
Mikhail Zarechenskiy
85b4f5d593 Move part of resolutionApi to ide-common 2016-01-14 12:06:45 +03:00
Mikhail Zarechenskiy
1523586717 Extract interface out from KotlinCacheService to provide separate implementation in Eclipse plugin 2016-01-14 12:06:44 +03:00
Dmitry Petrov
609ffc10a9 KT-10322, KT-10646, KT-10647:
- update diagnostic to (supposedly) more useful
- also report IMPLICIT_CAST_TO_ANY if expected type is DONT_CARE
 (effectively "no expected type" for lambda expression).
2016-01-14 10:08:20 +03:00
Dmitry Petrov
f54de08073 KT-10646, KT-10647:
Move IMPLICIT_CAST_TO_UNIT_OR_ANY to ControlFlowInformationProvider
(where checks for 'if' and 'when' used as expressions are performed).
2016-01-14 10:08:20 +03:00
Ilya Gorbunov
f91c01919b kotlin.test: 'fail' returns Nothing, 'assertFails' returns Throwable (not nullable).
Js tests now fail at the first failed assertion.
#KT-10289 Fixed
#KT-10369 Fixed
2016-01-14 06:03:40 +03:00
Dmitry Jemerov
8fdd8179b9 Workaround for KtEnumEntrySuperclassReferenceExpression which implements KtSimpleNameExpression in a weird way and can break Move refactoring (EA-75268 - assert: TextRange.<init>) 2016-01-13 20:28:39 +01:00
Zalim Bashorov
c1dbfee2a9 Don't fail when create IncrementalCacheImpl for target without output directory, and fail when try to use this info instead.
#KT-10505 Fixed
2016-01-13 21:37:36 +03:00
Zalim Bashorov
d9af9472f0 Don't fail when output directory not specified for "friend" build target
#KT-10505 Fixed
2016-01-13 21:09:06 +03:00
Zalim Bashorov
3df091e7cf Report error when output directory not specified for build target
#KT-10505 Fixed
2016-01-13 21:09:05 +03:00
Mikhail Glukhikh
6b09c5dfae Minor when missing cases renderer refactoring 2016-01-13 19:54:54 +03:00
Denis Zharkov
b8c79e689b Make all nested inlined closure classes public
#KT-6987 Fixed
2016-01-13 19:41:59 +03:00
Anton Sukhonosenko
ba0efda2f0 Suggest to replace 'substring' calls by take/drop/dropLast calls when possible
#KT-10196 Fixed
2016-01-13 19:05:50 +03:00
Alexey Tsvetkov
328169cd2e Minor: fix test data as exhaustive when error message was changed 2016-01-13 18:47:05 +03:00
Mikhail Glukhikh
e54471abbc Formatting rule: new line before when entry 2016-01-13 18:04:24 +03:00
Mikhail Glukhikh
b7790177e0 KotlinParserDefinition.kt: converted to Kotlin 2016-01-13 18:04:15 +03:00
Mikhail Glukhikh
6ae7309c54 KotlinParserDefinition.java --> KotlinParserDefinition.kt 2016-01-13 17:54:53 +03:00
Alexey Sedunov
2e18ad7160 Remove Right Part of Binary Expression Quick-Fix: Split to separate quick fixes for cast- and elvis-expressions 2016-01-13 17:47:23 +03:00
Alexey Sedunov
6be44f59da Remove Function Body Quick-Fix: Convert to Kotlin & refactor. Add tests with comments 2016-01-13 17:47:22 +03:00
Alexey Sedunov
de8a3c17a2 Remove Function Body Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:21 +03:00
Alexey Sedunov
ed679fef9d Remove Element Quick-Fixes: Convert to Kotlin & refactor 2016-01-13 17:47:20 +03:00
Alexey Sedunov
28a0e8ebe6 Remove Element Quick-Fixes: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:19 +03:00
Alexey Sedunov
9a8aef6b6d Remove Right Part of Binary Expression Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:18 +03:00
Alexey Sedunov
0a4a486048 Remove Right Part of Binary Expression Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:17 +03:00
Alexey Sedunov
cac479102a Remove Supertype Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:16 +03:00
Alexey Sedunov
2fcce20c73 Remove Supertype Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:15 +03:00
Alexey Sedunov
0fea86c10a Remove 'val'/'var' from Parameter Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:14 +03:00
Alexey Sedunov
f2a6805f8b Remove 'val'/'var' from Parameter Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:13 +03:00
Alexey Sedunov
474ab531ea Rename Parameter to Match Overridden Method Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:12 +03:00
Alexey Sedunov
c3b3ad52a9 Rename Parameter to Match Overridden Method Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:11 +03:00
Alexey Sedunov
012a36d97c Remove Nullable Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:10 +03:00
Alexey Sedunov
f1c38f5f16 Remove Nullable Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:09 +03:00
Alexey Sedunov
111a670d66 Move 'else' Branch in 'when' Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:08 +03:00
Alexey Sedunov
212504bbd4 Move 'else' Branch in 'when' Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:07 +03:00
Alexey Sedunov
b8a8f1638f Change Visibility Modifier Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:06 +03:00
Alexey Sedunov
1e77caedbc Change Visibility Modifier Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:05 +03:00
Alexey Sedunov
c44d0ed619 Add 'override' to equals/hashCode/toString Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:04 +03:00
Alexey Sedunov
96e6319ee1 Add 'override' to equals/hashCode/toString Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:03 +03:00
Alexey Sedunov
64eeaf8b9d Make Class an Annotation Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:02 +03:00
Alexey Sedunov
04b8f16576 Make Class an Annotation Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:47:01 +03:00
Alexey Sedunov
6c44aa4d76 Change to Function Invocation Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:47:00 +03:00
Alexey Sedunov
584d3ad374 Change to Function Invocation Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:59 +03:00
Alexey Sedunov
a7a5619523 Change to Star-Projection Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:46:58 +03:00
Alexey Sedunov
625967fc15 Change to Star-Projection Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:57 +03:00
Alexey Sedunov
3153196343 Change Type Quick-Fix: Convert to Kotlin & refactor. Wrap in delegating quick fix to decrease memory footprint 2016-01-13 17:46:56 +03:00
Alexey Sedunov
11ef780adf Change Type Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:55 +03:00
Alexey Sedunov
05506a24d7 Add Star Projections Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:46:54 +03:00
Alexey Sedunov
2e25d2d885 Add Star Projections Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:53 +03:00
Alexey Sedunov
a696efc3ef Change Accessor Type Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:46:52 +03:00
Alexey Sedunov
54b149ce71 Change Accessor Type Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:51 +03:00
Alexey Sedunov
4e54cee693 Cast Expression Quick-Fix: Convert to Kotlin & refactor. Wrap in delegating quick fix to decrease memory footprint 2016-01-13 17:46:49 +03:00
Alexey Sedunov
63ab9df275 Cast Expression Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:48 +03:00
Alexey Sedunov
7cb5bc8902 Add Else Branch to When Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:46:47 +03:00
Alexey Sedunov
c0ca4e6b79 Add Else Branch to When Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:46 +03:00
Alexey Sedunov
f8be2f23a1 Add Function Body Quick-Fix: Convert to Kotlin & refactor 2016-01-13 17:46:45 +03:00
Alexey Sedunov
50497e8013 Add Function Body Quick-Fix: Convert to Kotlin (rename to .kt) 2016-01-13 17:46:43 +03:00
Alexey Sedunov
8264cef004 Quick Fixes: Pass original element to KotlinIntentionActionFactoryWithDelegate.createFix() 2016-01-13 17:46:42 +03:00
Michael Bogdanov
66ab1c484c StackOverflow fix on type remapping 2016-01-13 16:57:36 +03:00
Alexey Tsvetkov
94cea25e2e Recompile all sealed class usages when new derived class is added 2016-01-13 15:46:54 +03:00
Alexey Tsvetkov
0cf2928761 Recompile all enum usages when new entry is added 2016-01-13 15:46:54 +03:00
Alexey Tsvetkov
e7f8d7103f Recompile all class and member usages when flag and member are changed 2016-01-13 15:46:53 +03:00
Alexander Udalov
b0627b4ce6 Minor, add system property to suppress color output in CLI 2016-01-13 14:24:42 +03:00
Mikhail Glukhikh
c3cce53aa2 Quick fix "add when remaining branches" refactoring + enum / sealed generated name w/o package name 2016-01-13 12:32:14 +03:00
Valentin Kipyatkov
0a3631db6a Fixed KT-10602 Incorrect completion for class name
#KT-10602 Fixed
2016-01-12 22:09:12 +03:00
Nikolay Krasko
12b9002c0e Remove assert that isn't valid in UpSource (UP-5742) 2016-01-12 21:40:11 +03:00
Dmitry Jemerov
7390e0ac66 editor is nullable in SelfTargetingIntention.applyTo() 2016-01-12 19:23:51 +01:00
Pavel V. Talanov
9bfa90dc0e Analyze local variable declarations in expression position
Fixes exception on invalid code "val c = 1 < val Int.f: Int = 3"
2016-01-12 19:31:16 +03:00
Pavel V. Talanov
060864f7af Minor: prettify code after autoconversion 2016-01-12 16:47:38 +03:00
Pavel V. Talanov
94ce1d1193 Refactor: extract type checking code for local variables to a separate component, extract code that creates descriptors for local variable out of DescriptorResolver 2016-01-12 16:47:31 +03:00
Pavel V. Talanov
9fea22885e AnnotationUtil: Do not throw on ErrorValue constant 2016-01-12 16:08:59 +03:00
Michael Bogdanov
657b9ff808 Write enclosing method info for transformed objects 2016-01-12 15:51:57 +03:00
Michael Bogdanov
8ab1190082 Don't try remap type parameter of inline lambda parent context 2016-01-12 15:51:57 +03:00
Michael Bogdanov
fee6d4f282 Type parameters mapping
#KT-10429 Fixed
2016-01-12 15:51:56 +03:00
Michael Bogdanov
5cdf170511 TypeRemapper.java -> TypeRemapper.kt 2016-01-12 15:51:56 +03:00
Michael Bogdanov
cb41f1cc2a Signature remapping moved to RemappingSignatureAdapter inside TypeRemapper 2016-01-12 15:51:55 +03:00
Michael Bogdanov
dd336a5581 ReifiedTypeParameterMappings renamed to TypeParameterMappings, add isReified property 2016-01-12 15:51:55 +03:00
Michael Bogdanov
833cdb0706 TypeParameterDescriptor propagation to CapturedTypeConstructor 2016-01-12 15:51:54 +03:00
Mikhail Glukhikh
0bcae4e0c0 Build fix: nullable exhaustiveness checker is now only a part of other exhaustiveness checkers 2016-01-12 15:44:55 +03:00
Alexey Tsvetkov
d928ac744e Make withSubtypesOf more efficent 2016-01-12 15:32:48 +03:00
Alexey Tsvetkov
756c78bfcc Append in a more safe way 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
f137910e63 Make doProcessChangesUsingLookups extension again 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
f20b39d02e Use one loop for changes processing 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
d36810ab42 Minor: rename getSubtypeOf->withSubtypes 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
9190029fcc Add tests for class hierarchy incremental recompilation 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
e2794cfa3f Do not write inline calls to cache when experimental incremental compilation is enabled 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
2286268929 Append to class map should use IOUtil.writeUTF 2016-01-12 15:32:47 +03:00
Alexey Tsvetkov
a9fb5647b8 Get caches for targets transitively for exported dependencies 2016-01-12 15:32:46 +03:00
Alexey Tsvetkov
dfc08b8f38 Process changed signatures of classes 2016-01-12 15:32:46 +03:00
Alexey Tsvetkov
ab13b2ddfc Minor: move processChanges 2016-01-12 15:32:46 +03:00
Mikhail Glukhikh
8b6156abd6 Quick fix "Add remaining when branches" with some tests 2016-01-12 14:33:20 +03:00
Mikhail Glukhikh
44b07d8dfa Refactoring: context instead of trace in WhenChecker and around 2016-01-12 14:19:29 +03:00
Mikhail Glukhikh
936fee0afa KT-10295: long enum (sealed) special case 2016-01-12 14:18:36 +03:00
Mikhail Glukhikh
c085eb650f Better diagnostics for non-exhaustive whens, relevant test #KT-10295 Fixed 2016-01-12 14:18:23 +03:00
Mikhail Glukhikh
61c2a88a32 Separate when exhaustiveness checkers with list of missing cases as result 2016-01-12 14:07:08 +03:00
Mikhail Glukhikh
a99b2a6799 J2K: WhenChecker converted to Kotlin 2016-01-12 11:17:09 +03:00
Mikhail Glukhikh
e59fed7d9b J2K: WhenChecker 2016-01-12 11:17:06 +03:00
Dmitry Jemerov
682a61ad26 use PARTIAL_FOR_COMPLETION resolve mode when checking whether reference will resolve to the property, otherwise we're going to miss local variables which shadow the property 2016-01-11 19:05:37 +01:00
Dmitry Jemerov
76c9bbc06d handle setter calls used as expression bodies in "Use property access syntax" intention
#KT-10587 Fixed
2016-01-11 18:53:07 +01:00
Dmitry Jemerov
36488d21da remove empty modifier list after removing visibility modifier 2016-01-11 18:46:04 +01:00
Dmitry Jemerov
d0a4e542af use StubIndex.getElements() with required class specified to diagnose CCE problems when using stub index 2016-01-11 16:29:41 +01:00
Pavel V. Talanov
8d22eafe3f Minor: prettify code 2016-01-11 16:33:20 +03:00
Pavel V. Talanov
41a8ded182 getting rid of ClsFileImpl.setPhysical
patch by Roman Shevchenko
2016-01-11 16:29:19 +03:00
Michael Bogdanov
0274ce4619 Always generate ACC_SUPER flag for all classes; Fix for KT-10260: java.lang.VerifyError in Android 4.x when Instant Run is used
#KT-10260 Fixed
2016-01-11 09:55:56 +03:00
Dmitry Jemerov
b11acdfbea regenerate builtins (don't remove 'public' modifiers until we agree that we don't want them in stdlib) 2016-01-08 16:01:34 +01:00
Dmitry Jemerov
f885459a43 fix compilation after cleanup 2016-01-08 16:01:28 +01:00
Dmitry Jemerov
5d3ba1ad6c remove "public" from generated code template 2016-01-08 16:01:26 +01:00
Dmitry Jemerov
d5903c5374 workaround for KT-10590: ensure that the inherited getProject() method is public, not protected 2016-01-08 16:01:20 +01:00
Dmitry Jemerov
44138f499e plugins: cleanup 'public', property access syntax 2016-01-07 18:15:44 +01:00
Dmitry Jemerov
d6a11b839b js: cleanup 'public', property access syntax 2016-01-07 18:15:19 +01:00
Dmitry Jemerov
33ef7ad024 jps-plugin: cleanup 'public', property access syntax 2016-01-07 18:14:31 +01:00
Dmitry Jemerov
6684dff14b j2k: cleanup 'public', property access syntax 2016-01-07 18:13:10 +01:00
Dmitry Jemerov
43a6e13f4b idea: cleanup 'public', property access syntax 2016-01-07 18:12:36 +01:00
Dmitry Jemerov
4afbf02bdd generators: cleanup 'public', property access syntax 2016-01-07 18:07:13 +01:00
Dmitry Jemerov
951a313331 eval4j: cleanup 'public', property access syntax 2016-01-07 18:03:29 +01:00
Dmitry Jemerov
3870bd04b8 core: cleanup 'public', property access syntax 2016-01-07 18:03:09 +01:00
Dmitry Jemerov
117a0d8b7b compiler: cleanup 'public', property access syntax 2016-01-07 17:57:38 +01:00
Dmitry Jemerov
b72ea1ff07 ant: cleanup 'public', property access syntax 2016-01-07 17:53:32 +01:00
Dmitry Jemerov
e47e9f6763 inspection and code cleanup for redundant visibility modifiers 2016-01-05 13:31:43 +01:00
Dmitry Petrov
b736880787 KT-6646, KT-10482:
when a method (or a property getter) returns Nothing, emit
  ACONST_NULL
  ATHROW
after a call so that class files verifier knows that this is an exit point in a method.
Note that if an inline method returning Nothing throws an exception explicitly
(or via a chain of inline methods), this code will be deleted by DCE.
2015-12-31 11:07:56 +03:00
Nikolay Krasko
ffd1bcf72f Update icons (KT-10516)
#KT-10516 Fixed
2015-12-30 17:26:34 +03:00
Nikolay Krasko
f9a6da05df Add explicit type (local builds othen fail here) 2015-12-30 17:26:06 +03:00
Nikolay Krasko
0518c6f618 Set "No" as default button 2015-12-30 17:19:16 +03:00
Natalia Ukhorskaya
ad9303b97b Support breakpoints in anonymous objects with usages of cross inline argument 2015-12-30 14:49:30 +03:00
Natalia Ukhorskaya
754b02aa3c Fix EA-76946 - IOOBE: LineSet.checkLineIndex: do not try to get line start offset for line out off document 2015-12-30 14:49:29 +03:00
Natalia Ukhorskaya
0a6dbc91ae Fix EA-75128 - KNPE: IdentifierKt.declarationIdentifier 2015-12-30 14:49:29 +03:00
Natalia Ukhorskaya
5c83e2ac5b KotlinSyntheticTypeComponentProvider: catch UnsupportedOperationException
#KT-10526 Fixed
2015-12-30 14:49:28 +03:00
Natalia Ukhorskaya
36d154babf Support breakpoints for inline function with cross inline argument 2015-12-30 14:49:27 +03:00
Natalia Ukhorskaya
c351293394 KotlinPositionManager: drop PositionElement, classNameForPosition now returns collection of names 2015-12-30 14:49:26 +03:00
Natalia Ukhorskaya
e8aef7d29e Minor: move methods from companion object 2015-12-30 14:49:26 +03:00
Natalia Ukhorskaya
3678bda409 InlineUtil: extract method 2015-12-30 14:49:25 +03:00
Michael Bogdanov
1d70b58d17 Fixed test data 2015-12-30 14:42:12 +03:00
Michael Bogdanov
11268331a8 Added '@' for annotation names in diagnostic messages 2015-12-30 12:25:13 +03:00
Dmitry Petrov
74c13906ed Drop "substitute with upper bounds" mode for calls with mapped arguments
(we don't need it since we build constraint system for generic types).
Cleanup tests.
2015-12-30 10:44:01 +03:00
Dmitry Petrov
4b3290dd8c Check specificity relation for generant types of the constraint system.
Otherwise we can't properly chose between 'dynamic' and generic type.
2015-12-30 10:44:00 +03:00
Dmitry Petrov
c97294a066 stdlib fixes:
- 'sequence(initialValue: T?, ...)' should have LowPriorityInOverloadResolution
(otherwise 'sequence({...}, {...})' is ambiguous).
- 'copyOf' and 'copyOfRange' should be defined for 'Array<T>' only
('Array<out T>' version always loses to 'Array<T>', since the second one
is always more specific).
2015-12-30 10:44:00 +03:00
Dmitry Petrov
02daeac41b Use constraint system for comparing for specificity against a generic signature.
Drop "discrimiate generics" mode where it's unneeded.
2015-12-30 10:44:00 +03:00
Alexey Sedunov
aeefdffaab Implement Abstract Member Intention: Support primary constructor parameters
#KT-8427 Fixed
2015-12-30 00:56:34 +03:00
Alexey Sedunov
2b4f03feef Implement Members Quick-Fix: Support primary constructor parameters
#KT-8427 In Progress
2015-12-30 00:56:34 +03:00
Alexey Sedunov
00cc9d4150 Specify Type Explicitly: Filter out types which can't be resolved in the target scope
#KT-10066 Fixed
2015-12-30 00:56:34 +03:00
Alexey Sedunov
21fd894d75 Create From Usage: Place caret at the end of initializer selection
#KT-10120 Fixed
2015-12-30 00:56:34 +03:00
Alexey Sedunov
c391882651 Minor: Fix NPE (EA-76742) 2015-12-30 00:56:34 +03:00
Alexey Sedunov
5b5e7fb9b7 'Change parameter type' Quick-Fix: Use Change Signature API
#KT-9812 Fixed
2015-12-30 00:56:34 +03:00
Alexey Sedunov
9180a99342 Convert to Kotlin: ChangeParameterTypeFix.java 2015-12-30 00:56:34 +03:00
Alexey Sedunov
3af7c7b57a Convert to Kotlin: ChangeParameterTypeFix.java (rename to .kt) 2015-12-30 00:56:34 +03:00
Pavel V. Talanov
004c266433 Minor: fix missed error marker in test data 2015-12-29 18:13:10 +03:00
Ilya Gorbunov
0aef321c73 Cleanup in idea plugin, src and tests 2015-12-29 18:04:24 +03:00
Ilya Gorbunov
145722b20d Cleanup in idea plugin modules, misc 2015-12-29 18:04:23 +03:00
Ilya Gorbunov
865fdd7962 Cleanup in idea plugin modules, idea-core 2015-12-29 18:04:22 +03:00
Ilya Gorbunov
6ffc407158 Cleanup in idea plugin modules, idea-completion 2015-12-29 18:04:21 +03:00
Ilya Gorbunov
be590312f7 Cleanup in idea plugin modules, idea-analysis 2015-12-29 18:04:20 +03:00
Ilya Gorbunov
bce9514739 Cleanup in idea plugin modules, ide-common 2015-12-29 18:04:19 +03:00
Ilya Gorbunov
fcfb063eca Cleanup in modules: j2k, jps, ant and generators. 2015-12-29 18:04:18 +03:00
Ilya Gorbunov
da4b1ae0fb Cleanup in js modules 2015-12-29 18:04:16 +03:00
Ilya Gorbunov
80916d5ed7 Cleanup in compiler modules 2015-12-29 18:04:15 +03:00
Ilya Gorbunov
911adfd04d Cleanup in core modules 2015-12-29 18:04:14 +03:00
Ilya Gorbunov
b71b336a69 Fix fq names of moved facade classes in imports and other code occurrences 2015-12-29 18:04:13 +03:00
Nikolay Krasko
f9944e28b0 Show full library panel. Add warning on attempt to create project without library. 2015-12-29 18:01:15 +03:00
Michael Bogdanov
d54c3f4fc7 Added '@' to annotation names in diagnostic messages 2015-12-29 17:20:16 +03:00
Michael Bogdanov
91f27ba176 Report error on 'JvmStatic' annotation on const or @JvmField property
#KT-10415 Fixed
2015-12-29 17:20:07 +03:00
Michael Bogdanov
ae4ca3b5bb Report JvmStatic diagnostic on primary constructor properties 2015-12-29 16:45:24 +03:00
Michael Bogdanov
bb63bcd520 Removed obsolete tests 2015-12-29 16:45:24 +03:00
Michael Bogdanov
e671d05105 Companion public val annotated with @JvmFIeld or const 2015-12-29 16:45:23 +03:00
Michael Bogdanov
e116cc3206 Private visibility for non-const, non-jvmField class companion property backing field 2015-12-29 16:45:22 +03:00
Michael Bogdanov
85ae0cb78e Restrict companion properties copying to interface by const 2015-12-29 16:45:22 +03:00
Pavel V. Talanov
6f0c2a0260 Project configuration: Add source directories for kotlin builtIns to KotlinRuntime 2015-12-29 15:57:02 +03:00
Pavel V. Talanov
9096a443ea Do not build light classes for local classes when the there is no class descriptor
These cases should be dealt with and this is only a way to degrade gracefully
2015-12-29 15:57:01 +03:00
Pavel V. Talanov
b38fc7b3c1 Parse local interfaces in expression position 2015-12-29 15:57:00 +03:00
Pavel V. Talanov
1c4d4f3e36 Create class descriptors for local classes in illegal positions
Typecheck code in illegal selector position
Fixes exceptions on "val p = A.class" erroneous code
2015-12-29 15:56:44 +03:00
Pavel V. Talanov
06e829936e Fix codegen predictor for properties and property accessors 2015-12-29 12:32:14 +03:00
Pavel V. Talanov
4f5f56e4a5 Add and use KtPropertyAccessor#getProperty() 2015-12-29 12:32:12 +03:00
Denis Zharkov
d511059cfa Unify code generation of as/is operation
They should be the same for common and reified cases
2015-12-28 18:32:15 +03:00
Denis Zharkov
da53d8cbf4 Replace reified operations instanceof/checkcast with is/as
It's more consistent with how they effectively work
2015-12-28 18:31:40 +03:00
Denis Zharkov
87b6374351 Get rid of redundant intrinsic
Also drop 'safe' parameter from TypeIntrinsics.checkcast,
because it's supposed to work as JVM checkcast (i.e. accepting nulls)
2015-12-28 18:31:40 +03:00
Denis Zharkov
39bbd7c795 Rework reified markers format
Use integer operation identifier instead of method name to differentiate
reified operations
2015-12-28 18:31:40 +03:00
Alexander Udalov
890c961383 Fix reflection internal error on enum nested classes query
#KT-10520 Fixed
2015-12-28 16:40:34 +03:00
Denis Zharkov
688a1b6305 Adjust type approximation to broken code and missing dependencies
- Do not run approximation if arguments number is different
- Add nullable Any? as supertype to MissingDependencyErrorClass

The latter is needed because otherwise TypeArgument.isConsistent became false
2015-12-28 11:13:39 +03:00
Denis Zharkov
722a152a74 Fix supertypes calculation for types with projections
Use captured types as replacement for non top-level entries

 #KT-7296 Fixed
2015-12-28 11:13:39 +03:00
Denis Zharkov
397d2ca312 Fix captured approximation for case of flexible types
#KT-9294 Fixed
2015-12-28 11:13:38 +03:00
Denis Zharkov
b6edddbe8b Make project compilable after member scope refinement 2015-12-28 11:13:38 +03:00
Denis Zharkov
ec0ec55ab5 Replace type entries of JsContext<*> with JsContext<JsNode>
It's needed to make method calls (e.g. replaceMe) on it typesafe,
otherwise it's value parameter type is subtype of captured
2015-12-28 11:13:37 +03:00
Denis Zharkov
9773e98d8a Refine type from property setter parameter on assignment
In most cases these types are equals, the only known exception is
var-property contained in projected type member scope (see test data)
2015-12-28 11:13:37 +03:00
Denis Zharkov
e2c02f825f Refine member scope for types with projections
Instead of erasing descriptors with conflicting substitution,
use invariant CapturedType(<projection>) as replacement for type parameter
within default member scope.

After substitution leave such types 'as is' everywhere except return types,
use common approximation for them.

 #KT-9294 In Progress
 #KT-5411 Fixed
 #KT-8647 Fixed

 #KT-9462 Fixed
 #KT-9893 Fixed
 #KT-7581 Fixed
 #KT-7296 In Progress
2015-12-28 11:13:37 +03:00
Denis Zharkov
365ff593f3 Extract and normalize member scope calculation
Basically it's wrong to use original types' member scope
as a worker for SubstitutionScope.
Member scope should always be determined by type constructor's default one
and substitution/arguments

 #KT-10448 Fixed
2015-12-28 07:44:56 +03:00
Denis Zharkov
58caff3411 Minor. Add tests checking not-null assertions
More precisely these tests check cases when expected type
was somehow obtained from captured type (in member scope with projections)
2015-12-28 07:44:56 +03:00
Denis Zharkov
7aaa6422b4 Introduce CustomSubstitutionCapability.substitutionToComposeWith
Mainly it's needed to prevent creation of subsituions composition
everytime we replacing arguments, because it's both unoptimal and wrong

When replace arguments in `A<E, F>` with <String, E> you got `A<String, String>`
as a result, that is unexpected.

But composition is only needed when previous substituion was abnormal
(e.g. RawSubsitution that should actually wrap new arguments), see RawTypes tests
2015-12-28 07:44:55 +03:00
Denis Zharkov
8d0a90a838 Preserve type capabilities of captured type 2015-12-28 07:44:55 +03:00
Denis Zharkov
e7dbcfe21f Minor. Cleanup code 2015-12-28 07:44:54 +03:00
Denis Zharkov
555286849e Minor. Move declaration closer to usages and optimize imports 2015-12-28 07:44:54 +03:00
Denis Zharkov
48b89a5db7 Replace unchecked 'is' on local class with unchecked 'as'
It became unchecked after latest changes (see parent commit)
2015-12-28 07:44:54 +03:00
Denis Zharkov
3fd35636ad Fix type parameter list for local classes
Add captured parameters from enclosing functions

 #KT-9584 Fixed
2015-12-28 07:44:53 +03:00
Denis Zharkov
73b961e885 Clean project code after #KT-3996 fix
No overload resolution ambiguity in smart-casts
2015-12-28 07:44:53 +03:00
Mikhail Glukhikh
0cc09872b6 Implicit exhaustive when annotation / highlighting 2015-12-26 10:46:44 +03:00
Mikhail Glukhikh
7d6ccc40c2 Implicit exhaustive whens now have exception in else branch #KT-8700 Fixed 2015-12-26 10:46:39 +03:00
Mikhail Glukhikh
011a9f23b9 Implicit exhaustive when check for definite variable initialization (KT-8700) 2015-12-26 10:46:35 +03:00
Mikhail Glukhikh
52c3fb03a2 ControlFlowInfo introduced to store variable states, related refactoring 2015-12-26 10:46:30 +03:00
Mikhail Glukhikh
0f3997c6ca InitState / VariableUseState / VariableControlFlowState moved to a separate file 2015-12-26 10:46:25 +03:00
Mikhail Glukhikh
4c4456c808 PseudocodeVariablesData converted to Kotlin 2015-12-26 10:46:20 +03:00
Mikhail Glukhikh
7179b37d95 PseudocodeVariablesData.java --> PseudocodeVariablesData.kt 2015-12-26 10:46:16 +03:00
Mikhail Glukhikh
b93894953d Exhaustive whens without else and 'Nothing' as the result are considered 'implicit exhaustive' 2015-12-26 10:46:11 +03:00
Mikhail Glukhikh
d62d7dd84f Introduced binding context storage for implicit exhaustive when (KT-8700) 2015-12-26 10:46:06 +03:00
Mikhail Glukhikh
b805ce06c2 CFG exhaustive when else instruction for KT-8700 2015-12-26 10:46:01 +03:00
Alexander Udalov
697228eae0 Mark enum entry names as name ids for incremental compilation purposes 2015-12-25 20:16:18 +03:00
Alexander Udalov
3513a64351 Move utilities about companion property fields to JvmAbi
To reuse that logic in reflection
2015-12-25 20:16:18 +03:00
Alexander Udalov
0685f06200 Drop outdated stuff from metadata annotations
Make KotlinLocalClass and KotlinInterfaceDefaultImpls not retained at runtime,
to be maybe deleted in the future
2015-12-25 20:16:18 +03:00
Alexander Udalov
0ecf04dcc5 Drop KotlinDelegatedMethod, simplify related code in codegen 2015-12-25 20:16:18 +03:00
Alexander Udalov
39c10867a0 Drop 'index' JVM binary format extension
Compute the JVM parameer index manually instead
2015-12-25 20:16:18 +03:00
Alexander Udalov
8dc604ac8b Drop compatibility flag, suppressing optimized generation of callable references 2015-12-25 20:16:18 +03:00
Alexander Udalov
64b48f4458 Drop compatibility flag, suppressing optimized generation of delegated property metadata 2015-12-25 20:16:18 +03:00
Alexander Udalov
002dc92d89 Drop old antlib.xml in org/jetbrains/jet/buildtools/ant
Use the new one in org/jetbrains/kotlin/ant instead
2015-12-25 20:16:18 +03:00
Alexander Udalov
dc6a176282 Drop old JVM binary format extensions: static in outer, impl class name 2015-12-25 20:16:18 +03:00
Alexander Udalov
fc74759231 Drop old enum entries from binary format 2015-12-25 20:16:18 +03:00
Alexander Udalov
57b96f38a9 Minor, remove/simplify unnecessary utilities in util.runtime 2015-12-25 20:16:18 +03:00
Alexander Udalov
b4addd0567 Move builtins-related logic from DeserializedPackageFragment to BuiltinsPackageFragment 2015-12-25 20:16:18 +03:00
Alexander Udalov
e7da56baf4 Restructure code in BuiltInsSerializer 2015-12-25 20:16:18 +03:00
Alexander Udalov
ddcdc11099 Write and read built-ins binary version 2015-12-25 20:16:18 +03:00
Alexander Udalov
906d706961 Deserialize builtins from new message 2015-12-25 20:16:18 +03:00
Alexander Udalov
7592f31596 Serialize built-ins to separate file .kotlin_builtins 2015-12-25 20:16:18 +03:00
Alexander Udalov
07a23cab10 Minor, make SerializedResourcePaths an interface 2015-12-25 20:16:18 +03:00
Alexander Udalov
75f046fa81 Drop Throwable#printStackTrace, make it a JVM-specific extension 2015-12-25 20:16:18 +03:00
Stanislav Erokhin
3d44471659 KT-10483 Missing smart cast on variable in variable as function call
#KT-10483 Fixed
2015-12-25 20:13:08 +03:00
Alexey Sedunov
4de26bed93 Minor: Add test for now-obsolete KT-8035 "Extended class is not open" quickfix fails on nested classes " 2015-12-25 18:51:03 +03:00
Alexey Sedunov
c90d283ff5 Quick Fixes: Implement 'Add val/var to primary constructor parameter' quick-fix for data classes
#KT-4038 Fixed
2015-12-25 18:50:59 +03:00
Alexey Sedunov
6978d842fb Intentions: Implement 'Add val/var to primary constructor parameter' intention
#KT-4038 In Progress
2015-12-25 18:50:55 +03:00
Alexey Sedunov
5dcf531048 Formatter: Leave single space between val/var and value parameter 2015-12-25 18:50:52 +03:00
Alexey Sedunov
2895e2e86f Change Signature: Process implicit usages of data class 'componentN' functions
#KT-9393 Fixed
2015-12-25 18:50:48 +03:00
Alexey Sedunov
4fba251fba Intentions: 'Implement abstract member' (Kotlin -> Java)
#KT-8467 Fixed
2015-12-25 18:50:41 +03:00
Alexey Sedunov
03641ffbee Intentions: 'Implement abstract member' (Kotlin -> Kotlin)
#KT-8467 In Progress
2015-12-25 18:50:37 +03:00
Alexey Sedunov
123b813073 'Replace with infix call' Intention: Disable on calls without explicit receiver
#KT-6332 Fixed
2015-12-25 18:50:34 +03:00
Alexey Sedunov
ae636a0d32 Iterate Intention: Add support of destructuring declarations 2015-12-25 18:50:30 +03:00
Alexey Sedunov
1d3054e7a6 Iterate Intention: Filter out functions without 'operator' modifier 2015-12-25 18:50:27 +03:00
Alexey Sedunov
1c74bab1cc Iterate Intention: Fix detection of extension iterators
#KT-8616 Fixed
2015-12-25 18:50:23 +03:00
Alexey Sedunov
ee9389d089 Create from Usage: Strip first parameter of extension function when expected type is non-extension 2015-12-25 18:50:19 +03:00
Alexey Sedunov
da2806acde Minor: Fix IllegalAccessError on referencing synthetic property 2015-12-25 12:59:15 +03:00
Michael Bogdanov
f870e365fa Removed accessors for const properties 2015-12-25 11:28:10 +03:00
Michael Bogdanov
b4db23a7b3 Removed 'INSTANCE' field from companions 2015-12-24 13:59:45 +03:00
Michael Bogdanov
2e73559f33 Removed 'INSTANCE$' field generation 2015-12-24 13:59:44 +03:00
Michael Bogdanov
aeb6486473 Deprecated 'INSTANCE$' replaced with 'INSTANCE' 2015-12-24 13:59:43 +03:00
Denis Zharkov
80fd9e3cbb Fix wrong contract assumption
Currently SamAdapterOverridabilityCondition can be called
even for incompatible descriptors

 #KT-10486 Fixed
2015-12-24 12:25:31 +03:00
Ilya Gorbunov
f9ba35af64 Place Char constants into builtin Char companion object. 2015-12-24 06:18:51 +03:00
Ilya Gorbunov
de11ed4fc6 Primitive Companion objects do not longer implement IntegerConstants and FloatingPointConstants. All declarations moved inside companions.
IntegerConstants and FloatingPointConstants are dropped.
#KT-8897 Fixed
2015-12-24 06:17:03 +03:00
Mikhail Glukhikh
fc4250b02b EA-75872 / KT-10473 fix: both JVM- and JS-diagnostic factories are now used as extensions 2015-12-23 18:33:50 +03:00
Mikhail Glukhikh
99a32b93fb Implemented missed checks for local functions #KT-10449 Fixed
Relevant code/test fixes
2015-12-23 18:22:32 +03:00
Mikhail Glukhikh
15746cbf56 Implicit callable type check refactoring, additional check for property with explicit Nothing type 2015-12-23 18:04:25 +03:00
Mikhail Glukhikh
6b8b39a7bd Intersection types are no more allowed in signatures #KT-10244 Fixed 2015-12-23 18:04:21 +03:00
Mikhail Glukhikh
f56dc722d9 Lateinit property backing field now inherits visibility from the property setter 2015-12-23 18:02:20 +03:00
Mikhail Glukhikh
ebda21c68a Codegen tests for lateinit var with private setter 2015-12-23 18:02:07 +03:00
Mikhail Glukhikh
60521e20ff SETTER_VISIBILITY_DIFFERS_FROM_LATEINIT_VISIBILITY diagnostic removed 2015-12-23 17:48:28 +03:00
Pavel V. Talanov
cfacd5da1e Fix a problem caused by getting project using an invalid psi element 2015-12-23 17:07:51 +03:00
Alexander Udalov
a7324ebad2 Minor, additional constructor for JvmPackagePartSource 2015-12-23 16:45:26 +03:00
Alexander Udalov
12e921ab15 Minor, add test on annotation in enum companion 2015-12-23 16:45:26 +03:00
Alexander Udalov
7170d488bd Fix package part class name calculation
Package part name can contain dollars
2015-12-23 16:45:26 +03:00
Alexander Udalov
e67318e049 Minor, add DescriptorUtils.isClassOrEnumClass 2015-12-23 16:45:26 +03:00
Alexander Udalov
48a0a95e8f Fix nested class context in cls stub builder
Previously two contexts were created for a nested class stub: one with the
replaced NameResolver, another with everything else. Now only one is created
2015-12-23 16:45:26 +03:00
Alexander Udalov
cd435c4130 Do not load implClassName JVM proto extension
Use JvmPackagePartSource instead for functions/properties in package parts,
check containing class kind for properties in interfaces
2015-12-23 16:45:26 +03:00
Alexander Udalov
03606c13aa Introduce PackagePartSource to store part class name in deserialized descriptors
Not used at the moment, will be in the following commits
2015-12-23 16:45:26 +03:00
Alexander Udalov
f4c5289cfc Minor, fix typo in class name: jmv -> jvm 2015-12-23 16:45:26 +03:00
Alexander Udalov
51cdb981f4 Remove obsolete code in IncrementalPackageFragmentProvider 2015-12-23 16:45:26 +03:00
Alexander Udalov
f7969621d6 Don't read isStaticInOuter message for fields
It's only written for fields of properties of companion objects of classes;
handle that case manually in deserialization
2015-12-23 16:45:26 +03:00
Alexander Udalov
696dce68fb Move deserialized callable descriptors to single file, convert to Kotlin 2015-12-23 16:45:26 +03:00
Alexander Udalov
19372a7210 Minor, make ProtoContainer sealed with two subclasses 2015-12-23 16:45:26 +03:00
Alexander Udalov
745de229cc Minor, split IMPL_CLASS_NAME_FOR_CALLABLE to two slices 2015-12-23 16:45:26 +03:00
Yan Zhulanow
b3877b5f0b Always compile Android projects without JDK in classpath #KT-10479 2015-12-23 16:42:35 +03:00
Pavel V. Talanov
70dc5a5c4c IDELightClassGenerationSupport: fix a problem when marking source root as both source and library source led to SO
# KT-10413 Fixed
2015-12-23 16:08:34 +03:00
Pavel V. Talanov
a8c5e0cc95 Minor, ProjectRootsUtil: extract a couple of utils and use them 2015-12-23 16:08:34 +03:00
Pavel V. Talanov
f20aba63a6 Add better diagnostic for "could not create stub for nested class" failures 2015-12-23 15:13:13 +03:00
Pavel V. Talanov
6a1ca7b9c9 Fix an exception caused by objects literals in supertype list not considered local 2015-12-23 14:56:27 +03:00
Dmitry Petrov
00db7d150b Fix KT-10472: compare all overloads including varargs in a single pass. 2015-12-23 10:05:40 +03:00
Nikolay Krasko
f25d80c38b Make add test lib quick-fix applicable only when there is unresolved import 2015-12-22 19:44:15 +03:00
Nikolay Krasko
259397db9d Add library for Gradle 2015-12-22 19:44:15 +03:00
Nikolay Krasko
2fba6c361a Determine maven library version from kotlin-stdlib 2015-12-22 19:44:15 +03:00
Nikolay Krasko
5467671a21 Add libraries to maven 2015-12-22 19:44:15 +03:00
Nikolay Krasko
1b92fa94bc Add kotlin-test.jar to classpath quickfix 2015-12-22 19:44:14 +03:00
Pavel V. Talanov
99966c17da Go to (show) implementations: skip light methods that are generated with DELEGATION or DELEGATION_TO_DEFAULT_IMPLS JvmDeclarationOriginKind
Add some unrelated tests for fake overrides
2015-12-22 17:30:51 +03:00
Stanislav Erokhin
de6f52030c Hack for unavailable archive.apache.org: use bintray.com instead 2015-12-22 16:44:10 +03:00
Dmitry Petrov
142e85be04 Prohibit functions (and constructors) with multiple vararg parameters. 2015-12-22 10:40:41 +03:00
Alexander Udalov
ed2ad8e8e3 Minor, fix warnings related to OperatorNameConventions 2015-12-21 20:41:45 +03:00
Alexander Udalov
97ce61ac44 Throw exception on inlining bytecode of version > 1.6
To prevent ASM from failing with a meaningless exception in this case as soon
as we support target 1.8 and someone tries to compile some code with the
current compiler against the new (1.8) code.
2015-12-21 20:38:18 +03:00
Alexander Udalov
7449ad2763 Rename Extension annotation to ExtensionFunctionType
The old one is kept temporarily and will be removed later
2015-12-21 20:33:32 +03:00
Alexander Udalov
6d40d94127 Minor, use String instead of DeprecationLevel
Using classes from runtime in the compiler is confusing and doesn't allow to
incompatibly change them
2015-12-21 20:28:40 +03:00
Alexander Udalov
c10cc30f40 Drop kotlin.jvm.internal.Intrinsic, use only one mechanism for intrinsics 2015-12-21 20:28:40 +03:00
Alexander Udalov
6048ebf871 Fix terminology: internal name instead of FQ name 2015-12-21 20:27:41 +03:00
Alexander Udalov
2ccd6d54b7 Add kotlin-reflect as a separate library
Exclude in core modules, since they do not have kotlin-reflect.jar in
dependencies when are built in build.xml
2015-12-21 18:46:08 +03:00
Alexander Udalov
a9476dfe37 Replace 'kotlin-runtime' in module dependencies with 'util' 2015-12-21 18:46:08 +03:00
Alexander Udalov
fa8c1f1a37 Delete obsolete tests on metadata annotations 2015-12-21 18:46:08 +03:00
Alexander Udalov
12922c3abd Minor, delete kunit source root from StdlibTest 2015-12-21 18:46:08 +03:00
Sergey Mashkov
c5e43a1327 kotlin-test: fix manifest description caused by copy-paste 2015-12-21 18:43:54 +03:00
Sergey Mashkov
2b6ae3127b kotlin-test: exclude OnlyInpuType from dist kotlin-test as well 2015-12-21 15:39:44 +03:00
Sergey Mashkov
8139070754 kotlin-test: exclude OnlyInputTypes annotation from jar 2015-12-21 15:14:55 +03:00
Sergey Mashkov
5ad0a84039 rename kotlin.test to kotlin-test 2015-12-21 15:10:24 +03:00
Andrey Breslav
a7e7d53e2b Reserve "async* {}", extend the quick-fix 2015-12-21 07:15:37 +03:00
Andrey Breslav
45074841a4 Minor. Additional test for "async {}" 2015-12-21 07:15:37 +03:00
Stanislav Erokhin
318f0c89b2 Completion fix for reserved 'async' syntax 2015-12-21 07:15:37 +03:00
Nikolay Krasko
afc1e24571 Quick fix for deprecated async syntax 2015-12-21 07:15:37 +03:00
Nikolay Krasko
01095bc652 More usages for getTestRoots method 2015-12-19 14:32:40 +03:00
Nikolay Krasko
2c1bf4dbd9 Remove filenameStartsLowerCase flag and clean warnings 2015-12-19 14:32:39 +03:00
Nikolay Krasko
aee36c40cd Request resolve only for modifier list for suppression check 2015-12-19 14:32:39 +03:00
Nikolay Krasko
b79aa686bb Avoid analyze in suppression check if there are no suppression annotations 2015-12-19 14:32:38 +03:00
Nikolay Krasko
697132561f Allow to override suppression key for inspections 2015-12-19 14:32:38 +03:00
Nikolay Krasko
8196621be5 Add test for inspections suppression 2015-12-19 14:32:38 +03:00
Nikolay Krasko
aff83087a3 Allow to suppress warnings at file level 2015-12-19 14:32:37 +03:00
Nikolay Krasko
712d2bdec0 Enable suppression actions for Kotlin inspections 2015-12-19 14:32:37 +03:00
Nikolay Krasko
94c0ccf2bf Fix test with dummy diagnostic 2015-12-19 14:32:36 +03:00
Nikolay Krasko
36210f0a27 Allow to suppress kotlin inspections with Suppress() annotation 2015-12-19 14:32:36 +03:00
Nikolay Krasko
ef265e23f8 Refactoring: SuppressionManager -> KotlinSuppressCache 2015-12-19 14:32:35 +03:00
Nikolay Krasko
b61b4e1c90 Allow to check suppression by string keys 2015-12-19 14:32:35 +03:00
Nikolay Krasko
20379028e8 Refactoring: extract separate class that can store suppressions 2015-12-19 14:32:34 +03:00
Nikolay Krasko
e562b73eff Refactoring: extract method for check test is AllFilesPresent test 2015-12-19 14:32:33 +03:00
Nikolay Krasko
5cd23daf4e Allow to run additional resolve from KtFileAnnotationList 2015-12-19 14:32:33 +03:00
Nikolay Krasko
0aa8d89b16 Minor: regenerate, optimize imports 2015-12-19 14:32:32 +03:00
Ilya Gorbunov
0a1f4d6088 Deprecate IndexingIterable and IndexingIterator and provide Iterator.withIndex() instead of the latter. 2015-12-19 09:56:52 +03:00
Ilya Gorbunov
fbfeb98ecf Deprecate some top-level constants to make 'em private later. 2015-12-19 09:56:46 +03:00
Ilya Chernikov
6ba68da811 Working around cancellation-related exception in case of different versions of daemon and client 2015-12-18 22:17:15 +01:00
Stanislav Erokhin
9e986db840 Minor. run generate tests 2015-12-18 22:54:05 +03:00
Stanislav Erokhin
bcaa755c4e Fix compilation.
- rename isFinal extension property to avoid ambiguity with synthetic property in DeserializedClassTypeConstructor
- add explicit parameter to lambda File.listFiles
- return true from lambda Query.forEach
2015-12-18 22:49:26 +03:00
Stanislav Erokhin
1574dc78df Synthetic extensions wins against top-level extension. 2015-12-18 22:49:25 +03:00
Stanislav Erokhin
e8a697cb6d Removed methods about synthetic from ImportingScope. 2015-12-18 22:49:24 +03:00
Stanislav Erokhin
fe9cbd982d Extract SyntheticScopes to injection component 2015-12-18 22:49:23 +03:00
Sergey Mashkov
3b08e5e547 kotlin-test: rename projects to eliminate possible mess 2015-12-18 22:17:48 +03:00
Sergey Mashkov
a97e623d04 kotlin-test: binary compatibility for fail function 2015-12-18 22:17:48 +03:00
Sergey Mashkov
f21b6a4777 Ant task to copy dist as a bootstrap compiler 2015-12-18 22:17:47 +03:00
Sergey Mashkov
fe4f51617c Add kotlin.test dependency to kotlin-compiler-embeddable 2015-12-18 22:17:47 +03:00
Sergey Mashkov
790524e391 Add library kotlin-test to IDEA project 2015-12-18 22:17:47 +03:00
Sergey Mashkov
f1783530ac Replace test assertions in the prod code with require 2015-12-18 22:17:47 +03:00
Sergey Mashkov
e25d31618c Fix tests 2015-12-18 22:16:04 +03:00
Sergey Mashkov
b57d2ff702 Add kotlin.test library to build distribution and provide for tests 2015-12-18 22:16:04 +03:00
Sergey Mashkov
7aae2bd452 kotlin-test: Remove javaClass as is in runtime now 2015-12-18 22:16:04 +03:00
Sergey Mashkov
a5b098c4a7 kotlin.test: Rename jvm module to junit 2015-12-18 22:16:04 +03:00
Sergey Mashkov
149ce70ce2 Move testing from stdlib to js.stdlib 2015-12-18 22:16:04 +03:00
Sergey Mashkov
1867abbbe7 Add kotlin.test library 2015-12-18 22:16:04 +03:00
Sergey Mashkov
dd36ef5712 Remove kunit 2015-12-18 22:16:04 +03:00
Andrey Breslav
6155d836a5 'async' reserved in front of function literals 2015-12-18 21:20:54 +03:00
Andrey Breslav
75ab0dd509 'sealed' reserved in front of when 2015-12-18 21:20:54 +03:00
Andrey Breslav
c36eeadab1 Minor. Constant used instead of constructor 2015-12-18 21:20:54 +03:00
Dmitry Petrov
09f53ea0bb Select most specific overloaded function/property by explicitly used arguments only.
Major rewrite of OverloadingConflictResolver.
2015-12-18 18:30:16 +03:00
Dmitry Petrov
52f0e0bc93 J2K: OverloadingConflictResolver.kt - convert to Kotlin 2015-12-18 18:30:16 +03:00
Dmitry Petrov
ca6153e8f1 J2K: OverloadingConflictResolver.kt 2015-12-18 18:30:16 +03:00
Ilya Gorbunov
03816373b3 Primitive array constructor-like functions with init lambda.
#KT-8831

Update testData and resolve ambiguity in newArray test
2015-12-18 17:54:09 +03:00
Natalia Ukhorskaya
513c4a4562 J2K: transform loops with double, float and char range with while
#KT-899 Fixed
2015-12-18 16:14:17 +03:00
Natalia Ukhorskaya
ecdef71580 J2K: cast right operand of equals for primitive types to left operand type
#KT-9997 Fixed
2015-12-18 16:14:16 +03:00
Natalia Ukhorskaya
1d787ed222 J2K: Insert initializer type for properties with primitive type if necessary 2015-12-18 16:14:15 +03:00
Ilya Gorbunov
188119aa83 Prepare to treat keys mapped to null same way as missing keys in Map extensions: getOrElse, getOrPut, getOrImplicitDefault. 2015-12-18 15:24:03 +03:00
Stanislav Erokhin
8b5a194dd6 Do not discriminate synthesized candidates.
#KT-9965 Fixed
2015-12-18 15:08:19 +03:00
Stanislav Erokhin
1b6f96ac2b Minor. update diagnostics/ReadMe.md 2015-12-18 15:08:18 +03:00
Alexey Sedunov
2fb3c727a7 Misc: Cleanup "org.jetbrains.kotlin.idea.intentions" package 2015-12-18 15:05:48 +03:00
Alexey Sedunov
3fca8f765c Misc: Cleanup "org.jetbrains.kotlin.idea.quickfix" package 2015-12-18 15:05:46 +03:00
Alexey Sedunov
ad55c8fb96 Misc: Cleanup "org.jetbrains.kotlin.idea.refactoring" package 2015-12-18 15:05:43 +03:00
Alexey Sedunov
f745f27694 Change Signature: Check syntactic validity of types. Warn about unresolved types 2015-12-18 15:05:40 +03:00
Alexey Sedunov
784b250de8 Change Signature: Fix rendering of unresolved types in overriding members 2015-12-18 15:05:39 +03:00
Alexey Sedunov
05ec9cc424 Initialize Property in Constructor Quick-Fix: Disable clearing of ShortenReferences waiting set 2015-12-18 15:05:37 +03:00
Alexey Sedunov
fd79145b73 Change Signature: Represent parameter/receiver types using KotlinTypeInfo 2015-12-18 15:05:36 +03:00
Alexey Sedunov
e558581667 Change Signature: Represent return type using KotlinTypeInfo 2015-12-18 15:05:34 +03:00
Alexey Sedunov
24951e8a38 J2K: KtTypeCodeFragment.java 2015-12-18 15:05:33 +03:00
Alexey Sedunov
6fe48243c7 J2K: KtTypeCodeFragment.java (rename to .kt) 2015-12-18 15:05:31 +03:00
Alexey Sedunov
594ad27952 Change Signature: Implement proper resolution of type code fragments
#KT-9210 Fixed
2015-12-18 15:05:29 +03:00
Alexey Sedunov
cfe1c44260 Introduce Variable: Add type argument to initializer if they can't be inferred from the context
#KT-5466 Fixed
2015-12-18 15:05:27 +03:00
Alexey Sedunov
ea8da18338 Inline Variable: Highlight usages in current file even if the variable is used in other files 2015-12-18 15:05:24 +03:00
Alexey Sedunov
4e36edb5d6 Inline Variable: Remove invalid imports and perform reference lengthening/shortening when inlining non-local declaration
#KT-8884 Fixed
2015-12-18 15:05:23 +03:00
Michael Bogdanov
44bdac6e11 Added file name to exception on indexing file mappings 2015-12-18 14:25:46 +03:00
Ilya Gorbunov
055c71e8d0 Provide minWith and maxWith to find maximum and minimum values according to the given comparator.
#KT-9002 Fixed
2015-12-18 00:00:52 +03:00
Ilya Gorbunov
b5e637bed5 Rename toMap with selector and transform to toMapBy 2015-12-17 22:50:44 +03:00
Ilya Gorbunov
544bc9a70c Introduce toMap with key-value pair selector.
#KT-6657
2015-12-17 22:50:43 +03:00
Ilya Gorbunov
2966420d24 Harden deprecation level for synchronized helper functions.
Make migration helper classes deprecated-hidden, although it doesn't affect anything.
2015-12-17 22:48:13 +03:00
Stanislav Erokhin
7521b89b3e Resolve unaryPlus as plus with error. 2015-12-17 20:21:01 +03:00
Denis Zharkov
1a6f9b8d1c Do not build inner type for error classes
#KT-10409 Fixed
2015-12-17 19:56:38 +03:00
Denis Zharkov
0d7c8635b3 Refine INSTANCE_ACCESS_BEFORE_SUPER_CALL check
- Detect usages of unitialized `this` as extension receiver argument
- Make it work within object literal created before super call

 #KT-9120 Fixed
 #KT-8289 Fixed
2015-12-17 19:56:38 +03:00
Zalim Bashorov
ba180f915a Minor: uncomment code fragments in ic tests which already should work 2015-12-17 19:41:25 +03:00
Zalim Bashorov
d9b67ae0ef Minor: use ".touch" extension instead of ".new" in incremental compilation tests when it possible 2015-12-17 19:41:24 +03:00
Mikhail Glukhikh
fe57a9e48f Setter visibility must be worse or the same as property visibility 2015-12-17 19:03:06 +03:00
Mikhail Glukhikh
f5989aa4f2 CallableMemberDescriptor.isOverridable / ClassDescriptor.isFinal refactoring
Extra JvmField and integer constants tests
2015-12-17 18:11:41 +03:00
Mikhail Glukhikh
91621704a2 Additional information to catch EA-75872 2015-12-17 17:30:30 +03:00
Evgeny Gerashchenko
16f482f723 Merge pull request #797 from JetBrains/rr/kt8365
KT-8365 Bogus "Receiver never used" warning when receiver is used in invoke() convention call
2015-12-17 17:38:24 +04:00
Alexey Tsvetkov
7384d25cb3 Prohibit Array<Nothing> 2015-12-17 16:26:26 +03:00
Mikhail Glukhikh
35f788a89c INAPPLICABLE_FIELD_TARGET_NO_BACKING_FIELD deleted (not necessary already) 2015-12-17 15:07:07 +03:00
Mikhail Glukhikh
3fb04aceb9 Check backing field availability for AnnotationTarget.FIELD #KT-10387 Fixed
Some duplicated checks deleted (UseSiteTargetChecker / JvmFieldApplicabilityChecker)
2015-12-17 15:06:58 +03:00
Mikhail Glukhikh
f55574df36 Code fix: TestOnly on a property without backing field 2015-12-17 15:06:51 +03:00
Michael Bogdanov
ca9e8fc5a7 Fix for KT-5910: Can't call Throwable() in Kotlin
#KT-5910 Fixed
2015-12-17 14:09:15 +03:00
Natalia Ukhorskaya
d40e9ffc13 Do not convert anonymous object to lambda if its function is recursive
#KT-10348 Fixed
2015-12-17 13:39:36 +03:00
Evgeny Gerashchenko
9aa38d99fb KT-8365 Bogus "Receiver never used" warning when receiver is used in invoke() convention call
#KT-8365 fixed
2015-12-17 13:31:43 +03:00
Evgeny Gerashchenko
2e6d82a72b Minor. Green code. 2015-12-17 13:06:27 +03:00
Natalia Ukhorskaya
43476bd773 Do not drop negation if resulting type isn't boolean 2015-12-17 11:11:33 +03:00
Natalia Ukhorskaya
f84b3414c8 Remove outdated test: generic property should have a receiver 2015-12-17 11:11:32 +03:00
Natalia Ukhorskaya
4b1edf7bb0 Intention tests: add directive to skip errors before 2015-12-17 11:11:31 +03:00
Natalia Ukhorskaya
7e6495618b ChangeVariableMutability: diagnostic can be reported on constructor parameter
#KT-10416 Fixed
2015-12-17 11:11:31 +03:00
Natalia Ukhorskaya
fc7c45d4d0 NegatedExpressionWithDemorgansLaw may produce code with error 2015-12-17 11:11:30 +03:00
Natalia Ukhorskaya
7f0065c806 Fix OperatorToFunctionIntention: insert function literal expressions to arguments correctly 2015-12-17 11:11:29 +03:00
Natalia Ukhorskaya
6bfbec8c88 ConvertAssertToIf may produce code with error
// TODO: we could generate anonymous function instead of lambda expression when there is a return
2015-12-17 11:11:28 +03:00
Natalia Ukhorskaya
ce3d53d2ee Intention tests: add operator modifier in some tests 2015-12-17 11:11:27 +03:00
Natalia Ukhorskaya
2c29f6f5ab ConvertIfWithThrowToAssertIntention: generate assert with lazy argument 2015-12-17 11:11:26 +03:00
Natalia Ukhorskaya
2dc1ba1d62 Intention 'remove explicit lambda parameter' may break code, do not check error in tests for it 2015-12-17 11:11:26 +03:00
Natalia Ukhorskaya
269676ee2e Intention tests: skip errors check for tests that fix some error 2015-12-17 11:11:25 +03:00
Natalia Ukhorskaya
abd7ed5c70 Fix intention for when: insert '||' instead of ',' 2015-12-17 11:11:24 +03:00
Natalia Ukhorskaya
6a3ac66208 Intention tests: add runtime where necessary 2015-12-17 11:11:23 +03:00
Natalia Ukhorskaya
78d737f3f4 Check errors in Intentions tests by default 2015-12-17 11:11:22 +03:00
Natalia Ukhorskaya
cc259c2d15 Intention convert object literal to lambda should add parameters if there are more than one 2015-12-17 11:11:22 +03:00
Natalia Ukhorskaya
5e231db631 J2K: convert method from Map (Java8) with cast to java.util.Map
#KT-10400 Fixed
2015-12-17 11:11:21 +03:00
Natalia Ukhorskaya
3f7b8554dd J2K: parenthesize receiver if needed
#KT-10121 Fixed
2015-12-17 11:11:20 +03:00
Natalia Ukhorskaya
a520e93b5b J2K: don't automatically convert Java code when pasting to a string literal in Kotlin
#KT-7759 Fixed
2015-12-17 11:11:19 +03:00
Natalia Ukhorskaya
f3a6c541ec J2K: Convert usages of kotlin functions from library correctly
#KT-6115 Fixed
2015-12-17 11:11:18 +03:00
Natalia Ukhorskaya
693e158759 Intention to convert anonymous function to lambda 2015-12-17 11:11:18 +03:00
Natalia Ukhorskaya
c79ffbac5c Run code cleanup on j2k module 2015-12-17 11:11:16 +03:00
Natalia Ukhorskaya
a983e6cf60 J2K: Do not convert string literal with escaped symbols automaticaly during java to kotlin conversion
#KT-9942 Fixed
2015-12-17 11:11:16 +03:00
Natalia Ukhorskaya
68101eeffa J2K: do not drop formatting for expressions with operator 2015-12-17 11:11:15 +03:00
Natalia Ukhorskaya
293b8eeda8 Minor: fix IDEA(win) run configuration 2015-12-17 11:11:14 +03:00
Michael Bogdanov
7a1d789e9a Added InliningLambdaContext 2015-12-17 09:52:28 +03:00
Michael Bogdanov
ebbc68dfae isInlineFunction renamed to isInlineMethodContext 2015-12-17 09:52:27 +03:00
Michael Bogdanov
9cad1a912a Choose proper context for accessor generation: skip inline ones; Fix for KT-6102: Bypass synthetic accessor when inlining lambda which calls private member
#KT-6102 Fixed
2015-12-17 09:51:41 +03:00
Michael Bogdanov
033698c51d Added crossinline field to MethodContext 2015-12-17 09:50:54 +03:00
Michael Bogdanov
b0a7706812 Test for obsolete KT-5445: Bad access to protected data in getfield
#KT-5445 Obsolete
2015-12-17 09:50:39 +03:00
Dmitry Jemerov
179498d971 UI for enabling EAP channel for plugin updates 2015-12-16 19:59:56 +01:00
Alexey Tsvetkov
5330248f6e Add checkbox for experimental incremental compilation; Make simple incremental compilation on by default 2015-12-16 21:52:39 +03:00
Alexander Udalov
0ba0ea5e1f Report 'unsupported' on synthetic Java property references
#KT-8575 Open
2015-12-16 19:50:15 +03:00
Alexander Udalov
dc84445e2e Inherit KProperty interfaces from function types
To be able to write the following: listOfStrings.map(String::length)
2015-12-16 19:48:28 +03:00
Mikhail Glukhikh
f25f0db10e Fixed long / double / float value merge in OptimizationBasicInterpreter #KT-7401 Fixed 2015-12-16 17:45:38 +03:00
Stanislav Erokhin
75089a3af8 Revert "Project configuration: Add sources to kotlin-runtime library"
This is workaround for KT-10413.
This reverts commit 623ecd2503.
2015-12-16 12:53:56 +03:00
Stanislav Erokhin
c725ed47f5 Replaced ReceiverValue.NO_RECEIVER to null. 2015-12-15 23:09:20 +03:00
Stanislav Erokhin
3692318c38 Minor. Removed ReceiverValue.IRRELEVANT_RECEIVER. 2015-12-15 23:08:41 +03:00
Pavel V. Talanov
56cd29dff2 Increase file size limit of compiler to 20 (was 2.5) megabytes (compiler will not read files larger than that)
Current IDEA api makes it possible to increase that to a higher value only by passing system property on compiler startup
2015-12-15 20:24:11 +03:00
Pavel V. Talanov
8d5d1b7dcc LightClassUtil: files can no longer "belong to builtIns" 2015-12-15 20:22:14 +03:00
Pavel V. Talanov
bd9221beaa Minor, fix test data for KotlinGoToTest 2015-12-15 20:22:13 +03:00
Pavel V. Talanov
623ecd2503 Project configuration: Add sources to kotlin-runtime library 2015-12-15 20:22:12 +03:00
Pavel V. Talanov
ca38a50e1a Test data: fix test data for LineMarkerTest 2015-12-15 20:22:12 +03:00
Pavel V. Talanov
4fdc77f86f Minor, mark component functions as operator in test data for ReferenceResolveWithLibTest 2015-12-15 20:22:11 +03:00
Pavel V. Talanov
6a780f01bd Replace calls to QuickFixUtil.canModify by calls to canRefactor
Fix ChangeFunctionSignatureFix#isAvailable
2015-12-15 20:22:10 +03:00
Pavel V. Talanov
a667aa2f71 Tests: add runtime (and runtime sources) to some tests that rely on being able to resolve references to built ins 2015-12-15 20:22:09 +03:00
Pavel V. Talanov
539b84b561 Minor, stricter check for when deciding whether to build light class for decompiled declaration 2015-12-15 20:22:09 +03:00
Pavel V. Talanov
ddde372fad Upgrade BuiltInsReferenceResolverTest 2015-12-15 20:22:08 +03:00
Pavel V. Talanov
ef134ffb1b ProjectDescriptorWithStdlibSources includes source files for builtIns 2015-12-15 20:22:07 +03:00
Pavel V. Talanov
0099c10e4e Drop BuiltInsReferenceResolver 2015-12-15 20:22:07 +03:00
Pavel V. Talanov
3f0d71411e KtDecompiledFile: hack to be able to navigate to builtIns on jvm
Which sometimes are loaded differently than they are rendered (see BuiltInClassesAreSerializableOnJvm)
2015-12-15 20:22:06 +03:00
Pavel V. Talanov
b5568f9ace findDecompiledDeclaration: rewrite using stub indices 2015-12-15 20:22:05 +03:00
Pavel V. Talanov
7ccdbfd596 Minor, rename file 2015-12-15 20:22:04 +03:00
Pavel V. Talanov
01b79f640f DecompiledNavigationUtils -> findDecompiledDeclaration() 2015-12-15 20:22:04 +03:00
Pavel V. Talanov
d89b609960 J2K DecompiledNavigationUtils: rename file 2015-12-15 20:22:03 +03:00
Pavel V. Talanov
9ad6685310 J2K DecompiledNavigationUtils: autoconvert 2015-12-15 20:22:02 +03:00
Zalim Bashorov
976fbf32ba Minor: use List instead of Array as container in chained scopes 2015-12-15 20:07:37 +03:00
Zalim Bashorov
5008a66a5b ChainedScope -> ChainedMemberScope 2015-12-15 20:07:36 +03:00
Zalim Bashorov
674a15daa1 Disable test until KT-10405 not fixed 2015-12-15 20:07:35 +03:00
Zalim Bashorov
8fa2e28729 Add usages of inherited static members from nested object 2015-12-15 20:07:33 +03:00
Zalim Bashorov
e201268f46 Remove unnecessary scopes 2015-12-15 19:41:18 +03:00
Zalim Bashorov
8c4deb80e5 Extract to property path to js.stdlib output dir and fix statistics for generated js files 2015-12-15 19:41:17 +03:00
Zalim Bashorov
0b6e100aff Fix compilation 2015-12-15 19:41:16 +03:00
Zalim Bashorov
51a8d5b9f0 Allow to use static members from companion object's parents 2015-12-15 19:41:15 +03:00
Zalim Bashorov
69c2668530 Don't allow to use own members when resolve super constructor call in (companion) object 2015-12-15 19:41:14 +03:00
Zalim Bashorov
e9ea4cc953 Don't allow to use own nested classes when resolve header of (companion) object 2015-12-15 19:41:13 +03:00
Zalim Bashorov
38522f60ea Minor: add helper function createLazyValue with onRecursion 2015-12-15 19:41:12 +03:00
Denis Zharkov
7756644eb1 Introduce KClass<T>.javaPrimitiveType and KClass<T>.javaObjectType
#KT-6319 Fixed
2015-12-15 16:18:31 +03:00
Denis Zharkov
154657a374 Fix wildcards for invariant arguments
See test with Java, we want preserve the invariant that if return type and
value parameter types are same in Kotlin, than we can use such return-value
as argument for that parameter
2015-12-15 16:18:31 +03:00
Denis Zharkov
5df2a58003 Minor. Adjust generic parameter naming 2015-12-15 16:18:31 +03:00
Denis Zharkov
b4bb92d136 Fix overload resolution ambiguity for types intersection
There are two different forms of types intestion:
1. Type parameters with multiple bounds
2. Smart casts

The problem was that when member scope of type intersection contained
effective duplicates and that lead to overload resolution ambiguity in
strange cases like `x.hashCode()`

For first type we do effectively the same thing as when building member
scope for class extending several interfaces: group all descriptors by
both-way-overridability relation and then choose most-specific in each
group.

For smart casts we do basically the same thing but with special
treatments:
1. From all descriptors that _equal_ to most specific we choose
   the one that works without smartcast if possible (i.e. we choose first from candidates list)
2. If smart-cast value seems to be unstable we use only member scope
   of receiver type + all descriptors from smart cast possible types
   that has incompatible signature. If we'd include all of them and
   choose one as more specific, and it would lead to false
   SMART_CAST_IMPOSIBLE (see test unstableSmartCast.kt)

 #KT-3996 Fixed
 #KT-10315 Fixed
2015-12-15 16:18:31 +03:00
Denis Zharkov
8d0c3281cd Choose first non-flexible when selecting most specific 2015-12-15 16:18:31 +03:00
Dmitry Petrov
02311538d6 Refactor createAntBindFakeOverride.
Drop unneeded helper functions from overridingUtils.kt
2015-12-15 16:18:30 +03:00
Ilya Gorbunov
19a6cc74de Build Markdown from sources tagged with forKotlin tag 2015-12-15 16:08:55 +03:00
Dmitry Jemerov
c83b6ed3a5 Inspection for migrating Kotlin stdlib API usages in Java code 2015-12-15 12:45:40 +01:00
Alexey Sedunov
3dfb9d2e5e Inline Variable: Move string template processing to InlineValHandler as it violates contract of the PsiElement.replace() 2015-12-15 13:31:35 +03:00
Alexey Sedunov
b5fad71b18 Inline Variable: Warn about non-Kotlin usages
#KT-8885 Fixed
2015-12-15 13:31:34 +03:00
Alexey Sedunov
ffb382e3bc PSI: Delete succeeding semicolon along with KtElement
#KT-5487 Fixed
2015-12-15 13:31:33 +03:00
Alexey Sedunov
d0b9b6a3b4 Introduce Parameter: Support conversion of local variables
#KT-9170 Fixed
2015-12-15 13:31:32 +03:00
Alexey Sedunov
fff011f60a Unit Test Tooling: Fix order of test method generation actions
#KT-9740 Fixed
2015-12-15 13:31:31 +03:00
Alexey Sedunov
258a6328a8 Pull Up: Default to "Make abstract" when moving to interface
#KT-9832 Fixed
2015-12-15 13:31:29 +03:00
Alexey Sedunov
04c6ea78c7 Name Suggester: Allow any Kotlin identifier in suggested names
#KT-10332 Fixed
2015-12-15 13:31:28 +03:00
Alexey Sedunov
ee9eb55b59 Extract Function: Fix NPE on parameter disabling. Fix parameter swapping 2015-12-15 13:31:27 +03:00
Mikhail Glukhikh
49e7417741 "as" in binary / unary expressions now checked only for original type conversion #KT-10384 Fixed
Also #KT-10386 Fixed
2015-12-15 12:02:33 +03:00
Mikhail Glukhikh
233e8e58e8 Code cleanup: get rid of unnecessary !! / as, fake warning comments and issues 2015-12-15 12:00:58 +03:00
Ilya Gorbunov
4ffd60cf52 Correct deprecation messages. 2015-12-14 21:07:33 +03:00
Ilya Gorbunov
43ce8222fc Soften deprecation level to ease migrations. 2015-12-14 21:05:13 +03:00
Pavel V. Talanov
46798ed845 Module configuration: 'idea-completion' depends on 'idea' at runtime
So that plugin.xml is in classpath when running completion tests separately
2015-12-14 17:35:17 +03:00
Stanislav Erokhin
cd80d9408d Extension function wins against function with no receiver 2015-12-14 16:49:29 +03:00
Dmitry Jemerov
a7503303d5 diagnostics for EA-73611 2015-12-14 13:28:45 +01:00
Mikhail Glukhikh
d2fce9b16d CFA classes rename: remove 'Kotlin' prefix 2015-12-14 15:25:43 +03:00
Dmitry Jemerov
8db3fb03f9 remove support for "package.foo.bar" syntax inside files 2015-12-14 13:22:54 +01:00
Mikhail Glukhikh
19084b8182 Additional codegen test for KT-10107 2015-12-14 12:52:43 +03:00
Mikhail Glukhikh
fdc9e9d7f5 Delegated properties never require backing field #KT-10107 Fixed 2015-12-14 12:26:37 +03:00
Ilya Gorbunov
9d753f24b7 Do not create regex to split path by directory separator char. 2015-12-14 06:31:44 +03:00
Ilya Gorbunov
a4f82a2dc4 Sensible behavior for File.startsWith and File.endsWith 2015-12-14 06:10:26 +03:00
Ilya Gorbunov
d2e22dc794 Fix tests on linux.
Add tests for File.startsWith
2015-12-14 06:10:24 +03:00
Ilya Gorbunov
645c78e2f4 Do not use assert in test, use assertTrue or assertEquals 2015-12-14 06:10:22 +03:00
Ilya Gorbunov
cb71e05c51 Deprecate File.directory, root, rootName as properties with unclear behavior. 2015-12-14 06:10:21 +03:00
Ilya Gorbunov
7c9b53c75c Do not convert separatorsToSystem in file path extensions.
Do not require network host in network share root to contain dot.
File.root now is always non-null to be consistent with File.toComponents().root.
Introduce invariantSeparatorsPath property.
Deprecate relativeTo to make it return File later. Introduce toRelativeString instead.
Introduce relativeToOrNull and relativeToOrSelf extensions.
2015-12-14 06:10:18 +03:00
Ilya Gorbunov
52eb9e4276 Refactor FilePathComponents: rename properties, deprecate constructor, rename filePathComponents extension. 2015-12-14 06:09:55 +03:00
Ilya Gorbunov
8deefd56db Rename FileTreeWalk public parameters and builder methods.
Directory filtering now is performed in newly introduced onEnter predicate.
2015-12-14 05:16:06 +03:00
Ilya Gorbunov
e24dbcefb6 Move all mutable state from FileTreeWalk to its iterator implementation, allowing this sequence to be iterated several times.
Introduce SingleFileState for single file walks.
Do not check isDirectory in DirectoryState constructor unless assertions are enabled.
2015-12-14 05:16:04 +03:00
Ilya Gorbunov
061803d7b1 Compare root of FilePathComponents according to case-sensitivity rules of current file system. 2015-12-14 05:16:02 +03:00
Ilya Gorbunov
4f2887df64 FileTreeWalk tests: do not remove failed directory from stack as leave is also called on failed dirs. 2015-12-14 05:16:01 +03:00
Ilya Gorbunov
162b152133 Improve File.relativeTo handling relative paths. Paths are normalized before calculating relative path. "x".relativeTo("../y") now is considered to have incompatible roots. 2015-12-14 05:15:59 +03:00
Ilya Gorbunov
9f5a972816 Improve resolve and resolveSibling for relative paths. 2015-12-14 05:15:57 +03:00
Ilya Gorbunov
923effe11d Change FilePathComponents parsing for file with empty name to enhance finding relative path between relative paths. 2015-12-14 05:15:55 +03:00
Ilya Gorbunov
6301c707cd Ensure resolveTo fails as expected.
Change UNC paths not to be misinterpreted on *nix.
2015-12-14 05:15:53 +03:00
Ilya Gorbunov
c23c2dbe85 FileTreeWalk: correct usage not to filter out subdirectories 2015-12-14 05:15:52 +03:00
Ilya Gorbunov
515d2cd3e7 FileTreeWalk.filter was dropped, use treeFilter otherwise filtering result becomes different.
Refactor walking tests.
2015-12-14 05:15:50 +03:00
Ilya Gorbunov
27551a8399 Make some io test classes non-nested as it's not supported by runners. 2015-12-14 05:15:48 +03:00
Ilya Gorbunov
33967a09f6 Unify minBy and maxBy for Maps with other families. 2015-12-14 04:56:47 +03:00
Ilya Gorbunov
33b366b9b9 Relax upper bound of T for minBy and maxBy to be nullable.
Swap type parameters of minBy and maxBy.
#KT-10099 Fixed
2015-12-14 04:56:45 +03:00
Ilya Gorbunov
58e93d5e1b Update testData for LoadBuiltinsTest and BuiltInDecompilerTest 2015-12-14 04:29:28 +03:00
Ilya Gorbunov
bf9d50ccc4 Fix testData for LookupTracker 2015-12-14 04:29:27 +03:00
Ilya Gorbunov
59a9e2549c Fix tests: codegen, completion, decompiler consistency, quickdoc, intentions, navigation, reference resolver, quick fixes 2015-12-14 04:29:25 +03:00
Ilya Gorbunov
f55b421853 Partially support default imports when analyzing ReplaceWith annotation pattern. 2015-12-14 04:29:23 +03:00
Ilya Gorbunov
d296d91272 Fix fq-names of top-level extensions in intentions. 2015-12-14 04:29:21 +03:00
Ilya Gorbunov
5df94da216 Fix fq-name of listOf in extract function. 2015-12-14 04:29:20 +03:00
Ilya Gorbunov
4dde59368c Fix tests not to duplicate array constructor definitions as they are available now in builtins. 2015-12-14 04:29:18 +03:00
Ilya Gorbunov
f509937037 Move array constructors to builtins module back to kotlin package. 2015-12-14 04:29:11 +03:00
Ilya Gorbunov
5aff07561d Move jvm annotations and class mapping intrinsics to runtime.jvm module to kotlin.jvm package.
Make annotationClass to be a property.
Deprecate with error javaClass property on KClass<T>
2015-12-14 03:51:07 +03:00
Ilya Gorbunov
feff5b2327 Stdlib generators: change values back to function. 2015-12-14 03:49:59 +03:00
Ilya Gorbunov
2d85c437cd Final moves: BigInteger and BigDecimal operations 2015-12-14 03:49:58 +03:00
Ilya Gorbunov
0ab33ab075 Final moves: map delegating accessors and timing utils, provide deprecated methods in the old place 2015-12-14 03:49:56 +03:00
Ilya Gorbunov
597f2c0a8c Final moves: map delegating accessors and timing utils 2015-12-14 03:49:55 +03:00
Ilya Gorbunov
16fbdcf107 For migration: provide deprecated classes inheriting multifile facade classes moved out of kotlin package. 2015-12-14 03:49:53 +03:00
Ilya Gorbunov
ae3135c770 For migration: Make an option "Xmultifile-facades-open" for compiler to generate open multifile facade classes. 2015-12-14 03:49:51 +03:00
Ilya Gorbunov
594d981094 Provide deprecated AbstractIterator in the old package kotlin.support. 2015-12-14 03:49:49 +03:00
Ilya Gorbunov
91b920f18e Move IndexedValue, IndexingIterable and IndexingIterator back to kotlin package 2015-12-14 03:49:48 +03:00
Ilya Gorbunov
871c5c66b4 Move code between packages (JS) 2015-12-14 03:49:46 +03:00
Ilya Gorbunov
dd2ae15531 Move code between packages. 2015-12-14 03:49:45 +03:00
Ilya Gorbunov
81e7826568 Move generated code between packages. 2015-12-14 03:49:43 +03:00
Alexander Udalov
477e25ae2f Remove Intrinsic annotation from *arrayOf functions 2015-12-14 03:49:41 +03:00
Ilya Gorbunov
09191622e5 Fix testData: import became not required. 2015-12-14 01:07:51 +03:00
Ilya Gorbunov
42565129ee Add packages kotlin.collections, kotlin.ranges, kotlin.sequences, and kotlin.text to default imports. 2015-12-14 01:07:49 +03:00
Alexander Udalov
65c5c99c68 Render decompiled annotations on enum entries 2015-12-13 17:49:44 +03:00
Alexander Udalov
6f347f351a Load annotations on compiled Kotlin enum entries
#KT-10339 Fixed
2015-12-13 03:52:42 +03:00
Alexander Udalov
3e2eb8c1a0 Serialize/deserialize annotations on enum entries
#KT-10338 Fixed
2015-12-13 03:52:41 +03:00
Alexander Udalov
5e421b4024 Improve type parameter bound diagnostic location
If there's only one erroneous bound (vast majority of cases), report it on the
bound; otherwise (to avoid reporting it several times) report on the type
parameter declaration
2015-12-13 02:06:07 +03:00
Michael Bogdanov
39d9b35e27 Force resolve companion in light class generation 2015-12-12 11:41:37 +03:00
Michael Bogdanov
a849f3f5d4 Fixed filtering error 2015-12-12 11:41:37 +03:00
Michael Bogdanov
4ad113d836 Removed redundant check 2015-12-12 11:41:36 +03:00
Michael Bogdanov
7c7786f7d0 Generate private methods in TraitImpl as private, don't generate delegation to private trait methods 2015-12-12 11:41:36 +03:00
Michael Bogdanov
a2d644f708 Fix for KT-9958: NoSuchMethodError when we call protected method from companion object
#KT-9958 Fixed
2015-12-12 11:41:35 +03:00
Michael Bogdanov
a7eea6e4dd Get rid of NeedSyntheticChecker 2015-12-12 11:41:35 +03:00
Denis Zharkov
b443f605ed Minor. Add load-java test checking that SamAdapterOverridabilityCondition is on 2015-12-11 22:41:03 +03:00
Denis Zharkov
871fe7680b Load special override as HIDDEN in case of signature clash
#KT-10151 Fixed
2015-12-11 22:41:03 +03:00
Denis Zharkov
45c0bc3610 Add 'subClassDescriptor' parameter to ExternalOverridabilityCondition 2015-12-11 22:41:03 +03:00
Denis Zharkov
417ff281ee Split getOverriddenBuiltinWithJvmDescriptor into two extensions 2015-12-11 22:41:02 +03:00
Mikhail Glukhikh
fe78f944a6 Private setter for open property: is now an error, not a warning 2015-12-11 18:54:40 +03:00
Mikhail Glukhikh
00504a3f6d Private setter for open property: take containing class modality into account #KT-10325 Fixed 2015-12-11 18:54:28 +03:00
Dmitry Jemerov
470dfc9bec remove "Jet" from names of classes related to resolve/scopes 2015-12-11 16:07:13 +01:00
Stanislav Erokhin
39b6637c7c Fix exception from InvokeProcessor when we get invoke from extension function type. 2015-12-11 17:01:04 +03:00
Stanislav Erokhin
616bb444ec Minor. strip explicit receiver for variable call if needed. 2015-12-11 17:01:03 +03:00
Stanislav Erokhin
1890b8cbd3 Removed InvokeOnExtensionFunctionWithExplicitReceiverFix 2015-12-11 17:01:03 +03:00
Stanislav Erokhin
dd24fd47f7 Update control flow test data for tower resolution algorithm
- locals win
- drop old invokeExtension convention
2015-12-11 17:01:02 +03:00
Stanislav Erokhin
79b30dddf9 Update lookupTracker test data for tower resolution algorithm 2015-12-11 17:01:02 +03:00
Alexander Udalov
239502368a Update test data for tower resolution algorithm
- locals win
- unary calls to plus/minus are not supported in favor of unaryPlus/unaryMinus
- unqualified nested classes are temporarily reported as unresolved
- function without receiver win against extension function
- explicit import win against star import
2015-12-11 17:01:02 +03:00
Stanislav Erokhin
66a031f7a0 Do not enter in recursion for implicit invoke on variable with un inferred type 2015-12-11 17:01:01 +03:00
Stanislav Erokhin
1dca49cecc Workaround for tower resolution algorithm in kotlin code. Will be investigated. 2015-12-11 17:01:01 +03:00
Stanislav Erokhin
cbe1ffed55 Use new tower resolution algorithm by default 2015-12-11 17:01:00 +03:00
Natalia Ukhorskaya
f699adda33 Stepping: skip methods deleting to static method call of DefaultImpl.
Support smart step into interface methods with implementation
 #KT-4803 Fixed
2015-12-11 16:21:05 +03:00
Natalia Ukhorskaya
ea8de883ac Implement 'Skip simple getters' for debugger 2015-12-11 16:21:04 +03:00
Michael Bogdanov
b950bf0e6e Fix for KT-10259: Proguard can't find generated lambda class of lambda nested inside object?.let lambda
#Fixed KT-10259
2015-12-11 16:14:59 +03:00
Michael Bogdanov
9452c200a0 Keep typeRemapper in inlining context instead of hashMap for transformed types 2015-12-11 16:14:58 +03:00
Mikhail Glukhikh
6fb871a088 A set of additional tests for complex expressions DFA 2015-12-11 15:17:37 +03:00
Mikhail Glukhikh
d024045638 Data flow values for Elvis / parenthesized expressions, smart casts on them 2015-12-11 15:17:29 +03:00
Mikhail Glukhikh
745a3aeeac Accurate representation of smart casts on complex expressions 2015-12-11 15:17:25 +03:00
Mikhail Glukhikh
7cd867b936 DFA: take into account if / else and when expression assignments #KT-10002 Fixed
Also #KT-7479 Fixed
2015-12-11 15:17:22 +03:00
Mikhail Glukhikh
e7fc6bcc6e BuiltIns refactoring: getEnumEntry 2015-12-11 11:11:46 +03:00
Mikhail Glukhikh
c8b50eec1e Enum.values: deprecation (warning) --> deprecation (error) 2015-12-11 11:11:42 +03:00
Mikhail Glukhikh
521b216602 Migration: Enum.values to Enum.values() 2015-12-11 11:11:38 +03:00
Mikhail Glukhikh
3254641c5a Local sealed classes: warning --> error 2015-12-11 11:11:34 +03:00
Dmitry Petrov
0fe74a8b43 COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT is an ERROR now.
Migrated code.
Updated test data in IDE tests.
Dropped whenWithRangeTestsAndMultiConditions.kt:
"Introduce subject" is not applicable to 'when' with ||-ed conditions.
2015-12-11 10:43:16 +03:00
Alexey Tsvetkov
199827635f Reserve 'typeof' as a keyword 2015-12-10 21:26:41 +03:00
Alexey Sedunov
4c3f620255 Minor: Fix compilation 2015-12-10 21:03:44 +03:00
Alexey Sedunov
f87d2d1fcc Introduce Refactorings: Implement trimming renderer for expression
chooser. Do not suggest parenthesized expressions
 #KT-9028 Fixed
2015-12-10 20:07:26 +03:00
Alexey Sedunov
ae2fc19fe5 Introduce Parameter/Lambda Parameter: Parenthesize binary expressions if operation reference starts with a new line 2015-12-10 20:07:24 +03:00
Alexey Sedunov
354e1dc337 Extract Function: Parenthesize binary expressions if operation reference starts with a new line 2015-12-10 20:07:23 +03:00
Alexey Sedunov
1824f10f07 Introduce Variable: Parenthesize binary expressions if operation references starts with a new line
#KT-3933 Fixed
2015-12-10 20:07:22 +03:00
Alexey Sedunov
ffc8b6fd89 Safe Delete: Move test classes and test data to refactoring directory 2015-12-10 20:06:34 +03:00
Alexey Sedunov
a76f43b66c Safe Delete: Skip internal usages of class constructors when deleting class itself
#KT-8857 Fixed
2015-12-10 20:06:31 +03:00
Alexey Sedunov
f50059a11a Create from Usage: Implement "Create function" on callable references
#KT-10283 Fixed
2015-12-10 20:06:30 +03:00
Alexey Sedunov
87aebd2cdf Create from Usage: Forbid "Create local variable/parameter/property" on callable references
#KT-10283 In Progress
2015-12-10 20:06:27 +03:00
Alexey Sedunov
44743aade5 Create from Usage: Allow type parameters in the receiver position
#KT-7497 Fixed
2015-12-10 20:06:26 +03:00
Alexey Sedunov
76cf284b77 Introduce Variable: Do not suggest type-based names for multi-declaration entries if component function corresponds to value parameter
#KT-10287 Fixed
2015-12-10 20:06:24 +03:00
Yan Zhulanow
15faa6610c Android Extensions: do not cache package fragment provider with synthetic properties (KT-10318) 2015-12-10 19:38:38 +03:00
Yan Zhulanow
ac9a1350c2 Application package from manifest file has a higher priority than the applicationId value in build.gradle (KT-10320) 2015-12-10 19:38:38 +03:00
Dmitry Jemerov
009e3f9cd7 rename PSI classes according to current terminology:
KtMultiDeclaration(Entry) -> KtDestructuringDeclaration(Entry)
KtFunctionLiteralExpression -> KtLambdaExpression
KtFunctionLiteralArgument -> KtLambdaArgument
KtDelegationSpecifierList -> KtSuperTypeList
KtDelegationSpecifier -> KtSuperTypeListEntry
KtDelegatorToSuperClass -> KtSuperTypeEntry
KtDelegatorToSuperCall -> KtSuperTypeCallEntry
KtDelegationByExpressionSpecifier ->KtDelegatedSuperTypeEntry
2015-12-10 16:15:13 +01:00
Alexey Tsvetkov
ef4b3c99f4 Minor: remove default values for markChunk parameters 2015-12-10 18:03:20 +03:00
Alexey Tsvetkov
6a74b1c8bf Rebuild only kotlin when cache version is changed 2015-12-10 18:03:17 +03:00
Alexey Tsvetkov
49778d2fb6 Minor: move buildFinished closer to buildStarted 2015-12-10 18:03:13 +03:00
Natalia Ukhorskaya
d10c3ffbe4 Fix exception in EE for inline function invocation
#KT-10217 Fixed
2015-12-10 14:42:00 +03:00
Natalia Ukhorskaya
58d62fde4d Add test for smart step into in method with default args
#KT-4803 In Progress
2015-12-10 14:41:58 +03:00
Natalia Ukhorskaya
1dbe560734 Run Code Clean up for org.jetbrains.kotlin.idea.debugger 2015-12-10 14:41:56 +03:00
Natalia Ukhorskaya
1ca6c695e6 Remove println() from debugger testData 2015-12-10 14:41:53 +03:00
Natalia Ukhorskaya
9b8e5c5684 Refactor KotlinDebuggerTestCase to avoid StubIndexReindex between test invocation 2015-12-10 14:41:51 +03:00
Natalia Ukhorskaya
42119b311d Skip whitespaces as context elements of codeFragmnets
#KT-10171 Fixed
2015-12-10 14:41:49 +03:00
Natalia Ukhorskaya
49e484d796 Do not throw exception analyzing imports in KtCodeFragments 2015-12-10 14:41:47 +03:00
Natalia Ukhorskaya
08c29b7325 Fix step out from inline function literal placed at one line
#KT-10187 Fixed
2015-12-10 13:11:40 +03:00
Natalia Ukhorskaya
3b3dbbab04 Evaluate expression for variable of function type
#KT-10199 Fixed
2015-12-10 13:11:39 +03:00
Natalia Ukhorskaya
2bc2d81486 Debugger: correctly box parameter types in case of generics
#KT-10180 Fixed
2015-12-10 13:11:39 +03:00
Pavel V. Talanov
280e00981f Load java: load annotations on enum entries 2015-12-10 11:12:23 +03:00
Pavel V. Talanov
fb19552920 Mark enum entries that are deprecated in Kotlin as deprecated in bytecode 2015-12-10 11:12:22 +03:00
Zalim Bashorov
5bf8b4d946 Allow to use "static" part of class in own constructors by short name, including in primary constructor 2015-12-09 21:42:32 +03:00
Mikhail Glukhikh
f319b1b93a Sealed classes are not taken into account in live templates 2015-12-09 19:27:50 +03:00
Mikhail Glukhikh
9a4eb2a368 Refactoring: ClassDescriptor.isFinal, no more Modality.isOverridable 2015-12-09 19:27:47 +03:00
Mikhail Glukhikh
fb406bfc24 Refactoring: CallableMemberDescriptor.isOverridable 2015-12-09 19:27:04 +03:00
Mikhail Glukhikh
c73f01927a 'sealed' is now not 'final' by default + related code changes #KT-10266 Fixed 2015-12-09 19:19:04 +03:00
Mikhail Glukhikh
5b72afe8a0 J2K: Modality.kt 2015-12-09 19:19:00 +03:00
Mikhail Glukhikh
d80206376a Modality.java --> Modality.kt 2015-12-09 19:18:56 +03:00
Nikolay Krasko
8e71006e86 Add test JDK 8 module to be able reparse IDEA step 2015-12-09 19:16:37 +03:00
Pavel V. Talanov
da02ed9057 GroupingMessageCollector: ensure that messages without location are reported first
Should fix CompileKotlinAgainstCustomBinariesTest.testIncompleteHierarchyInJava(Kotlin) tests
2015-12-09 18:54:15 +03:00
Pavel V. Talanov
2e971b13aa KotlinGoToTest: test go to for builtIn classes and functions 2015-12-09 18:51:32 +03:00
Pavel V. Talanov
7e6bed7ad8 Decompiled text: should always render all modifiers even if we don't feel like it 2015-12-09 18:51:31 +03:00
Pavel V. Talanov
fee19ad9de CallableClsStubBuilder: correctly decide whether callable is extension 2015-12-09 18:51:30 +03:00
Pavel V. Talanov
deb6410a5c Add test for builtIn stub builder and decompiler
These test are by no means exhaustive, the correctness of the subsystem relies on it sharing code with well-tested js-decompilation
2015-12-09 18:51:30 +03:00
Pavel V. Talanov
5cc04e41fe Enable keyword highlighting in .kotlin_class, .kotlin_package files 2015-12-09 18:51:29 +03:00
Pavel V. Talanov
c40d6af1e5 Decompile builtins (kotlin_class and kotlin_package files)
The main purpose of this is to be able to index builtin declarations and enable go to symbol/class functionality in ide
Also it makes sense to show builtin classes (Any, Int ...) as classes when browsing kotlin-runtime.jar

Refactor decompiler code to eliminate existing and potential duplication
Share the code between js (kjsm) decompilation and builtin decompilation heavily
2015-12-09 18:51:28 +03:00
Pavel V. Talanov
6164566cad Extract duplicate logic between javascript and builtins serialization/deserialization 2015-12-09 18:51:27 +03:00
Pavel V. Talanov
34c3c04ead Implement NameResolverImpl#getPackageFqName(index) 2015-12-09 18:51:26 +03:00
Pavel V. Talanov
5846769b43 J2K NameResolverImpl: convert 2015-12-09 18:51:26 +03:00
Pavel V. Talanov
9ff6be6f0f J2K NameResolverImpl: rename file 2015-12-09 18:51:25 +03:00
Pavel V. Talanov
e458534c93 Write package_fq_name to for Package message when serializing builtins 2015-12-09 18:51:24 +03:00
Pavel V. Talanov
f05de6d6eb Add package_fq_name field extension to builtins.proto 2015-12-09 18:51:24 +03:00
Pavel V. Talanov
9a2442bba6 Decompiler, refactor: reduce the number of classes needed to define a decompiler 2015-12-09 18:51:23 +03:00
Pavel V. Talanov
dc34d4fc31 Decompiler, minor: fix some strange code 2015-12-09 18:51:22 +03:00
Pavel V. Talanov
136e8d9d02 Refactor: repackage decompiler code and explicitly extract class file and js metafile parts 2015-12-09 18:51:21 +03:00
Dmitry Petrov
70c200d265 Fix diagnostic messages for properties.
Fix IDE tests.
Update quick fixes in IDE
(TODO: review new inheritance-related diagnostics with regards to quick fixes)
2015-12-09 17:43:48 +03:00
Dmitry Petrov
94bea54db3 Change "most specific return type" definition for fake overrides.
Given overridden descriptors D = d[i].
1. Find D*, subset of D:
  returnType(d* from D*) <: returnType(d) for each d from D.
  Always prefer var to val.
2. Prefer non-flexible return type to flexible.

Check for var/val overrides properly
(NB: this will report PROPERTY_TYPE_MISMATCH_ON_OVERRIDE
for all properties, not just overrides involving vars as it was before).
2015-12-09 17:43:48 +03:00
Dmitry Petrov
594039ac42 Delegation and overrides:
- Tests.
- No need for a separate diagnostic message regarding
return/property type conflict on override by delegation:
it is always a conflict of inherited signatures.
2015-12-09 17:43:48 +03:00
Dmitry Petrov
84824b1024 Fix KT-10194: skip incorrect delegates. 2015-12-09 17:43:48 +03:00
Dmitry Petrov
ef72c594c4 KT-1934 & KT-10197:
Naive approximation for fake overriding signature:
use upper bound for flexible types.
Check delegation errors.
2015-12-09 17:43:47 +03:00
Dmitry Petrov
6e2d42daf9 J2K: DelegationResolver.kt: convert to Kotlin 2015-12-09 17:43:47 +03:00
Dmitry Petrov
8f5df45edc J2K: DelegationResolver.kt 2015-12-09 17:43:47 +03:00
Dmitry Petrov
2fcb7e532b KT-1934: Fixing synthetic accessors hierarchy 2015-12-09 17:43:47 +03:00
Dmitry Petrov
135c30323b KT-1934 Check inherited signatures for compatibility
Overridden signatures should have compatible return types
(equal types for 'var').
Only relevant overrides should be taken into account.
Refactor inherited signatures check,
introduce a strategy interface for problem reporting.
2015-12-09 17:43:47 +03:00
Dmitry Jemerov
18e343d405 Merge pull request #795 from mcgee/KT-10124
#KT-10124 Fixed
2015-12-09 15:28:31 +01:00
Dmitry Jemerov
863e32c5cd Merge pull request #791 from mcgee/KT-9938
#KT-9938 Fixed
2015-12-09 15:17:31 +01:00
Andrey Breslav
83189013c6 Minor. Drop deprecated unary operator names from JS back-end 2015-12-09 17:10:30 +03:00
Andrey Breslav
0a0e4f1ba2 Minor. Clean up the code in OperatorChecker.kt 2015-12-09 17:10:30 +03:00
Andrey Breslav
3eeab68261 Signature checks fixed for plus() and minus() 2015-12-09 17:10:30 +03:00
Andrey Breslav
421f84e05a Error messages fixed for deprecations that have been made errors 2015-12-09 17:10:30 +03:00
Andrey Breslav
434082cadb 'yield' reserved as a keyword 2015-12-09 17:10:30 +03:00
Alexey Tsvetkov
e6bba01798 Increment cache version
Wildcard generation could cause source level incompatibility, so we should rebuild
2015-12-09 16:23:35 +03:00
Alexey Tsvetkov
c567376e35 Save class hierarchy to incremental caches
Author:    Alexey Tsvetkov <Alexey.Tsvetkov@jetbrains.com>
2015-12-09 16:23:35 +03:00
Alexey Tsvetkov
6ba5dcaa06 Simplify collection externalizers 2015-12-09 16:23:35 +03:00
Nikolay Krasko
8a95f23a23 Adjust formatting for FILE_ANNOTATION_LIST 2015-12-09 16:01:56 +03:00
Nikolay Krasko
966ad9d3b6 Move idea-repl module to ide group 2015-12-09 16:01:55 +03:00
Nikolay Krasko
a2d6bd09f3 Minor: allow to use ${file} directive in action text to reference file name 2015-12-09 16:01:53 +03:00
Nikolay Krasko
3374ac7606 Minor: More tests for warnings suppression 2015-12-09 16:01:52 +03:00
Nikolay Krasko
3c5b02e54a Minor: better diagnostic message in tests 2015-12-09 16:01:50 +03:00
Nikolay Krasko
789738c45f Minor: add fqname to dictionary 2015-12-09 16:01:49 +03:00
Dmitry Jemerov
e97e82d119 use terms "lambda expression" and "anonymous function" instead of "function literal" and "function expression" 2015-12-09 13:55:40 +01:00
mcgee
4a0e33003b #KT-9938 Fixed
Top level test case is added
2015-12-09 07:32:41 +03:00
Alexander Udalov
9a01c0d9cb Test that no delegated properties are used in critical classes in reflection 2015-12-08 22:59:00 +03:00
Stanislav Erokhin
cfed28c2ff Use CastImplicitClassReceiver for implicit this with smart cast 2015-12-08 20:42:55 +03:00
Stanislav Erokhin
b7e4fdf4d5 Add extensionReceiver to ScopeTowerLevel & use it in ImportingScopeBasedTowerLevel 2015-12-08 20:42:55 +03:00
Dmitry Jemerov
57b5588498 rename "Jet" to "Kotlin" in CFG classes 2015-12-08 16:54:09 +01:00
Dmitry Jemerov
3275542426 one more missing invokeLater() for plugin update checks (EA-76738 - Throwable: DebugUtil.currentStackTrace) 2015-12-08 16:45:40 +01:00
Dmitry Jemerov
d65c8fb06c double-check action parameters (EA-76026 - KNPE: ShowExpressionTypeAction.actionPerformed) 2015-12-08 16:45:39 +01:00
Dmitry Jemerov
0ec57e7fee add missing scope checks for highlight usages (EA-75896)
#KT-10038 Fixed
2015-12-08 16:45:19 +01:00
Stanislav Erokhin
10a13e737e Minor. Add isComputing to DeferredType 2015-12-08 17:29:55 +03:00
Stanislav Erokhin
11410000b4 Minor. Do not resolve implicit invoke for callable reference 2015-12-08 17:29:55 +03:00
Stanislav Erokhin
859a8adc31 Fix priority for functions without infix or operator modifier 2015-12-08 17:29:54 +03:00
Stanislav Erokhin
64b101785f Minor. Introduce util function 2015-12-08 17:29:54 +03:00
Alexey Sedunov
e82e4bcfc8 Inline Variable: Show error message on attempt to inline unused declaration 2015-12-08 16:21:08 +03:00
Alexey Sedunov
5c88a1c63e Inline Variable: Parenthesize arguments of the form "e1 < e2" if the next argument has the form "e1 > e2"
#KT-8261 Fixed
2015-12-08 16:21:07 +03:00
Alexey Sedunov
b2bdb8ed02 Inline Variable: Inline string template entries
#KT-7654 Fixed
2015-12-08 16:21:05 +03:00
Alexey Sedunov
0af2243245 J2K: KotlinInlineValHandler (conversion and refactoring) 2015-12-08 16:21:03 +03:00
Alexey Sedunov
2fef2763ab J2K: KotlinInlineValHandler (rename to .kt) 2015-12-08 16:21:02 +03:00
Alexey Sedunov
f4135a0a9f J2K: AbstractInlineTest 2015-12-08 16:21:00 +03:00
Alexey Sedunov
9df3ce018b J2K: AbstractInlineTest (rename to .kt) 2015-12-08 16:20:58 +03:00
Alexey Sedunov
f6b374f829 Inline Variable: Fix dialog text for non-local variables
#KT-6365 Fixed
2015-12-08 16:20:57 +03:00
Alexey Sedunov
e517cbcf78 Quick Fixes: Implement "Rename unresolved reference" fix
#KT-8795 Fixed
2015-12-08 16:20:56 +03:00
Alexey Sedunov
d850d7bbad Change Signature: Parenthesize functional type of receiver in the signature preview
#KT-8737 Fixed
2015-12-08 16:20:53 +03:00
Alexey Sedunov
8f8acf7a83 Pull Up: Drop default parameter values in function which becomes overriding. Disable function with default values if target class is the Java one
#KT-9833 Fixed
2015-12-08 16:20:52 +03:00
Alexey Sedunov
80051b8303 Create from Usage: Locate new declaration using RangeMarker
#KT-9197 Fixed
2015-12-08 16:20:50 +03:00
Alexey Sedunov
99c88cb0c5 Line Marking: Use new-style icons for Kotlin test classes/functions
#KT-10235 Fixed
2015-12-08 16:20:48 +03:00
Alexey Sedunov
8fcda32287 Unit Test Tooling: Support Go to Test/Create Test actions for top-level declarations
#KT-10133 Fixed
2015-12-08 16:20:47 +03:00
Denis Zharkov
ecac0f177b Fix order of type parameters loaded from PSI
#KT-10285 Fixed
2015-12-08 15:46:34 +03:00
Mikhail Glukhikh
d08f6f8238 DataFlowInfo Refactoring: getNullability() --> getCollectedNullability(); getPossibleTypes() --> getCollectedTypes() 2015-12-08 11:23:44 +03:00
Mikhail Glukhikh
57b3bc0496 Regression: getPredictableNullability for unnecessary safe call check #KT-10276 Fixed 2015-12-08 11:23:35 +03:00
Mikhail Glukhikh
2330ce2c28 Optimization: do not collect not-null types in DataFlowInfo.equate 2015-12-08 11:22:33 +03:00
Mikhail Glukhikh
5c9e55f3fb DFA bug fix: assignment of unstable to stable uses predictable type set (see test) 2015-12-08 10:13:38 +03:00
Mikhail Glukhikh
2e73bcb3a6 DFA bug fix: assignment of unstable to stable uses predictable nullability (see test) 2015-12-08 10:13:34 +03:00
Mikhail Glukhikh
96d0c4a1db Nullability bug fix in the source code 2015-12-08 10:13:22 +03:00
Mikhail Glukhikh
bfad9bd87f More exact unnecessary not-null assertion message #KT-3688 Fixed 2015-12-08 10:13:14 +03:00
Stanislav Erokhin
75245b3046 Rewrite TowerLevels. 2015-12-08 00:16:17 +03:00
Stanislav Erokhin
11c86405bf Fix ClassKind for Serializable and change ClassKind to INTERFACE for error classes. 2015-12-08 00:16:16 +03:00
Stanislav Erokhin
f2e60a0e11 Minor. Have to deal with error descriptors like previous resolution does. 2015-12-08 00:16:16 +03:00
Anton Sukhonosenko
da5f71773a #KT-9938 Fixed
Code review fixes
2015-12-07 22:48:47 +03:00
Zalim Bashorov
1e0b133e19 Find Nothing only in own arguments of generic type to make type raw and generate ''?" for contravariant position instead of use raw type 2015-12-07 19:25:59 +03:00
Alexander Udalov
fa77808319 Rename UpperBoundCheckerTask -> UpperBoundCheckRequest 2015-12-07 15:47:47 +03:00
Alexander Udalov
2dce7ad1e2 Add test on "inconsistent type parameter bounds"
It seems that all tests on that diagnostic were replaced in previous commits by
"repeated bound" and "no other bounds except a type parameter bound"
diagnostics
2015-12-07 15:47:47 +03:00
Alexander Udalov
d3c17ec337 Report error when type parameter has a type parameter bound and any other bound
To prevent issues with erasure on JVM: it's unclear what such type parameter
should be erased to
2015-12-07 15:47:47 +03:00
Alexander Udalov
b1fa740341 Do not report "inconsistent bounds" when there are repeated bounds
Also slightly refactor DeclarationsChecker#checkSupertypesForConsistency
2015-12-07 15:47:47 +03:00
Alexander Udalov
5fbb9bfe3b Report error on repeated upper bounds for type parameters 2015-12-07 15:47:47 +03:00
Alexander Udalov
21e64e02bd Report error on more than one class bound for type parameters
Such code may behave unexpectedly when compiled to JVM
2015-12-07 15:47:47 +03:00
Alexander Udalov
5541224288 Minor, add test on annotation on type argument 2015-12-07 15:47:47 +03:00
Anton Sukhonosenko
6b49ac6b46 #KT-9938 Fixed 2015-12-06 01:44:57 +03:00
Ilya Gorbunov
dc70c0d31e Move sequence interface definition to a separate file.
Merge SequnceJVM content into Sequences.
2015-12-05 02:40:27 +03:00
Ilya Gorbunov
a15ca7c374 Minor: rename file with sequences 2015-12-05 02:40:25 +03:00
Mikhail Glukhikh
5729855e4f Type parameter as result type: more precise expected type definition #KT-5385 Fixed
Tests for KT-5385 KT-10223 KT-7800 KT-7817 + something related
2015-12-04 19:00:24 +03:00
Natalia Ukhorskaya
51abb021bc Correct resource path for flavors in android-extensions-plugin 2015-12-04 17:21:37 +03:00
Natalia Ukhorskaya
c523817213 Do not cache AndroidModule in IDEAndroidLayoutXmlManager 2015-12-04 17:21:36 +03:00
Mikhail Glukhikh
408dd9bc9d Optimization: data flow info no more stores supertypes of the variable original type as possible types (dynamic is an exception) 2015-12-04 11:40:16 +03:00
Denis Zharkov
9c73502bdc Partially revert "Fix project source to overcome bootstrap problem"
Adjust code to new generic signatures generated by Kotlin compiler
This reverts commit 0fd2484bc9.
2015-12-04 10:19:48 +03:00
Nikolay Krasko
a19708693b Update kotlin run configuration editor
- Remove deprecated component for selecting JRE
- Update module selector
2015-12-04 01:03:26 +03:00
Nikolay Krasko
8683582c40 Fix red code in AbstractEditorForEvaluateExpressionTest.kt 2015-12-03 18:59:55 +03:00
Nikolay Krasko
703f39f492 Add icon for the project 2015-12-03 18:59:55 +03:00
Denis Zharkov
95cecdbc42 Support overrides of generic methods with erased version in Java 2015-12-03 18:19:36 +03:00
Denis Zharkov
4f06cece37 Refactor external overidability conditions
Before this change they could only negatively affect on result
Now they may force success result

Also refine overridavility condition for java fields:
two java fields having the same name are seen as overrides even
if they have different type
2015-12-03 18:19:36 +03:00
Denis Zharkov
8838e46578 Do not create KotlinTypeImpl with error scope while erasing
See assertion in KotlinTypeImpl init block
2015-12-03 18:19:36 +03:00
Denis Zharkov
e2b51f30ed Extract 'doSubstitute' parameters into SubstitutionConfiguration 2015-12-03 18:19:36 +03:00
Natalia Ukhorskaya
a197fc8cb8 Fix NoSuchMethod in android-extensions-plugin
#KT-10263 Fixed
2015-12-03 16:17:24 +03:00
Michael Bogdanov
4b8017e34b Fix for KT-7999: Wrong result when use nullable types as reified parameter, KT-8043: Unsafe cast to reified parameter throws NPE instead of TypeCastException
#KT-7999 Fixed
  #KT-8043 Fixed

~
2015-12-03 15:09:54 +03:00
Dmitry Jemerov
3478a6fb6c download markdown tagged with forKotlin, not latest build from master 2015-12-03 11:57:55 +01:00
Dmitry Jemerov
ce9012c352 fix compilation after changes in markdown library 2015-12-02 19:44:46 +01:00
Alexey Tsvetkov
d53cd3c70b Save system properties in incremental jps tests 2015-12-02 20:56:38 +03:00
Alexey Tsvetkov
73444ce59b Minor: refactor shouldRebuildBecauseVersionChanged 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
7fff17ba7c Minor: rename CACHE_DIRECTORY_NAME->KOTLIN_CACHE_DIRECTORY_NAME 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
7063e1f56a Do not mark dirty same files 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
4800cff87f Do not recompile files compiled in current round 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
19089f8b17 Prevent processing changes if all kotlin in chunk was rebuilt 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
87f09ab5b0 Introduce FSOperationsHelper to mark files dirty 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
98e0905eb3 Minor: add java to test case 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
3d3d670cd7 Minor: move check inside hasDirtyOrRemovedKotlin 2015-12-02 20:56:37 +03:00
Alexey Tsvetkov
60a8db1c6c Do not use USER_DATA to preserve data between compilation rounds 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
a447c39f69 Kotlin incremental cache version change should not affect java only modules 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
b1b0da5228 Minor: add description to key 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
c9012b10c5 Simplify lazy caches tests 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
aea6ad0f0c Move CacheVersion properties to constructor 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
e90dc047bd Test turning incremental compilation on/off 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
a8b551e518 Test versioning of experimental incremental compilation 2015-12-02 20:56:36 +03:00
Alexey Tsvetkov
69c906014f Enable separate versioning for experimental incremental compilation 2015-12-02 20:56:35 +03:00
Pavel V. Talanov
d20fb5ddd7 BuilderFactoryForDuplicateSignatureDiagnostics: report diagnostics lazily 2015-12-02 20:44:53 +03:00
Dmitry Jemerov
05a62c5892 avoid unnecessary reads of file content during indexing 2015-12-02 18:09:19 +01:00
Dmitry Jemerov
f9306d9c3c KotlinBinaryClassCache: J2K 2015-12-02 18:09:18 +01:00
Dmitry Jemerov
3abbdb4d15 KotlinBinaryClassCache: rename to .kt 2015-12-02 18:09:17 +01:00
Anton Sukhonosenko
5bc70b3150 #KT-10124 Fixed 2015-12-02 20:03:13 +03:00
Mikhail Glukhikh
dd3b85dca3 Pseudocode refactoring: repeatPart + repeatWhole 2015-12-02 18:15:03 +03:00
Mikhail Glukhikh
ea3a65d0b8 Additional tests for KT-10243 2015-12-02 18:14:59 +03:00
Pavel V. Talanov
b9ce9f8576 Script, IDE: tweak extract based refactorings to behave better in scripts
Fix not being able to invoke introduce variable for top level script expression
Prohibit introduce parameter and introduce property for scripts on top level
Basic test for introduce function (produces red code atm)
2015-12-02 15:14:25 +03:00
Alexey Sedunov
ffd8863875 Extract Function: Add support for member extension properties 2015-12-02 13:54:05 +03:00
Alexey Sedunov
39b46bb3ef Extract Function: Add support for member extension functions 2015-12-02 13:54:04 +03:00
Alexey Sedunov
6abf13be41 Extract Function: Consider member property with invoke() a receiver candidate
#KT-9774 Fixed
2015-12-02 13:54:03 +03:00
Alexey Sedunov
03e1480476 Extraction Engine: Get rid of explicit element offset manipulation and use copyable user data instead 2015-12-02 13:54:02 +03:00
Alexey Sedunov
44bc937499 Shorten References: Fix removal of explicit companion references in the position of callee expression
#KT-10102
2015-12-02 13:54:01 +03:00
Alexey Sedunov
2dcc38b92f Create from Usage: Forbid "Create parameter/local variable/property" on label references
#KT-10119 Fixed
2015-12-02 13:54:00 +03:00
Alexey Sedunov
3c87ccc5ff Move File: Reimplement Move dialog for Kotlin files. Do not show "Search for references" option (consider it true in all cases)
#KT-10118 Fixed
2015-12-02 13:53:59 +03:00
Alexey Sedunov
bcadfd4661 Introduce Variable: Suggest choosing between single variable and
multi-declaration. Forbid multi-declaration for collections and arrays
 #KT-10242 Fixed
2015-12-02 13:46:47 +03:00
Ilya Chernikov
c1c6d0ee3a fixes after review 2015-12-02 10:30:56 +01:00
Ilya Chernikov
6313ecac1c another attempt to fix parallel compilation - enabling keepalive in compiler use sites, but in jps taking parallel compilation option into account, so it should be now not set in tests 2015-12-02 10:30:56 +01:00
Mikhail Glukhikh
60e457167d Creating deep copy of local function declaration instructions in CFA, regression test #KT-10243 Fixed 2015-12-01 23:40:50 +03:00
Stanislav Erokhin
36206ddf6d Minor. Enable assertion for dist. 2015-12-01 20:44:27 +03:00
Ilya Gorbunov
b7a50b333e Better replacement for containsAll, removeAll, retainAll with incompatible types. 2015-12-01 20:35:46 +03:00
Alexander Udalov
2821448dd8 Minor, simplify kdoc for KClass#qualifiedName 2015-12-01 20:20:48 +03:00
Stanislav Erokhin
8807cd828f Removed MemberScope.getPackage 2015-12-01 15:38:04 +03:00
Stanislav Erokhin
846fb397c4 Collect all candidates for completion 2015-12-01 15:38:04 +03:00
Stanislav Erokhin
2b66af29aa Added debug info 2015-12-01 15:38:03 +03:00
Stanislav Erokhin
22b14cfc5c Fix missing smart casts 2015-12-01 15:38:03 +03:00
Stanislav Erokhin
3776e5698f Removed hidden descriptors from new resolve 2015-12-01 15:38:03 +03:00
Stanislav Erokhin
e92c314b46 Base dynamic support in new resolve 2015-12-01 15:38:02 +03:00
Stanislav Erokhin
2987576a0a Minor. fix applicability level for UsedSmartCastForDispatchReceiver 2015-12-01 15:38:02 +03:00
Stanislav Erokhin
5edadfe8ea Refactor ScopeTowerProcessor 2015-12-01 15:38:01 +03:00
Stanislav Erokhin
bc49825f55 Fix testLib test 2015-12-01 15:38:01 +03:00
27408 changed files with 722946 additions and 265984 deletions

8
.gitignore vendored
View File

@@ -13,3 +13,11 @@ workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
ultimate/.DS_Store
ultimate/.idea/shelf
ultimate/dependencies
ultimate/ideaSDK
ultimate/out
ultimate/tmp
ultimate/workspace.xml
ultimate/*.versionsBackup

3
.idea/ant.xml generated
View File

@@ -3,7 +3,7 @@
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/compiler/frontend/buildLexer.xml" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<antCommandLine value="-J-XX:MaxPermSize=100m" />
<antCommandLine value="-J-XX:MaxPermSize=100m -J-ea" />
<maximumHeapSize value="1024" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" />
@@ -18,5 +18,6 @@
</properties>
</buildFile>
<buildFile url="file://$PROJECT_DIR$/TeamCityRelay.xml" />
<buildFile url="file://$PROJECT_DIR$/node_utils.xml" />
</component>
</project>

View File

@@ -1,27 +0,0 @@
<component name="ArtifactManager">
<artifact name="KotlinBarePlugin">
<output-path>$PROJECT_DIR$/out/artifacts/BareKotlin</output-path>
<properties id="ant-postprocessing">
<options enabled="true">
<file>file://$PROJECT_DIR$/idea-runner/runner.xml</file>
<target>copy-runtime-for-idea-plugin</target>
</options>
</properties>
<root id="root">
<element id="directory" name="kotlinc">
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />
</element>
<element id="directory" name="lib">
<element id="archive" name="kotlin-bare-plugin.jar">
<element id="module-output" name="bare-plugin" />
<element id="module-output" name="descriptor.loader.java" />
<element id="module-output" name="frontend.java" />
<element id="module-output" name="descriptors" />
</element>
<element id="directory" name="jps">
<element id="artifact" artifact-name="KotlinJpsPlugin" />
</element>
</element>
</root>
</artifact>
</component>

9
.idea/artifacts/KotlinFormatter.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="ArtifactManager">
<artifact type="jar" name="KotlinFormatter">
<output-path>$PROJECT_DIR$/out/artifacts/internal</output-path>
<root id="archive" name="kotlin-formatter.jar">
<element id="module-output" name="formatter" />
<element id="dir-copy" path="$PROJECT_DIR$/idea/formatter" />
</root>
</artifact>
</component>

View File

@@ -11,7 +11,7 @@
<element id="directory" name="META-INF">
<element id="dir-copy" path="$PROJECT_DIR$/jps-plugin/src/META-INF" />
</element>
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/cli-parser-1.1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar" path-in-jar="/" />
<element id="module-output" name="cli-common" />
<element id="module-output" name="idea-jps-common" />
<element id="module-output" name="jps-plugin" />
@@ -23,7 +23,8 @@
<element id="module-output" name="daemon-common" />
<element id="module-output" name="deserialization" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/native-platform-uberjar.jar" path-in-jar="/" />
<element id="module-output" name="android-jps-plugin" />
<element id="module-output" name="android-extensions-jps" />
<element id="module-output" name="build-common" />
</root>
</artifact>
</component>

View File

@@ -37,7 +37,8 @@
<element id="module-output" name="idea-analysis" />
<element id="module-output" name="ide-common" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
<element id="module-output" name="kotlin-android-plugin" />
<element id="module-output" name="idea-android" />
<element id="module-output" name="idea-android-output-parser" />
<element id="module-output" name="js.serializer" />
<element id="module-output" name="serialization" />
<element id="module-output" name="idea-completion" />
@@ -46,6 +47,16 @@
<element id="module-output" name="daemon-common" />
<element id="module-output" name="idea-repl" />
<element id="module-output" name="idea-live-templates" />
<element id="module-output" name="resolution" />
<element id="module-output" name="plugin-api" />
<element id="module-output" name="idea-ultimate" />
<element id="module-output" name="formatter" />
<element id="module-output" name="idea-maven" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="backend.common" />
<element id="module-output" name="ir.tree" />
<element id="module-output" name="backend.jvm" />
<element id="module-output" name="ir.psi2ir" />
</element>
<element id="library" level="project" name="javax.inject" />
<element id="directory" name="jps">
@@ -53,11 +64,23 @@
</element>
<element id="library" level="project" name="markdown" />
<element id="archive" name="kotlin-android-extensions-plugin.jar">
<element id="module-output" name="android-idea-plugin" />
<element id="module-output" name="android-extensions-idea" />
</element>
<element id="archive" name="kotlin-android-extensions-compiler-plugin.jar">
<element id="module-output" name="android-compiler-plugin" />
<element id="module-output" name="android-extensions-compiler" />
</element>
<element id="archive" name="android-lint.jar">
<element id="module-output" name="uast-kotlin" />
<element id="module-output" name="lint-idea" />
<element id="module-output" name="uast-java" />
<element id="module-output" name="uast-common" />
<element id="module-output" name="lint-checks" />
<element id="library" level="project" name="guava" />
<element id="module-output" name="lint-api" />
<element id="module-output" name="uast-android" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/dist/kotlinc/lib/kotlin-daemon-client.jar" />
<element id="file-copy" path="$PROJECT_DIR$/dist/kotlinc/lib/kotlin-script-runtime.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="dir-copy" path="$PROJECT_DIR$/dist/kotlinc" />

8
.idea/codeInsightSettings.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaProjectCodeInsightSettings">
<excluded-names>
<name>kotlin.reflect.jvm.internal.impl</name>
</excluded-names>
</component>
</project>

View File

@@ -60,6 +60,9 @@
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
@@ -142,10 +145,6 @@
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>

25
.idea/compiler.xml generated
View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<option name="BUILD_PROCESS_HEAP_SIZE" value="2000" />
<excludeFromCompile>
<directory url="file://$PROJECT_DIR$/core/reflection.jvm" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/runtime.jvm" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/builtins" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/core/script.runtime" includeSubdirectories="true" />
</excludeFromCompile>
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
@@ -18,13 +18,18 @@
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.6" />
<bytecodeTargetLevel>
<module name="android-studio" target="1.8" />
<module name="idea" target="1.8" />
<module name="idea-analysis" target="1.8" />
<module name="idea-completion" target="1.8" />
<module name="idea-core" target="1.8" />
<module name="idea-live-templates" target="1.8" />
<module name="idea-repl" target="1.8" />
<module name="idea-runner" target="1.8" />
<module name="idea-test-framework" target="1.8" />
<module name="j2k" target="1.8" />
<module name="kannotator-jps-plugin-test" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

8
.idea/dictionaries/Alexey_Sedunov.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ProjectDictionaryState">
<dictionary name="Alexey.Sedunov">
<words>
<w>inplace</w>
<w>renamer</w>
</words>
</dictionary>
</component>

View File

@@ -2,6 +2,7 @@
<dictionary name="Nikolay.Krasko">
<words>
<w>accessors</w>
<w>fqname</w>
<w>goto</w>
<w>gradle</w>
<w>intrinsics</w>
@@ -15,6 +16,7 @@
<w>preloading</w>
<w>preprocess</w>
<w>redeclarations</w>
<w>smap</w>
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>

View File

@@ -2,8 +2,10 @@
<dictionary name="bashor">
<words>
<w>ctor</w>
<w>interner</w>
<w>kclass</w>
<w>lookups</w>
<w>unescape</w>
</words>
</dictionary>
</component>
</component>

10
.idea/dictionaries/dzharkov.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<component name="ProjectDictionaryState">
<dictionary name="dzharkov">
<words>
<w>checkcast</w>
<w>coroutine</w>
<w>insn</w>
<w>liveness</w>
</words>
</dictionary>
</component>

View File

@@ -3,6 +3,7 @@
<words>
<w>decapitalize</w>
<w>delegator</w>
<w>elipsis</w>
<w>funs</w>
<w>immediates</w>
<w>initializers</w>
@@ -17,6 +18,8 @@
<w>renderers</w>
<w>rparenth</w>
<w>selectioner</w>
<w>smartcast</w>
<w>summand</w>
<w>unpluralize</w>
<w>weighers</w>
</words>

8
.idea/dictionaries/yan.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<component name="ProjectDictionaryState">
<dictionary name="yan">
<words>
<w>kapt</w>
<w>uast</w>
</words>
</dictionary>
</component>

BIN
.idea/icon.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -236,6 +236,11 @@
<scope name="idea openapi" level="WARNING" enabled="true" />
<scope name="runtime.classes" level="ERROR" enabled="true" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="LoopToCallChain" enabled="false" level="INFO" enabled_by_default="false" />
<inspection_tool class="MethodMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_onlyPrivateOrFinal" value="false" />
<option name="m_ignoreEmptyMethods" value="true" />
@@ -273,6 +278,9 @@
<inspection_tool class="ObsoleteCollection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreRequiredObsoleteCollectionTypes" value="false" />
</inspection_tool>
<inspection_tool class="PackageDirectoryMismatch" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="all except testData" level="WARNING" enabled="true" />
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="ERROR" enabled_by_default="true">

6
.idea/kotlinc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCompilerSettings">
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check" />
</component>
</project>

View File

@@ -6,6 +6,7 @@
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib" />
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/android/lib/jps" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/android-common.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View File

@@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="cli-parser">
<CLASSES>
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -11,7 +11,6 @@
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/guava-17.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/asm5-src.zip!/" />
<root url="jar://$PROJECT_DIR$/dependencies/cli-parser-1.1.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/lib" recursive="false" />

View File

@@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="java-decompiler-plugin">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/plugins/java-decompiler/lib/java-decompiler.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -8,8 +8,18 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-java-2.5.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/antLayout/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-builders/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/jps-launcher/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-api/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-impl/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-impl/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-serialization/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/model-serialization/testSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/plugin-system/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.jar!/jps/standalone-builder/src" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/jps" recursive="false" />
</library>

9
.idea/libraries/kotlin_reflect.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="kotlin-reflect">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -2,11 +2,12 @@
<library name="kotlin-runtime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/libraries/stdlib/src" />
<root url="file://$PROJECT_DIR$/core/builtins/native" />
<root url="file://$PROJECT_DIR$/core/builtins/src" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="kotlin-script-runtime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-script-runtime.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

13
.idea/libraries/kotlin_test.xml generated Normal file
View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="kotlin-test">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/"/>
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/shared/src/main/kotlin" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/shared/src/main/kotlin.jvm" />
<root url="file://$PROJECT_DIR$/libraries/kotlin.test/junit/src/main/kotlin" />
</SOURCES>
</library>
</component>

View File

@@ -4,11 +4,11 @@
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/protobuf-2.5.0.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-2.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-java-2.5.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/protobuf-2.6.1-sources.jar!/" />
</SOURCES>
</library>
</component>

2
.idea/misc.xml generated
View File

@@ -49,7 +49,7 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SuppressABINotification">

38
.idea/modules.xml generated
View File

@@ -3,22 +3,27 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Kotlin.iml" filepath="$PROJECT_DIR$/Kotlin.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-compiler-plugin/android-compiler-plugin.iml" filepath="$PROJECT_DIR$/plugins/android-compiler-plugin/android-compiler-plugin.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-idea-plugin/android-idea-plugin.iml" filepath="$PROJECT_DIR$/plugins/android-idea-plugin/android-idea-plugin.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-jps-plugin/android-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/android-jps-plugin/android-jps-plugin.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/android-annotations/android-annotations.iml" filepath="$PROJECT_DIR$/plugins/lint/android-annotations/android-annotations.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/android-extensions-compiler.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/android-extensions-compiler.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/android-extensions-idea.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/android-extensions-idea.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/plugins/android-extensions/android-extensions-jps/android-extensions-jps.iml" filepath="$PROJECT_DIR$/plugins/android-extensions/android-extensions-jps/android-extensions-jps.iml" group="plugins/android-extensions" />
<module fileurl="file://$PROJECT_DIR$/android-studio/android-studio.iml" filepath="$PROJECT_DIR$/android-studio/android-studio.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/android-tests/android-tests.iml" filepath="$PROJECT_DIR$/compiler/android-tests/android-tests.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" filepath="$PROJECT_DIR$/plugins/annotation-collector/annotation-collector.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" filepath="$PROJECT_DIR$/plugins/annotation-processing/annotation-processing.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/ant/ant.iml" filepath="$PROJECT_DIR$/ant/ant.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/backend/backend.iml" filepath="$PROJECT_DIR$/compiler/backend/backend.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/compiler/backend-common/backend-common.iml" filepath="$PROJECT_DIR$/compiler/backend-common/backend-common.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/bare-plugin/bare-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/bare-plugin/bare-plugin.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/backend.common/backend.common.iml" filepath="$PROJECT_DIR$/compiler/ir/backend.common/backend.common.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/backend.jvm/backend.jvm.iml" filepath="$PROJECT_DIR$/compiler/ir/backend.jvm/backend.jvm.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/build-common/build-common.iml" filepath="$PROJECT_DIR$/build-common/build-common.iml" />
<module fileurl="file://$PROJECT_DIR$/core/builtins/builtins.iml" filepath="$PROJECT_DIR$/core/builtins/builtins.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" filepath="$PROJECT_DIR$/compiler/builtins-serializer/builtins-serializer.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/cli/cli.iml" filepath="$PROJECT_DIR$/compiler/cli/cli.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/cli/cli-common/cli-common.iml" filepath="$PROJECT_DIR$/compiler/cli/cli-common/cli-common.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/cli/cli-runner/cli-runner.iml" filepath="$PROJECT_DIR$/compiler/cli/cli-runner/cli-runner.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests/compiler-tests.iml" filepath="$PROJECT_DIR$/compiler/tests/compiler-tests.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-java8/compiler-tests-java8.iml" filepath="$PROJECT_DIR$/compiler/tests-java8/compiler-tests-java8.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/conditional-preprocessor/conditional-preprocessor.iml" filepath="$PROJECT_DIR$/compiler/conditional-preprocessor/conditional-preprocessor.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/container/container.iml" filepath="$PROJECT_DIR$/compiler/container/container.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/daemon/daemon.iml" filepath="$PROJECT_DIR$/compiler/daemon/daemon.iml" group="compiler/daemon" />
@@ -29,6 +34,7 @@
<module fileurl="file://$PROJECT_DIR$/core/descriptors.runtime/descriptors.runtime.iml" filepath="$PROJECT_DIR$/core/descriptors.runtime/descriptors.runtime.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/core/deserialization/deserialization.iml" filepath="$PROJECT_DIR$/core/deserialization/deserialization.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/eval4j/eval4j.iml" filepath="$PROJECT_DIR$/eval4j/eval4j.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/formatter/formatter.iml" filepath="$PROJECT_DIR$/idea/formatter/formatter.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend/frontend.iml" filepath="$PROJECT_DIR$/compiler/frontend/frontend.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" filepath="$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/generators/generators.iml" filepath="$PROJECT_DIR$/generators/generators.iml" group="infrastructure" />
@@ -36,17 +42,24 @@
<module fileurl="file://$PROJECT_DIR$/idea/ide-common/ide-common.iml" filepath="$PROJECT_DIR$/idea/ide-common/ide-common.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea.iml" filepath="$PROJECT_DIR$/idea/idea.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-analysis/idea-analysis.iml" filepath="$PROJECT_DIR$/idea/idea-analysis/idea-analysis.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-android/idea-android.iml" filepath="$PROJECT_DIR$/idea/idea-android/idea-android.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/idea-android-output-parser.iml" filepath="$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/idea-android-output-parser.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-completion/idea-completion.iml" filepath="$PROJECT_DIR$/idea/idea-completion/idea-completion.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-core/idea-core.iml" filepath="$PROJECT_DIR$/idea/idea-core/idea-core.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-jps-common/idea-jps-common.iml" filepath="$PROJECT_DIR$/idea/idea-jps-common/idea-jps-common.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-live-templates/idea-live-templates.iml" filepath="$PROJECT_DIR$/idea/idea-live-templates/idea-live-templates.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" filepath="$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-maven/idea-maven.iml" filepath="$PROJECT_DIR$/idea/idea-maven/idea-maven.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" filepath="$PROJECT_DIR$/idea/idea-repl/idea-repl.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea-runner/idea-runner.iml" filepath="$PROJECT_DIR$/idea-runner/idea-runner.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" filepath="$PROJECT_DIR$/idea/idea-test-framework/idea-test-framework.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" filepath="$PROJECT_DIR$/compiler/preloader/instrumentation/instrumentation.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.ir2cfg/ir.ir2cfg.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.ir2cfg/ir.ir2cfg.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.psi2ir/ir.psi2ir.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.psi2ir/ir.psi2ir.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/compiler/ir/ir.tree/ir.tree.iml" filepath="$PROJECT_DIR$/compiler/ir/ir.tree/ir.tree.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/j2k/j2k.iml" filepath="$PROJECT_DIR$/j2k/j2k.iml" group="j2k" />
<module fileurl="file://$PROJECT_DIR$/compiler/java8-tests/java8-tests.iml" filepath="$PROJECT_DIR$/compiler/java8-tests/java8-tests.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" filepath="$PROJECT_DIR$/plugins/java-model-wrappers/java-model-wrappers.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-plugin.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-plugin.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" filepath="$PROJECT_DIR$/jps-plugin/jps-tests/jps-tests.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" filepath="$PROJECT_DIR$/js/js.dart-ast/js.dart-ast.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.frontend/js.frontend.iml" filepath="$PROJECT_DIR$/js/js.frontend/js.frontend.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.inliner/js.inliner.iml" filepath="$PROJECT_DIR$/js/js.inliner/js.inliner.iml" group="compiler/js" />
@@ -55,13 +68,24 @@
<module fileurl="file://$PROJECT_DIR$/js/js.tests/js.tests.iml" filepath="$PROJECT_DIR$/js/js.tests/js.tests.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/js/js.translator/js.translator.iml" filepath="$PROJECT_DIR$/js/js.translator/js.translator.iml" group="compiler/js" />
<module fileurl="file://$PROJECT_DIR$/jps-plugin/kannotator-jps-plugin-test/kannotator-jps-plugin-test.iml" filepath="$PROJECT_DIR$/jps-plugin/kannotator-jps-plugin-test/kannotator-jps-plugin-test.iml" group="ide/jps" />
<module fileurl="file://$PROJECT_DIR$/idea/kotlin-android-plugin/kotlin-android-plugin.iml" filepath="$PROJECT_DIR$/idea/kotlin-android-plugin/kotlin-android-plugin.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/light-classes/light-classes.iml" filepath="$PROJECT_DIR$/compiler/light-classes/light-classes.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-api/lint-api.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-api/lint-api.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-checks/lint-checks.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-checks/lint-checks.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/lint/lint-idea/lint-idea.iml" filepath="$PROJECT_DIR$/plugins/lint/lint-idea/lint-idea.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/non-compiler-tests/non-compiler-tests.iml" filepath="$PROJECT_DIR$/non-compiler-tests/non-compiler-tests.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler/plugin-api/plugin-api.iml" filepath="$PROJECT_DIR$/compiler/plugin-api/plugin-api.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/plugins-tests/plugins-tests.iml" filepath="$PROJECT_DIR$/plugins/plugins-tests/plugins-tests.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/compiler/preloader/preloader.iml" filepath="$PROJECT_DIR$/compiler/preloader/preloader.iml" group="compiler/cli" />
<module fileurl="file://$PROJECT_DIR$/core/reflection.jvm/reflection.jvm.iml" filepath="$PROJECT_DIR$/core/reflection.jvm/reflection.jvm.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/resolution/resolution.iml" filepath="$PROJECT_DIR$/compiler/resolution/resolution.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/core/runtime.jvm/runtime.jvm.iml" filepath="$PROJECT_DIR$/core/runtime.jvm/runtime.jvm.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/core/script.runtime/script.runtime.iml" filepath="$PROJECT_DIR$/core/script.runtime/script.runtime.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/compiler/serialization/serialization.iml" filepath="$PROJECT_DIR$/compiler/serialization/serialization.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-common/tests-common.iml" filepath="$PROJECT_DIR$/compiler/tests-common/tests-common.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/tests-ir-jvm/tests-ir-jvm.iml" filepath="$PROJECT_DIR$/compiler/tests-ir-jvm/tests-ir-jvm.iml" group="compiler/ir" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-common/uast-common.iml" filepath="$PROJECT_DIR$/plugins/uast-common/uast-common.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-java/uast-java.iml" filepath="$PROJECT_DIR$/plugins/uast-java/uast-java.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" filepath="$PROJECT_DIR$/plugins/uast-kotlin/uast-kotlin.iml" group="plugins/lint" />
<module fileurl="file://$PROJECT_DIR$/compiler/util/util.iml" filepath="$PROJECT_DIR$/compiler/util/util.iml" />
<module fileurl="file://$PROJECT_DIR$/core/util.runtime/util.runtime.iml" filepath="$PROJECT_DIR$/core/util.runtime/util.runtime.iml" group="core" />
</modules>

View File

@@ -1,37 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Compiler Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<configuration default="false" name="All Compiler Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="JUnit" name="Compiler Tests" />
<toRun type="JUnit" name="Java 8 Tests" />
<toRun type="JUnit" name="Js-backend tests" />
<method />
</configuration>
</component>

View File

@@ -8,12 +8,12 @@
</extension>
<module name="idea" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -8,12 +8,12 @@
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -0,0 +1,39 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Non Compiler Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="non-compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1100m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs>
<env name="NO_FS_ROOTS_ACCESS_CHECK" value="true" />
</envs>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="53032" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,39 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="generators" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=400m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs>
<env name="NO_FS_ROOTS_ACCESS_CHECK" value="true" />
</envs>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="53032" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<configuration default="false" name="All Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="CompoundRunConfigurationType" name="All Compiler Tests" />
<toRun type="JUnit" name="All Non Compiler Tests" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All in jps-tests" type="JUnit" factoryName="JUnit" nameIsGenerated="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="jps-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Profile ">
<option name="myExternalizedOptions" />
</RunnerSettings>
<method />
</configuration>
</component>

View File

@@ -2,11 +2,11 @@
<configuration default="false" name="Android Studio" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Didea.paths.selector=AndroidStudioPreview -Didea.platform.prefix=AndroidStudio -Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=450m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin,$PROJECT_DIR$/out/artifacts/KotlinAndroidExtensions" />
<option name="VM_PARAMETERS" value="-Didea.paths.selector=AndroidStudioPreview -Didea.platform.prefix=AndroidStudio -Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin,$PROJECT_DIR$/out/artifacts/KotlinAndroidExtensions" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/android-studio/sdk/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />

View File

@@ -2,13 +2,13 @@
<configuration default="false" name="Codegen Tests on Android" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="android-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.6" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.android.tests" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.android.tests.AndroidRunner" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx850m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -0,0 +1,37 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Compiler Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="compiler-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -XX:MaxPermSize=300m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -3,12 +3,12 @@
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="eval4j" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.eval4j.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="VM_PARAMETERS" value="-ea -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -11,7 +11,7 @@
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="IDEA" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=450m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -43,7 +43,6 @@
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
<option name="BuildArtifacts" enabled="true" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/idea-runner/runner.xml" target="force-enable-kotlin-plugin" />
</method>
</configuration>

View File

@@ -2,11 +2,11 @@
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=250m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />

View File

@@ -1,23 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (win)" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=450m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=${JAVA_HOME}\lib\tools.jar,../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.7" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="idea-runner" />
<envs />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
<option name="BuildArtifacts" enabled="true" />
<option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/idea-runner/runner.xml" target="force-enable-kotlin-plugin" />
</method>
</configuration>
</component>

View File

@@ -8,21 +8,24 @@
</extension>
<module name="j2k" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx350m -XX:MaxPermSize=320m" />
<option name="TEST_OBJECT" value="pattern" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx700m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<patterns>
<pattern testClass="org.jetbrains.kotlin.idea.conversion.copy.*" />
<pattern testClass="org.jetbrains.kotlin.j2k.*" />
</patterns>
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />

View File

@@ -6,14 +6,14 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="java8-tests" />
<module name="compiler-tests-java8" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=64m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -3,12 +3,12 @@
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="js.tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.js.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx900m -XX:MaxPermSize=320m -XX:+UseCodeCacheFlushing" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -3,12 +3,12 @@
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="kannotator-jps-plugin-test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.jps.build.kannotator" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="VM_PARAMETERS" value="-ea -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -8,12 +8,12 @@
</extension>
<module name="idea" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.completion.handlers" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="pattern" />
<option name="VM_PARAMETERS" value="-ea -Xmx512m -XX:MaxPermSize=320m" />
<option name="VM_PARAMETERS" value="-ea -Xmx850m -Djna.nosys=true" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />

View File

@@ -2,11 +2,11 @@
<configuration default="false" name="Update-Dist-Run" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=450m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=64m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />

2
.idea/scopes/IDE.xml generated
View File

@@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="IDE" pattern="file[idea]:*/||file[idea-analysis]:*/||file[ide-lazy-resolve]:*/" />
<scope name="IDE" pattern="file[idea]:src/*/||file[idea]:testData/*/||file[ide-common]:src/*/||file[idea-analysis]:src/*/||file[idea-android]:src/*/||file[idea-completion]:src/*/||file[idea-completion]:testData/*/||file[idea-core]:src/*/||file[idea-jps-common]:/*/||file[idea-live-templates]:/*/||file[idea-live-templates]:testData/*/||file[idea-repl]:/*/||src[idea-android-output-parser]:*..*" />
</component>

1471
ChangeLog.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -20,13 +20,26 @@ Welcome to [Kotlin](http://kotlinlang.org/)! Some handy links:
## Editing Kotlin
* [Kotlin IntelliJ IDEA Plugin](http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/)
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Kotlin Eclipse Plugin](http://kotlinlang.org/docs/tutorials/getting-started-eclipse.html)
* [Kotlin TextMate Bundle](https://github.com/k33g/kotlin-textmate-bundle#readme)
* [Kotlin TextMate Bundle](https://github.com/vkostyukov/kotlin-sublime-package)
## Build environment requirements
In order to build Kotlin distribution you need to have:
- Apache Ant 1.9.4 and higher
- JDK 1.6, 1.7 and 1.8
- Setup environment variables as following:
JAVA_HOME="path to JDK 1.6"
JDK_16="path to JDK 1.6"
JDK_17="path to JDK 1.7"
JDK_18="path to JDK 1.8"
## Building
To build this project, first time you try to build you need to run this (requires Apache **Ant 1.8** or higher and **JDK 1.6**):
To build this project, first time you try to build you need to run this:
ant -f update_dependencies.xml
@@ -46,7 +59,7 @@ which will build the binaries of the compiler and put them into the 'dist' direc
mvn package
from 'libraries' directory after building the compiler. Refer to `libraries/ReadMe.md` for details.
from 'libraries' directory after building the compiler. Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
## Working with the project in IntelliJ IDEA
@@ -107,7 +120,7 @@ We love contributions! There's [lots to do on Kotlin](http://youtrack.jetbrains.
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://kotlinslackin.herokuapp.com/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues?q=tag%3A+%7BUp+For+Grabs%7D+%23Unresolved) which should find all issues that marked as "up-for-grabs".
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20%23Unresolved) which should find all Kotlin issues that marked as "up-for-grabs".
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
@@ -115,9 +128,9 @@ A nice gentle way to contribute would be to review the [standard library docs](h
and find classes or functions which are not documented very well and submit a patch.
In particular it'd be great if all functions included a nice example of how to use it such as for the
<a href="http://kotlinlang.org/api/latest/jvm/stdlib/kotlin/hash-map-of.html">hashMapOf()</a> function.
This is implemented using the <a href=https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/collections/Maps.kt#L53">@sample</a>
macro to include code from a test function. This serves as a double win; the API gets better documented with nice examples to help new users and the code gets more test coverage.
[`hashMapOf()`](http://kotlinlang.org/api/latest/jvm/stdlib/kotlin/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/collections/Maps.kt#L64)
macro to include code from a test function. The benefits of this approach are twofold; First, the API's documentation is improved via beneficial examples that help new users and second, the code coverage is increased.
Also the [JavaScript translation](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
@@ -153,7 +166,7 @@ Some of the code in the standard library is created by generating code from temp
## Submitting patches
The best way to submit a patch is to [fork the project on github](http://help.github.com/fork-a-repo/) then send us a
[pull request](http://help.github.com/send-pull-requests/) via [github](http://github.com).
[pull request](https://help.github.com/articles/creating-a-pull-request/) via [github](http://github.com).
If you create your own fork, it might help to enable rebase by default
when you pull by executing `git config --global pull.rebase

View File

@@ -11,17 +11,14 @@
<property name="plugin.xml" value="idea/src/META-INF/plugin.xml"/>
<property name="plugin.xml.bk" value="${version_substitute_dir}/plugin.xml.bk"/>
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned"/>
<property name="plugin.xml.version.number" value="${build.number}"/>
<property name="compiler.version.java" value="compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/KotlinVersion.java"/>
<property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinVersion.java.bk"/>
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned"/>
<property name="compiler.version.number" value="${build.number}"/>
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip"/>
<property name="bare.plugin.zip" value="${artifact.output.path}/kotlin-bare-plugin-${build.number}.zip"/>
<property name="android-extensions.zip" value="${artifact.output.path}/kotlin-android-extensions-plugin-${build.number}.zip"/>
<property name="kotlin.bare.plugin.xml" value="jps-plugin/bare-plugin/src/META-INF/plugin.xml"/>
<property name="kotlin.bare.plugin.xml.bk" value="${version_substitute_dir}/kotlin.bare.plugin.xml.bk"/>
<macrodef name="echoprop">
<attribute name="prop"/>
@@ -76,37 +73,36 @@
</sequential>
</macrodef>
<target name="writeVersionToTemplateFiles">
<target name="writeCompilerVersionToTemplateFile">
<mkdir dir="${version_substitute_dir}"/>
<substituteVersionInFile
target.file="${plugin.xml}"
target.file.bk="${plugin.xml.bk}"
target.file.versioned="${plugin.xml.versioned}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"/>
target.file="${compiler.version.java}"
target.file.bk="${compiler.version.java.bk}"
target.file.versioned="${compiler.version.java.versioned}"
test.string="public static final String VERSION = &quot;@snapshot@&quot;;"
version="${compiler.version.number}"/>
</target>
<target name="writePluginVersionToTemplateFile">
<mkdir dir="${version_substitute_dir}"/>
<substituteVersionInFile
target.file="${compiler.version.java}"
target.file.bk="${compiler.version.java.bk}"
target.file.versioned="${compiler.version.java.versioned}"
test.string="public static final String VERSION = &quot;@snapshot@&quot;;"/>
<substituteVersionInFile
target.file="${kotlin.bare.plugin.xml}"
target.file.bk="${kotlin.bare.plugin.xml.bk}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"/>
</target>
target.file="${plugin.xml}"
target.file.bk="${plugin.xml.bk}"
target.file.versioned="${plugin.xml.versioned}"
test.string="&lt;version&gt;@snapshot@&lt;/version&gt;"
version="${plugin.xml.version.number}"/>
</target>
<target name="revertTemplateFiles">
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true"/>
<copy file="${compiler.version.java.bk}" tofile="${compiler.version.java}" overwrite="true"/>
<copy file="${kotlin.bare.plugin.xml.bk}" tofile="${kotlin.bare.plugin.xml}" overwrite="true"/>
<delete dir="${version_substitute_dir}" quiet="true"/>
</target>
<target name="pre_build" depends="writeVersionToTemplateFiles, cleanupArtifacts"/>
<target name="pre_build" depends="writeCompilerVersionToTemplateFile, writePluginVersionToTemplateFile, cleanupArtifacts"/>
<target name="zipArtifacts">
<macrodef name="zipPlugin">
@@ -126,11 +122,6 @@
</macrodef>
<zipPlugin filename="${plugin.zip}" dir="Kotlin"/>
<zipPlugin filename="${bare.plugin.zip}" dir="BareKotlin"/>
<zip destfile="${android-extensions.zip}">
<zipfileset prefix="META-INF" dir="${basedir}/plugins/android-idea-plugin/old_plugin" includes="plugin.xml" />
</zip>
</target>
<macrodef name="print-statistic">
@@ -158,11 +149,9 @@
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-reflect.jar"/>
<print-file-size-statistic path="${kotlin-home}/lib" file-name="kotlin-jslib.jar"/>
<print-file-size-statistic path="${output}" file-name="kotlin.js"/>
<print-file-size-statistic path="${output}" file-name="builtins.js"/>
<print-file-size-statistic path="${output}" file-name="builtins.meta.js"/>
<print-file-size-statistic path="${output}" file-name="stdlib.js"/>
<print-file-size-statistic path="${output}" file-name="stdlib.meta.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="kotlin.js"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.meta.js}"/>
<print-file-size-statistic path="${js.stdlib.output.dir}" file-name="${compiled.stdlib.js}"/>
</target>
<target name="post_build" depends="zipArtifacts, revertTemplateFiles, printStatistics, remove_internal_artifacts, dont_remove_internal_artifacts"/>
@@ -175,14 +164,16 @@
<condition property="need.remove.artifacts" value="true">
<and>
<matches pattern="rr/.*" string="${teamcity.build.branch}"/>
<matches pattern="rri?/.*" string="${teamcity.build.branch}"/>
<not>
<matches pattern="rr/internal/.*" string="${teamcity.build.branch}"/>
<matches pattern="rri?/internal/.*" string="${teamcity.build.branch}"/>
</not>
</and>
</condition>
<target name="remove_internal_artifacts" description="Remove internal artifacts for rr/* branches, but store them for rr/internal/*" if="need.remove.artifacts">
<target name="remove_internal_artifacts"
description="Remove internal artifacts for rri?/* branches, but store them for rri?/internal/*"
if="need.remove.artifacts">
<echo message="Remove internal artifacts" />
<delete failonerror="false" verbose="true">

View File

@@ -82,13 +82,6 @@
plugin.subdir="Kotlin"
substituted.version="${relay.substitute.version}"/>
<substitudeVersionInPlugin
plugin.jar.name="kotlin-bare-plugin"
plugin.path="${relay.plugins.dir}/kotlin-bare-plugin-${relay.origin.version}.zip"
origin.version="${relay.origin.version}"
plugin.subdir="BareKotlin"
substituted.version="${relay.substitute.version}"/>
<substitudeVersionInPlugin
plugin.jar.name="kotlin-android-extensions"
plugin.path="${relay.plugins.dir}/kotlin-android-extensions-plugin-${relay.origin.version}.zip"

View File

@@ -3,10 +3,9 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="RUNTIME" name="android-studio" level="project" />
<orderEntry type="module" module-name="idea" scope="PROVIDED" />
</component>
</module>
</module>

View File

@@ -9,6 +9,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="ant" level="project" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="library" name="kotlin-reflect" level="project" />
<orderEntry type="module" module-name="preloader" />
</component>
</module>

View File

@@ -1,7 +0,0 @@
<!-- NOTE: this Antlib is deprecated. Use org/jetbrains/kotlin/ant/antlib.xml instead -->
<!-- TODO: delete this file -->
<antlib>
<taskdef name="kotlinc" classname="org.jetbrains.kotlin.ant.Kotlin2JvmTask"/>
<taskdef name="kotlin2js" classname="org.jetbrains.kotlin.ant.Kotlin2JsTask"/>
<typedef name="withKotlin" classname="org.jetbrains.kotlin.ant.KotlinCompilerAdapter"/>
</antlib>

View File

@@ -19,22 +19,23 @@ package org.jetbrains.kotlin.ant
import org.apache.tools.ant.types.Path
import java.io.File
public class Kotlin2JsTask : KotlinCompilerBaseTask() {
class Kotlin2JsTask : KotlinCompilerBaseTask() {
override val compilerFqName = "org.jetbrains.kotlin.cli.js.K2JSCompiler"
public var library: Path? = null
public var outputPrefix: File? = null
public var outputPostfix: File? = null
public var sourceMap: Boolean = false
public var metaInfo: Boolean = false
var library: Path? = null
var outputPrefix: File? = null
var outputPostfix: File? = null
var sourceMap: Boolean = false
var metaInfo: Boolean = false
var moduleKind: String = "plain"
/**
* {@link K2JsArgumentConstants.CALL} (default) if need generate a main function call (main function will be auto detected)
* {@link K2JsArgumentConstants.NO_CALL} otherwise.
*/
public var main: String? = null
var main: String? = null
public fun createLibrary(): Path {
fun createLibrary(): Path {
val libraryPath = library
if (libraryPath == null) {
val t = Path(getProject())
@@ -73,5 +74,7 @@ public class Kotlin2JsTask : KotlinCompilerBaseTask() {
if (noStdlib) args.add("-no-stdlib")
if (sourceMap) args.add("-source-map")
if (metaInfo) args.add("-meta-info")
args += listOf("-module-kind", moduleKind)
}
}

View File

@@ -20,15 +20,17 @@ import org.apache.tools.ant.types.Path
import org.apache.tools.ant.types.Reference
import java.io.File.pathSeparator
public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
class Kotlin2JvmTask : KotlinCompilerBaseTask() {
override val compilerFqName = "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"
public var includeRuntime: Boolean = true
public var moduleName: String? = null
var includeRuntime: Boolean = true
var moduleName: String? = null
var noReflect: Boolean = false
private var compileClasspath: Path? = null
public fun setClasspath(classpath: Path) {
fun setClasspath(classpath: Path) {
if (compileClasspath == null) {
compileClasspath = classpath
}
@@ -37,14 +39,14 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
}
}
public fun setClasspathRef(ref: Reference) {
fun setClasspathRef(ref: Reference) {
if (compileClasspath == null) {
compileClasspath = Path(getProject())
}
compileClasspath!!.createPath().setRefid(ref)
compileClasspath!!.createPath().refid = ref
}
public fun addConfiguredClasspath(classpath: Path) {
fun addConfiguredClasspath(classpath: Path) {
setClasspath(classpath)
}
@@ -68,6 +70,7 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
}
if (noStdlib) args.add("-no-stdlib")
if (noReflect) args.add("-no-reflect")
if (includeRuntime) args.add("-include-runtime")
}
}

View File

@@ -24,32 +24,29 @@ import java.io.File
import java.lang.ref.SoftReference
import java.net.JarURLConnection
object KotlinAntTaskUtil {
internal object KotlinAntTaskUtil {
private var classLoaderRef = SoftReference<ClassLoader?>(null)
private val libPath: File by lazy {
// Find path of kotlin-ant.jar in the filesystem and find kotlin-compiler.jar in the same directory
val resourcePath = "/" + javaClass.getName().replace('.', '/') + ".class"
val resourcePath = "/" + javaClass.name.replace('.', '/') + ".class"
val jarConnection = javaClass.getResource(resourcePath).openConnection() as? JarURLConnection
?: throw UnsupportedOperationException("Kotlin compiler Ant task should be loaded from the JAR file")
val antTaskJarPath = File(jarConnection.getJarFileURL().toURI())
val antTaskJarPath = File(jarConnection.jarFileURL.toURI())
antTaskJarPath.getParentFile()
antTaskJarPath.parentFile
}
val compilerJar: File by lazy {
File(libPath, "kotlin-compiler.jar").assertExists()
}
val compilerJar: File by jar("kotlin-compiler.jar")
val runtimeJar: File by jar("kotlin-runtime.jar")
val reflectJar: File by jar("kotlin-reflect.jar")
val runtimeJar: File by lazy {
File(libPath, "kotlin-runtime.jar").assertExists()
}
private fun File.assertExists(): File {
if (!this.exists()) {
throw IllegalStateException("${getName()} is not found in the directory of Kotlin Ant task")
private fun jar(name: String) = lazy {
File(libPath, name).apply {
if (!exists()) {
throw IllegalStateException("File is not found in the directory of Kotlin Ant task: $name")
}
}
return this
}
@Synchronized
@@ -65,8 +62,7 @@ object KotlinAntTaskUtil {
return classLoader
}
}
public val Task.defaultModuleName: String?
get() = owningTarget?.name ?: project?.name
internal val Task.defaultModuleName: String?
get() = owningTarget?.name ?: project?.name

View File

@@ -31,6 +31,7 @@ class KotlinCompilerAdapter : Javac13() {
var additionalArguments: MutableList<Commandline.Argument> = ArrayList(0)
@Suppress("unused") // Used via reflection by Ant
fun createCompilerArg(): Commandline.Argument {
val argument = Commandline.Argument()
additionalArguments.add(argument)
@@ -70,7 +71,7 @@ class KotlinCompilerAdapter : Javac13() {
// Javac13#execute passes everything in compileList to javac, which doesn't recognize .kt files
val compileListForJavac = filterOutKotlinSources(compileList)
val hasKotlinFilesInSources = compileListForJavac.size() < compileList.size()
val hasKotlinFilesInSources = compileListForJavac.size < compileList.size
if (hasKotlinFilesInSources) {
kotlinc.execute()
@@ -94,15 +95,22 @@ class KotlinCompilerAdapter : Javac13() {
}
private fun addRuntimeToJavacClasspath(kotlinc: Kotlin2JvmTask) {
for (arg in kotlinc.args) {
// If "-no-stdlib" was specified explicitly, probably the user also wanted the javac classpath to not have it
if ("-no-stdlib" == arg) return
}
// If "-no-stdlib" (or "-no-reflect") was specified explicitly, probably the user also wanted the javac classpath to not have it
val addStdlib = "-no-stdlib" !in kotlinc.args
val addReflect = "-no-reflect" !in kotlinc.args
if (!addStdlib && !addReflect) return
if (compileClasspath == null) {
compileClasspath = Path(getProject())
}
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.runtimeJar.absolutePath))
if (addStdlib) {
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.runtimeJar.absolutePath))
}
// "-no-stdlib" implies "-no-reflect", see K2JVMCompiler.Companion.getClasspath
if (addReflect && addStdlib) {
compileClasspath.add(Path(getProject(), KotlinAntTaskUtil.reflectJar.absolutePath))
}
}
private fun checkAntVersion() {

View File

@@ -24,25 +24,25 @@ import org.apache.tools.ant.types.Reference
import java.io.File
import java.io.PrintStream
public abstract class KotlinCompilerBaseTask : Task() {
abstract class KotlinCompilerBaseTask : Task() {
protected abstract val compilerFqName: String
public val args: MutableList<String> = arrayListOf()
val args: MutableList<String> = arrayListOf()
public var src: Path? = null
public var output: File? = null
public var nowarn: Boolean = false
public var verbose: Boolean = false
public var printVersion: Boolean = false
public var failOnError: Boolean = true
var src: Path? = null
var output: File? = null
var nowarn: Boolean = false
var verbose: Boolean = false
var printVersion: Boolean = false
var failOnError: Boolean = true
public var noStdlib: Boolean = false
var noStdlib: Boolean = false
public val additionalArguments: MutableList<Commandline.Argument> = arrayListOf()
val additionalArguments: MutableList<Commandline.Argument> = arrayListOf()
public var exitCode: Int? = null
var exitCode: Int? = null
public fun createSrc(): Path {
fun createSrc(): Path {
val srcPath = src
if (srcPath == null) {
val t = Path(getProject())
@@ -53,11 +53,11 @@ public abstract class KotlinCompilerBaseTask : Task() {
return srcPath.createPath()
}
public fun setSrcRef(ref: Reference) {
createSrc().setRefid(ref)
fun setSrcRef(ref: Reference) {
createSrc().refid = ref
}
public fun createCompilerArg(): Commandline.Argument {
fun createCompilerArg(): Commandline.Argument {
val argument = Commandline.Argument()
additionalArguments.add(argument)
return argument
@@ -65,7 +65,7 @@ public abstract class KotlinCompilerBaseTask : Task() {
abstract fun fillSpecificArguments()
public fun fillArguments() {
fun fillArguments() {
val sourcePaths = src ?: throw BuildException("\"src\" should be specified")
args.addAll(sourcePaths.list().map { File(it).canonicalPath })
@@ -75,7 +75,7 @@ public abstract class KotlinCompilerBaseTask : Task() {
if (verbose) args.add("-verbose")
if (printVersion) args.add("-version")
args.addAll(additionalArguments.flatMap { it.getParts().toList() })
args.addAll(additionalArguments.flatMap { it.parts.toList() })
fillSpecificArguments()
}
@@ -85,12 +85,12 @@ public abstract class KotlinCompilerBaseTask : Task() {
val compilerClass = KotlinAntTaskUtil.getOrCreateClassLoader().loadClass(compilerFqName)
val compiler = compilerClass.newInstance()
val exec = compilerClass.getMethod("execFullPathsInMessages", javaClass<PrintStream>(), javaClass<Array<String>>())
val exec = compilerClass.getMethod("execFullPathsInMessages", PrintStream::class.java, Array<String>::class.java)
log("Compiling ${src!!.list().toList()} => [${output!!.canonicalPath}]");
log("Compiling ${src!!.list().toList()} => [${output!!.canonicalPath}]")
val result = exec(compiler, System.err, args.toTypedArray())
exitCode = (result as Enum<*>).ordinal()
exitCode = (result as Enum<*>).ordinal
if (failOnError && exitCode != 0) {
throw BuildException("Compile failed; see the compiler error output for details.")

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="frontend.java" />
<orderEntry type="module" module-name="util.runtime" />
<orderEntry type="module" module-name="cli-common" />
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="tests-common" scope="TEST" />
<orderEntry type="library" scope="TEST" name="idea-full" level="project" />
</component>
</module>

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.build
package org.jetbrains.kotlin.build
import java.io.File

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.incremental.LocalFileKotlinClass
import org.jetbrains.kotlin.load.kotlin.ModuleMapping
import org.jetbrains.kotlin.utils.sure
import java.io.File
open class GeneratedFile<Target>(
val target: Target,
val sourceFiles: Collection<File>,
val outputFile: File
)
class GeneratedJvmClass<Target> (
target: Target,
sourceFiles: Collection<File>,
outputFile: File
) : GeneratedFile<Target>(target, sourceFiles, outputFile) {
val outputClass = LocalFileKotlinClass.create(outputFile).sure {
"Couldn't load KotlinClass from $outputFile; it may happen because class doesn't have valid Kotlin annotations"
}
}
fun File.isModuleMappingFile() = extension == ModuleMapping.MAPPING_FILE_EXT && parentFile.name == "META-INF"

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -0,0 +1,114 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
import java.io.File
private val NORMAL_VERSION = 8
private val EXPERIMENTAL_VERSION = 4
private val DATA_CONTAINER_VERSION = 1
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
private val EXPERIMENTAL_VERSION_FILE_NAME = "experimental-format-version.txt"
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
class CacheVersion(
private val ownVersion: Int,
private val versionFile: File,
private val whenVersionChanged: CacheVersion.Action,
private val whenTurnedOn: CacheVersion.Action,
private val whenTurnedOff: CacheVersion.Action,
isEnabled: ()->Boolean
) {
private val isEnabled by lazy(isEnabled)
private val actualVersion: Int
get() = versionFile.readText().toInt()
private val expectedVersion: Int
get() {
val metadata = JvmMetadataVersion.INSTANCE
val bytecode = JvmBytecodeBinaryVersion.INSTANCE
return ownVersion * 1000000 +
bytecode.major * 10000 + bytecode.minor * 100 +
metadata.major * 1000 + metadata.minor
}
fun checkVersion(): Action =
when (versionFile.exists() to isEnabled) {
true to true -> if (actualVersion != expectedVersion) whenVersionChanged else Action.DO_NOTHING
false to true -> whenTurnedOn
true to false -> whenTurnedOff
else -> Action.DO_NOTHING
}
fun saveIfNeeded() {
if (!isEnabled) return
if (!versionFile.parentFile.exists()) {
versionFile.parentFile.mkdirs()
}
versionFile.writeText(expectedVersion.toString())
}
fun clean() {
versionFile.delete()
}
@get:TestOnly
val formatVersionFile: File
get() = versionFile
// Order of entries is important, because actions are sorted in KotlinBuilder::checkVersions
enum class Action {
REBUILD_ALL_KOTLIN,
REBUILD_CHUNK,
CLEAN_NORMAL_CACHES,
CLEAN_EXPERIMENTAL_CACHES,
CLEAN_DATA_CONTAINER,
DO_NOTHING
}
}
fun normalCacheVersion(dataRoot: File): CacheVersion =
CacheVersion(ownVersion = NORMAL_VERSION,
versionFile = File(dataRoot, NORMAL_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOn = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES,
isEnabled = { IncrementalCompilation.isEnabled() })
fun experimentalCacheVersion(dataRoot: File): CacheVersion =
CacheVersion(ownVersion = EXPERIMENTAL_VERSION,
versionFile = File(dataRoot, EXPERIMENTAL_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOn = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOff = CacheVersion.Action.CLEAN_EXPERIMENTAL_CACHES,
isEnabled = { IncrementalCompilation.isExperimental() })
fun dataContainerCacheVersion(dataRoot: File): CacheVersion =
CacheVersion(ownVersion = DATA_CONTAINER_VERSION,
versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOn = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOff = CacheVersion.Action.CLEAN_DATA_CONTAINER,
isEnabled = { IncrementalCompilation.isExperimental() })

View File

@@ -0,0 +1,34 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.cli.common.ExitCode
import java.io.File
abstract class IncReporter {
abstract fun report(message: ()->String)
// used in Gradle plugin
@Suppress("unused")
open fun reportCompileIteration(sourceFiles: Iterable<File>, exitCode: ExitCode) {}
open fun pathsAsString(files: Iterable<File>): String =
files.map { it.canonicalPath }.joinToString()
fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
}

View File

@@ -0,0 +1,835 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.util.SmartList
import com.intellij.util.io.BooleanDataDescriptor
import com.intellij.util.io.EnumeratorStringDescriptor
import gnu.trove.THashSet
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.incremental.ChangeInfo.MembersChanged
import org.jetbrains.kotlin.incremental.ChangeInfo.Removed
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.inline.inlineFunctionsJvmNames
import org.jetbrains.kotlin.load.kotlin.ModuleMapping
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
import org.jetbrains.kotlin.load.kotlin.incremental.components.JvmPackagePartProto
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.protobuf.MessageLite
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.serialization.Flags
import org.jetbrains.kotlin.serialization.ProtoBuf
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
import org.jetbrains.kotlin.serialization.deserialization.TypeTable
import org.jetbrains.kotlin.serialization.deserialization.supertypes
import org.jetbrains.kotlin.serialization.jvm.BitEncoding
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil
import org.jetbrains.kotlin.utils.singletonOrEmptyList
import org.jetbrains.org.objectweb.asm.*
import java.io.File
import java.security.MessageDigest
import java.util.*
val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalCacheImpl<Target>(
private val targetDataRoot: File,
targetOutputDir: File?,
target: Target
) : BasicMapsOwner(), IncrementalCache {
companion object {
private val PROTO_MAP = "proto"
private val CONSTANTS_MAP = "constants"
private val PACKAGE_PARTS = "package-parts"
private val MULTIFILE_CLASS_FACADES = "multifile-class-facades"
private val MULTIFILE_CLASS_PARTS = "multifile-class-parts"
private val SOURCE_TO_CLASSES = "source-to-classes"
private val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
private val INLINE_FUNCTIONS = "inline-functions"
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
private val CLASS_FQ_NAME_TO_SOURCE = "class-fq-name-to-source"
private val INTERNAL_NAME_TO_SOURCE = "internal-name-to-source"
private val MODULE_MAPPING_FILE_NAME = "." + ModuleMapping.MAPPING_FILE_EXT
}
private val baseDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)
private val experimentalMaps = arrayListOf<BasicMap<*, *>>()
private fun <K, V, M : BasicMap<K, V>> registerExperimentalMap(map: M): M {
experimentalMaps.add(map)
return registerMap(map)
}
protected val String.storageFile: File
get() = File(baseDir, this + "." + CACHE_EXTENSION)
private val protoMap = registerMap(ProtoMap(PROTO_MAP.storageFile))
private val constantsMap = registerMap(ConstantsMap(CONSTANTS_MAP.storageFile))
private val packagePartMap = registerMap(PackagePartMap(PACKAGE_PARTS.storageFile))
private val multifileFacadeToParts = registerMap(MultifileClassFacadeMap(MULTIFILE_CLASS_FACADES.storageFile))
private val partToMultifileFacade = registerMap(MultifileClassPartMap(MULTIFILE_CLASS_PARTS.storageFile))
private val sourceToClassesMap = registerMap(SourceToClassesMap(SOURCE_TO_CLASSES.storageFile))
private val dirtyOutputClassesMap = registerMap(DirtyOutputClassesMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
private val subtypesMap = registerExperimentalMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerExperimentalMap(SupertypesMap(SUPERTYPES.storageFile))
private val classFqNameToSourceMap = registerExperimentalMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
// todo: try to use internal names only?
private val internalNameToSource = registerExperimentalMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
private val dependents = arrayListOf<IncrementalCacheImpl<Target>>()
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory: $target" } }
val thisWithDependentCaches: Iterable<IncrementalCacheImpl<Target>> by lazy {
val result = arrayListOf(this)
result.addAll(dependents)
result
}
override fun registerInline(fromPath: String, jvmSignature: String, toPath: String) {
}
protected open fun debugLog(message: String) {}
fun addDependentCache(cache: IncrementalCacheImpl<Target>) {
dependents.add(cache)
}
fun markOutputClassesDirty(removedAndCompiledSources: List<File>) {
for (sourceFile in removedAndCompiledSources) {
val classes = sourceToClassesMap[sourceFile]
classes.forEach {
dirtyOutputClassesMap.markDirty(it.internalName)
}
sourceToClassesMap.clearOutputsForSource(sourceFile)
}
}
// used in gradle
@Suppress("unused")
fun classesBySources(sources: Iterable<File>): Iterable<JvmClassName> =
sources.flatMap { sourceToClassesMap[it] }
fun getSubtypesOf(className: FqName): Sequence<FqName> =
subtypesMap[className].asSequence()
fun getSourceFileIfClass(fqName: FqName): File? =
classFqNameToSourceMap[fqName]
fun sourcesByInternalName(internalName: String): Collection<File> =
internalNameToSource[internalName]
fun isMultifileFacade(className: JvmClassName): Boolean =
className.internalName in multifileFacadeToParts
override fun getClassFilePath(internalClassName: String): String {
return toSystemIndependentName(File(outputDir, "$internalClassName.class").canonicalPath)
}
fun saveModuleMappingToCache(sourceFiles: Collection<File>, file: File): CompilationResult {
val jvmClassName = JvmClassName.byInternalName(MODULE_MAPPING_FILE_NAME)
protoMap.process(jvmClassName, file.readBytes(), emptyArray<String>(), isPackage = false, checkChangesIsOpenPart = false)
dirtyOutputClassesMap.notDirty(MODULE_MAPPING_FILE_NAME)
sourceFiles.forEach { sourceToClassesMap.add(it, jvmClassName) }
return CompilationResult.NO_CHANGES
}
open fun saveFileToCache(generatedClass: GeneratedJvmClass<Target>): CompilationResult {
val sourceFiles: Collection<File> = generatedClass.sourceFiles
val kotlinClass: LocalFileKotlinClass = generatedClass.outputClass
val className = kotlinClass.className
dirtyOutputClassesMap.notDirty(className.internalName)
sourceFiles.forEach {
sourceToClassesMap.add(it, className)
}
if (IncrementalCompilation.isExperimental()) {
internalNameToSource[className.internalName] = sourceFiles
}
if (kotlinClass.classId.isLocal) {
return CompilationResult.NO_CHANGES
}
val header = kotlinClass.classHeader
val changesInfo = when (header.kind) {
KotlinClassHeader.Kind.FILE_FACADE -> {
assert(sourceFiles.size == 1) { "Package part from several source files: $sourceFiles" }
packagePartMap.addPackagePart(className)
protoMap.process(kotlinClass, isPackage = true) +
constantsMap.process(kotlinClass, isPackage = true) +
inlineFunctionsMap.process(kotlinClass, isPackage = true)
}
KotlinClassHeader.Kind.MULTIFILE_CLASS -> {
val partNames = kotlinClass.classHeader.data?.toList()
?: throw AssertionError("Multifile class has no parts: ${kotlinClass.className}")
multifileFacadeToParts[className] = partNames
// When a class is replaced with a facade with the same name,
// the class' proto wouldn't ever be deleted,
// because we don't write proto for multifile facades.
// As a workaround we can remove proto values for multifile facades.
val additionalChangeInfo = if (className in protoMap) {
val info = ChangeInfo.SignatureChanged(className.fqNameForClassNameWithoutDollars, areSubclassesAffected = true)
CompilationResult(protoChanged = true, changes = sequenceOf(info))
}
else CompilationResult.NO_CHANGES
protoMap.remove(className)
classFqNameToSourceMap.remove(className.fqNameForClassNameWithoutDollars)
internalNameToSource.remove(className.internalName)
// TODO NO_CHANGES? (delegates only)
constantsMap.process(kotlinClass, isPackage = true) +
inlineFunctionsMap.process(kotlinClass, isPackage = true) +
additionalChangeInfo
}
KotlinClassHeader.Kind.MULTIFILE_CLASS_PART -> {
assert(sourceFiles.size == 1) { "Multifile class part from several source files: $sourceFiles" }
packagePartMap.addPackagePart(className)
partToMultifileFacade.set(className.internalName, header.multifileClassName!!)
protoMap.process(kotlinClass, isPackage = true) +
constantsMap.process(kotlinClass, isPackage = true) +
inlineFunctionsMap.process(kotlinClass, isPackage = true)
}
KotlinClassHeader.Kind.CLASS -> {
assert(sourceFiles.size == 1) { "Class is expected to have only one source file: $sourceFiles" }
addToClassStorage(kotlinClass, sourceFiles.first())
protoMap.process(kotlinClass, isPackage = false) +
constantsMap.process(kotlinClass, isPackage = false) +
inlineFunctionsMap.process(kotlinClass, isPackage = false)
}
else -> CompilationResult.NO_CHANGES
}
changesInfo.logIfSomethingChanged(className)
return changesInfo
}
private fun CompilationResult.logIfSomethingChanged(className: JvmClassName) {
if (this == CompilationResult.NO_CHANGES) return
debugLog("$className is changed: $this")
}
private fun computeChanges(className: JvmClassName, createChangeInfo: (FqName, Collection<String>) -> ChangeInfo): List<ChangeInfo> {
fun <T> T.getNonPrivateNames(nameResolver: NameResolver, vararg members: T.() -> List<MessageLite>): Set<String> =
members.flatMap { this.it().filterNot { it.isPrivate }.names(nameResolver) }.toSet()
if (className.internalName == MODULE_MAPPING_FILE_NAME) return emptyList()
val mapValue = protoMap[className] ?: return emptyList()
return when {
mapValue.isPackageFacade -> {
val packageData = JvmProtoBufUtil.readPackageDataFrom(mapValue.bytes, mapValue.strings)
val memberNames =
packageData.packageProto.getNonPrivateNames(
packageData.nameResolver,
ProtoBuf.Package::getFunctionList,
ProtoBuf.Package::getPropertyList
)
listOf(createChangeInfo(className.packageFqName, memberNames))
}
else -> {
val classData = JvmProtoBufUtil.readClassDataFrom(mapValue.bytes, mapValue.strings)
val classFqName = className.fqNameForClassNameWithoutDollars
val kind = Flags.CLASS_KIND.get(classData.classProto.flags)
if (kind == ProtoBuf.Class.Kind.COMPANION_OBJECT) {
val memberNames =
classData.classProto.getNonPrivateNames(
classData.nameResolver,
ProtoBuf.Class::getConstructorList,
ProtoBuf.Class::getFunctionList,
ProtoBuf.Class::getPropertyList
) + classData.classProto.enumEntryList.map { classData.nameResolver.getString(it.name) }
val companionObjectChanged = createChangeInfo(classFqName.parent(), classFqName.shortName().asString().singletonOrEmptyList())
val companionObjectMembersChanged = createChangeInfo(classFqName, memberNames)
listOf(companionObjectMembersChanged, companionObjectChanged)
}
else {
listOf(ChangeInfo.SignatureChanged(classFqName, areSubclassesAffected = true))
}
}
}
}
fun clearCacheForRemovedClasses(): CompilationResult {
val dirtyClasses = dirtyOutputClassesMap
.getDirtyOutputClasses()
.map(JvmClassName::byInternalName)
.toList()
val changes =
if (IncrementalCompilation.isExperimental())
dirtyClasses.flatMap { computeChanges(it, ::Removed) }.asSequence()
else
emptySequence<ChangeInfo>()
val changesInfo = dirtyClasses.fold(CompilationResult(changes = changes)) { info, className ->
val newInfo = CompilationResult(protoChanged = className in protoMap,
constantsChanged = className in constantsMap)
newInfo.logIfSomethingChanged(className)
info + newInfo
}
val facadesWithRemovedParts = hashMapOf<JvmClassName, MutableSet<String>>()
for (dirtyClass in dirtyClasses) {
val facade = partToMultifileFacade.get(dirtyClass.internalName) ?: continue
val facadeClassName = JvmClassName.byInternalName(facade)
val removedParts = facadesWithRemovedParts.getOrPut(facadeClassName) { hashSetOf() }
removedParts.add(dirtyClass.internalName)
}
for ((facade, removedParts) in facadesWithRemovedParts.entries) {
val allParts = multifileFacadeToParts[facade.internalName] ?: continue
val notRemovedParts = allParts.filter { it !in removedParts }
if (notRemovedParts.isEmpty()) {
multifileFacadeToParts.remove(facade)
}
else {
multifileFacadeToParts[facade] = notRemovedParts
}
}
dirtyClasses.forEach {
protoMap.remove(it)
packagePartMap.remove(it)
multifileFacadeToParts.remove(it)
partToMultifileFacade.remove(it)
constantsMap.remove(it)
inlineFunctionsMap.remove(it)
internalNameToSource.remove(it.internalName)
}
removeAllFromClassStorage(dirtyClasses)
dirtyOutputClassesMap.clean()
return changesInfo
}
override fun getObsoletePackageParts(): Collection<String> {
val obsoletePackageParts =
dirtyOutputClassesMap.getDirtyOutputClasses().filter { packagePartMap.isPackagePart(JvmClassName.byInternalName(it)) }
debugLog("Obsolete package parts: $obsoletePackageParts")
return obsoletePackageParts
}
override fun getPackagePartData(partInternalName: String): JvmPackagePartProto? {
return protoMap[JvmClassName.byInternalName(partInternalName)]?.let { value ->
JvmPackagePartProto(value.bytes, value.strings)
}
}
override fun getObsoleteMultifileClasses(): Collection<String> {
val obsoleteMultifileClasses = linkedSetOf<String>()
for (dirtyClass in dirtyOutputClassesMap.getDirtyOutputClasses()) {
val dirtyFacade = partToMultifileFacade.get(dirtyClass) ?: continue
obsoleteMultifileClasses.add(dirtyFacade)
}
debugLog("Obsolete multifile class facades: $obsoleteMultifileClasses")
return obsoleteMultifileClasses
}
override fun getStableMultifileFacadeParts(facadeInternalName: String): Collection<String>? {
val partNames = multifileFacadeToParts.get(facadeInternalName) ?: return null
return partNames.filter { !dirtyOutputClassesMap.isDirty(it) }
}
override fun getModuleMappingData(): ByteArray? {
return protoMap[JvmClassName.byInternalName(MODULE_MAPPING_FILE_NAME)]?.bytes
}
override fun clean() {
super.clean()
normalCacheVersion(targetDataRoot).clean()
experimentalCacheVersion(targetDataRoot).clean()
}
fun cleanExperimental() {
experimentalCacheVersion(targetDataRoot).clean()
experimentalMaps.forEach { it.clean() }
}
private inner class ProtoMap(storageFile: File) : BasicStringMap<ProtoMapValue>(storageFile, ProtoMapValueExternalizer) {
fun process(kotlinClass: LocalFileKotlinClass, isPackage: Boolean): CompilationResult {
val header = kotlinClass.classHeader
val bytes = BitEncoding.decodeBytes(header.data!!)
return put(kotlinClass.className, bytes, header.strings!!, isPackage, checkChangesIsOpenPart = true)
}
fun process(className: JvmClassName, data: ByteArray, strings: Array<String>, isPackage: Boolean, checkChangesIsOpenPart: Boolean): CompilationResult {
return put(className, data, strings, isPackage, checkChangesIsOpenPart)
}
private fun put(
className: JvmClassName, bytes: ByteArray, strings: Array<String>, isPackage: Boolean, checkChangesIsOpenPart: Boolean
): CompilationResult {
val key = className.internalName
val oldData = storage[key]
val data = ProtoMapValue(isPackage, bytes, strings)
if (oldData == null ||
!Arrays.equals(bytes, oldData.bytes) ||
!Arrays.equals(strings, oldData.strings) ||
isPackage != oldData.isPackageFacade
) {
storage[key] = data
}
if (!checkChangesIsOpenPart) return CompilationResult(protoChanged = true)
if (oldData == null) {
val changes =
if (IncrementalCompilation.isExperimental())
computeChanges(className, ::MembersChanged).asSequence()
else
emptySequence<ChangeInfo>()
return CompilationResult(protoChanged = true, changes = changes)
}
val difference = difference(oldData, data)
val fqName = if (isPackage) className.packageFqName else className.fqNameForClassNameWithoutDollars
val changeList = SmartList<ChangeInfo>()
if (difference.isClassAffected) {
changeList.add(ChangeInfo.SignatureChanged(fqName, difference.areSubclassesAffected))
}
if (difference.changedMembersNames.isNotEmpty()) {
changeList.add(ChangeInfo.MembersChanged(fqName, difference.changedMembersNames))
}
return CompilationResult(protoChanged = changeList.isNotEmpty(), changes = changeList.asSequence())
}
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
operator fun get(className: JvmClassName): ProtoMapValue? =
storage[className.internalName]
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: ProtoMapValue): String {
return (if (value.isPackageFacade) "1" else "0") + java.lang.Long.toHexString(value.bytes.md5())
}
}
private inner class ConstantsMap(storageFile: File) : BasicStringMap<Map<String, Any>>(storageFile, ConstantsMapExternalizer) {
private fun getConstantsMap(bytes: ByteArray): Map<String, Any>? {
val result = HashMap<String, Any>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE
if (value != null && access and staticFinal == Opcodes.ACC_STATIC or Opcodes.ACC_FINAL) {
result[name] = value
}
return null
}
}, ClassReader.SKIP_CODE or ClassReader.SKIP_DEBUG or ClassReader.SKIP_FRAMES)
return if (result.isEmpty()) null else result
}
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
fun process(kotlinClass: LocalFileKotlinClass, isPackage: Boolean): CompilationResult {
return put(kotlinClass.className, getConstantsMap(kotlinClass.fileContents), isPackage)
}
private fun put(className: JvmClassName, constantsMap: Map<String, Any>?, isPackage: Boolean): CompilationResult {
val key = className.internalName
val oldMap = storage[key]
if (oldMap == constantsMap) return CompilationResult.NO_CHANGES
if (constantsMap != null) {
storage[key] = constantsMap
}
else {
remove(className)
}
val changes =
if (!IncrementalCompilation.isExperimental() ||
constantsMap == null || constantsMap.isEmpty() ||
oldMap == null || oldMap.isEmpty()
) {
emptySequence<ChangeInfo>()
}
else {
// we need only changed constants everything other should be covered by diff
val changedNames = oldMap.filter { constantsMap.containsKey(it.key) && constantsMap[it.key] != it.value }.map { it.key }
val fqName = if (isPackage) className.packageFqName else className.fqNameForClassNameWithoutDollars
sequenceOf(ChangeInfo.MembersChanged(fqName, changedNames))
}
return CompilationResult(constantsChanged = true, changes = changes)
}
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: Map<String, Any>): String =
value.dumpMap(Any::toString)
}
private inner class PackagePartMap(storageFile: File) : BasicStringMap<Boolean>(storageFile, BooleanDataDescriptor.INSTANCE) {
fun addPackagePart(className: JvmClassName) {
storage[className.internalName] = true
}
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
fun isPackagePart(className: JvmClassName): Boolean =
className.internalName in storage
override fun dumpValue(value: Boolean) = ""
}
private inner class MultifileClassFacadeMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
operator fun set(facadeName: JvmClassName, partNames: Collection<String>) {
storage[facadeName.internalName] = partNames
}
operator fun get(internalName: String): Collection<String>? = storage[internalName]
operator fun contains(internalName: String): Boolean = internalName in storage
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
}
private inner class MultifileClassPartMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor.INSTANCE) {
fun set(partName: String, facadeName: String) {
storage[partName] = facadeName
}
fun get(partName: String): String? {
return storage.get(partName)
}
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: String): String = value
}
inner class SourceToClassesMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(sourceFile.absolutePath)
}
fun add(sourceFile: File, className: JvmClassName) {
storage.append(sourceFile.absolutePath, className.internalName)
}
operator fun get(sourceFile: File): Collection<JvmClassName> =
storage[sourceFile.absolutePath].orEmpty().map { JvmClassName.byInternalName(it) }
override fun dumpValue(value: Collection<String>) = value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)
}
}
inner class ClassFqNameToSourceMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())
}
override fun dumpValue(value: String) = value
}
inner class InternalNameToSourcesMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Iterable<File>) {
storage[internalName] = sourceFiles.map { it.canonicalPath }
}
operator fun get(internalName: String): Collection<File> =
(storage[internalName] ?: emptyList()).map(::File)
fun remove(internalName: String) {
storage.remove(internalName)
}
override fun dumpValue(value: Collection<String>): String =
value.dumpCollection()
}
private fun addToClassStorage(kotlinClass: LocalFileKotlinClass, srcFile: File) {
if (!IncrementalCompilation.isExperimental()) return
val classData = JvmProtoBufUtil.readClassDataFrom(kotlinClass.classHeader.data!!, kotlinClass.classHeader.strings!!)
val supertypes = classData.classProto.supertypes(TypeTable(classData.classProto.typeTable))
val parents = supertypes.map { classData.nameResolver.getClassId(it.className).asSingleFqName() }
.filter { it.asString() != "kotlin.Any" }
.toSet()
val child = kotlinClass.classId.asSingleFqName()
parents.forEach { subtypesMap.add(it, child) }
val removedSupertypes = supertypesMap[child].filter { it !in parents }
removedSupertypes.forEach { subtypesMap.removeValues(it, setOf(child)) }
supertypesMap[child] = parents
classFqNameToSourceMap[kotlinClass.className.fqNameForClassNameWithoutDollars] = srcFile
}
private fun removeAllFromClassStorage(removedClasses: Collection<JvmClassName>) {
if (!IncrementalCompilation.isExperimental() || removedClasses.isEmpty()) return
val removedFqNames = removedClasses.map { it.fqNameForClassNameWithoutDollars }.toSet()
for (cache in thisWithDependentCaches) {
val parentsFqNames = hashSetOf<FqName>()
val childrenFqNames = hashSetOf<FqName>()
for (removedFqName in removedFqNames) {
parentsFqNames.addAll(cache.supertypesMap[removedFqName])
childrenFqNames.addAll(cache.subtypesMap[removedFqName])
cache.supertypesMap.remove(removedFqName)
cache.subtypesMap.remove(removedFqName)
}
for (child in childrenFqNames) {
cache.supertypesMap.removeValues(child, removedFqNames)
}
for (parent in parentsFqNames) {
cache.subtypesMap.removeValues(parent, removedFqNames)
}
}
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
private inner class DirtyOutputClassesMap(storageFile: File) : BasicStringMap<Boolean>(storageFile, BooleanDataDescriptor.INSTANCE) {
fun markDirty(className: String) {
storage[className] = true
}
fun notDirty(className: String) {
storage.remove(className)
}
fun getDirtyOutputClasses(): Collection<String> =
storage.keys
fun isDirty(className: String): Boolean =
storage.contains(className)
override fun dumpValue(value: Boolean) = ""
}
private inner class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private fun getInlineFunctionsMap(header: KotlinClassHeader, bytes: ByteArray): Map<String, Long> {
val inlineFunctions = inlineFunctionsJvmNames(header)
if (inlineFunctions.isEmpty()) return emptyMap()
val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
return object : MethodVisitor(Opcodes.ASM5, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
override fun visitEnd() {
val jvmName = name + desc
if (jvmName !in inlineFunctions) return
val dummyBytes = dummyClassWriter.toByteArray()!!
val hash = dummyBytes.md5()
result[jvmName] = hash
}
}
}
}, 0)
return result
}
fun process(kotlinClass: LocalFileKotlinClass, isPackage: Boolean): CompilationResult {
return put(kotlinClass.className, getInlineFunctionsMap(kotlinClass.classHeader, kotlinClass.fileContents), isPackage)
}
private fun put(className: JvmClassName, newMap: Map<String, Long>, isPackage: Boolean): CompilationResult {
val internalName = className.internalName
val oldMap = storage[internalName] ?: emptyMap()
val added = hashSetOf<String>()
val changed = hashSetOf<String>()
val allFunctions = oldMap.keys + newMap.keys
for (fn in allFunctions) {
val oldHash = oldMap[fn]
val newHash = newMap[fn]
when {
oldHash == null -> added.add(fn)
oldHash != newHash -> changed.add(fn)
}
}
when {
newMap.isNotEmpty() -> storage[internalName] = newMap
else -> storage.remove(internalName)
}
val changes =
if (IncrementalCompilation.isExperimental()) {
val fqName = if (isPackage) className.packageFqName else className.fqNameForClassNameWithoutDollars
// TODO get name in better way instead of using substringBefore
(added.asSequence() + changed.asSequence()).map { ChangeInfo.MembersChanged(fqName, listOf(it.substringBefore("("))) }
}
else {
emptySequence<ChangeInfo>()
}
processChangedInlineFunctions(className, changed)
return CompilationResult(inlineChanged = changed.isNotEmpty(),
inlineAdded = added.isNotEmpty(),
changes = changes)
}
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
}
protected open fun processChangedInlineFunctions(
className: JvmClassName,
changedFunctions: Collection<String>
) {
}
}
private object PathCollectionExternalizer : CollectionExternalizer<String>(PathStringDescriptor, { THashSet(FileUtil.PATH_HASHING_STRATEGY) })
sealed class ChangeInfo(val fqName: FqName) {
open class MembersChanged(fqName: FqName, val names: Collection<String>) : ChangeInfo(fqName) {
override fun toStringProperties(): String = super.toStringProperties() + ", names = $names"
}
class Removed(fqName: FqName, names: Collection<String>) : MembersChanged(fqName, names)
class SignatureChanged(fqName: FqName, val areSubclassesAffected: Boolean) : ChangeInfo(fqName)
protected open fun toStringProperties(): String = "fqName = $fqName"
override fun toString(): String {
return this.javaClass.simpleName + "(${toStringProperties()})"
}
}
data class CompilationResult(
val protoChanged: Boolean = false,
val constantsChanged: Boolean = false,
val inlineChanged: Boolean = false,
val inlineAdded: Boolean = false,
val changes: Sequence<ChangeInfo> = emptySequence()
) {
companion object {
val NO_CHANGES: CompilationResult = CompilationResult()
}
operator fun plus(other: CompilationResult): CompilationResult =
CompilationResult(protoChanged || other.protoChanged,
constantsChanged || other.constantsChanged,
inlineChanged || other.inlineChanged,
inlineAdded || other.inlineAdded,
changes + other.changes)
}
fun ByteArray.md5(): Long {
val d = MessageDigest.getInstance("MD5").digest(this)!!
return ((d[0].toLong() and 0xFFL)
or ((d[1].toLong() and 0xFFL) shl 8)
or ((d[2].toLong() and 0xFFL) shl 16)
or ((d[3].toLong() and 0xFFL) shl 24)
or ((d[4].toLong() and 0xFFL) shl 32)
or ((d[5].toLong() and 0xFFL) shl 40)
or ((d[6].toLong() and 0xFFL) shl 48)
or ((d[7].toLong() and 0xFFL) shl 56)
)
}
@TestOnly
fun <K : Comparable<K>, V> Map<K, V>.dumpMap(dumpValue: (V)->String): String =
buildString {
append("{")
for (key in keys.sorted()) {
if (length != 1) {
append(", ")
}
val value = get(key)?.let(dumpValue) ?: "null"
append("$key -> $value")
}
append("}")
}
@TestOnly fun <T : Comparable<T>> Collection<T>.dumpCollection(): String =
"[${sorted().joinToString(", ", transform = Any::toString)}]"

View File

@@ -14,22 +14,20 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental
package org.jetbrains.kotlin.incremental
import org.jetbrains.jps.incremental.ModuleBuildTarget
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
import org.jetbrains.kotlin.modules.TargetId
public class IncrementalCompilationComponentsImpl(
caches: Map<ModuleBuildTarget, IncrementalCache>,
class IncrementalCompilationComponentsImpl(
private val caches: Map<TargetId, IncrementalCache>,
private val lookupTracker: LookupTracker
): IncrementalCompilationComponents {
private val caches = caches.mapKeys { TargetId(it.key) }
override fun getIncrementalCache(target: TargetId): IncrementalCache =
caches[target]!!
caches[target] ?: throw Exception("Incremental cache for target ${target.name} not found")
override fun getLookupTracker(): LookupTracker = lookupTracker
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.load.kotlin.FileBasedKotlinClass
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
@@ -26,23 +26,25 @@ class LocalFileKotlinClass private constructor(
private val file: File,
private val fileContents: ByteArray,
className: ClassId,
classVersion: Int,
classHeader: KotlinClassHeader,
innerClasses: FileBasedKotlinClass.InnerClassesInfo
) : FileBasedKotlinClass(className, classHeader, innerClasses) {
innerClasses: InnerClassesInfo
) : FileBasedKotlinClass(className, classVersion, classHeader, innerClasses) {
companion object {
fun create(file: File): LocalFileKotlinClass? {
val fileContents = file.readBytes()
return FileBasedKotlinClass.create(fileContents) {
className, classHeader, innerClasses ->
LocalFileKotlinClass(file, fileContents, className, classHeader, innerClasses)
className, classVersion, classHeader, innerClasses ->
LocalFileKotlinClass(file, fileContents, className, classVersion, classHeader, innerClasses)
}
}
}
public val className: JvmClassName by lazy { JvmClassName.byClassId(classId) }
val className: JvmClassName by lazy { JvmClassName.byClassId(classId) }
override fun getLocation(): String = file.absolutePath
override val location: String
get() = file.absolutePath
public override fun getFileContents(): ByteArray = fileContents

View File

@@ -0,0 +1,217 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import com.intellij.util.containers.MultiMap
import com.intellij.util.containers.StringInterner
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.incremental.components.Position
import org.jetbrains.kotlin.incremental.components.ScopeKind
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.utils.Printer
import org.jetbrains.kotlin.utils.keysToMap
import java.io.File
import java.util.*
open class LookupStorage(private val targetDataDir: File) : BasicMapsOwner() {
companion object {
private val DELETED_TO_SIZE_TRESHOLD = 0.5
private val MINIMUM_GARBAGE_COLLECTIBLE_SIZE = 10000
}
private val String.storageFile: File
get() = File(targetDataDir, this + "." + CACHE_EXTENSION)
private val countersFile = "counters".storageFile
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile))
private val lookupMap = registerMap(LookupMap("lookups".storageFile))
@Volatile
private var size: Int = 0
@Volatile
private var deletedCount: Int = 0
init {
if (countersFile.exists()) {
val lines = countersFile.readLines()
size = lines[0].toInt()
deletedCount = lines[1].toInt()
}
}
@Synchronized
fun get(lookupSymbol: LookupSymbol): Collection<String> {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val fileIds = lookupMap[key] ?: return emptySet()
return fileIds.mapNotNull {
// null means it's outdated
idToFile[it]?.path
}
}
@Synchronized
fun addAll(lookups: Set<Map.Entry<LookupSymbol, Collection<String>>>, allPaths: Set<String>) {
val pathToId = allPaths.keysToMap { addFileIfNeeded(File(it)) }
for ((lookupSymbol, paths) in lookups) {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val fileIds = paths.mapTo(HashSet<Int>()) { pathToId[it]!! }
fileIds.addAll(lookupMap[key] ?: emptySet())
lookupMap[key] = fileIds
}
}
@Synchronized
fun removeLookupsFrom(files: Sequence<File>) {
for (file in files) {
val id = fileToId[file] ?: continue
idToFile.remove(id)
fileToId.remove(file)
deletedCount++
}
}
@Synchronized
override fun clean() {
if (countersFile.exists()) {
countersFile.delete()
}
size = 0
deletedCount = 0
super.clean()
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
try {
removeGarbageIfNeeded()
if (size > 0) {
if (!countersFile.exists()) {
countersFile.parentFile.mkdirs()
countersFile.createNewFile()
}
countersFile.writeText("$size\n$deletedCount")
}
}
finally {
super.flush(memoryCachesOnly)
}
}
private fun addFileIfNeeded(file: File): Int {
val existing = fileToId[file]
if (existing != null) return existing
val id = size++
fileToId[file] = id
idToFile[id] = file
return id
}
private fun removeGarbageIfNeeded(force: Boolean = false) {
if (force || (size > MINIMUM_GARBAGE_COLLECTIBLE_SIZE && deletedCount.toDouble() / size > DELETED_TO_SIZE_TRESHOLD)) {
doRemoveGarbage()
}
}
private fun doRemoveGarbage() {
for (hash in lookupMap.keys) {
lookupMap[hash] = lookupMap[hash]!!.filter { it in idToFile }.toSet()
}
val oldFileToId = fileToId.toMap()
val oldIdToNewId = HashMap<Int, Int>(oldFileToId.size)
idToFile.clean()
fileToId.clean()
size = 0
deletedCount = 0
for ((file, oldId) in oldFileToId.entries) {
val newId = addFileIfNeeded(file)
oldIdToNewId[oldId] = newId
}
for (lookup in lookupMap.keys) {
val fileIds = lookupMap[lookup]!!.mapNotNull { oldIdToNewId[it] }.toSet()
if (fileIds.isEmpty()) {
lookupMap.remove(lookup)
}
else {
lookupMap[lookup] = fileIds
}
}
}
@TestOnly fun forceGC() {
removeGarbageIfNeeded(force = true)
flush(false)
}
@TestOnly fun dump(lookupSymbols: Set<LookupSymbol>, basePath: File? = null): String {
flush(false)
val sb = StringBuilder()
val p = Printer(sb)
val lookupsStrings = lookupSymbols.groupBy { LookupSymbolKey(it.name, it.scope) }
for (lookup in lookupMap.keys.sorted()) {
val fileIds = lookupMap[lookup]!!
val key = if (lookup in lookupsStrings) {
lookupsStrings[lookup]!!.map { "${it.scope}#${it.name}" }.sorted().joinToString(", ")
}
else {
lookup.toString()
}
val value = fileIds.map { idToFile[it]?.let { if (basePath == null) it.absolutePath else it.toRelativeString(basePath) } ?: it.toString() }.sorted().joinToString(", ")
p.println("$key -> $value")
}
return sb.toString()
}
}
class LookupTrackerImpl(private val delegate: LookupTracker) : LookupTracker {
val lookups = MultiMap<LookupSymbol, String>()
val pathInterner = StringInterner()
private val interner = StringInterner()
override val requiresPosition: Boolean
get() = delegate.requiresPosition
override fun record(filePath: String, position: Position, scopeFqName: String, scopeKind: ScopeKind, name: String) {
val internedScopeFqName = interner.intern(scopeFqName)
val internedName = interner.intern(name)
val internedFilePath = pathInterner.intern(filePath)
lookups.putValue(LookupSymbol(internedName, internedScopeFqName), internedFilePath)
delegate.record(internedFilePath, position, internedScopeFqName, scopeKind, internedName)
}
}
data class LookupSymbol(val name: String, val scope: String)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.serialization.ProtoBuf
@@ -25,12 +25,12 @@ import java.util.*
/** This file is generated by org.jetbrains.kotlin.generators.protobuf.GenerateProtoBufCompare. DO NOT MODIFY MANUALLY */
open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, public val newNameResolver: NameResolver) {
open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameResolver: NameResolver) {
private val strings = Interner<String>()
public val oldStringIndexesMap: MutableMap<Int, Int> = hashMapOf()
public val newStringIndexesMap: MutableMap<Int, Int> = hashMapOf()
public val oldClassIdIndexesMap: MutableMap<Int, Int> = hashMapOf()
public val newClassIdIndexesMap: MutableMap<Int, Int> = hashMapOf()
val oldStringIndexesMap: MutableMap<Int, Int> = hashMapOf()
val newStringIndexesMap: MutableMap<Int, Int> = hashMapOf()
val oldClassIdIndexesMap: MutableMap<Int, Int> = hashMapOf()
val newClassIdIndexesMap: MutableMap<Int, Int> = hashMapOf()
private val classIds = Interner<ClassId>()
@@ -39,31 +39,47 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEqualsPackageProperty(old, new)) return false
if (!checkEqualsPackageTypeAlias(old, new)) return false
if (old.hasTypeTable() != new.hasTypeTable()) return false
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasExtension(JvmProtoBuf.packageModuleName) != new.hasExtension(JvmProtoBuf.packageModuleName)) return false
if (old.hasExtension(JvmProtoBuf.packageModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.packageModuleName), new.getExtension(JvmProtoBuf.packageModuleName))) return false
}
return true
}
public enum class ProtoBufPackageKind {
enum class ProtoBufPackageKind {
FUNCTION_LIST,
PROPERTY_LIST,
TYPE_TABLE
TYPE_ALIAS_LIST,
TYPE_TABLE,
PACKAGE_MODULE_NAME
}
public fun difference(old: ProtoBuf.Package, new: ProtoBuf.Package): EnumSet<ProtoBufPackageKind> {
fun difference(old: ProtoBuf.Package, new: ProtoBuf.Package): EnumSet<ProtoBufPackageKind> {
val result = EnumSet.noneOf(ProtoBufPackageKind::class.java)
if (!checkEqualsPackageFunction(old, new)) result.add(ProtoBufPackageKind.FUNCTION_LIST)
if (!checkEqualsPackageProperty(old, new)) result.add(ProtoBufPackageKind.PROPERTY_LIST)
if (!checkEqualsPackageTypeAlias(old, new)) result.add(ProtoBufPackageKind.TYPE_ALIAS_LIST)
if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufPackageKind.TYPE_TABLE)
if (old.hasTypeTable()) {
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufPackageKind.TYPE_TABLE)
}
if (old.hasExtension(JvmProtoBuf.packageModuleName) != new.hasExtension(JvmProtoBuf.packageModuleName)) result.add(ProtoBufPackageKind.PACKAGE_MODULE_NAME)
if (old.hasExtension(JvmProtoBuf.packageModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.packageModuleName), new.getExtension(JvmProtoBuf.packageModuleName))) result.add(ProtoBufPackageKind.PACKAGE_MODULE_NAME)
}
return result
}
@@ -94,6 +110,8 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEqualsClassProperty(old, new)) return false
if (!checkEqualsClassTypeAlias(old, new)) return false
if (!checkEqualsClassEnumEntry(old, new)) return false
if (old.hasTypeTable() != new.hasTypeTable()) return false
@@ -101,15 +119,14 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.getExtensionCount(JvmProtoBuf.classAnnotation) != new.getExtensionCount(JvmProtoBuf.classAnnotation)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.classAnnotation) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.classAnnotation, i), new.getExtension(JvmProtoBuf.classAnnotation, i))) return false
if (old.hasExtension(JvmProtoBuf.classModuleName) != new.hasExtension(JvmProtoBuf.classModuleName)) return false
if (old.hasExtension(JvmProtoBuf.classModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.classModuleName), new.getExtension(JvmProtoBuf.classModuleName))) return false
}
return true
}
public enum class ProtoBufClassKind {
enum class ProtoBufClassKind {
FLAGS,
FQ_NAME,
COMPANION_OBJECT_NAME,
@@ -120,12 +137,13 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
CONSTRUCTOR_LIST,
FUNCTION_LIST,
PROPERTY_LIST,
TYPE_ALIAS_LIST,
ENUM_ENTRY_LIST,
TYPE_TABLE,
CLASS_ANNOTATION_LIST
CLASS_MODULE_NAME
}
public fun difference(old: ProtoBuf.Class, new: ProtoBuf.Class): EnumSet<ProtoBufClassKind> {
fun difference(old: ProtoBuf.Class, new: ProtoBuf.Class): EnumSet<ProtoBufClassKind> {
val result = EnumSet.noneOf(ProtoBufClassKind::class.java)
if (old.hasFlags() != new.hasFlags()) result.add(ProtoBufClassKind.FLAGS)
@@ -154,6 +172,8 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEqualsClassProperty(old, new)) result.add(ProtoBufClassKind.PROPERTY_LIST)
if (!checkEqualsClassTypeAlias(old, new)) result.add(ProtoBufClassKind.TYPE_ALIAS_LIST)
if (!checkEqualsClassEnumEntry(old, new)) result.add(ProtoBufClassKind.ENUM_ENTRY_LIST)
if (old.hasTypeTable() != new.hasTypeTable()) result.add(ProtoBufClassKind.TYPE_TABLE)
@@ -161,10 +181,9 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE)
}
if (old.getExtensionCount(JvmProtoBuf.classAnnotation) != new.getExtensionCount(JvmProtoBuf.classAnnotation)) result.add(ProtoBufClassKind.CLASS_ANNOTATION_LIST)
for(i in 0..old.getExtensionCount(JvmProtoBuf.classAnnotation) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.classAnnotation, i), new.getExtension(JvmProtoBuf.classAnnotation, i))) result.add(ProtoBufClassKind.CLASS_ANNOTATION_LIST)
if (old.hasExtension(JvmProtoBuf.classModuleName) != new.hasExtension(JvmProtoBuf.classModuleName)) result.add(ProtoBufClassKind.CLASS_MODULE_NAME)
if (old.hasExtension(JvmProtoBuf.classModuleName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.classModuleName), new.getExtension(JvmProtoBuf.classModuleName))) result.add(ProtoBufClassKind.CLASS_MODULE_NAME)
}
return result
@@ -176,6 +195,11 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (old.flags != new.flags) return false
}
if (old.hasOldFlags() != new.hasOldFlags()) return false
if (old.hasOldFlags()) {
if (old.oldFlags != new.oldFlags) return false
}
if (!checkStringEquals(old.name, new.name)) return false
if (old.hasReturnType() != new.hasReturnType()) return false
@@ -212,11 +236,6 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEquals(old.getExtension(JvmProtoBuf.methodSignature), new.getExtension(JvmProtoBuf.methodSignature))) return false
}
if (old.hasExtension(JvmProtoBuf.methodImplClassName) != new.hasExtension(JvmProtoBuf.methodImplClassName)) return false
if (old.hasExtension(JvmProtoBuf.methodImplClassName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.methodImplClassName), new.getExtension(JvmProtoBuf.methodImplClassName))) return false
}
return true
}
@@ -226,6 +245,11 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (old.flags != new.flags) return false
}
if (old.hasOldFlags() != new.hasOldFlags()) return false
if (old.hasOldFlags()) {
if (old.oldFlags != new.oldFlags) return false
}
if (!checkStringEquals(old.name, new.name)) return false
if (old.hasReturnType() != new.hasReturnType()) return false
@@ -270,11 +294,41 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEquals(old.getExtension(JvmProtoBuf.propertySignature), new.getExtension(JvmProtoBuf.propertySignature))) return false
}
if (old.hasExtension(JvmProtoBuf.propertyImplClassName) != new.hasExtension(JvmProtoBuf.propertyImplClassName)) return false
if (old.hasExtension(JvmProtoBuf.propertyImplClassName)) {
if (!checkStringEquals(old.getExtension(JvmProtoBuf.propertyImplClassName), new.getExtension(JvmProtoBuf.propertyImplClassName))) return false
return true
}
open fun checkEquals(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.hasFlags() != new.hasFlags()) return false
if (old.hasFlags()) {
if (old.flags != new.flags) return false
}
if (!checkStringEquals(old.name, new.name)) return false
if (!checkEqualsTypeAliasTypeParameter(old, new)) return false
if (old.hasUnderlyingType() != new.hasUnderlyingType()) return false
if (old.hasUnderlyingType()) {
if (!checkEquals(old.underlyingType, new.underlyingType)) return false
}
if (old.hasUnderlyingTypeId() != new.hasUnderlyingTypeId()) return false
if (old.hasUnderlyingTypeId()) {
if (old.underlyingTypeId != new.underlyingTypeId) return false
}
if (old.hasExpandedType() != new.hasExpandedType()) return false
if (old.hasExpandedType()) {
if (!checkEquals(old.expandedType, new.expandedType)) return false
}
if (old.hasExpandedTypeId() != new.hasExpandedTypeId()) return false
if (old.hasExpandedTypeId()) {
if (old.expandedTypeId != new.expandedTypeId) return false
}
if (!checkEqualsTypeAliasAnnotation(old, new)) return false
return true
}
@@ -355,6 +409,11 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkStringEquals(old.typeParameterName, new.typeParameterName)) return false
}
if (old.hasTypeAliasName() != new.hasTypeAliasName()) return false
if (old.hasTypeAliasName()) {
if (!checkClassIdEquals(old.typeAliasName, new.typeAliasName)) return false
}
if (old.hasOuterType() != new.hasOuterType()) return false
if (old.hasOuterType()) {
if (!checkEquals(old.outerType, new.outerType)) return false
@@ -365,6 +424,16 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (old.outerTypeId != new.outerTypeId) return false
}
if (old.hasAbbreviatedType() != new.hasAbbreviatedType()) return false
if (old.hasAbbreviatedType()) {
if (!checkEquals(old.abbreviatedType, new.abbreviatedType)) return false
}
if (old.hasAbbreviatedTypeId() != new.hasAbbreviatedTypeId()) return false
if (old.hasAbbreviatedTypeId()) {
if (old.abbreviatedTypeId != new.abbreviatedTypeId) return false
}
if (old.getExtensionCount(JvmProtoBuf.typeAnnotation) != new.getExtensionCount(JvmProtoBuf.typeAnnotation)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) {
@@ -395,10 +464,11 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
open fun checkEquals(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean {
if (!checkClassIdEquals(old.id, new.id)) return false
if (!checkEqualsAnnotationArgument(old, new)) return false
open fun checkEquals(old: ProtoBuf.EnumEntry, new: ProtoBuf.EnumEntry): Boolean {
if (old.hasName() != new.hasName()) return false
if (old.hasName()) {
if (!checkStringEquals(old.name, new.name)) return false
}
return true
}
@@ -431,11 +501,6 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (old.varargElementTypeId != new.varargElementTypeId) return false
}
if (old.hasExtension(JvmProtoBuf.index) != new.hasExtension(JvmProtoBuf.index)) return false
if (old.hasExtension(JvmProtoBuf.index)) {
if (old.getExtension(JvmProtoBuf.index) != new.getExtension(JvmProtoBuf.index)) return false
}
return true
}
@@ -477,6 +542,14 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
open fun checkEquals(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean {
if (!checkClassIdEquals(old.id, new.id)) return false
if (!checkEqualsAnnotationArgument(old, new)) return false
return true
}
open fun checkEquals(old: ProtoBuf.Type.Argument, new: ProtoBuf.Type.Argument): Boolean {
if (old.hasProjection() != new.hasProjection()) return false
if (old.hasProjection()) {
@@ -496,14 +569,6 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
open fun checkEquals(old: ProtoBuf.Annotation.Argument, new: ProtoBuf.Annotation.Argument): Boolean {
if (!checkStringEquals(old.nameId, new.nameId)) return false
if (!checkEquals(old.value, new.value)) return false
return true
}
open fun checkEquals(old: JvmProtoBuf.JvmFieldSignature, new: JvmProtoBuf.JvmFieldSignature): Boolean {
if (old.hasName() != new.hasName()) return false
if (old.hasName()) {
@@ -515,10 +580,13 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkStringEquals(old.desc, new.desc)) return false
}
if (old.hasIsStaticInOuter() != new.hasIsStaticInOuter()) return false
if (old.hasIsStaticInOuter()) {
if (old.isStaticInOuter != new.isStaticInOuter) return false
}
return true
}
open fun checkEquals(old: ProtoBuf.Annotation.Argument, new: ProtoBuf.Annotation.Argument): Boolean {
if (!checkStringEquals(old.nameId, new.nameId)) return false
if (!checkEquals(old.value, new.value)) return false
return true
}
@@ -589,6 +657,16 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
open fun checkEqualsPackageTypeAlias(old: ProtoBuf.Package, new: ProtoBuf.Package): Boolean {
if (old.typeAliasCount != new.typeAliasCount) return false
for(i in 0..old.typeAliasCount - 1) {
if (!checkEquals(old.getTypeAlias(i), new.getTypeAlias(i))) return false
}
return true
}
open fun checkEqualsClassTypeParameter(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -659,11 +737,21 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
open fun checkEqualsClassTypeAlias(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.typeAliasCount != new.typeAliasCount) return false
for(i in 0..old.typeAliasCount - 1) {
if (!checkEquals(old.getTypeAlias(i), new.getTypeAlias(i))) return false
}
return true
}
open fun checkEqualsClassEnumEntry(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.enumEntryCount != new.enumEntryCount) return false
for(i in 0..old.enumEntryCount - 1) {
if (!checkStringEquals(old.getEnumEntry(i), new.getEnumEntry(i))) return false
if (!checkEquals(old.getEnumEntry(i), new.getEnumEntry(i))) return false
}
return true
@@ -699,6 +787,26 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
open fun checkEqualsTypeAliasTypeParameter(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
for(i in 0..old.typeParameterCount - 1) {
if (!checkEquals(old.getTypeParameter(i), new.getTypeParameter(i))) return false
}
return true
}
open fun checkEqualsTypeAliasAnnotation(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.annotationCount != new.annotationCount) return false
for(i in 0..old.annotationCount - 1) {
if (!checkEquals(old.getAnnotation(i), new.getAnnotation(i))) return false
}
return true
}
open fun checkEqualsTypeTableType(old: ProtoBuf.TypeTable, new: ProtoBuf.TypeTable): Boolean {
if (old.typeCount != new.typeCount) return false
@@ -769,10 +877,10 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return true
}
public fun oldGetIndexOfString(index: Int): Int = getIndexOfString(index, oldStringIndexesMap, oldNameResolver)
public fun newGetIndexOfString(index: Int): Int = getIndexOfString(index, newStringIndexesMap, newNameResolver)
fun oldGetIndexOfString(index: Int): Int = getIndexOfString(index, oldStringIndexesMap, oldNameResolver)
fun newGetIndexOfString(index: Int): Int = getIndexOfString(index, newStringIndexesMap, newNameResolver)
public fun getIndexOfString(index: Int, map: MutableMap<Int, Int>, nameResolver: NameResolver): Int {
fun getIndexOfString(index: Int, map: MutableMap<Int, Int>, nameResolver: NameResolver): Int {
map[index]?.let { return it }
val result = strings.intern(nameResolver.getString(index))
@@ -780,10 +888,10 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
return result
}
public fun oldGetIndexOfClassId(index: Int): Int = getIndexOfClassId(index, oldClassIdIndexesMap, oldNameResolver)
public fun newGetIndexOfClassId(index: Int): Int = getIndexOfClassId(index, newClassIdIndexesMap, newNameResolver)
fun oldGetIndexOfClassId(index: Int): Int = getIndexOfClassId(index, oldClassIdIndexesMap, oldNameResolver)
fun newGetIndexOfClassId(index: Int): Int = getIndexOfClassId(index, newClassIdIndexesMap, newNameResolver)
public fun getIndexOfClassId(index: Int, map: MutableMap<Int, Int>, nameResolver: NameResolver): Int {
fun getIndexOfClassId(index: Int, map: MutableMap<Int, Int>, nameResolver: NameResolver): Int {
map[index]?.let { return it }
val result = classIds.intern(nameResolver.getClassId(index))
@@ -800,7 +908,7 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
}
}
public fun ProtoBuf.Package.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Package.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
for(i in 0..functionCount - 1) {
@@ -811,14 +919,22 @@ public fun ProtoBuf.Package.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes:
hashCode = 31 * hashCode + getProperty(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..typeAliasCount - 1) {
hashCode = 31 * hashCode + getTypeAlias(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasTypeTable()) {
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JvmProtoBuf.packageModuleName)) {
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.packageModuleName))
}
return hashCode
}
public fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
@@ -859,28 +975,36 @@ public fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (
hashCode = 31 * hashCode + getProperty(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..typeAliasCount - 1) {
hashCode = 31 * hashCode + getTypeAlias(i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..enumEntryCount - 1) {
hashCode = 31 * hashCode + stringIndexes(getEnumEntry(i))
hashCode = 31 * hashCode + getEnumEntry(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasTypeTable()) {
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JvmProtoBuf.classAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.classAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
if (hasExtension(JvmProtoBuf.classModuleName)) {
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.classModuleName))
}
return hashCode
}
public fun ProtoBuf.Function.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Function.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
if (hasOldFlags()) {
hashCode = 31 * hashCode + oldFlags
}
hashCode = 31 * hashCode + stringIndexes(name)
if (hasReturnType()) {
@@ -915,20 +1039,20 @@ public fun ProtoBuf.Function.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.methodSignature).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JvmProtoBuf.methodImplClassName)) {
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.methodImplClassName))
}
return hashCode
}
public fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
if (hasOldFlags()) {
hashCode = 31 * hashCode + oldFlags
}
hashCode = 31 * hashCode + stringIndexes(name)
if (hasReturnType()) {
@@ -967,14 +1091,46 @@ public fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.propertySignature).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JvmProtoBuf.propertyImplClassName)) {
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.propertyImplClassName))
return hashCode
}
fun ProtoBuf.TypeAlias.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}
hashCode = 31 * hashCode + stringIndexes(name)
for(i in 0..typeParameterCount - 1) {
hashCode = 31 * hashCode + getTypeParameter(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasUnderlyingType()) {
hashCode = 31 * hashCode + underlyingType.hashCode(stringIndexes, fqNameIndexes)
}
if (hasUnderlyingTypeId()) {
hashCode = 31 * hashCode + underlyingTypeId
}
if (hasExpandedType()) {
hashCode = 31 * hashCode + expandedType.hashCode(stringIndexes, fqNameIndexes)
}
if (hasExpandedTypeId()) {
hashCode = 31 * hashCode + expandedTypeId
}
for(i in 0..annotationCount - 1) {
hashCode = 31 * hashCode + getAnnotation(i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
public fun ProtoBuf.TypeTable.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.TypeTable.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
for(i in 0..typeCount - 1) {
@@ -988,7 +1144,7 @@ public fun ProtoBuf.TypeTable.hashCode(stringIndexes: (Int) -> Int, fqNameIndexe
return hashCode
}
public fun ProtoBuf.TypeParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.TypeParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + id
@@ -1018,7 +1174,7 @@ public fun ProtoBuf.TypeParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIn
return hashCode
}
public fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
for(i in 0..argumentCount - 1) {
@@ -1053,6 +1209,10 @@ public fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I
hashCode = 31 * hashCode + stringIndexes(typeParameterName)
}
if (hasTypeAliasName()) {
hashCode = 31 * hashCode + fqNameIndexes(typeAliasName)
}
if (hasOuterType()) {
hashCode = 31 * hashCode + outerType.hashCode(stringIndexes, fqNameIndexes)
}
@@ -1061,6 +1221,14 @@ public fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I
hashCode = 31 * hashCode + outerTypeId
}
if (hasAbbreviatedType()) {
hashCode = 31 * hashCode + abbreviatedType.hashCode(stringIndexes, fqNameIndexes)
}
if (hasAbbreviatedTypeId()) {
hashCode = 31 * hashCode + abbreviatedTypeId
}
for(i in 0..getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.typeAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1072,7 +1240,7 @@ public fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I
return hashCode
}
public fun ProtoBuf.Constructor.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Constructor.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
@@ -1090,19 +1258,17 @@ public fun ProtoBuf.Constructor.hashCode(stringIndexes: (Int) -> Int, fqNameInde
return hashCode
}
public fun ProtoBuf.Annotation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.EnumEntry.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + fqNameIndexes(id)
for(i in 0..argumentCount - 1) {
hashCode = 31 * hashCode + getArgument(i).hashCode(stringIndexes, fqNameIndexes)
if (hasName()) {
hashCode = 31 * hashCode + stringIndexes(name)
}
return hashCode
}
public fun ProtoBuf.ValueParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.ValueParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasFlags()) {
@@ -1127,14 +1293,10 @@ public fun ProtoBuf.ValueParameter.hashCode(stringIndexes: (Int) -> Int, fqNameI
hashCode = 31 * hashCode + varargElementTypeId
}
if (hasExtension(JvmProtoBuf.index)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.index)
}
return hashCode
}
public fun JvmProtoBuf.JvmMethodSignature.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun JvmProtoBuf.JvmMethodSignature.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasName()) {
@@ -1148,7 +1310,7 @@ public fun JvmProtoBuf.JvmMethodSignature.hashCode(stringIndexes: (Int) -> Int,
return hashCode
}
public fun JvmProtoBuf.JvmPropertySignature.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun JvmProtoBuf.JvmPropertySignature.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasField()) {
@@ -1170,7 +1332,19 @@ public fun JvmProtoBuf.JvmPropertySignature.hashCode(stringIndexes: (Int) -> Int
return hashCode
}
public fun ProtoBuf.Type.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Annotation.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + fqNameIndexes(id)
for(i in 0..argumentCount - 1) {
hashCode = 31 * hashCode + getArgument(i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}
fun ProtoBuf.Type.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasProjection()) {
@@ -1188,17 +1362,7 @@ public fun ProtoBuf.Type.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIn
return hashCode
}
public fun ProtoBuf.Annotation.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + stringIndexes(nameId)
hashCode = 31 * hashCode + value.hashCode(stringIndexes, fqNameIndexes)
return hashCode
}
public fun JvmProtoBuf.JvmFieldSignature.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun JvmProtoBuf.JvmFieldSignature.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasName()) {
@@ -1209,14 +1373,20 @@ public fun JvmProtoBuf.JvmFieldSignature.hashCode(stringIndexes: (Int) -> Int, f
hashCode = 31 * hashCode + stringIndexes(desc)
}
if (hasIsStaticInOuter()) {
hashCode = 31 * hashCode + isStaticInOuter.hashCode()
}
return hashCode
}
fun ProtoBuf.Annotation.Argument.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
hashCode = 31 * hashCode + stringIndexes(nameId)
hashCode = 31 * hashCode + value.hashCode(stringIndexes, fqNameIndexes)
return hashCode
}
public fun ProtoBuf.Annotation.Argument.Value.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
fun ProtoBuf.Annotation.Argument.Value.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
var hashCode = 1
if (hasType()) {

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
class SourceRetentionAnnotationHandlerImpl : SourceRetentionAnnotationHandler {
private val mutableSourceRetentionAnnotations = mutableSetOf<String>()
val sourceRetentionAnnotations: Set<String>
get() = mutableSourceRetentionAnnotations
override fun register(internalName: String) {
mutableSourceRetentionAnnotations += internalName
}
}

View File

@@ -0,0 +1,288 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// these functions are used in the kotlin gradle plugin
@file:Suppress("unused")
package org.jetbrains.kotlin.incremental
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.build.isModuleMappingFile
import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
import org.jetbrains.kotlin.modules.KotlinModuleXmlBuilder
import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.utils.keysToMap
import java.io.File
import java.util.*
fun Iterable<File>.javaSourceRoots(roots: Iterable<File>): Iterable<File> =
filter { it.isJavaFile() }
.map { findSrcDirRoot(it, roots) }
.filterNotNull()
fun makeModuleFile(name: String, isTest: Boolean, outputDir: File, sourcesToCompile: Iterable<File>, javaSourceRoots: Iterable<File>, classpath: Iterable<File>, friendDirs: Iterable<File>): File {
val builder = KotlinModuleXmlBuilder()
builder.addModule(
name,
outputDir.absolutePath,
sourcesToCompile,
javaSourceRoots.map { JvmSourceRoot(it) },
classpath,
"java-production",
isTest,
// this excludes the output directories from the class path, to be removed for true incremental compilation
setOf(outputDir),
friendDirs
)
val scriptFile = File.createTempFile("kjps", StringUtil.sanitizeJavaIdentifier(name) + ".script.xml")
FileUtil.writeToFile(scriptFile, builder.asText().toString())
return scriptFile
}
fun makeCompileServices(
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,
compilationCanceledStatus: CompilationCanceledStatus?,
sourceRetentionAnnotationHandler: SourceRetentionAnnotationHandler? = null
): Services =
with(Services.Builder()) {
register(IncrementalCompilationComponents::class.java,
IncrementalCompilationComponentsImpl(incrementalCaches, lookupTracker))
compilationCanceledStatus?.let {
register(CompilationCanceledStatus::class.java, it)
}
sourceRetentionAnnotationHandler?.let {
register(SourceRetentionAnnotationHandler::class.java, it)
}
build()
}
fun makeLookupTracker(parentLookupTracker: LookupTracker = LookupTracker.DO_NOTHING): LookupTracker =
if (IncrementalCompilation.isExperimental()) LookupTrackerImpl(parentLookupTracker)
else parentLookupTracker
fun<Target> makeIncrementalCachesMap(
targets: Iterable<Target>,
getDependencies: (Target) -> Iterable<Target>,
getCache: (Target) -> IncrementalCacheImpl<Target>,
getTargetId: Target.() -> TargetId
): Map<TargetId, IncrementalCacheImpl<Target>>
{
val dependents = targets.keysToMap { hashSetOf<Target>() }
val targetsWithDependents = targets.toHashSet()
for (target in targets) {
for (dependency in getDependencies(target)) {
if (dependency !in targets) continue
dependents[dependency]!!.add(target)
targetsWithDependents.add(target)
}
}
val caches = targetsWithDependents.keysToMap { getCache(it) }
for ((target, cache) in caches) {
dependents[target]?.forEach {
cache.addDependentCache(caches[it]!!)
}
}
return caches.mapKeys { it.key.getTargetId() }
}
fun<Target> updateIncrementalCaches(
targets: Iterable<Target>,
generatedFiles: List<GeneratedFile<Target>>,
compiledWithErrors: Boolean,
getIncrementalCache: (Target) -> IncrementalCacheImpl<Target>
): CompilationResult {
var changesInfo = CompilationResult.NO_CHANGES
for (generatedFile in generatedFiles) {
val ic = getIncrementalCache(generatedFile.target)
when {
generatedFile is GeneratedJvmClass<Target> -> changesInfo += ic.saveFileToCache(generatedFile)
generatedFile.outputFile.isModuleMappingFile() -> changesInfo += ic.saveModuleMappingToCache(generatedFile.sourceFiles, generatedFile.outputFile)
}
}
if (!compiledWithErrors) {
targets.forEach {
val newChangesInfo = getIncrementalCache(it).clearCacheForRemovedClasses()
changesInfo += newChangesInfo
}
}
return changesInfo
}
fun LookupStorage.update(
lookupTracker: LookupTracker,
filesToCompile: Iterable<File>,
removedFiles: Iterable<File>
) {
if (lookupTracker !is LookupTrackerImpl) throw AssertionError("Lookup tracker is expected to be LookupTrackerImpl, got ${lookupTracker.javaClass}")
removeLookupsFrom(filesToCompile.asSequence() + removedFiles.asSequence())
addAll(lookupTracker.lookups.entrySet(), lookupTracker.pathInterner.values)
}
fun<Target> OutputItemsCollectorImpl.generatedFiles(
targets: Collection<Target>,
representativeTarget: Target,
getSources: (Target) -> Iterable<File>,
getOutputDir: (Target) -> File?
): List<GeneratedFile<Target>> {
// If there's only one target, this map is empty: get() always returns null, and the representativeTarget will be used below
val sourceToTarget =
if (targets.size >1) targets.flatMap { target -> getSources(target).map { Pair(it, target) } }.toMap()
else mapOf<File, Target>()
return outputs.map { outputItem ->
val target =
outputItem.sourceFiles.firstOrNull()?.let { sourceToTarget[it] } ?:
targets.filter { getOutputDir(it)?.let { outputItem.outputFile.startsWith(it) } ?: false }.singleOrNull() ?:
representativeTarget
if (outputItem.outputFile.name.endsWith(".class"))
GeneratedJvmClass(target, outputItem.sourceFiles, outputItem.outputFile)
else
GeneratedFile(target, outputItem.sourceFiles, outputItem.outputFile)
}
}
data class DirtyData(
val dirtyLookupSymbols: Collection<LookupSymbol> = emptyList(),
val dirtyClassesFqNames: Collection<FqName> = emptyList()
)
fun <Target> CompilationResult.getDirtyData(
caches: Iterable<IncrementalCacheImpl<Target>>,
reporter: IncReporter
): DirtyData {
val dirtyLookupSymbols = HashSet<LookupSymbol>()
val dirtyClassesFqNames = HashSet<FqName>()
for (change in changes) {
reporter.report { "Process $change" }
if (change is ChangeInfo.SignatureChanged) {
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
for (classFqName in fqNames) {
assert(!classFqName.isRoot) { "$classFqName is root when processing $change" }
val scope = classFqName.parent().asString()
val name = classFqName.shortName().identifier
dirtyLookupSymbols.add(LookupSymbol(name, scope))
}
}
else if (change is ChangeInfo.MembersChanged) {
val fqNames = withSubtypes(change.fqName, caches)
// need to recompile subtypes because changed member might break override
dirtyClassesFqNames.addAll(fqNames)
for (name in change.names) {
for (fqName in fqNames) {
dirtyLookupSymbols.add(LookupSymbol(name, fqName.asString()))
}
}
}
}
return DirtyData(dirtyLookupSymbols, dirtyClassesFqNames)
}
fun mapLookupSymbolsToFiles(
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: IncReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
for (lookup in lookupSymbols) {
val affectedFiles = lookupStorage.get(lookup).map(::File).filter { it !in excludes }
reporter.report { "${lookup.scope}#${lookup.name} caused recompilation of: ${reporter.pathsAsString(affectedFiles)}" }
dirtyFiles.addAll(affectedFiles)
}
return dirtyFiles
}
fun <Target> mapClassesFqNamesToFiles(
caches: Iterable<IncrementalCacheImpl<Target>>,
classesFqNames: Iterable<FqName>,
reporter: IncReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
for (cache in caches) {
for (dirtyClassFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(dirtyClassFqName)
if (srcFile == null || srcFile in excludes) continue
reporter.report { ("Class $dirtyClassFqName caused recompilation of: ${reporter.pathsAsString(srcFile)}") }
dirtyFiles.add(srcFile)
}
}
return dirtyFiles
}
private fun File.isJavaFile() = extension.equals(JavaFileType.INSTANCE.defaultExtension, ignoreCase = true)
private fun findSrcDirRoot(file: File, roots: Iterable<File>): File? =
roots.firstOrNull { FileUtil.isAncestor(it, file, false) }
fun <Target> withSubtypes(
typeFqName: FqName,
caches: Iterable<IncrementalCacheImpl<Target>>
): Set<FqName> {
val types = LinkedList(listOf(typeFqName))
val subtypes = hashSetOf<FqName>()
while (types.isNotEmpty()) {
val unprocessedType = types.pollFirst()
caches.asSequence()
.flatMap { it.getSubtypesOf(unprocessedType) }
.filter { it !in subtypes }
.forEach { types.addLast(it) }
subtypes.add(unprocessedType)
}
return subtypes
}

View File

@@ -0,0 +1,283 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.incremental.ProtoCompareGenerated.ProtoBufClassKind
import org.jetbrains.kotlin.incremental.ProtoCompareGenerated.ProtoBufPackageKind
import org.jetbrains.kotlin.incremental.storage.ProtoMapValue
import org.jetbrains.kotlin.protobuf.MessageLite
import org.jetbrains.kotlin.serialization.Flags
import org.jetbrains.kotlin.serialization.ProtoBuf
import org.jetbrains.kotlin.serialization.deserialization.Deserialization
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil
import java.util.*
data class Difference(
val isClassAffected: Boolean = false,
val areSubclassesAffected: Boolean = false,
val changedMembersNames: Set<String> = emptySet()
)
fun difference(oldData: ProtoMapValue, newData: ProtoMapValue): Difference {
if (!oldData.isPackageFacade && newData.isPackageFacade) return Difference(isClassAffected = true, areSubclassesAffected = true)
if (oldData.isPackageFacade && !newData.isPackageFacade) return Difference(isClassAffected = true)
val differenceObject =
if (oldData.isPackageFacade) {
DifferenceCalculatorForPackageFacade(oldData, newData)
}
else {
DifferenceCalculatorForClass(oldData, newData)
}
return differenceObject.difference()
}
internal val MessageLite.isPrivate: Boolean
get() = Visibilities.isPrivate(Deserialization.visibility(
when (this) {
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Property -> Flags.VISIBILITY.get(flags)
is ProtoBuf.TypeAlias -> Flags.VISIBILITY.get(flags)
else -> error("Unknown message: $this")
}))
private fun MessageLite.name(nameResolver: NameResolver): String {
return when (this) {
is ProtoBuf.Constructor -> "<init>"
is ProtoBuf.Function -> nameResolver.getString(name)
is ProtoBuf.Property -> nameResolver.getString(name)
is ProtoBuf.TypeAlias -> nameResolver.getString(name)
else -> error("Unknown message: $this")
}
}
internal fun List<MessageLite>.names(nameResolver: NameResolver): List<String> = map { it.name(nameResolver) }
private abstract class DifferenceCalculator() {
protected abstract val oldNameResolver: NameResolver
protected abstract val newNameResolver: NameResolver
protected val compareObject by lazy { ProtoCompareGenerated(oldNameResolver, newNameResolver) }
abstract fun difference(): Difference
protected fun calcDifferenceForMembers(oldList: List<MessageLite>, newList: List<MessageLite>): Collection<String> {
val result = hashSetOf<String>()
val oldMap =
oldList.groupBy { it.getHashCode({ compareObject.oldGetIndexOfString(it) }, { compareObject.oldGetIndexOfClassId(it) }) }
val newMap =
newList.groupBy { it.getHashCode({ compareObject.newGetIndexOfString(it) }, { compareObject.newGetIndexOfClassId(it) }) }
val hashes = oldMap.keys + newMap.keys
for (hash in hashes) {
val oldMembers = oldMap[hash]
val newMembers = newMap[hash]
val differentMembers = when {
newMembers == null -> oldMembers!!.names(compareObject.oldNameResolver)
oldMembers == null -> newMembers.names(compareObject.newNameResolver)
else -> calcDifferenceForEqualHashes(oldMembers, newMembers)
}
result.addAll(differentMembers)
}
return result
}
private fun calcDifferenceForEqualHashes(
oldList: List<MessageLite>,
newList: List<MessageLite>
): Collection<String> {
val result = hashSetOf<String>()
val newSet = HashSet(newList)
oldList.forEach { oldMember ->
val newMember = newSet.firstOrNull { compareObject.checkEquals(oldMember, it) }
if (newMember != null) {
newSet.remove(newMember)
}
else {
result.add(oldMember.name(compareObject.oldNameResolver))
}
}
newSet.forEach { newMember ->
result.add(newMember.name(compareObject.newNameResolver))
}
return result
}
protected fun calcDifferenceForNames(
oldList: List<Int>,
newList: List<Int>
): Collection<String> {
val oldNames = oldList.map { compareObject.oldNameResolver.getString(it) }.toSet()
val newNames = newList.map { compareObject.newNameResolver.getString(it) }.toSet()
return oldNames.union(newNames) - oldNames.intersect(newNames)
}
private fun MessageLite.getHashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
return when (this) {
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes)
else -> error("Unknown message: $this")
}
}
private fun ProtoCompareGenerated.checkEquals(old: MessageLite, new: MessageLite): Boolean {
return when {
old is ProtoBuf.Constructor && new is ProtoBuf.Constructor -> checkEquals(old, new)
old is ProtoBuf.Function && new is ProtoBuf.Function -> checkEquals(old, new)
old is ProtoBuf.Property && new is ProtoBuf.Property -> checkEquals(old, new)
old is ProtoBuf.TypeAlias && new is ProtoBuf.TypeAlias -> checkEquals(old, new)
else -> error("Unknown message: $this")
}
}
}
private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: ProtoMapValue) : DifferenceCalculator() {
val oldClassData = JvmProtoBufUtil.readClassDataFrom(oldData.bytes, oldData.strings)
val newClassData = JvmProtoBufUtil.readClassDataFrom(newData.bytes, newData.strings)
val oldProto = oldClassData.classProto
val newProto = newClassData.classProto
override val oldNameResolver = oldClassData.nameResolver
override val newNameResolver = newClassData.nameResolver
val diff = compareObject.difference(oldProto, newProto)
override fun difference(): Difference {
var isClassAffected = false
var areSubclassesAffected = false
val names = hashSetOf<String>()
val classIsSealed = newProto.isSealed && oldProto.isSealed
fun Int.oldToNames() = names.add(oldNameResolver.getString(this))
fun Int.newToNames() = names.add(newNameResolver.getString(this))
fun calcDifferenceForNonPrivateMembers(members: (ProtoBuf.Class) -> List<MessageLite>): Collection<String> {
val oldMembers = members(oldProto).filterNot { it.isPrivate }
val newMembers = members(newProto).filterNot { it.isPrivate }
return calcDifferenceForMembers(oldMembers, newMembers)
}
for (kind in diff) {
when (kind!!) {
ProtoBufClassKind.COMPANION_OBJECT_NAME -> {
if (oldProto.hasCompanionObjectName()) oldProto.companionObjectName.oldToNames()
if (newProto.hasCompanionObjectName()) newProto.companionObjectName.newToNames()
isClassAffected = true
}
ProtoBufClassKind.NESTED_CLASS_NAME_LIST -> {
if (classIsSealed) {
// when class is sealed, adding an implementation can break exhaustive when expressions
// the workaround is to recompile all class usages
isClassAffected = true
}
names.addAll(calcDifferenceForNames(oldProto.nestedClassNameList, newProto.nestedClassNameList))
}
ProtoBufClassKind.CONSTRUCTOR_LIST -> {
val differentNonPrivateConstructors = calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getConstructorList)
if (differentNonPrivateConstructors.isNotEmpty()) {
isClassAffected = true
}
}
ProtoBufClassKind.FUNCTION_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getFunctionList))
ProtoBufClassKind.PROPERTY_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getPropertyList))
ProtoBufClassKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getTypeAliasList))
ProtoBufClassKind.ENUM_ENTRY_LIST -> {
isClassAffected = true
}
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoBufClassKind.FLAGS,
ProtoBufClassKind.FQ_NAME,
ProtoBufClassKind.TYPE_PARAMETER_LIST,
ProtoBufClassKind.SUPERTYPE_LIST,
ProtoBufClassKind.SUPERTYPE_ID_LIST-> {
isClassAffected = true
areSubclassesAffected = true
}
ProtoBufClassKind.CLASS_MODULE_NAME -> {
// TODO
}
}
}
return Difference(isClassAffected, areSubclassesAffected, names)
}
}
private class DifferenceCalculatorForPackageFacade(oldData: ProtoMapValue, newData: ProtoMapValue) : DifferenceCalculator() {
val oldPackageData = JvmProtoBufUtil.readPackageDataFrom(oldData.bytes, oldData.strings)
val newPackageData = JvmProtoBufUtil.readPackageDataFrom(newData.bytes, newData.strings)
val oldProto = oldPackageData.packageProto
val newProto = newPackageData.packageProto
override val oldNameResolver = oldPackageData.nameResolver
override val newNameResolver = newPackageData.nameResolver
val diff = compareObject.difference(oldProto, newProto)
override fun difference(): Difference {
val names = hashSetOf<String>()
fun calcDifferenceForNonPrivateMembers(members: (ProtoBuf.Package) -> List<MessageLite>): Collection<String> {
val oldMembers = members(oldProto).filterNot { it.isPrivate }
val newMembers = members(newProto).filterNot { it.isPrivate }
return calcDifferenceForMembers(oldMembers, newMembers)
}
for (kind in diff) {
when (kind!!) {
ProtoBufPackageKind.FUNCTION_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getFunctionList))
ProtoBufPackageKind.PROPERTY_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
ProtoBufPackageKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getTypeAliasList))
ProtoBufPackageKind.TYPE_TABLE,
ProtoBufPackageKind.PACKAGE_MODULE_NAME -> {
// TODO
}
else -> throw IllegalArgumentException("Unsupported kind: $kind")
}
}
return Difference(changedMembersNames = names)
}
}
private val ProtoBuf.Class.isSealed: Boolean
get() = ProtoBuf.Modality.SEALED == Flags.MODALITY.get(flags)

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental.storage
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor
@@ -23,14 +23,14 @@ import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.utils.Printer
import java.io.File
internal abstract class BasicMap<K : Comparable<K>, V>(
abstract class BasicMap<K : Comparable<K>, V>(
storageFile: File,
keyDescriptor: KeyDescriptor<K>,
valueExternalizer: DataExternalizer<V>
) {
protected val storage = LazyStorage(storageFile, keyDescriptor, valueExternalizer)
open fun clean() {
fun clean() {
storage.clean()
}
@@ -60,19 +60,22 @@ internal abstract class BasicMap<K : Comparable<K>, V>(
}.toString()
}
@TestOnly
protected abstract fun dumpKey(key: K): String
@TestOnly
protected abstract fun dumpValue(value: V): String
}
internal abstract class BasicStringMap<V>(
abstract class BasicStringMap<V>(
storageFile: File,
keyDescriptor: KeyDescriptor<String>,
valueExternalizer: DataExternalizer<V>
) : BasicMap<String, V>(storageFile, keyDescriptor, valueExternalizer) {
public constructor(
constructor(
storageFile: File,
valueExternalizer: DataExternalizer<V>
) : this(storageFile, EnumeratorStringDescriptor.INSTANCE, valueExternalizer)
override fun dumpKey(key: String): String = key
}
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.annotations.TestOnly
open class BasicMapsOwner {
private val maps = arrayListOf<BasicMap<*, *>>()
companion object {
val CACHE_EXTENSION = "tab"
}
protected fun <K, V, M : BasicMap<K, V>> registerMap(map: M): M {
maps.add(map)
return map
}
open fun clean() {
maps.forEach { it.clean() }
}
open fun close() {
maps.forEach { it.close() }
}
open fun flush(memoryCachesOnly: Boolean) {
maps.forEach { it.flush(memoryCachesOnly) }
}
@TestOnly fun dump(): String = maps.map { it.dump() }.joinToString("\n\n")
}

View File

@@ -0,0 +1,55 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import org.jetbrains.kotlin.name.FqName
import java.io.File
internal open class ClassOneToManyMap(
storageFile: File
) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
fun add(key: FqName, value: FqName) {
storage.append(key.asString(), value.asString())
}
operator fun get(key: FqName): Collection<FqName> =
storage[key.asString()]?.map(::FqName) ?: setOf()
operator fun set(key: FqName, values: Collection<FqName>) {
if (values.isEmpty()) {
remove(key)
return
}
storage[key.asString()] = values.map(FqName::asString)
}
fun remove(key: FqName) {
storage.remove(key.asString())
}
fun removeValues(key: FqName, removed: Set<FqName>) {
val notRemoved = this[key].filter { it !in removed }
this[key] = notRemoved
}
}
internal class SubtypesMap(storageFile: File) : ClassOneToManyMap(storageFile)
internal class SupertypesMap(storageFile: File) : ClassOneToManyMap(storageFile)

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental.storage
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.utils.keysToMap
import java.io.File
@@ -24,15 +24,15 @@ internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescri
override fun dumpValue(value: Int): String = value.toString()
public operator fun get(file: File): Int? = storage[file]
operator fun get(file: File): Int? = storage[file]
public operator fun set(file: File, id: Int) {
operator fun set(file: File, id: Int) {
storage[file] = id
}
public fun remove(file: File) {
fun remove(file: File) {
storage.remove(file)
}
public fun toMap(): Map<File, Int> = storage.keys.keysToMap { storage[it]!! }
fun toMap(): Map<File, Int> = storage.keys.keysToMap { storage[it]!! }
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental.storage
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.ExternalIntegerKeyDescriptor
import java.io.File
@@ -24,15 +24,15 @@ internal class IdToFileMap(file: File) : BasicMap<Int, File>(file, ExternalInteg
override fun dumpValue(value: File): String = value.toString()
public operator fun get(id: Int): File? = storage[id]
operator fun get(id: Int): File? = storage[id]
public operator fun contains(id: Int): Boolean = id in storage
operator fun contains(id: Int): Boolean = id in storage
public operator fun set(id: Int, file: File) {
operator fun set(id: Int, file: File) {
storage[id] = file
}
public fun remove(id: Int) {
fun remove(id: Int) {
storage.remove(id)
}
}

View File

@@ -14,9 +14,10 @@
* limitations under the License.
*/
package org.jetbrains.kotlin.jps.incremental.storage
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.DataOutput
@@ -27,7 +28,7 @@ import java.io.IOException
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
internal class LazyStorage<K, V>(
class LazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
@@ -73,8 +74,12 @@ internal class LazyStorage<K, V>(
getStorageIfExists()?.remove(key)
}
fun append(key: K, append: (DataOutput)->Unit) {
getStorageOrCreateNew().appendData(key, append)
fun append(key: K, value: String) {
append(key) { out -> IOUtil.writeUTF(out, value) }
}
fun append(key: K, value: Int) {
append(key) { out -> out.writeInt(value) }
}
@Synchronized
@@ -110,4 +115,8 @@ internal class LazyStorage<K, V>(
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
private fun append(key: K, append: (DataOutput)->Unit) {
getStorageOrCreateNew().appendData(key, append)
}
}

View File

@@ -0,0 +1,42 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.storage
import java.io.File
internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<Int>>(storage, LookupSymbolKeyDescriptor, IntCollectionExternalizer) {
override fun dumpKey(key: LookupSymbolKey): String = key.toString()
override fun dumpValue(value: Collection<Int>): String = value.toString()
fun add(name: String, scope: String, fileId: Int) {
storage.append(LookupSymbolKey(name, scope), fileId)
}
operator fun get(key: LookupSymbolKey): Collection<Int>? = storage[key]
operator fun set(key: LookupSymbolKey, fileIds: Set<Int>) {
storage[key] = fileIds
}
fun remove(key: LookupSymbolKey) {
storage.remove(key)
}
val keys: Collection<LookupSymbolKey>
get() = storage.keys
}

View File

@@ -0,0 +1,216 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.storage
import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import java.io.DataInput
import java.io.DataInputStream
import java.io.DataOutput
import java.io.File
import java.util.*
object LookupSymbolKeyDescriptor : KeyDescriptor<LookupSymbolKey> {
override fun read(input: DataInput): LookupSymbolKey {
val first = input.readInt()
val second = input.readInt()
return LookupSymbolKey(first, second)
}
override fun save(output: DataOutput, value: LookupSymbolKey) {
output.writeInt(value.nameHash)
output.writeInt(value.scopeHash)
}
override fun getHashCode(value: LookupSymbolKey): Int = value.hashCode()
override fun isEqual(val1: LookupSymbolKey, val2: LookupSymbolKey): Boolean = val1 == val2
}
object ProtoMapValueExternalizer : DataExternalizer<ProtoMapValue> {
override fun save(output: DataOutput, value: ProtoMapValue) {
output.writeBoolean(value.isPackageFacade)
output.writeInt(value.bytes.size)
output.write(value.bytes)
output.writeInt(value.strings.size)
for (string in value.strings) {
output.writeUTF(string)
}
}
override fun read(input: DataInput): ProtoMapValue {
val isPackageFacade = input.readBoolean()
val bytesLength = input.readInt()
val bytes = ByteArray(bytesLength)
input.readFully(bytes, 0, bytesLength)
val stringsLength = input.readInt()
val strings = Array<String>(stringsLength) { input.readUTF() }
return ProtoMapValue(isPackageFacade, bytes, strings)
}
}
abstract class StringMapExternalizer<T> : DataExternalizer<Map<String, T>> {
override fun save(output: DataOutput, map: Map<String, T>?) {
output.writeInt(map!!.size)
for ((key, value) in map.entries) {
IOUtil.writeString(key, output)
writeValue(output, value)
}
}
override fun read(input: DataInput): Map<String, T>? {
val size = input.readInt()
val map = HashMap<String, T>(size)
repeat(size) {
val name = IOUtil.readString(input)!!
map[name] = readValue(input)
}
return map
}
protected abstract fun writeValue(output: DataOutput, value: T)
protected abstract fun readValue(input: DataInput): T
}
object StringToLongMapExternalizer : StringMapExternalizer<Long>() {
override fun readValue(input: DataInput): Long = input.readLong()
override fun writeValue(output: DataOutput, value: Long) {
output.writeLong(value)
}
}
object ConstantsMapExternalizer : DataExternalizer<Map<String, Any>> {
override fun save(output: DataOutput, map: Map<String, Any>?) {
output.writeInt(map!!.size)
for (name in map.keys.sorted()) {
IOUtil.writeString(name, output)
val value = map[name]!!
when (value) {
is Int -> {
output.writeByte(Kind.INT.ordinal)
output.writeInt(value)
}
is Float -> {
output.writeByte(Kind.FLOAT.ordinal)
output.writeFloat(value)
}
is Long -> {
output.writeByte(Kind.LONG.ordinal)
output.writeLong(value)
}
is Double -> {
output.writeByte(Kind.DOUBLE.ordinal)
output.writeDouble(value)
}
is String -> {
output.writeByte(Kind.STRING.ordinal)
IOUtil.writeString(value, output)
}
else -> throw IllegalStateException("Unexpected constant class: ${value.javaClass}")
}
}
}
override fun read(input: DataInput): Map<String, Any>? {
val size = input.readInt()
val map = HashMap<String, Any>(size)
repeat(size) {
val name = IOUtil.readString(input)!!
val kind = Kind.values()[input.readByte().toInt()]
val value: Any = when (kind) {
Kind.INT -> input.readInt()
Kind.FLOAT -> input.readFloat()
Kind.LONG -> input.readLong()
Kind.DOUBLE -> input.readDouble()
Kind.STRING -> IOUtil.readString(input)!!
}
map[name] = value
}
return map
}
private enum class Kind {
INT, FLOAT, LONG, DOUBLE, STRING
}
}
object IntExternalizer : DataExternalizer<Int> {
override fun read(input: DataInput): Int = input.readInt()
override fun save(output: DataOutput, value: Int) {
output.writeInt(value)
}
}
object PathStringDescriptor : EnumeratorStringDescriptor() {
override fun getHashCode(value: String) = FileUtil.pathHashCode(value)
override fun isEqual(val1: String, val2: String?) = FileUtil.pathsEqual(val1, val2)
}
object FileKeyDescriptor : KeyDescriptor<File> {
override fun read(input: DataInput): File = File(input.readUTF())
override fun save(output: DataOutput, value: File) {
output.writeUTF(value.canonicalPath)
}
override fun getHashCode(value: File?): Int =
FileUtil.FILE_HASHING_STRATEGY.computeHashCode(value)
override fun isEqual(val1: File?, val2: File?): Boolean =
FileUtil.FILE_HASHING_STRATEGY.equals(val1, val2)
}
open class CollectionExternalizer<T>(
private val elementExternalizer: DataExternalizer<T>,
private val newCollection: () -> MutableCollection<T>
) : DataExternalizer<Collection<T>> {
override fun read(input: DataInput): Collection<T> {
val result = newCollection()
val stream = input as DataInputStream
while (stream.available() > 0) {
result.add(elementExternalizer.read(stream))
}
return result
}
override fun save(output: DataOutput, value: Collection<T>) {
value.forEach { elementExternalizer.save(output, it) }
}
}
object StringCollectionExternalizer : CollectionExternalizer<String>(EnumeratorStringDescriptor(), { HashSet() })
object IntCollectionExternalizer : CollectionExternalizer<Int>(IntExternalizer, { HashSet() })

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.storage
data class LookupSymbolKey(val nameHash: Int, val scopeHash: Int) : Comparable<LookupSymbolKey> {
constructor(name: String, scope: String) : this(name.hashCode(), scope.hashCode())
override fun compareTo(other: LookupSymbolKey): Int {
val nameCmp = nameHash.compareTo(other.nameHash)
if (nameCmp != 0) return nameCmp
return scopeHash.compareTo(other.scopeHash)
}
}
data class ProtoMapValue(val isPackageFacade: Boolean, val bytes: ByteArray, val strings: Array<String>)

View File

@@ -0,0 +1,131 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.modules
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.openapi.util.text.StringUtil.escapeXml
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser.*
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.utils.Printer
import java.io.File
class KotlinModuleXmlBuilder {
private val xml = StringBuilder()
private val p = Printer(xml)
private var done = false
init {
openTag(p, MODULES)
}
fun addModule(
moduleName: String,
outputDir: String,
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
friendDirs: Iterable<File>): KotlinModuleXmlBuilder {
assert(!done) { "Already done" }
p.println("<!-- Module script for ${if (isTests) "tests" else "production"} -->")
p.println("<", MODULE, " ",
NAME, "=\"", escapeXml(moduleName), "\" ",
TYPE, "=\"", escapeXml(targetTypeId), "\" ",
OUTPUT_DIR, "=\"", getEscapedPath(File(outputDir)), "\">")
p.pushIndent()
for (friendDir in friendDirs) {
p.println("<", FRIEND_DIR, " ", PATH, "=\"", getEscapedPath(friendDir), "\"/>")
}
for (sourceFile in sourceFiles) {
p.println("<", SOURCES, " ", PATH, "=\"", getEscapedPath(sourceFile), "\"/>")
}
processJavaSourceRoots(javaSourceRoots)
processClasspath(classpathRoots, directoriesToFilterOut)
closeTag(p, MODULE)
return this
}
private fun processClasspath(
files: Iterable<File>,
directoriesToFilterOut: Set<File>) {
p.println("<!-- Classpath -->")
for (file in files) {
val isOutput = directoriesToFilterOut.contains(file) && !IncrementalCompilation.isEnabled()
if (isOutput) {
// For IDEA's make (incremental compilation) purposes, output directories of the current module and its dependencies
// appear on the class path, so we are at risk of seeing the results of the previous build, i.e. if some class was
// removed in the sources, it may still be there in binaries. Thus, we delete these entries from the classpath.
p.println("<!-- Output directory, commented out -->")
p.println("<!-- ")
p.pushIndent()
}
p.println("<", CLASSPATH, " ", PATH, "=\"", getEscapedPath(file), "\"/>")
if (isOutput) {
p.popIndent()
p.println("-->")
}
}
}
private fun processJavaSourceRoots(roots: Iterable<JvmSourceRoot>) {
p.println("<!-- Java source roots -->")
for (root in roots) {
p.print("<")
p.printWithNoIndent(JAVA_SOURCE_ROOTS, " ", PATH, "=\"", getEscapedPath(root.file), "\"")
if (root.packagePrefix != null) {
p.printWithNoIndent(" ", JAVA_SOURCE_PACKAGE_PREFIX, "=\"", root.packagePrefix, "\"")
}
p.printWithNoIndent("/>")
p.println()
}
}
fun asText(): CharSequence {
if (!done) {
closeTag(p, MODULES)
done = true
}
return xml
}
private fun openTag(p: Printer, tag: String) {
p.println("<$tag>")
p.pushIndent()
}
private fun closeTag(p: Printer, tag: String) {
p.popIndent()
p.println("</$tag>")
}
private fun getEscapedPath(sourceFile: File): String {
return escapeXml(toSystemIndependentName(sourceFile.path))
}
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.testingUtils
import java.io.File
class BuildLogFinder(
private val isExperimentalEnabled: Boolean = false,
private val isDataContainerBuildLogEnabled: Boolean = false,
private val isGradleEnabled: Boolean = false
) {
companion object {
private const val GRADLE_LOG = "gradle-build.log"
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
private const val EXPERIMENTAL_LOG = "experimental-ic-build.log"
private const val SIMPLE_LOG = "build.log"
}
fun findBuildLog(dir: File): File? {
val names = dir.list() ?: arrayOf()
val files = names.filter { File(dir, it).isFile }.toSet()
val matchedName = when {
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isDataContainerBuildLogEnabled && DATA_CONTAINER_LOG in files -> DATA_CONTAINER_LOG
isExperimentalEnabled && EXPERIMENTAL_LOG in files -> EXPERIMENTAL_LOG
SIMPLE_LOG in files -> SIMPLE_LOG
else -> null
}
return File(dir, matchedName ?: return null)
}
}

View File

@@ -0,0 +1,181 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.kotlin.incremental.LocalFileKotlinClass
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.protobuf.ExtensionRegistry
import org.jetbrains.kotlin.serialization.DebugProtoBuf
import org.jetbrains.kotlin.serialization.jvm.BitEncoding
import org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf
import org.jetbrains.kotlin.utils.Printer
import org.jetbrains.org.objectweb.asm.ClassReader
import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor
import org.junit.Assert
import org.junit.Assert.assertNotNull
import java.io.ByteArrayInputStream
import java.io.File
import java.io.PrintWriter
import java.io.StringWriter
import java.util.*
import java.util.zip.CRC32
import kotlin.comparisons.compareBy
// Set this to true if you want to dump all bytecode (test will fail in this case)
private val DUMP_ALL = System.getProperty("comparison.dump.all") == "true"
fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Boolean) {
val pathsInExpected = getAllRelativePaths(expected)
val pathsInActual = getAllRelativePaths(actual)
val commonPaths = pathsInExpected.intersect(pathsInActual)
val changedPaths = commonPaths
.filter { DUMP_ALL || !Arrays.equals(File(expected, it).readBytes(), File(actual, it).readBytes()) }
.sorted()
val expectedString = getDirectoryString(expected, changedPaths)
val actualString = getDirectoryString(actual, changedPaths)
if (DUMP_ALL) {
Assert.assertEquals(expectedString, actualString + " ")
}
if (forgiveExtraFiles) {
// If compilation fails, output may be different for full rebuild and partial make. Parsing output (directory string) for simplicity.
if (changedPaths.isEmpty()) {
val expectedListingLines = expectedString.split('\n').toList()
val actualListingLines = actualString.split('\n').toList()
if (actualListingLines.containsAll(expectedListingLines)) {
return
}
}
}
Assert.assertEquals(expectedString, actualString)
}
private fun File.checksumString(): String {
val crc32 = CRC32()
crc32.update(this.readBytes())
return java.lang.Long.toHexString(crc32.value)
}
private fun getDirectoryString(dir: File, interestingPaths: List<String>): String {
val buf = StringBuilder()
val p = Printer(buf)
fun addDirContent(dir: File) {
p.pushIndent()
val listFiles = dir.listFiles()
assertNotNull("$dir does not exist", listFiles)
val children = listFiles!!.sortedWith(compareBy({ it.isDirectory }, { it.name }))
for (child in children) {
if (child.isDirectory) {
if ((child.list()?.isNotEmpty() ?: false)) {
p.println(child.name)
addDirContent(child)
}
}
else {
p.println(child.name, " ", child.checksumString())
}
}
p.popIndent()
}
p.println(".")
addDirContent(dir)
for (path in interestingPaths) {
p.println("================", path, "================")
p.println(fileToStringRepresentation(File(dir, path)))
p.println()
p.println()
}
return buf.toString()
}
private fun getAllRelativePaths(dir: File): Set<String> {
val result = HashSet<String>()
FileUtil.processFilesRecursively(dir) {
if (it!!.isFile) {
result.add(FileUtil.getRelativePath(dir, it)!!)
}
true
}
return result
}
private fun classFileToString(classFile: File): String {
val out = StringWriter()
val traceVisitor = TraceClassVisitor(PrintWriter(out))
ClassReader(classFile.readBytes()).accept(traceVisitor, 0)
val classHeader = LocalFileKotlinClass.create(classFile)?.classHeader
val annotationDataEncoded = classHeader?.data
if (annotationDataEncoded != null) {
ByteArrayInputStream(BitEncoding.decodeBytes(annotationDataEncoded)).use {
input ->
out.write("\n------ string table types proto -----\n${DebugJvmProtoBuf.StringTableTypes.parseDelimitedFrom(input)}")
if (!classHeader!!.metadataVersion.isCompatible()) {
error("Incompatible class ($classHeader): $classFile")
}
when (classHeader.kind) {
KotlinClassHeader.Kind.FILE_FACADE ->
out.write("\n------ file facade proto -----\n${DebugProtoBuf.Package.parseFrom(input, getExtensionRegistry())}")
KotlinClassHeader.Kind.CLASS ->
out.write("\n------ class proto -----\n${DebugProtoBuf.Class.parseFrom(input, getExtensionRegistry())}")
KotlinClassHeader.Kind.MULTIFILE_CLASS_PART ->
out.write("\n------ multi-file part proto -----\n${DebugProtoBuf.Package.parseFrom(input, getExtensionRegistry())}")
else -> throw IllegalStateException()
}
}
}
return out.toString()
}
private fun getExtensionRegistry(): ExtensionRegistry {
val registry = ExtensionRegistry.newInstance()!!
DebugJvmProtoBuf.registerAllExtensions(registry)
return registry
}
private fun fileToStringRepresentation(file: File): String {
return when {
file.name.endsWith(".class") -> {
classFileToString(file)
}
else -> {
file.readText()
}
}
}

View File

@@ -0,0 +1,181 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import java.io.File
import java.util.*
private val COMMANDS = listOf("new", "touch", "delete")
private val COMMANDS_AS_REGEX_PART = COMMANDS.joinToString("|")
private val COMMANDS_AS_MESSAGE_PART = COMMANDS.joinToString("/") { "\".$it\"" }
enum class TouchPolicy {
TIMESTAMP,
CHECKSUM
}
fun copyTestSources(testDataDir: File, sourceDestinationDir: File, filePrefix: String): Map<File, File> {
val mapping = hashMapOf<File, File>()
FileUtil.copyDir(testDataDir, sourceDestinationDir) {
it.isDirectory || it.name.startsWith(filePrefix) && (it.name.endsWith(".kt") || it.name.endsWith(".java"))
}
for (file in sourceDestinationDir.walk()) {
if (!file.isFile) continue
val renamedFile =
if (filePrefix.isEmpty()) {
file
}
else {
File(sourceDestinationDir, file.name.removePrefix(filePrefix)).apply {
file.renameTo(this)
}
}
mapping[renamedFile] = File(testDataDir, file.name)
}
return mapping
}
fun getModificationsToPerform(
testDataDir: File,
moduleNames: Collection<String>?,
allowNoFilesWithSuffixInTestData: Boolean,
touchPolicy: TouchPolicy
): List<List<Modification>> {
fun getModificationsForIteration(newSuffix: String, touchSuffix: String, deleteSuffix: String): List<Modification> {
fun splitToModuleNameAndFileName(fileName: String): Pair<String?, String> {
val underscore = fileName.indexOf("_")
if (underscore != -1) {
val module = fileName.substring(0, underscore)
assert(moduleNames != null) { "File name has module prefix, but multi-module environment is absent" }
assert(module in moduleNames!!) { "Module not found for file with prefix: $fileName" }
return Pair(module, fileName.substring(underscore + 1))
}
assert(moduleNames == null) { "Test is multi-module, but file has no module prefix: $fileName" }
return Pair(null, fileName)
}
val rules = mapOf<String, (String, File) -> Modification>(
newSuffix to { path, file -> ModifyContent(path, file) },
touchSuffix to { path, file -> TouchFile(path, touchPolicy) },
deleteSuffix to { path, file -> DeleteFile(path) }
)
val modifications = ArrayList<Modification>()
for (file in testDataDir.walkTopDown()) {
if (!file.isFile) continue
val relativeFilePath = file.toRelativeString(testDataDir)
val (suffix, createModification) = rules.entries.firstOrNull { file.path.endsWith(it.key) } ?: continue
val (moduleName, fileName) = splitToModuleNameAndFileName(relativeFilePath)
val srcDir = moduleName?.let { "$it/src" } ?: "src"
modifications.add(createModification(srcDir + "/" + fileName.removeSuffix(suffix), file))
}
return modifications
}
val haveFilesWithoutNumbers = testDataDir.walkTopDown().any { it.name.matches(".+\\.($COMMANDS_AS_REGEX_PART)$".toRegex()) }
val haveFilesWithNumbers = testDataDir.walkTopDown().any { it.name.matches(".+\\.($COMMANDS_AS_REGEX_PART)\\.\\d+$".toRegex()) }
if (haveFilesWithoutNumbers && haveFilesWithNumbers) {
throw IllegalStateException("Bad test data format: files ending with both unnumbered and numbered ${COMMANDS_AS_MESSAGE_PART} were found")
}
if (!haveFilesWithoutNumbers && !haveFilesWithNumbers) {
if (allowNoFilesWithSuffixInTestData) {
return listOf(listOf())
}
else {
throw IllegalStateException("Bad test data format: no files ending with ${COMMANDS_AS_MESSAGE_PART} found")
}
}
if (haveFilesWithoutNumbers) {
return listOf(getModificationsForIteration(".new", ".touch", ".delete"))
}
else {
return (1..10)
.map { getModificationsForIteration(".new.$it", ".touch.$it", ".delete.$it") }
.filter { it.isNotEmpty() }
}
}
abstract class Modification(val path: String) {
abstract fun perform(workDir: File, mapping: MutableMap<File, File>)
override fun toString(): String = "${javaClass.simpleName} $path"
}
class ModifyContent(path: String, val dataFile: File) : Modification(path) {
override fun perform(workDir: File, mapping: MutableMap<File, File>) {
val file = File(workDir, path)
val oldLastModified = file.lastModified()
file.delete()
dataFile.copyTo(file)
val newLastModified = file.lastModified()
if (newLastModified <= oldLastModified) {
//Mac OS and some versions of Linux truncate timestamp to nearest second
file.setLastModified(oldLastModified + 1000)
}
mapping[file] = dataFile
}
}
class TouchFile(path: String, private val touchPolicy: TouchPolicy) : Modification(path) {
override fun perform(workDir: File, mapping: MutableMap<File, File>) {
val file = File(workDir, path)
when (touchPolicy) {
TouchPolicy.TIMESTAMP -> {
val oldLastModified = file.lastModified()
//Mac OS and some versions of Linux truncate timestamp to nearest second
file.setLastModified(Math.max(System.currentTimeMillis(), oldLastModified + 1000))
}
TouchPolicy.CHECKSUM -> {
file.appendText(" ")
}
}
}
}
class DeleteFile(path: String) : Modification(path) {
override fun perform(workDir: File, mapping: MutableMap<File, File>) {
val fileToDelete = File(workDir, path)
if (!fileToDelete.delete()) {
throw AssertionError("Couldn't delete $fileToDelete")
}
mapping.remove(fileToDelete)
}
}

View File

@@ -0,0 +1,100 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: core/deserialization/src/ext_options.debug.proto
package org.jetbrains.kotlin.serialization;
public final class DebugExtOptionsProtoBuf {
private DebugExtOptionsProtoBuf() {}
public static void registerAllExtensions(
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry) {
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.serialization.DebugExtOptionsProtoBuf.stringIdInTable);
}
public static final int SKIP_IN_COMPARISON_FIELD_NUMBER = 50000;
/**
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
java.lang.Boolean> skipInComparison = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int NAME_ID_IN_TABLE_FIELD_NUMBER = 50001;
/**
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
java.lang.Boolean> nameIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int FQ_NAME_ID_IN_TABLE_FIELD_NUMBER = 50002;
/**
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
java.lang.Boolean> fqNameIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int STRING_ID_IN_TABLE_FIELD_NUMBER = 50003;
/**
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
java.lang.Boolean> stringIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n0core/deserialization/src/ext_options.d" +
"ebug.proto\022\"org.jetbrains.kotlin.seriali" +
"zation\032 google/protobuf/descriptor.proto" +
":;\n\022skip_in_comparison\022\035.google.protobuf" +
".FieldOptions\030\320\206\003 \001(\010:9\n\020name_id_in_tabl" +
"e\022\035.google.protobuf.FieldOptions\030\321\206\003 \001(\010" +
":<\n\023fq_name_id_in_table\022\035.google.protobu" +
"f.FieldOptions\030\322\206\003 \001(\010:;\n\022string_id_in_t" +
"able\022\035.google.protobuf.FieldOptions\030\323\206\003 " +
"\001(\010B\031B\027DebugExtOptionsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public org.jetbrains.kotlin.protobuf.ExtensionRegistry assignDescriptors(
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor[] {
org.jetbrains.kotlin.protobuf.DescriptorProtos.getDescriptor(),
}, assigner);
skipInComparison.internalInit(descriptor.getExtensions().get(0));
nameIdInTable.internalInit(descriptor.getExtensions().get(1));
fqNameIdInTable.internalInit(descriptor.getExtensions().get(2));
stringIdInTable.internalInit(descriptor.getExtensions().get(3));
org.jetbrains.kotlin.protobuf.DescriptorProtos.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -6,12 +6,12 @@ package org.jetbrains.kotlin.serialization.jvm;
public final class DebugJvmPackageTable {
private DebugJvmPackageTable() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry) {
}
public interface PackageTableOrBuilder
extends com.google.protobuf.MessageOrBuilder {
public interface PackageTableOrBuilder extends
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.jvm.PackageTable)
org.jetbrains.kotlin.protobuf.MessageOrBuilder {
// repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;
/**
* <code>repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;</code>
*/
@@ -40,14 +40,15 @@ public final class DebugJvmPackageTable {
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageTable}
*/
public static final class PackageTable extends
com.google.protobuf.GeneratedMessage
implements PackageTableOrBuilder {
org.jetbrains.kotlin.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.jvm.PackageTable)
PackageTableOrBuilder {
// Use PackageTable.newBuilder() to construct.
private PackageTable(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
private PackageTable(org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private PackageTable(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private PackageTable(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final PackageTable defaultInstance;
public static PackageTable getDefaultInstance() {
@@ -58,20 +59,20 @@ public final class DebugJvmPackageTable {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
private final org.jetbrains.kotlin.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
public final org.jetbrains.kotlin.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PackageTable(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
org.jetbrains.kotlin.protobuf.UnknownFieldSet.Builder unknownFields =
org.jetbrains.kotlin.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@@ -97,10 +98,10 @@ public final class DebugJvmPackageTable {
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
@@ -110,34 +111,33 @@ public final class DebugJvmPackageTable {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable.Builder.class);
}
public static com.google.protobuf.Parser<PackageTable> PARSER =
new com.google.protobuf.AbstractParser<PackageTable>() {
public static org.jetbrains.kotlin.protobuf.Parser<PackageTable> PARSER =
new org.jetbrains.kotlin.protobuf.AbstractParser<PackageTable>() {
public PackageTable parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return new PackageTable(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<PackageTable> getParserForType() {
public org.jetbrains.kotlin.protobuf.Parser<PackageTable> getParserForType() {
return PARSER;
}
// repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;
public static final int PACKAGE_PARTS_FIELD_NUMBER = 1;
private java.util.List<org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts> packageParts_;
/**
@@ -179,7 +179,8 @@ public final class DebugJvmPackageTable {
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
for (int i = 0; i < getPackagePartsCount(); i++) {
if (!getPackageParts(i).isInitialized()) {
@@ -191,7 +192,7 @@ public final class DebugJvmPackageTable {
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < packageParts_.size(); i++) {
@@ -207,7 +208,7 @@ public final class DebugJvmPackageTable {
size = 0;
for (int i = 0; i < packageParts_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(1, packageParts_.get(i));
}
size += getUnknownFields().getSerializedSize();
@@ -223,24 +224,24 @@ public final class DebugJvmPackageTable {
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.ByteString data)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.ByteString data,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(java.io.InputStream input)
@@ -249,7 +250,7 @@ public final class DebugJvmPackageTable {
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
@@ -259,18 +260,18 @@ public final class DebugJvmPackageTable {
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
com.google.protobuf.CodedInputStream input)
org.jetbrains.kotlin.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
@@ -284,7 +285,7 @@ public final class DebugJvmPackageTable {
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
@@ -292,14 +293,15 @@ public final class DebugJvmPackageTable {
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageTable}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTableOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.jvm.PackageTable)
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTableOrBuilder {
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable
.ensureFieldAccessorsInitialized(
@@ -312,12 +314,12 @@ public final class DebugJvmPackageTable {
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
if (org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getPackagePartsFieldBuilder();
}
}
@@ -340,7 +342,7 @@ public final class DebugJvmPackageTable {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
public org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
}
@@ -373,7 +375,7 @@ public final class DebugJvmPackageTable {
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
public Builder mergeFrom(org.jetbrains.kotlin.protobuf.Message other) {
if (other instanceof org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable) {
return mergeFrom((org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable)other);
} else {
@@ -403,7 +405,7 @@ public final class DebugJvmPackageTable {
packageParts_ = other.packageParts_;
bitField0_ = (bitField0_ & ~0x00000001);
packagePartsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getPackagePartsFieldBuilder() : null;
} else {
packagePartsBuilder_.addAllMessages(other.packageParts_);
@@ -425,13 +427,13 @@ public final class DebugJvmPackageTable {
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageTable) e.getUnfinishedMessage();
throw e;
} finally {
@@ -443,7 +445,6 @@ public final class DebugJvmPackageTable {
}
private int bitField0_;
// repeated .org.jetbrains.kotlin.serialization.jvm.PackageParts package_parts = 1;
private java.util.List<org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts> packageParts_ =
java.util.Collections.emptyList();
private void ensurePackagePartsIsMutable() {
@@ -453,7 +454,7 @@ public final class DebugJvmPackageTable {
}
}
private com.google.protobuf.RepeatedFieldBuilder<
private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder> packagePartsBuilder_;
/**
@@ -585,7 +586,8 @@ public final class DebugJvmPackageTable {
java.lang.Iterable<? extends org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts> values) {
if (packagePartsBuilder_ == null) {
ensurePackagePartsIsMutable();
super.addAll(values, packageParts_);
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, packageParts_);
onChanged();
} else {
packagePartsBuilder_.addAllMessages(values);
@@ -668,11 +670,11 @@ public final class DebugJvmPackageTable {
getPackagePartsBuilderList() {
return getPackagePartsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder>
getPackagePartsFieldBuilder() {
if (packagePartsBuilder_ == null) {
packagePartsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
packagePartsBuilder_ = new org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder>(
packageParts_,
((bitField0_ & 0x00000001) == 0x00000001),
@@ -694,10 +696,10 @@ public final class DebugJvmPackageTable {
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.PackageTable)
}
public interface PackagePartsOrBuilder
extends com.google.protobuf.MessageOrBuilder {
public interface PackagePartsOrBuilder extends
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.jvm.PackageParts)
org.jetbrains.kotlin.protobuf.MessageOrBuilder {
// required string package_fq_name = 1;
/**
* <code>required string package_fq_name = 1;</code>
*/
@@ -709,15 +711,14 @@ public final class DebugJvmPackageTable {
/**
* <code>required string package_fq_name = 1;</code>
*/
com.google.protobuf.ByteString
org.jetbrains.kotlin.protobuf.ByteString
getPackageFqNameBytes();
// repeated string class_name = 2;
/**
* <code>repeated string class_name = 2;</code>
*/
java.util.List<java.lang.String>
getClassNameList();
org.jetbrains.kotlin.protobuf.ProtocolStringList
getClassNameList();
/**
* <code>repeated string class_name = 2;</code>
*/
@@ -729,21 +730,22 @@ public final class DebugJvmPackageTable {
/**
* <code>repeated string class_name = 2;</code>
*/
com.google.protobuf.ByteString
org.jetbrains.kotlin.protobuf.ByteString
getClassNameBytes(int index);
}
/**
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageParts}
*/
public static final class PackageParts extends
com.google.protobuf.GeneratedMessage
implements PackagePartsOrBuilder {
org.jetbrains.kotlin.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.jvm.PackageParts)
PackagePartsOrBuilder {
// Use PackageParts.newBuilder() to construct.
private PackageParts(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
private PackageParts(org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private PackageParts(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private PackageParts(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final PackageParts defaultInstance;
public static PackageParts getDefaultInstance() {
@@ -754,20 +756,20 @@ public final class DebugJvmPackageTable {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
private final org.jetbrains.kotlin.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
public final org.jetbrains.kotlin.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private PackageParts(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
org.jetbrains.kotlin.protobuf.UnknownFieldSet.Builder unknownFields =
org.jetbrains.kotlin.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@@ -784,62 +786,63 @@ public final class DebugJvmPackageTable {
break;
}
case 10: {
org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
packageFqName_ = input.readBytes();
packageFqName_ = bs;
break;
}
case 18: {
org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
className_ = new com.google.protobuf.LazyStringArrayList();
className_ = new org.jetbrains.kotlin.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000002;
}
className_.add(input.readBytes());
className_.add(bs);
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
className_ = new com.google.protobuf.UnmodifiableLazyStringList(className_);
className_ = className_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts.Builder.class);
}
public static com.google.protobuf.Parser<PackageParts> PARSER =
new com.google.protobuf.AbstractParser<PackageParts>() {
public static org.jetbrains.kotlin.protobuf.Parser<PackageParts> PARSER =
new org.jetbrains.kotlin.protobuf.AbstractParser<PackageParts>() {
public PackageParts parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return new PackageParts(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<PackageParts> getParserForType() {
public org.jetbrains.kotlin.protobuf.Parser<PackageParts> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string package_fq_name = 1;
public static final int PACKAGE_FQ_NAME_FIELD_NUMBER = 1;
private java.lang.Object packageFqName_;
/**
@@ -856,8 +859,8 @@ public final class DebugJvmPackageTable {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
org.jetbrains.kotlin.protobuf.ByteString bs =
(org.jetbrains.kotlin.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
packageFqName_ = s;
@@ -868,27 +871,26 @@ public final class DebugJvmPackageTable {
/**
* <code>required string package_fq_name = 1;</code>
*/
public com.google.protobuf.ByteString
public org.jetbrains.kotlin.protobuf.ByteString
getPackageFqNameBytes() {
java.lang.Object ref = packageFqName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
org.jetbrains.kotlin.protobuf.ByteString b =
org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
packageFqName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
return (org.jetbrains.kotlin.protobuf.ByteString) ref;
}
}
// repeated string class_name = 2;
public static final int CLASS_NAME_FIELD_NUMBER = 2;
private com.google.protobuf.LazyStringList className_;
private org.jetbrains.kotlin.protobuf.LazyStringList className_;
/**
* <code>repeated string class_name = 2;</code>
*/
public java.util.List<java.lang.String>
public org.jetbrains.kotlin.protobuf.ProtocolStringList
getClassNameList() {
return className_;
}
@@ -907,19 +909,20 @@ public final class DebugJvmPackageTable {
/**
* <code>repeated string class_name = 2;</code>
*/
public com.google.protobuf.ByteString
public org.jetbrains.kotlin.protobuf.ByteString
getClassNameBytes(int index) {
return className_.getByteString(index);
}
private void initFields() {
packageFqName_ = "";
className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasPackageFqName()) {
memoizedIsInitialized = 0;
@@ -929,7 +932,7 @@ public final class DebugJvmPackageTable {
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
@@ -948,13 +951,13 @@ public final class DebugJvmPackageTable {
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeBytesSize(1, getPackageFqNameBytes());
}
{
int dataSize = 0;
for (int i = 0; i < className_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeBytesSizeNoTag(className_.getByteString(i));
}
size += dataSize;
@@ -973,24 +976,24 @@ public final class DebugJvmPackageTable {
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.ByteString data)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.ByteString data,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(java.io.InputStream input)
@@ -999,7 +1002,7 @@ public final class DebugJvmPackageTable {
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
@@ -1009,18 +1012,18 @@ public final class DebugJvmPackageTable {
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
com.google.protobuf.CodedInputStream input)
org.jetbrains.kotlin.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
@@ -1034,7 +1037,7 @@ public final class DebugJvmPackageTable {
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
@@ -1042,14 +1045,15 @@ public final class DebugJvmPackageTable {
* Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.PackageParts}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
org.jetbrains.kotlin.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.jvm.PackageParts)
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackagePartsOrBuilder {
public static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
protected org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable
.ensureFieldAccessorsInitialized(
@@ -1062,12 +1066,12 @@ public final class DebugJvmPackageTable {
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
org.jetbrains.kotlin.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
if (org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
@@ -1078,7 +1082,7 @@ public final class DebugJvmPackageTable {
super.clear();
packageFqName_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
@@ -1087,7 +1091,7 @@ public final class DebugJvmPackageTable {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
public org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
}
@@ -1113,8 +1117,7 @@ public final class DebugJvmPackageTable {
}
result.packageFqName_ = packageFqName_;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
className_ = new com.google.protobuf.UnmodifiableLazyStringList(
className_);
className_ = className_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.className_ = className_;
@@ -1123,7 +1126,7 @@ public final class DebugJvmPackageTable {
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
public Builder mergeFrom(org.jetbrains.kotlin.protobuf.Message other) {
if (other instanceof org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts) {
return mergeFrom((org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts)other);
} else {
@@ -1162,13 +1165,13 @@ public final class DebugJvmPackageTable {
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
org.jetbrains.kotlin.protobuf.CodedInputStream input,
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.jetbrains.kotlin.serialization.jvm.DebugJvmPackageTable.PackageParts) e.getUnfinishedMessage();
throw e;
} finally {
@@ -1180,7 +1183,6 @@ public final class DebugJvmPackageTable {
}
private int bitField0_;
// required string package_fq_name = 1;
private java.lang.Object packageFqName_ = "";
/**
* <code>required string package_fq_name = 1;</code>
@@ -1194,9 +1196,12 @@ public final class DebugJvmPackageTable {
public java.lang.String getPackageFqName() {
java.lang.Object ref = packageFqName_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
packageFqName_ = s;
org.jetbrains.kotlin.protobuf.ByteString bs =
(org.jetbrains.kotlin.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
packageFqName_ = s;
}
return s;
} else {
return (java.lang.String) ref;
@@ -1205,17 +1210,17 @@ public final class DebugJvmPackageTable {
/**
* <code>required string package_fq_name = 1;</code>
*/
public com.google.protobuf.ByteString
public org.jetbrains.kotlin.protobuf.ByteString
getPackageFqNameBytes() {
java.lang.Object ref = packageFqName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
org.jetbrains.kotlin.protobuf.ByteString b =
org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
packageFqName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
return (org.jetbrains.kotlin.protobuf.ByteString) ref;
}
}
/**
@@ -1244,7 +1249,7 @@ public final class DebugJvmPackageTable {
* <code>required string package_fq_name = 1;</code>
*/
public Builder setPackageFqNameBytes(
com.google.protobuf.ByteString value) {
org.jetbrains.kotlin.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@@ -1254,20 +1259,19 @@ public final class DebugJvmPackageTable {
return this;
}
// repeated string class_name = 2;
private com.google.protobuf.LazyStringList className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private org.jetbrains.kotlin.protobuf.LazyStringList className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
private void ensureClassNameIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
className_ = new com.google.protobuf.LazyStringArrayList(className_);
className_ = new org.jetbrains.kotlin.protobuf.LazyStringArrayList(className_);
bitField0_ |= 0x00000002;
}
}
/**
* <code>repeated string class_name = 2;</code>
*/
public java.util.List<java.lang.String>
public org.jetbrains.kotlin.protobuf.ProtocolStringList
getClassNameList() {
return java.util.Collections.unmodifiableList(className_);
return className_.getUnmodifiableView();
}
/**
* <code>repeated string class_name = 2;</code>
@@ -1284,7 +1288,7 @@ public final class DebugJvmPackageTable {
/**
* <code>repeated string class_name = 2;</code>
*/
public com.google.protobuf.ByteString
public org.jetbrains.kotlin.protobuf.ByteString
getClassNameBytes(int index) {
return className_.getByteString(index);
}
@@ -1320,7 +1324,8 @@ public final class DebugJvmPackageTable {
public Builder addAllClassName(
java.lang.Iterable<java.lang.String> values) {
ensureClassNameIsMutable();
super.addAll(values, className_);
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, className_);
onChanged();
return this;
}
@@ -1328,7 +1333,7 @@ public final class DebugJvmPackageTable {
* <code>repeated string class_name = 2;</code>
*/
public Builder clearClassName() {
className_ = com.google.protobuf.LazyStringArrayList.EMPTY;
className_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
@@ -1337,7 +1342,7 @@ public final class DebugJvmPackageTable {
* <code>repeated string class_name = 2;</code>
*/
public Builder addClassNameBytes(
com.google.protobuf.ByteString value) {
org.jetbrains.kotlin.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@@ -1358,22 +1363,22 @@ public final class DebugJvmPackageTable {
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.PackageParts)
}
private static com.google.protobuf.Descriptors.Descriptor
private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
private static final org.jetbrains.kotlin.protobuf.Descriptors.Descriptor
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
public static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
private static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
@@ -1386,31 +1391,31 @@ public final class DebugJvmPackageTable {
"\nclass_name\030\002 \003(\tB\026B\024DebugJvmPackageTabl" +
"e"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor,
new java.lang.String[] { "PackageParts", });
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor,
new java.lang.String[] { "PackageFqName", "ClassName", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public org.jetbrains.kotlin.protobuf.ExtensionRegistry assignDescriptors(
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageTable_descriptor,
new java.lang.String[] { "PackageParts", });
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_serialization_jvm_PackageParts_descriptor,
new java.lang.String[] { "PackageFqName", "ClassName", });
}
// @@protoc_insertion_point(outer_class_scope)
}
}

641
build.xml
View File

@@ -1,4 +1,5 @@
<project name="Kotlin" default="dist" xmlns:if="ant:if" xmlns:unless="ant:unless">
<import file="common.xml" optional="false"/>
<property file="resources/kotlinManifest.properties"/>
<!-- Set to false to disable proguard run on kotlin-compiler.jar. Speeds up the build -->
@@ -6,27 +7,29 @@
<!-- Set to false to disable compiler's javadoc generation. Speeds up the build -->
<property name="generate.javadoc" value="true"/>
<!-- Set to false to prevent jarjar and metadata stripping on kotlin-reflect.jar and reflection sources. Use to debug reflection -->
<property name="obfuscate.reflect" value="true"/>
<property name="max.heap.size.for.forked.jvm" value="1024m"/>
<property name="bootstrap.home" value="${basedir}/dependencies/bootstrap-compiler"/>
<property name="bootstrap.compiler.home" value="${bootstrap.home}/Kotlin/kotlinc"/>
<property name="bootstrap.runtime" value="${bootstrap.compiler.home}/lib/kotlin-runtime.jar"/>
<property name="bootstrap.reflect" value="${bootstrap.compiler.home}/lib/kotlin-reflect.jar"/>
<property name="bootstrap.script.runtime" value="${bootstrap.compiler.home}/lib/kotlin-script-runtime.jar"/>
<property name="bootstrap.kotlin.test" value="${bootstrap.compiler.home}/lib/kotlin-test.jar" />
<property name="output" value="${basedir}/dist"/>
<property name="intermediate-sources" value="out/src" />
<property name="kotlin-home" value="${output}/kotlinc"/>
<property name="build.number" value="snapshot"/>
<property name="bootstrap.build.no.tests" value="false"/>
<property name="idea.sdk" value="${basedir}/ideaSDK"/>
<property name="protobuf.jar" value="${idea.sdk}/lib/protobuf-2.5.0.jar"/>
<property name="protobuf-lite.jar" value="${basedir}/dependencies/protobuf-2.5.0-lite.jar"/>
<property name="protobuf.jar" value="${basedir}/dependencies/protobuf-2.6.1.jar"/>
<property name="protobuf-lite.jar" value="${basedir}/dependencies/protobuf-2.6.1-lite.jar"/>
<property name="javax.inject.jar" value="${basedir}/lib/javax.inject.jar"/>
<property name="java.target" value="1.6"/>
<property name="dependencies.dir" value="${basedir}/dependencies"/>
<condition property="bootstrap.or.local.build" value="true">
<or>
<istrue value="${bootstrap.build.no.tests}"/>
@@ -38,6 +41,10 @@
<include file="jslib_files.xml" />
<property name="compiled.stdlib.js" value="stdlib.js"/>
<property name="compiled.stdlib.meta.js" value="kotlin.meta.js"/>
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData"/>
<!--
The compiler produced on the first step of the build (Bootstrap No Tests) is only guaranteed to work against the OLD runtime
located in dependencies/bootstrap-compiler/.../kotlin-runtime.jar, because the newly built compiler is just a Kotlin application,
@@ -48,21 +55,23 @@
little to no differences between the new and the newest runtime.
-->
<condition property="compiler.manifest.class.path"
value="kotlin-runtime-internal-bootstrap.jar kotlin-reflect-internal-bootstrap.jar"
else="kotlin-runtime.jar kotlin-reflect.jar">
value="kotlin-runtime-internal-bootstrap.jar kotlin-reflect-internal-bootstrap.jar kotlin-script-runtime-internal-bootstrap.jar"
else="kotlin-runtime.jar kotlin-reflect.jar kotlin-script-runtime.jar">
<istrue value="${bootstrap.or.local.build}"/>
</condition>
<path id="classpath">
<file file="${bootstrap.runtime}"/>
<file file="${bootstrap.kotlin.test}" />
<file file="${bootstrap.reflect}"/>
<file file="${bootstrap.script.runtime}"/>
<fileset dir="${idea.sdk}" includes="core/*.jar"/>
<pathelement location="${protobuf.jar}"/>
<fileset dir="${basedir}/lib" includes="**/*.jar"/>
<fileset dir="${dependencies.dir}" includes="jansi.jar"/>
<fileset dir="${dependencies.dir}" includes="jline.jar"/>
<fileset dir="${dependencies.dir}" includes="cli-parser-1.1.1.jar"/>
<fileset dir="${dependencies}" includes="jansi.jar"/>
<fileset dir="${dependencies}" includes="jline.jar"/>
<fileset dir="${dependencies}" includes="cli-parser-1.1.2.jar"/>
<fileset dir="${basedir}/ideaSDK/jps" includes="jps-model.jar"/>
</path>
@@ -82,12 +91,17 @@
<include name="core/util.runtime/src"/>
<include name="compiler/backend/src"/>
<include name="compiler/backend-common/src"/>
<include name="compiler/ir/backend.common/src"/>
<include name="compiler/ir/backend.jvm/src"/>
<include name="compiler/ir/ir.psi2ir/src"/>
<include name="compiler/ir/ir.tree/src"/>
<include name="compiler/builtins-serializer/src"/>
<include name="compiler/cli/src"/>
<include name="compiler/cli/cli-common/src"/>
<include name="compiler/conditional-preprocessor/src/"/>
<include name="compiler/container/src"/>
<include name="compiler/frontend/src"/>
<include name="compiler/resolution/src"/>
<include name="compiler/frontend.java/src"/>
<include name="compiler/light-classes/src"/>
<include name="compiler/plugin-api/src"/>
@@ -107,6 +121,7 @@
<property name="idea.out" value="${basedir}/out/production"/>
<patternset id="compilerClassesFromIDEA.fileset">
<include name="frontend/**"/>
<include name="resolution/**"/>
<include name="container/**"/>
<include name="descriptors/**"/>
<include name="deserialization/**"/>
@@ -115,10 +130,15 @@
<include name="frontend.java/**"/>
<include name="backend/**"/>
<include name="backend-common/**"/>
<include name="backend.common/**"/>
<include name="backend.jvm/**"/>
<include name="ir.psi2ir/**"/>
<include name="ir.tree/**"/>
<include name="cli/**"/>
<include name="cli-common/**"/>
<include name="conditional-preprocessor/**"/>
<include name="daemon/**"/>
<include name="daemon-common/**"/>
<include name="util/**"/>
<include name="util.runtime/**"/>
<include name="light-classes/**"/>
@@ -177,19 +197,35 @@
<sequential if:true="${bootstrap.or.local.build}">
<copy file="${bootstrap.runtime}" tofile="${kotlin-home}/lib/kotlin-runtime-internal-bootstrap.jar"/>
<copy file="${bootstrap.reflect}" tofile="${kotlin-home}/lib/kotlin-reflect-internal-bootstrap.jar"/>
<copy file="${bootstrap.script.runtime}" tofile="${kotlin-home}/lib/kotlin-script-runtime-internal-bootstrap.jar"/>
<copy file="${bootstrap.kotlin.test}" tofile="${kotlin-home}/lib/kotlin-test-internal-bootstrap.jar" failonerror="false"/>
<jar destfile="${kotlin-home}/lib/kotlin-reflect-internal-bootstrap.jar" update="true">
<manifest>
<attribute name="Class-Path" value="kotlin-runtime-internal-bootstrap.jar"/>
</manifest>
</jar>
<jar destfile="${kotlin-home}/lib/kotlin-test-internal-bootstrap.jar" update="true">
<manifest>
<attribute name="Class-Path" value="kotlin-runtime-internal-bootstrap.jar"/>
</manifest>
</jar>
</sequential>
<sequential unless:true="${bootstrap.or.local.build}">
<copy file="${bootstrap.runtime}" todir="${kotlin-home}/lib"/>
<copy file="${bootstrap.reflect}" todir="${kotlin-home}/lib"/>
<copy file="${bootstrap.script.runtime}" todir="${kotlin-home}/lib"/>
<copy file="${bootstrap.kotlin.test}" todir="${kotlin-home}/lib"/>
</sequential>
</target>
<target name="copy-dist-to-bootstrap">
<delete dir="${basedir}/dependencies/bootstrap-compiler/Kotlin/kotlinc" />
<copy todir="${basedir}/dependencies/bootstrap-compiler/Kotlin/kotlinc">
<fileset dir="${basedir}/dist/kotlinc" />
</copy>
</target>
<target name="compiler-sources">
<jar jarfile="${output}/kotlin-compiler-sources.jar">
<!-- TODO How to convert it from pathset or dirset ? -->
@@ -199,6 +235,10 @@
<fileset dir="core/util.runtime/src"/>
<fileset dir="compiler/backend/src"/>
<fileset dir="compiler/backend-common/src"/>
<fileset dir="compiler/ir/backend.common/src"/>
<fileset dir="compiler/ir/backend.jvm/src"/>
<fileset dir="compiler/ir/ir.psi2ir/src"/>
<fileset dir="compiler/ir/ir.tree/src"/>
<fileset dir="compiler/builtins-serializer/src"/>
<fileset dir="compiler/cli/src"/>
<fileset dir="compiler/cli/cli-common/src"/>
@@ -207,6 +247,7 @@
<fileset dir="compiler/daemon/daemon-common/src"/>
<fileset dir="compiler/container/src"/>
<fileset dir="compiler/frontend/src"/>
<fileset dir="compiler/resolution/src"/>
<fileset dir="compiler/frontend.java/src"/>
<fileset dir="compiler/light-classes/src"/>
<fileset dir="compiler/plugin-api/src"/>
@@ -292,80 +333,121 @@
<arg value="-output"/>
<arg value="@{output}"/>
<arg value="-no-stdlib"/>
<arg value="-version"/>
<arg value="-meta-info"/>
<arg value="-kjsm"/>
<arg line="-main noCall"/>
<arg line="-module-kind commonjs"/>
</java>
</sequential>
</macrodef>
<target name="js-stdlib">
<property name="compiled.builtins.js" value="builtins.js"/>
<property name="compiled.builtins.meta.js" value="builtins.meta.js"/>
<property name="compiled.stdlib.js" value="stdlib.js"/>
<property name="compiled.stdlib.meta.js" value="stdlib.meta.js"/>
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData"/>
<kotlin-pp src="libraries/stdlib/src" output="${intermediate-sources}/stdlib/js" profile="JS" />
<new-kotlin2js output="${output}/js/${compiled.builtins.js}">
<src>
<fileset refid="kotlin.builtin.files"/>
</src>
</new-kotlin2js>
<new-kotlin2js output="${output}/js/${compiled.stdlib.js}">
<src>
<resources refid="js.lib.files"/>
</src>
</new-kotlin2js>
<taskdef name="closure-compiler"
classname="com.google.javascript.jscomp.ant.CompileTask"
classpath="${dependencies.dir}/closure-compiler.jar"/>
<target name="js-stdlib-merge">
<!-- value should be one of: whitespace, simple, advanced -->
<property name="compilationLevel" value="whitespace"/>
<!-- value should be one of: default, quiet, verbose -->
<property name="warningLevel" value="default"/>
<taskdef name="closure-compiler"
classname="com.google.javascript.jscomp.ant.CompileTask"
classpath="${dependencies}/closure-compiler.jar"/>
<closure-compiler
compilationLevel="${compilationLevel}"
prettyprint="true"
languagein="ECMASCRIPT5_STRICT"
warning="${warningLevel}"
output="${output}/js/kotlin.js">
output="${js.stdlib.output.dir}/kotlin.js"
outputWrapperFile="${stdlib.js.dir}/closure-wrapper.txt">
<sources dir="${stdlib.js.dir}">
<file name="kotlin_lib_ecma5.js"/>
<file name="kotlin_lib.js"/>
<file name="maps.js"/>
<file name="long.js"/>
</sources>
<sources dir="${output}/js">
<file name="${compiled.builtins.js}"/>
</sources>
<sources dir="${output}/js">
<sources dir="${js.stdlib.output.dir}">
<file name="builtins.js"/>
<file name="${compiled.stdlib.js}"/>
</sources>
<sources dir="${stdlib.js.dir}">
<file name="export_Kotlin_if_possible.js"/>
</sources>
<externs dir="${stdlib.js.dir}">
<file name="externs.js"/>
</externs>
</closure-compiler>
<!--
Few hacks to compose one kotlin.js from several smaller files:
1. Wrapper function takes Kotlin and _, whereas they are already defined above (see closure-wrapper.txt), so delete these
parameters.
2. Since we deleted parameters, we can get rid or arguments passed to wrapper function.
They are module.exports and require("Kotlin"), accordingly to CommonJS spec.
3. We can omit return _, since it's already exported by the code in UMD wrapper.
-->
<replaceregexp file="${js.stdlib.output.dir}/kotlin.js"
match="module.exports,\s*require\([^)]+\)"
replace=""
byline="true" encoding="UTF-8" />
<replaceregexp file="${js.stdlib.output.dir}/kotlin.js"
match="function\s*\(_,\s*Kotlin\)"
replace="function()"
byline="true" encoding="UTF-8" />
<replaceregexp file="${js.stdlib.output.dir}/kotlin.js"
match="return\s+_;"
replace=""
byline="true" encoding="UTF-8" />
</target>
<target name="js-stdlib">
<property environment="env"/>
<kotlin-pp src="libraries/stdlib/src" output="${intermediate-sources}/stdlib/js" profile="JS" />
<!-- We don't want descriptors for built-ins to be serialized, so we compile these files separately. -->
<new-kotlin2js output="${js.stdlib.output.dir}/tmp-builtins/kotlin.js">
<src>
<union>
<resources refid="kotlin.builtin.native.files"/>
</union>
</src>
</new-kotlin2js>
<new-kotlin2js output="${js.stdlib.output.dir}/tmp/kotlin.js">
<src>
<union>
<fileset refid="kotlin.builtin.files"/>
<resources refid="js.lib.files"/>
</union>
</src>
</new-kotlin2js>
<move file="${js.stdlib.output.dir}/tmp-builtins/kotlin.js" tofile="${js.stdlib.output.dir}/builtins.js" />
<move file="${js.stdlib.output.dir}/tmp/kotlin.js" tofile="${js.stdlib.output.dir}/${compiled.stdlib.js}" />
<move file="${js.stdlib.output.dir}/tmp/kotlin" todir="${js.stdlib.output.dir}" />
<move file="${js.stdlib.output.dir}/tmp/${compiled.stdlib.meta.js}" tofile="${js.stdlib.output.dir}/${compiled.stdlib.meta.js}" />
<condition property="jdk17" value="${env.JDK_17}" else="${env.JAVA_HOME}">
<isset property="env.JDK_17" />
</condition>
<java classname="org.apache.tools.ant.launch.Launcher"
fork="true"
failonerror="true"
timeout="4000000"
taskname="startAnt"
jvm="${jdk17}/bin/java">
<env key="JAVA_HOME" value="${jdk17}"/>
<classpath>
<pathelement location="${ant.home}/lib/ant-launcher.jar"/>
</classpath>
<arg line="-f" />
<arg line="build.xml" />
<arg line="js-stdlib-merge" />
</java>
<jar jarfile="${kotlin-home}/lib/kotlin-jslib.jar" duplicate="fail">
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<zipfileset dir="${output}/js" prefix="">
<zipfileset dir="${js.stdlib.output.dir}" prefix="">
<include name="kotlin.js"/>
<include name="${compiled.stdlib.meta.js}"/>
<include name="stdlib/**"/>
<include name="kotlin/**"/>
</zipfileset>
<manifest>
@@ -469,7 +551,6 @@
<fileset dir="${output}/classes/compiler"/>
<fileset dir="${output}/builtins">
<include name="kotlin/**"/>
<exclude name="kotlin/internal/**"/>
</fileset>
<fileset dir="${basedir}/core/descriptor.loader.java/src" includes="META-INF/services/**"/>
<fileset dir="${basedir}/compiler/frontend.java/src" includes="META-INF/services/**"/>
@@ -488,8 +569,8 @@
<zipfileset src="${idea.sdk}/lib/jna-platform.jar"/>
<zipfileset src="${idea.sdk}/lib/oromatcher.jar"/>
<zipfileset src="${idea.sdk}/jps/jps-model.jar"/>
<zipfileset src="${dependencies.dir}/jline.jar"/>
<zipfileset src="${dependencies.dir}/cli-parser-1.1.1.jar"/>
<zipfileset src="${dependencies}/jline.jar"/>
<zipfileset src="${dependencies}/cli-parser-1.1.2.jar"/>
<zipfileset src="${protobuf.jar}"/>
<manifest>
@@ -522,8 +603,8 @@
<target name="compiler">
<taskdef resource="proguard/ant/task.properties">
<classpath>
<pathelement path="${dependencies.dir}/proguard.jar"/>
<pathelement path="${dependencies.dir}/proguard-anttask.jar"/>
<pathelement path="${dependencies}/proguard.jar"/>
<pathelement path="${dependencies}/proguard-anttask.jar"/>
</classpath>
</taskdef>
@@ -531,8 +612,10 @@
<javac2 destdir="${output}/classes/compiler" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-compiler"/>
<skip pattern="kotlin/jvm/internal/.*"/>
<withKotlin modulename="kotlin-compiler">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/Metadata"/>
<src refid="compilerSources.path"/>
<classpath refid="classpath"/>
</javac2>
@@ -570,6 +653,9 @@
<zipfileset src="${bootstrap.reflect}">
<patternset refid="lib.metainf.patternset"/>
</zipfileset>
<zipfileset src="${bootstrap.script.runtime}">
<patternset refid="lib.metainf.patternset"/>
</zipfileset>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
@@ -583,6 +669,91 @@
</jar>
</target>
<target name="kotlin-build-common">
<cleandir dir="${output}/classes/kotlin-build-common"/>
<javac2 destdir="${output}/classes/kotlin-build-common" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-build-common">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/Metadata"/>
<src>
<pathelement path="build-common/src"/>
</src>
<classpath>
<pathelement path="${bootstrap.runtime}"/>
<pathelement path="${bootstrap.reflect}"/>
<pathelement path="${bootstrap.script.runtime}"/>
<pathelement path="${idea.sdk}/lib/util.jar"/>
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
</classpath>
</javac2>
<jar destfile="${kotlin-home}/lib/kotlin-build-common.jar">
<fileset dir="${output}/classes/kotlin-build-common"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.build.common}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
<jar jarfile="${output}/kotlin-build-common-sources.jar">
<fileset dir="build-common/src"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.build.common.sources}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</target>
<target name="kotlin-build-common-test">
<cleandir dir="${output}/classes/kotlin-build-common-test"/>
<javac2 destdir="${output}/classes/kotlin-build-common-test" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-build-common"/>
<skip pattern="kotlin/Metadata"/>
<src path="build-common/test"/>
<classpath>
<pathelement path="${bootstrap.runtime}"/>
<pathelement path="${bootstrap.reflect}"/>
<pathelement path="${bootstrap.script.runtime}"/>
<pathelement path="${bootstrap.kotlin.test}"/>
<pathelement path="${protobuf.jar}"/>
<pathelement path="${idea.sdk}/lib/junit-4.12.jar"/>
<pathelement path="${kotlin-home}/lib/kotlin-build-common.jar"/>
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
</classpath>
</javac2>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="dependencies/jarjar.jar"/>
<jarjar jarfile="${kotlin-home}/lib/kotlin-build-common-test.jar">
<fileset dir="${output}/classes/kotlin-build-common-test"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<zipfileset src="${protobuf.jar}"/>
<rule pattern="com.intellij.**" result="org.jetbrains.kotlin.com.intellij.@1"/>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.build.common}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jarjar>
</target>
<target name="daemon-client">
<cleandir dir="${output}/classes/daemon-client"/>
@@ -591,40 +762,110 @@
<pathelement path="compiler/daemon/daemon-client/src"/>
</src>
<classpath>
<pathelement path="${bootstrap.runtime}"/>
<pathelement path="${bootstrap.reflect}"/>
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
<pathelement path="${dependencies.dir}/native-platform-uberjar.jar"/>
<pathelement path="${dependencies}/native-platform-uberjar.jar"/>
</classpath>
</kotlinc>
<jar destfile="${kotlin-home}/lib/kotlin-daemon-client.jar">
<fileset dir="${output}/classes/daemon-client"/>
<zipfileset src="${dependencies.dir}/native-platform-uberjar.jar" includes="**" />
<zipfileset src="${dependencies}/native-platform-uberjar.jar" includes="**" />
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.daemon-client}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
<jar jarfile="${output}/kotlin-daemon-client-sources.jar">
<fileset dir="compiler/daemon/daemon-common/src"/>
<fileset dir="compiler/daemon/daemon-client/src"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.daemon.client.sources}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</target>
<target name="android-compiler-plugin">
<cleandir dir="${output}/classes/android-compiler-plugin"/>
<javac2 destdir="${output}/classes/android-compiler-plugin" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false">
<withKotlin modulename="kotlin-android-compiler-plugin"/>
<skip pattern="kotlin/jvm/internal/.*"/>
<target name="android-extensions-compiler">
<cleandir dir="${output}/classes/android-extensions/android-extensions-compiler"/>
<javac2 destdir="${output}/classes/android-extensions/android-extensions-compiler" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false">
<withKotlin modulename="kotlin-android-extensions-compiler">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/Metadata"/>
<src>
<pathelement path="plugins/android-compiler-plugin/src"/>
<pathelement path="plugins/android-extensions/android-extensions-compiler/src"/>
</src>
<classpath>
<pathelement path="${idea.sdk}/core/intellij-core.jar"/>
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
</classpath>
</javac2>
<jar destfile="${kotlin-home}/lib/android-extensions-compiler.jar">
<fileset dir="${output}/classes/android-extensions/android-extensions-compiler"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<fileset dir="${basedir}/plugins/android-extensions/android-extensions-compiler/src" includes="META-INF/services/**"/>
</jar>
</target>
<target name="annotation-processing-under-jdk8">
<property environment="env"/>
<condition property="jdk18" value="${env.JDK_18}" else="${env.JAVA_HOME}">
<isset property="env.JDK_18" />
</condition>
<java classname="org.apache.tools.ant.launch.Launcher"
fork="true"
failonerror="true"
timeout="4000000"
taskname="startAnt"
jvm="${jdk18}/bin/java">
<env key="JAVA_HOME" value="${jdk18}"/>
<classpath>
<pathelement location="${ant.home}/lib/ant-launcher.jar"/>
</classpath>
<arg line="-f" />
<arg line="build.xml" />
<arg line="annotation-processing" />
</java>
</target>
<target name="annotation-processing">
<cleandir dir="${output}/classes/annotation-processing"/>
<javac2 destdir="${output}/classes/annotation-processing" debug="true" debuglevel="lines,vars,source"
includeAntRuntime="false" source="${java.target}" target="${java.target}">
<withKotlin modulename="annotation-processing">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/Metadata"/>
<src>
<pathelement path="plugins/annotation-processing/src"/>
<pathelement path="plugins/java-model-wrappers/src"/>
</src>
<classpath>
<pathelement path="${idea.sdk}/core/intellij-core.jar"/>
<pathelement path="${kotlin-home}/lib/kotlin-compiler.jar"/>
<pathelement path="${bootstrap.runtime}"/>
<pathelement path="${bootstrap.reflect}"/>
<pathelement path="${bootstrap.script.runtime}"/>
</classpath>
</javac2>
<jar destfile="${kotlin-home}/lib/android-compiler-plugin.jar">
<fileset dir="${output}/classes/android-compiler-plugin"/>
<jar destfile="${kotlin-home}/lib/kotlin-annotation-processing.jar">
<fileset dir="${output}/classes/annotation-processing"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
<fileset dir="${basedir}/plugins/android-compiler-plugin/src" includes="META-INF/services/**"/>
<fileset dir="${basedir}/plugins/annotation-processing/src" includes="META-INF/services/**"/>
</jar>
</target>
@@ -632,8 +873,10 @@
<cleandir dir="${output}/classes/ant"/>
<javac2 destdir="${output}/classes/ant" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-ant-tools"/>
<skip pattern="kotlin/jvm/internal/.*"/>
<withKotlin modulename="kotlin-ant-tools">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/Metadata"/>
<src>
<dirset dir="${basedir}/ant">
<include name="src"/>
@@ -641,9 +884,7 @@
</src>
<compilerarg value="-Xlint:all"/>
<classpath>
<file file="${bootstrap.runtime}"/>
<file file="${bootstrap.reflect}"/>
<pathelement location="${dependencies.dir}/ant-1.8/lib/ant.jar"/>
<pathelement location="${dependencies}/ant-1.8/lib/ant.jar"/>
<pathelement location="${kotlin-home}/lib/kotlin-preloader.jar"/>
</classpath>
</javac2>
@@ -665,30 +906,6 @@
</jar>
</target>
<target name="jdk-annotations">
<jar destfile="${kotlin-home}/lib/kotlin-jdk-annotations.jar">
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.jdk.annotations}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</target>
<target name="android-sdk-annotations">
<jar destfile="${kotlin-home}/lib/kotlin-android-sdk-annotations.jar">
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.android.sdk.annotations}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</target>
<macrodef name="new-kotlinc">
<attribute name="output"/>
<attribute name="moduleName"/>
@@ -725,16 +942,18 @@
<arg value="-d"/>
<arg value="@{output}"/>
<arg value="-no-stdlib"/>
<arg value="-version"/>
<arg line="@{additionalOptions}"/>
<arg value="-classpath"/>
<arg value="${toString:classpath.path}"/>
<arg value="-module-name"/>
<arg value="@{moduleName}"/>
<arg value="-Xallow-kotlin-package"/>
</java>
<javac2 srcdir="${toString:src.dirset}" destdir="@{output}" debug="true" debuglevel="lines,vars,source"
includeAntRuntime="false" source="${java.target}" target="${java.target}">
<skip pattern="kotlin/jvm/internal/.*"/>
<skip pattern="kotlin/Metadata"/>
<classpath>
<path refid="classpath.path"/>
<!-- Include @{output} here for Java compiler to resolve symbols from Kotlin sources -->
@@ -774,23 +993,45 @@
<include name="core/runtime.jvm/src"/>
</src>
<class-path>
<!-- Need something to pass to compiler's "-classpath" here -->
<pathelement location="core/builtins/src"/>
<!-- TODO: serialize and compile built-ins in one step here instead -->
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
</target>
<target name="stdlib">
<new-kotlinc output="${output}/classes/stdlib" moduleName="kotlin-stdlib">
<new-kotlinc output="${output}/classes/stdlib" moduleName="kotlin-stdlib" additionalOptions="-Xmultifile-parts-inherit -Xdump-declarations-to ${output}/declarations/stdlib-declarations.json">
<src>
<include name="libraries/stdlib/src"/>
</src>
<class-path>
<pathelement path="${output}/classes/builtins"/>
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
</target>
<target name="kotlin-test">
<new-kotlinc output="${output}/classes/kotlin-test" moduleName="kotlin-test">
<src>
<include name="libraries/kotlin.test/shared/src/main/kotlin" />
<include name="libraries/kotlin.test/shared/src/main/kotlin.jvm" />
<include name="libraries/kotlin.test/junit/src/main/kotlin" />
</src>
<class-path>
<pathelement path="${output}/classes/builtins"/>
<pathelement path="libraries/lib/junit-4.11.jar"/>
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
<pack-runtime-jar jar-name="kotlin-test.jar" implementation-title="${manifest.impl.title.kotlin.test}">
<jar-content>
<fileset dir="${output}/classes/kotlin-test" includes="**/*" excludes="kotlin/internal/OnlyInputTypes*,kotlin/internal/InlineOnly*,kotlin/internal"/>
</jar-content>
</pack-runtime-jar>
</target>
<target name="core">
<new-kotlinc output="${output}/classes/core" moduleName="kotlin-core">
<src>
@@ -805,6 +1046,7 @@
<pathelement path="${output}/classes/stdlib"/>
<pathelement path="${protobuf-lite.jar}"/>
<pathelement path="${javax.inject.jar}"/>
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
</target>
@@ -819,6 +1061,7 @@
<pathelement path="${output}/classes/stdlib"/>
<pathelement path="${output}/classes/core"/>
<pathelement path="${protobuf-lite.jar}"/>
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
</target>
@@ -853,8 +1096,7 @@
<fileset dir="${output}/classes/stdlib"/>
<zipfileset dir="${output}/builtins">
<include name="kotlin/**"/>
<exclude name="kotlin/internal/**"/>
<!-- TODO: load metadata from @KotlinClass annotation in KotlinBuiltIns on JVM and restore this exclusion -->
<!-- TODO: load metadata from @Metadata annotation in KotlinBuiltIns on JVM and restore this exclusion (also below in mock-runtime) -->
<!-- exclude name="kotlin/reflect/**"/ -->
</zipfileset>
</jar-content>
@@ -877,31 +1119,46 @@
</jar>
<delete file="${output}/kotlin-reflect-jarjar.jar" failonerror="false"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="dependencies/jarjar.jar"/>
<jarjar jarfile="${output}/kotlin-reflect-jarjar.jar" filesonly="true" filesetmanifest="merge">
<zipfileset src="${output}/kotlin-reflect-before-jarjar.jar"/>
<rule pattern="org.jetbrains.kotlin.**" result="kotlin.reflect.jvm.internal.impl.@1"/>
<rule pattern="com.google.protobuf.**" result="kotlin.reflect.jvm.internal.impl.com.google.protobuf.@1"/>
<rule pattern="javax.inject.**" result="kotlin.reflect.jvm.internal.impl.javax.inject.@1"/>
</jarjar>
<kotlinc src="${basedir}/generators/infrastructure/strip-kotlin-annotations.kts" output="">
<compilerarg value="-script"/>
<compilerarg value="kotlin/jvm/internal/.*"/> <!-- Annotations to strip -->
<compilerarg value="kotlin/reflect/jvm/internal/impl/.*"/> <!-- Classes to strip from -->
<compilerarg value="${output}/kotlin-reflect-jarjar.jar"/>
<compilerarg value="${kotlin-home}/lib/kotlin-reflect.jar"/>
<classpath>
<pathelement location="${idea.sdk}/lib/asm-all.jar"/>
</classpath>
</kotlinc>
<sequential if:true="${obfuscate.reflect}">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="dependencies/jarjar.jar"/>
<jarjar jarfile="${output}/kotlin-reflect-jarjar.jar" filesonly="true" filesetmanifest="merge">
<zipfileset src="${output}/kotlin-reflect-before-jarjar.jar"/>
<rule pattern="org.jetbrains.kotlin.**" result="kotlin.reflect.jvm.internal.impl.@1"/>
<rule pattern="javax.inject.**" result="kotlin.reflect.jvm.internal.impl.javax.inject.@1"/>
</jarjar>
<kotlinc src="${basedir}/generators/infrastructure/strip-kotlin-annotations.kts" output="">
<compilerarg value="-version"/>
<compilerarg value="-script"/>
<compilerarg value="kotlin/Metadata"/> <!-- Annotation to strip -->
<compilerarg value="kotlin/reflect/jvm/internal/impl/.*"/> <!-- Classes to strip from -->
<compilerarg value="${output}/kotlin-reflect-jarjar.jar"/>
<compilerarg value="${kotlin-home}/lib/kotlin-reflect.jar"/>
<classpath>
<pathelement location="${idea.sdk}/lib/asm-all.jar"/>
</classpath>
</kotlinc>
</sequential>
<sequential unless:true="${obfuscate.reflect}">
<echo message="Obfuscation of kotlin-reflect is disabled"/>
<copy file="${output}/kotlin-reflect-before-jarjar.jar" tofile="${output}/kotlin-reflect-jarjar.jar" overwrite="true"/>
<copy file="${output}/kotlin-reflect-before-jarjar.jar" tofile="${kotlin-home}/lib/kotlin-reflect.jar" overwrite="true"/>
</sequential>
</target>
<target name="pack-runtime-sources">
<!-- Rename packages in the sources of reflection impl (core) -->
<delete dir="${output}/core.src" failonerror="false"/>
<copy todir="${output}/core.src/kotlin/reflect/jvm/internal/impl">
<local name="runtime.sources.base.dir"/>
<condition property="runtime.sources.base.dir"
value="${output}/core.src/kotlin/reflect/jvm/internal/impl"
else="${output}/core.src/org/jetbrains/kotlin">
<istrue value="${obfuscate.reflect}"/>
</condition>
<copy todir="${runtime.sources.base.dir}">
<fileset dir="core">
<include name="descriptor.loader.java/src/**"/>
<include name="descriptors/src/**"/>
@@ -911,9 +1168,13 @@
</fileset>
<cutdirsmapper dirs="5"/> <!-- module/src/org/jetbrains/kotlin -->
</copy>
<replaceregexp match="org\.jetbrains\.kotlin" replace="kotlin.reflect.jvm.internal.impl" flags="g">
<fileset dir="${output}/core.src"/>
</replaceregexp>
<sequential if:true="${obfuscate.reflect}">
<!-- Rename packages in the sources of reflection impl (core) -->
<replaceregexp match="org\.jetbrains\.kotlin" replace="kotlin.reflect.jvm.internal.impl" flags="g">
<fileset dir="${output}/core.src"/>
</replaceregexp>
</sequential>
<pack-runtime-jar jar-name="kotlin-runtime-sources.jar" implementation-title="${manifest.impl.title.kotlin.jvm.runtime.sources}">
<jar-content>
@@ -935,15 +1196,37 @@
</pack-runtime-jar>
</target>
<target name="script-runtime">
<new-kotlinc output="${output}/classes/script-runtime" moduleName="kotlin-script-runtime">
<src>
<include name="core/script.runtime/src"/>
</src>
<class-path>
<pathelement path="${output}/classes/builtins"/>
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
<pack-runtime-jar jar-name="kotlin-script-runtime.jar" implementation-title="${manifest.impl.title.kotlin.script.runtime}">
<jar-content>
<fileset dir="${output}/classes/script-runtime"/>
</jar-content>
</pack-runtime-jar>
<pack-runtime-jar jar-name="kotlin-script-runtime-sources.jar" implementation-title="${manifest.impl.title.kotlin.script.runtime.sources}">
<jar-content>
<fileset dir="${basedir}/core/script.runtime/src" includes="**/*"/>
</jar-content>
</pack-runtime-jar>
</target>
<target name="runtime"
depends="builtins,stdlib,core,reflection,pack-runtime,pack-runtime-sources"/>
depends="builtins,stdlib,kotlin-test,core,reflection,pack-runtime,pack-runtime-sources,script-runtime,mock-runtime-for-test"/>
<target name="dist"
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler,compiler-sources,ant-tools,jdk-annotations,android-sdk-annotations,runtime,kotlin-js-stdlib,android-compiler-plugin,daemon-client"
depends="clean,init,prepare-dist,preloader,runner,serialize-builtins,compiler,compiler-sources,kotlin-build-common,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler,annotation-processing-under-jdk8,daemon-client,kotlin-build-common-test"
description="Builds redistributables from sources"/>
<target name="dist-quick"
depends="clean,init,prepare-dist,preloader,serialize-builtins,compiler-quick,ant-tools,jdk-annotations,android-sdk-annotations,runtime,kotlin-js-stdlib,android-compiler-plugin"
depends="clean,init,prepare-dist,preloader,serialize-builtins,compiler-quick,ant-tools,runtime,kotlin-js-stdlib,android-extensions-compiler,annotation-processing-under-jdk8"
description="Builds everything, but classes are reused from project out dir, doesn't run proguard and javadoc"/>
<target name="dist-quick-compiler-only"
@@ -958,75 +1241,6 @@
</zip>
</target>
<target name="kotlin-for-upsource">
<cleandir dir="${output}/classes/idea-analysis"/>
<javac2 destdir="${output}/classes/idea-analysis" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-for-upsource"/>
<skip pattern="kotlin/jvm/internal/.*"/>
<src>
<dirset dir="${basedir}/idea/ide-common" includes="src"/>
<dirset dir="${basedir}/idea/idea-analysis" includes="src"/>
</src>
<classpath>
<fileset dir="${idea.sdk}" includes="core-analysis/*.jar"/>
<pathelement location="${output}/kotlin-compiler-before-shrink.jar"/>
<path refid="classpath"/>
</classpath>
</javac2>
<copy todir="${output}/classes/idea-analysis">
<fileset dir="${basedir}/idea/idea-analysis/src" excludes="**/*.java, **/*.kt"/>
</copy>
<jar jarfile="${output}/kotlin-for-upsource0.jar">
<fileset dir="${output}/classes/idea-analysis"/>
<fileset dir="${output}/classes/compiler"/>
<fileset dir="${output}/builtins">
<include name="kotlin/**"/>
<exclude name="kotlin/internal/**"/>
</fileset>
<fileset dir="${basedir}/core/descriptor.loader.java/src" includes="META-INF/services/**"/>
<fileset dir="${basedir}/compiler/frontend.java/src" includes="META-INF/services/**"/>
<fileset dir="${basedir}/compiler/backend/src" includes="META-INF/services/**"/>
<fileset dir="${basedir}/compiler/cli/src" includes="META-INF/services/**"/>
<zipgroupfileset dir="${basedir}/lib" includes="*.jar"/>
<zipgroupfileset file="${kotlin-home}/lib/kotlin-runtime.jar"/>
<zipgroupfileset file="${kotlin-home}/lib/kotlin-runtime-sources.jar"/>
<zipgroupfileset file="${kotlin-home}/lib/kotlin-reflect.jar"/>
<fileset dir="${basedir}/resources"/>
<!-- icons, etc. -->
<fileset dir="idea/resources"/>
<!-- plugin.xml and friends -->
<fileset dir="idea/src" includes="META-INF/**"/>
</jar>
<sleep seconds="1"/>
<jar jarfile="${output}/kotlin-for-upsource.jar">
<zipfileset src="${output}/kotlin-for-upsource0.jar">
<exclude name="javax/**/*.java"/>
</zipfileset>
</jar>
<delete file="${output}/kotlin-for-upsource0.jar"/>
<!-- sources -->
<jar jarfile="${output}/kotlin-for-upsource-sources.jar">
<zipfileset src="${output}/kotlin-compiler-sources.jar" includes="**/*"/>
<fileset dir="idea/idea-analysis/src"/>
<fileset dir="idea/ide-common/src"/>
<manifest>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</target>
<target name="zip-test-data">
<zip destfile="${output}/kotlin-test-data.zip">
<zipfileset dir="compiler/testData" prefix="compiler"/>
@@ -1035,7 +1249,36 @@
</zip>
</target>
<target name="mock-runtime-for-test">
<delete dir="${output}/mock-runtime-src" failonerror="false"/>
<mkdir dir="${output}/mock-runtime-src"/>
<copy file="${basedir}/core/runtime.jvm/src/kotlin/TypeAliases.kt" todir="${output}/mock-runtime-src"/>
<copy file="${basedir}/core/runtime.jvm/src/kotlin/text/TypeAliases.kt" todir="${output}/mock-runtime-src/text"/>
<copy file="${basedir}/libraries/stdlib/src/kotlin/util/Standard.kt" todir="${output}/mock-runtime-src"/>
<copy file="${basedir}/libraries/stdlib/src/kotlin/internal/Annotations.kt" todir="${output}/mock-runtime-src"/>
<new-kotlinc output="${output}/classes/mock-runtime" moduleName="kotlin-stdlib">
<src>
<include name="dist/mock-runtime-src"/>
</src>
<class-path>
<pathelement path="${output}/classes/builtins"/>
<pathelement path="${output}/builtins"/>
</class-path>
</new-kotlinc>
<pack-runtime-jar jar-dir="${output}" jar-name="kotlin-mock-runtime-for-test.jar" implementation-title="Kotlin Mock Runtime">
<jar-content>
<fileset dir="${output}/classes/mock-runtime"/>
<zipfileset dir="${output}/builtins">
<include name="kotlin/**"/>
<!-- exclude name="kotlin/reflect/**"/ -->
</zipfileset>
</jar-content>
</pack-runtime-jar>
</target>
<target name="build-bootstrap-artifacts" depends="dist,zip-compiler"/>
<target name="build-artifacts" depends="dist,zip-compiler,kotlin-for-upsource,zip-test-data"/>
<target name="build-artifacts" depends="dist,zip-compiler,zip-test-data"/>
</project>

Some files were not shown because too many files have changed in this diff Show More