Commit Graph

3152 Commits

Author SHA1 Message Date
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
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
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 484b0e36fb Add KotlinBuiltIns#isBuiltIn, use it instead of other utilities 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 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 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 6b6ddf5f75 Import classes from kotlin.coroutines by default, add to default imports in JS 2016-10-24 15:30:38 +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 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
Michael Bogdanov 978a4db07b Introduced IR CodegenFactory, added configuration key to enable it 2016-10-18 09:09:35 +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
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
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
Alexander Udalov 2f616bdd33 Drop ModuleParameters, inline defaultImports everywhere 2016-10-12 17:07:09 +03:00
Ilya Chernikov 63c5133167 Remove support for xml-based script configs, other minor refactorings 2016-10-12 15:37:47 +02: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
Valentin Kipyatkov 147d1da1ed Supported obtaining function type parameter names from KotlinType 2016-10-11 23:38:48 +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 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
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 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
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