Commit Graph

240 Commits

Author SHA1 Message Date
Alexander Udalov 73f872172f Add multi-platform projects as experimental language feature 2016-11-22 18:19:01 +03:00
Mikhael Bogdanov 61da8be260 Generate parameters metadata for java 8 reflection 2016-11-14 14:27:08 +01: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 c49c019250 Add option to restore fallback to compiler built-ins + resurrect Maven build 2016-10-26 19:02:31 +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
Mikhail Glukhikh bfaa9cf56f UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed 2016-10-21 10:31:50 +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
Zalim Bashorov 279b4dc03c Remove obsolete test about class literals is not supported 2016-10-14 19:44:55 +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 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 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
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
Alexey Tsvetkov 8fa7e1f93e Minor: JS test fix 2016-10-05 22:50:46 +03:00
Michael Bogdanov dd4d5e3aa1 Generate 'DefaultImpls' for jvm 8 target only within compiler option 2016-10-03 14:05:59 +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
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
Ilya Chernikov 46a7c706e1 Fixes and refactorings after review 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
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
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 149a4eddff0106bbe91c9a6b51a26c12c242d14f and commit
285b20e3ff387eb3d2ee33ceaa376ed8eba90857
2016-07-21 15:03:52 +03:00
Alexey Andreev cfbe48ac46 KT-3008: fix ABI compatibility test 2016-06-27 15:33:31 +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 b556b6efca KT-3008 Fix JS backend tests 2016-06-27 15:33:24 +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
Alexander Udalov da332d1a27 Validate "-jvm-target" value in CLI, improve message 2016-06-16 16:51:18 +03:00
Mikhael Bogdanov 3a8591a729 Support 'jvm-target' in CLI 2016-06-15 13:43:29 +03:00
Ilya Chernikov 3e6616de42 Read script config if appropriate flag is specified, fix classpath handling 2016-06-07 21:12:58 +02:00
Alexander Udalov bc5202a4d7 Validate "-language-version" argument value, add 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
Alexander Udalov 1b79770121 Do not produce trailing space when rendering root package header 2016-05-20 14:53:07 +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
Dmitry Petrov 0ccaf43e2c KT-11410: Add Xmultifile-parts-inherit CLI option. 2016-04-01 10:13:21 +03:00
Ilya Gorbunov e7d75fccd6 Introduce compiler option to dump declaration mapping. 2016-03-29 13:49:34 +03:00
Natalia Ukhorskaya 7e6fa8ef17 Refactoring: rename android-compiler-plugin to android-extensions-compiler 2016-03-15 20:25:45 +03:00
Ilya Gorbunov 02bb7f2f0d Remove the compiler option "Xmultifile-facades-open" 2016-03-15 14:10:33 +03:00
Pavel V. Talanov a4c005fefd Update existing test data depending on diagnostic parameter rendering 2016-02-26 14:45:11 +03:00
Alexander Udalov 3b22483fb2 CLI tests: move file existance checks to config files 2016-02-17 20:51:57 +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
Zalim Bashorov 030c55ebb2 Minor: fix testdata 2016-02-03 17:35:14 +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
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
Ilya Gorbunov 801a26a544 Fix testData 2016-02-01 22:20:30 +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
Ilya Gorbunov f4822cd757 Fix testData in compiler: add collections and ranges package to fq-names. 2016-01-22 05:54:38 +03:00
Dmitry Jemerov 51799ef70e fix tests on Windows agents: report canonical paths to conflicting Kotlin runtimes 2016-01-21 11:33:32 +01: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
Alexander Udalov b587d3a78d Use JvmMetadataVersion where appropriate instead of bytecode version 2016-01-19 18:39:59 +03:00