Commit Graph

11 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 68d7e51d32 Support test directive for rendering full diagnostic messages
New `RENDER_DIAGNOSTICS_MESSAGES` directive forces test system render
full messages for all diagnostics that found in test file
2019-01-31 17:25:13 +03:00
Dmitry Petrov caae6ff2ec KT-16264 Forbid usage of _ without backticks
Forbid underscore-only (_, __, ___, ...) names as callees and as types.

If CHECK_TYPE directive is on, filter out UNDERSCORE_USAGE_WITHOUT_BACKTICKS messages.
2017-03-29 15:47:22 +03:00
Alexander Udalov 32826c1686 Introduce LanguageFeature.State, drop coroutines-related pseudofeatures
Previously there were three LanguageFeature instances -- Coroutines,
DoNotWarnOnCoroutines and ErrorOnCoroutines -- which were handled very
awkwardly in the compiler and in the IDE to basically support a language
feature with a more complex state: not just enabled/disabled, but also
enabled with warning and enabled with error. Introduce a new enum
LanguageFeature.State for this and allow LanguageVersionSettings to get
the state of any language feature with 'getFeatureSupport'.

One noticeable drawback of this approach is that looking at the API, one
may assume that any language feature can be in one of the four states
(enabled, warning, error, disabled). This is not true however; there's
only one language feature at the moment (coroutines) for which these
intermediate states (warning, error) are handled in any way. This may be
refactored further by abstracting the logic that checks the language
feature availability so that it would work exactly the same for any
feature.

Another issue is that the difference among ENABLED_WITH_ERROR and
DISABLED is not clear. They are left as separate states because at the
moment, different diagnostics are reported in these two cases and
quick-fixes in IDE rely on that
2017-03-15 11:03:00 +03: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 0e881daba3 Update diagnostic tests ReadMe, explain tests with diagnostic arguments 2016-06-19 12:45:22 +03:00
Alexander Udalov 7cb61b81ab Minor, capitalize language feature names in tests
To simplify textual search across the codebase
2016-05-26 22:21:22 +03:00
Alexander Udalov 98c3e030a1 Support enabling/disabling language features in diagnostic tests 2016-05-26 22:15:39 +03:00
Stanislav Erokhin 1b6f96ac2b Minor. update diagnostics/ReadMe.md 2015-12-18 15:08:18 +03:00
Svetlana Isakova 2440c48f1c Added description of 'FILE' directive for diagnostic tests 2014-12-12 23:08:28 +03:00
Svetlana Isakova f74fbf9f8b added readme file about diagnostic tests directives 2014-02-11 21:07:09 +04:00