Commit Graph

33995 Commits

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