Commit Graph

31 Commits

Author SHA1 Message Date
simon.ogorodnik f83c20065d [FIR-test] Unmute passing tests, mostly fir2ir 2020-03-24 18:58:19 +03:00
Mikhail Glukhikh 8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00
Mikhail Glukhikh 64c7ab1302 [FIR] Fix lambda resolve in independent context 2020-02-04 15:00:12 +03:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov 7742a3b697 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in compiler tests 2020-01-14 21:04:42 +01:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Ilya Chernikov 2c02ee3d29 Rename test files to scripts to trigger proper scripting initialization
fix generation config accordingly
2019-02-10 13:31:57 +01:00
Alexander Udalov 77c87fa6c9 Remove API_VERSION 1.3 from compiler tests
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov d1e1e274d9 Render property accessor annotations in .txt test data
If property accessor rendering is disabled in a test, render annotations
on accessors as use-site-targeted, as was done with
`@setparam:`-annotations. Otherwise they were lost
2018-10-24 18:17:12 +02:00
Alexander Udalov 5713298108 Fix FQ name usage of experimental marker in UseExperimental
#KT-26366 Fixed
2018-09-26 18:36:01 +02:00
Alexander Udalov 3e90d367f2 Do not report experimental usage errors in import statements
#KT-25545 Fixed
2018-09-21 17:35:50 +03:00
Mikhail Zarechenskiy 659289b41a Report diagnostics about experimentality on unsigned literals
#KT-25580 Fixed
2018-08-06 17:45:22 +03:00
Alexander Udalov 6f9441d3f4 Do not output empty non-root packages in tests with txt
Mostly to avoid listing every internal package in
kotlin-stdlib/kotlin-reflect, as in
https://github.com/JetBrains/kotlin/blob/acd5b62148d797ffd24c4811d1d663f0c1ae7885/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/conversionOfSignedToUnsigned.txt#L144
2018-08-06 13:43:32 +02:00
Dmitry Petrov 5767f84c0e Restrict retention for annotations with target EXPRESSION
#KT-13762 Fixed
2018-07-18 14:21:03 +03:00
Alexander Udalov 143c3ccb95 Disallow usages of experimental markers as qualifiers
Only allow explicit imports of markers, but not of nested classes
declared in them
2018-05-07 11:37:31 +02:00
Alexander Udalov 2fea2135f8 Add TYPEALIAS target to UseExperimental 2018-05-07 11:37:31 +02:00
Alexander Udalov 7d74508529 Report experimental diagnostics on inaccessible (wrt SinceKotlin) API
If a declaration is annotated both with SinceKotlin and WasExperimental
and the SinceKotlin version makes it inaccessible, the experimental
checker must regard it as experimental, with markers specified in the
WasExperimental annotation arguments. So only errors/warnings about the
experimentality are going to be reported in this case, and no error that
the declaration is unavailable because of a low API version
2018-05-07 11:37:31 +02:00
Alexander Udalov 1f0d3d9c7c Load WasExperimental values correctly for associated declarations
For example, if a class is `@SinceKotlin("X")
@WasExperimental(M::class)`, then its constructor should also be
accessible if API < X, provided that the opt-in to M is given
2018-05-07 11:37:31 +02:00
Alexander Udalov 9995438b37 Forbid non-intended usages of Experimental and markers
Experimental and UseExperimental can only be used as annotations or
qualifiers (to allow "Experimental.Level.*"); experimental markers can
only be used as annotations or qualifiers, or as left-hand side of a
::class literal in arguments to UseExperimental/WasExperimental.

This is needed because we're not yet sure of the design of this feature
and would like to retain the possibility to drop these declarations
(Experimental, UseExperimental) altogether. If they were going to be
used as types, it would be problematic because we can't simply delete
something from stdlib, should deprecate it first. With this change,
these declarations can only be used if the user has opted into using the
experimental API somehow (for example, with
`-Xuse-experimental=kotlin.Experimental`), so we won't stop conforming
to our deprecation policy if we decide to remove these declarations in
the future
2018-05-07 11:37:31 +02:00
Alexander Udalov ed6f044fb0 Add internal WasExperimental for stdlib
Usages of declarations annotated with WasExperimental are allowed even
if the API version requirement is not satisfied, provided that the
opt-in to all mentioned markers is given. This is needed for smooth
graduation of API in kotlin-stdlib
2018-05-07 11:37:31 +02:00
Alexander Udalov fdc4313860 Minor, fix bodyUsagesAndInline.kt test data 2018-05-07 11:37:31 +02:00
Alexander Udalov c57864e46c Require "-Xuse-experimental=kotlin.Experimental" on usages of Experimental
Since we're not yet sure of the design of Experimental/UseExperimental,
we're making them "experimental" themselves in some sense, in that the
user is required to provide the magic argument
"-Xuse-experimental=kotlin.Experimental" to be allowed to use either
Experimental or UseExperimental. This is more convenient than the
previous approach of "-language-version 1.3
-Xskip-metadata-version-check" because it's simpler and does not cause
pre-release binaries to be produced
2018-05-04 13:48:24 +02:00
Alexander Udalov 4f53a54115 Drop Experimental.Impact, simplify related code and tests
See https://github.com/Kotlin/KEEP/issues/95#issuecomment-383889404

Drop Experimental.changesMayBreak, Experimental.Impact, the concept of
signature/body usage, same module exemption. Make the majority of tests
single-module because there is now no difference in the checker between
usages from the same module or from another module
2018-05-04 13:48:24 +02:00
Alexander Udalov e19ed1e001 Add test on experimental const val in annotation argument
This test checks that a usage inside an annotation argument is a
signature usage, which may be too restricting but easier to support at
the moment (and the restriction can be lifted in the future)
2018-02-08 17:08:34 +01:00
Alexander Udalov a4af9dd5d1 Always consider container's experimentality in ExperimentalUsageChecker
This results in more diagnostics usually, but allows library authors to
avoid annotating everything in each experimental class with the marker
(only the class needs to be annotated now)

 #KT-22759
2018-02-08 17:08:34 +01:00
Alexander Udalov 65a6171782 Add test on Experimental in scripts 2018-02-08 17:08:33 +01:00
Alexander Udalov 5e78adb501 Support -Xexperimental/-Xuse-experimental in ExperimentalUsageChecker
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 153c86c069 Report diagnostic on overrides of experimental members
Unless they're experimental themselves

 #KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 29c35e6686 Do not require experimental propagation for body usages in same module
Unless it's a usage inside the body of an effectively public inline
function

 #KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 6d4e8f3781 Add some validation for Experimental/UseExperimental usages
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 0bf0a315ed Introduce Experimental and UseExperimental annotations
#KT-22759 In Progress
2018-02-08 17:07:21 +01:00