Commit Graph

34837 Commits

Author SHA1 Message Date
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