Commit Graph

383 Commits

Author SHA1 Message Date
simon.ogorodnik cd9273028b Profiling and repeat support for JVM CLI Compiler 2020-06-08 20:40:27 +03:00
Alexander Udalov a0400f59c2 Add -Xskip-prerelease-check compiler argument
#KT-38070 Fixed
2020-05-07 13:24:26 +02:00
Mikhail Bogdanov 4f7599076c Postpone JvmDefault deprecation. Revert "Deprecate @JvmDefault"
This reverts commit c11f3868
2020-05-04 10:02:16 +02:00
Alexander Udalov 94346e8a03 Add JVM target bytecode version 14
#KT-38413 Fixed
2020-04-28 13:00:23 +02:00
Dmitry Petrov ac5411c32e Command-line option disabling KotlinNothingValueException generation 2020-04-16 19:38:30 +03:00
Mikhail Bogdanov 6e1af0caee Minor. Update test data 2020-04-09 07:49:30 +02:00
Mikhail Bogdanov 0ddef7e4e4 Add new options for '-Xjvm-default' 2020-04-09 07:37:33 +02:00
Alexander Gorshenev 97be5617ca Renamed -Xklib-mpp to -Xexpect-actual-linker to reduce user confusion 2020-04-08 05:23:12 +03:00
Mikhail Zarechenskiy 73e1ddc505 Allow Result as a return type if one enabled inline classes explicitly
#KT-38042 Fixed
2020-04-08 01:25:13 +03:00
Alexander Udalov a9f7ff254b Add -Xno-optimized-callable-references to disable KT-27362 optimization
This argument is useful in situations where the stdlib version which the
code compiles against is different from the one which is available at
runtime, such as the case of kotlin-gradle-plugin, which depends on the
compiler/stdlib compiled by 1.4, but may be executed in Gradle where
only 1.3.x is available.

 #KT-37435
2020-03-13 10:07:22 +01:00
Mikhail Zarechenskiy cd0012c527 [NI-MIGRATE] Update CLI tests 2020-02-13 11:15:59 +03:00
Alexander Udalov d5987fd7f3 Minor, move wrongAnnotationArgumentInCtor.kt to CLI tests
The fact that this was a codegen box test was probably an abuse of the
testing infrastructure. It was never meant to pass, since it checks
presence of an error, and diagnostic tests aren't enough since they
might not check the full compiler execution.
2020-02-12 17:36:08 +01:00
Alexander Udalov dc7b1fbff9 JVM IR: report warning instead of error for language/API version 1.2
This is needed for testing JVM IR on existing projects which for some
reason are still on Kotlin 1.2.
2020-02-10 17:32:18 +01:00
Pavel Kirpichenkov fee72839bf Report error if IR is enabled with incorrect language version
^KT-36338 Fixed
2020-02-07 16:10:03 +03:00
Dmitry Petrov 8ef79f932c JVM_IR: Implement some BE diagnostics
TODO proper diagnostics tests with BE diagnostics
2020-02-04 00:04:22 +03:00
Pavel Kirpichenkov 9902643a26 Remove unsupported versions from kotlin compiler tab in settings
KT-36146 In progress
2020-01-29 21:40:50 +03:00
Pavel Kirpichenkov 913ed71863 Update error about unsupported language and API versions
Set first supported version to 1.3
Add property for oldest depecated language version in order to control unsupported ones
Report error on attempts to manually disable language feature from unsupported versions
Update test data, drop compatibility tests for features from unsupported versions

KT-36146 In progress
2020-01-29 21:40:44 +03:00
Alexander Udalov 953b461c53 Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when
compiling against class files produced by the JVM IR backend. This is
needed because we're not yet sure that the ABI generated by JVM IR is
fully correct and do not want to land in a 2-dimensional compatibility
situation where we'll need to consider twice more scenarios when
introducing any breaking change in the language. This is generally OK
since the JVM IR backend is still going to be experimental in 1.4.

However, for purposes of users which _do_ need to compile something with
the old backend against JVM IR, we provide two new compiler flags:
* -Xallow-jvm-ir-dependencies -- allows to suppress the error when
  compiling with the old backend against JVM IR.
* -Xir-binary-with-stable-api -- allows to mark the generated binaries
  as stable, when compiling anything with JVM IR, so that dependent
  modules will compile even with the old backend automatically. In this
  case, the author usually does not care for the generated ABI, or s/he
  ensures that it's consistent with the one expected by the old compiler
  with some external tools.

Internally, this is implemented by storing two new flags in
kotlin.Metadata: one tells if the class file was compiled with the JVM
IR, and another tells if the class file is stable (in case it's compiled
with JVM IR). Implementation is similar to the diagnostic reported by
the pre-release dependency checker.
2020-01-29 17:20:41 +01:00
Georgy Bronnikov 5ede65c525 JVM_IR: read Klib 2020-01-28 12:19:43 +03:00
Ilya Chernikov 891914167a Switch cli expression evaluation argument syntax to -expression/-e
#KT-35414 fixed
2020-01-21 17:42:48 +01:00
Alexander Udalov b6feec4115 Add language version 1.5 2020-01-21 15:57:35 +01:00
Dmitriy Novozhilov 5cb7cf040a Update some testdata according switching compiler to 1.4 2020-01-20 16:41:46 +03:00
Ilya Gorbunov ec6fdc5d4d Fix noStdlib cli test
Replace 'isExternal' with 'name', since 'name' is still available in builtins and 'isExternal' is only accessible with a proper stdlib dependency.
2020-01-16 15:33:16 +03:00
Alexander Udalov f45ca7acd3 Add -Xno-use-ir to override useIR flag for custom-built compiler 2020-01-15 19:39:07 +01:00
Alexander Udalov 7742a3b697 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in compiler tests 2020-01-14 21:04:42 +01:00
Alexander Udalov b839b905b5 Rename Experimental/UseExperimental in compiler diagnostic messages
#KT-34647
2020-01-14 21:04:41 +01:00
Mikhael Bogdanov 2ed0cb2a89 Support type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Ilya Chernikov 995c6a32b8 Allow only single expression eval in cli compiler and kotlin runner
#KT-35740 fixed
also add tests and drop logger usage in the cli dependencies manager:
the logger is normally unitialized in the usage scenarios, but related
warnings are annoying.
2020-01-09 10:51:25 +01:00
Steven Schäfer 929fb5c82b Mute FIR tests containing broken function calls 2020-01-08 13:20:00 +01:00
Alexander Gorshenev dc8240c24e Expect/actual support in klibs under -Xklib-mpp 2019-12-18 19:29:56 +03:00
Alexander Udalov e009c7064e Add -Xopt-in command line argument
As per https://github.com/Kotlin/KEEP/pull/201
2019-12-17 18:17:48 +01:00
Alexander Udalov 33bc3db144 Deprecate -Xexperimental compiler argument
This option is not widely used and its implementation relies on a
complicated mechanism of a module-wide metadata, which is not properly
supported in the IDE (see IdeModuleAnnotationsResolver).

 #KT-34649 Fixed
2019-12-17 18:17:48 +01:00
Ilya Chernikov 354be2b14f [minor] Change expression evaluation cli argument to -Xexpression 2019-12-11 12:20:49 +01:00
Ilya Chernikov f2a4a835e7 Improve script cli diagnostics 2019-12-02 16:46:55 +01:00
Ilya Chernikov 531ff92791 Implement support for expression evaluation in jvm cli compiler 2019-12-02 16:46:54 +01:00
Alexander Udalov f9b66d57cf Fix test data for -Xuse-mixed-named-arguments
Remove incorrect jar clash warning and avoid unrelated unused parameter
warnings
2019-11-08 20:52:22 +01:00
Dmitriy Novozhilov 45523a5767 Fix -Xuse-mixed-named-arguments compiler arg 2019-11-08 15:30:04 +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
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
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