Commit Graph

464 Commits

Author SHA1 Message Date
Nikolay Krasko 155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Leonid Startsev 3b100e57f2 Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list.
Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword)

 Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection.

Fix stylistic problems and typos after review
2019-11-06 19:54:00 +03:00
Leonid Startsev ebb7e434c8 Explicit Api mode: Renamings after design discussions
Change CLI flag to -Xexplicit-api=strict|warning. 'Disable' state and 'mode' suffix are left out as implementation details.

Change intention title to 'make X public explicitly'

Do not report 'no explicit visibility' on property accessors

Set DECLARATION_SIGNATURE as a range for report

Rename internal diagnostic from _MIGRATION to _WARNING
2019-11-06 19:53:59 +03:00
Leonid Startsev 7058492b55 Explicit Api mode: prototype with check for missing explicit visibility
Add cli flag with 3-state switch
2019-11-06 19:53:58 +03:00
Dmitriy Novozhilov ca4784ffd3 Fix CLI testdata broken in 7f58162a 2019-11-05 15:41:35 +03:00
Nikolay Krasko 740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Svyatoslav Kuzmich 1b8df45bfe [JS IR] Support generating both IR and pre-IR libraries
Remove all previous -Xir options

Add:
 -Xir-produce-klib-dir
 -Xir-produce-klib-file
 -Xir-produce-js
 -Xir-only
2019-11-01 19:42:05 +03:00
Alexander Udalov df4ab4ed81 Add JVM bytecode target version 13
#KT-34119 Fixed
2019-10-29 12:54:24 +01:00
Alexander Udalov f248e4a2ee Update CLI test data and Gradle option descriptions 2019-10-25 19:26:20 +02:00
Mikhail Glukhikh 87e2f9d96b Add CLI test for K/javac project with K/J interdependency
Yet this test fails if JavacWrapper does not add Kotlin output dir to classpath
2019-10-18 12:02:04 +03:00
Alexander Udalov d0b241b681 Minor, fix typo in -include-runtime argument help
#KT-34240 Fixed
2019-10-16 15:00:03 +02:00
Vitaliy.Tikhonov f59e393e37 [CLI] add support running scripts in js compiler, extract common code with jvm part 2019-10-10 12:52:06 +03:00
Anton Bannykh ead8379c50 JS: add -Xmetadata-only flag for JS common code modules (KT-33142 fixed) 2019-09-27 19:12:03 +03:00
Alexander Udalov 6ef434a711 JVM IR: add -Xir-check-local-names to check names for consistency
Since KotlinTypeMapper is no longer used in the JVM IR backend, we need
not run CodegenBinding.initTrace and check that names of local entities
are exactly equal to local names computed by that algorithm.

However, it's still useful as an opt-in flag, to discover issues where
unwanted elements take part in the naming (such as temporary IR
variables, see for example cb2e68fece). So we introduce a new command
line argument -Xir-check-local-names which, when the IR backend is used
(via -Xuse-ir), launches the name computation algorithm from the old
backend and then compares that the names are exactly equal to the names
computed by the IR backend in InventNamesForLocalClasses.
2019-09-18 17:55:42 +02:00
Pavel Kirpichenkov 0a1b3a8455 Clearify diagnostic messages that involve internal visibilities
KT-7354 Fixed

Visibility.displayText is deprecated with warning.
Diagnostics for java visibilities changed.
2019-09-16 19:00:43 +03:00
Mikhail Zarechenskiy 04e57f712e [NI] Introduce feature for passing function references with defaults
Relates to KT-8834, we continue reducing differences between old and new
 inference. Note that as for `SamConversionPerArgument`, this feature
 is enabled in the compiler and not in the IDE to avoid breaking code
 for those users that already enabled new inference in the compiler
2019-08-07 15:58:36 +03:00
Victor Petukhov e25b315319 Introduce -Xpolymorphic-signature compiler flag as more priority than -XXLanguage:+PolymorphicSignature 2019-07-26 09:01:25 +03:00
Victor Petukhov 944ee8fcd5 Introduce -Xinline-classes compiler flag as more priority than -XXLanguage:+InlineClasses 2019-07-26 09:01:25 +03:00
Alexander Udalov dabb7bb496 Fix new inference CLI tests on Windows 2019-07-09 11:52:54 +02:00
Mikhail Zarechenskiy c2cf4aa2b5 [NI] Move ability to convert standalone SAM-argument under the feature
If new inference is enabled only for IDE analysis, then this feature
 will be disabled to reduce difference between new and old inference,
 but if new inference is enabled in the compiler, then this feature
 will be enabled too to preserve behavior of new inference for
 compilation

 #KT-32175 Fixed
 #KT-32143 Fixed
 #KT-32123 Fixed
 #KT-32230 Fixed
2019-07-01 12:53:33 +03:00
Svyatoslav Kuzmich cd651be461 [JS IR BE] Migrate JS BE to common klib utils 2019-06-05 11:15:45 +03:00
Mikhail Glukhikh 139557e641 FIR2IR: support super-types & type parameters for external class 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh f3960c9482 Preliminary implementation of parts & facade in FIR-based compiler 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh b28207deca FIR2IR: support fields in Java FIR 2019-05-23 14:02:09 +03:00
Mikhail Glukhikh f4fdc66a34 Introduce experimental FIR compiler #KT-31265 Fixed
This commit also includes several FIR2IR fixes which helps FIR compiler
to produce normal results
2019-05-23 14:02:06 +03:00
Alexander Udalov 43bf962d79 Fix CLI test data on -XXLanguage arguments
We should use '\:' instead of ':' because the latter is replaced to the
path separator in AbstractCliTest.readArg which is ';' on Windows.
2019-05-22 08:48:37 +02:00
Svyatoslav Kuzmich b07690fccf Phaser: Implement dumper and verifier as general actions 2019-05-14 16:23:43 +03:00
Mads Ager 99e7ae6b3f Fix typo in expectation files for command line tests.
The expectations contained ';' instead of ':' which makes two
CLI tests fail.
2019-05-09 16:57:29 +02:00
Mikhail Zarechenskiy 4ed5c5363f [NI] Update testdata after 03e5e55f 2019-05-06 13:59:32 +03:00
Alexander Udalov 5aae832c5f Minor, update doc on -Xsanitize-parentheses
The ASM issue with parentheses was fixed in
https://gitlab.ow2.org/asm/asm/commit/02f00c4a82d9252b34d08dad47c540309fda3b7e

 #KT-29475
2019-04-30 13:15:29 +02:00
Andrey Uskov 998a24414a Improved parsing of internal compiler arguments with boolean state in
case when the argument is listed twice in the list of command line
arguments. The last value will be used.
#KT-27181 Fixed
2019-04-29 19:48:01 +03:00
Alexander Udalov cb6fb78bc3 JS: do not use "-no-stdlib" in non-relevant tests
Rename some Ant tests: "simple[...]" -> "simpleWithoutStdlib[...]" and
"simpleWithStdlib[...]" -> "simple[...]"
2019-04-25 14:42:43 +02:00
Svyatoslav Kuzmich bb3b9a935f Command line interface 2019-04-23 23:19:12 +03:00
Alexander Udalov 822b210e85 Minor, update argfile usage description 2019-04-19 12:55:23 +03:00
Ilya Chernikov 090dadce3e Fix testdata - script extension hint is not generated anymore...
due to changes in the scripting initialization logic
2019-04-17 22:03:58 +02:00
Mikhail Zarechenskiy 705a8a2234 [NI] Disable SAM-conversions for Kotlin functions by default
#KT-30661 Fixed
2019-04-17 01:40:54 +03:00
Alexander Udalov 4cb5a4fb6d Fix misc typos in IR backends 2019-03-28 14:26:09 +01:00
Alexey Tsvetkov 0687b8eac3 Add argument to allow running compiler without sources
`-Xbuild-file` argument allows the compiler to run without
passing any Kotlin source file in arguments.
We have been using this property in
Kotlin Gradle plugin for a few important cases:
1. incremental compilation (to update caches when there are only removed files);
2. for KAPT (Kotlin sources don't make sense in context
of running APs).

We want to stop using `-Xbuild-file` in Kotlin Gradle plugin,
and avoid breaking the Gradle plugin or IC in other build-systems.

This change adds an argument to explicitly run
the compiler without specifying any Kotlin source file.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov 4154e97aa3 Fixes after code review 2019-03-25 16:39:47 +03:00
Alexander Udalov ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Georgy Bronnikov e627f08614 Make wrong phase name an error 2019-03-21 23:32:25 +03:00
Georgy Bronnikov fae003866b Use CLI compiler arguments directly in PhaseConfig creation 2019-03-21 23:32:25 +03:00
Georgy Bronnikov 469fd20902 Warn about mistyped phase names in CLI 2019-03-21 23:32:25 +03:00
Alexander Udalov 518b03125c Support JVM target versions up to 12
#KT-26240 Fixed
2019-03-07 11:42:31 +01:00
Ilya Chernikov 57ac149f5b Extract script cli evaluation to the plugin 2019-03-02 08:10:17 +01:00
Georgy Bronnikov c618ef9304 Correct phase argument names and cli test outputs 2019-02-28 11:53:02 +03:00
Alexander Udalov db487a622a Add -Xsanitize-parentheses to workaround ASM 6.1 issue in frame computation
#KT-29475 Fixed
2019-01-31 15:47:43 +01:00
Nikita Katkov 4db9174b4d Error on calling suspend functions inside Lock.withLock body
See SuspensionPointInsideCriticalSectionChecker
2018-12-28 19:56:26 +03:00
Marcin Moskala 686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Georgy Bronnikov ffa3d7c57a Update test data 2018-11-29 12:48:52 +03:00