Commit Graph

2877 Commits

Author SHA1 Message Date
Mikhail Glukhikh 126304c197 Destructure intention applied (compiler) 2016-10-10 14:42:04 +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
Alexander Udalov 8ffe379c92 Use separate module analysis in CliReplAnalyzerEngine 2016-10-06 14:40:21 +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 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
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
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
Michael Bogdanov 95a1c254e1 Added error diagnostic on inheriting target 6 interface 2016-10-03 14:13:17 +03:00
Michael Bogdanov dd4d5e3aa1 Generate 'DefaultImpls' for jvm 8 target only within compiler option 2016-10-03 14:05:59 +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 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 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 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 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
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
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
Dmitry Petrov 07198cf86d SAM constructors for type aliases. 2016-09-22 10:38:34 +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
Dmitry Petrov 796d11c860 ClassDescriptor is now a super-interface for ClassConstructorDescriptor and TypeAliasConstructorDescriptor. 2016-09-20 10:55:36 +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 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
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 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
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
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
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
Stanislav Erokhin 19e4dbc37c Refactoring. Move functionTypeResolveUtils.kt to resolution module. 2016-07-29 17:53:11 +03:00
Pavel V. Talanov 0294551433 Refactor: move OldPackageFacadeClassUtils to 'frontend.jvm' module 2016-07-28 18:00:48 +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
Alexander Udalov a92f0a0446 Do not report "reflection is not available" on built-in sources 2016-07-22 18:13:39 +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
Alexander Udalov ceb54492e6 Get rid of CallChecker#checkPropertyCall, create fake ResolvedCall 2016-07-07 13:55:48 +03:00