Commit Graph

2049 Commits

Author SHA1 Message Date
Marco Pennekamp 88ac5727cc [LL FIR] KT-50732 Add support for LL FIR-specific tests (.ll.kt)
- `.ll.kt` test data can be added in cases where LL FIR resolution
  legally diverges from K2 compiler results.
- Each `.ll.kt` test is prefixed with an `LL_FIR_DIVERGENCE` directive
  which must explain why the test may diverge from K2 compiler results.
  - `LLFirDivergenceCommentChecker` ensures that each `.ll.kt` file
    contains an `LL_FIR_DIVERGENCE` directive.
- `LLFirIdenticalChecker` results in an assertion error if the `.ll.kt`
  test and its base test are completely identical, including in their
  meta info (but ignoring `LL_FIR_DIVERGENCE`).
  - The checker additionally ensures that the base source file and the
    `.ll.kt` source file have identical Kotlin source code (ignoring
    meta info and `LL_FIR_DIVERGENCE`). This ensures that both tests
    test the exact same thing.
- `.ll.kt` files are ignored by select test generators, in addition to
  `.fir.kt` files.
2023-01-16 15:20:50 +00:00
Vladimir Dolzhenko ca31307941 [AA] Add expectForActual
#KT-54864

Merge-request: KT-MR-8222
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-01-13 21:36:04 +00:00
Justin Paupore fbcde11b04 [AA] Add meta-annotation test for analysis API.
This test ensures that annotations on other annotations are properly
handled, even if those annotations are defined in Java rather than in
Kotlin.

Note that this functionality only works on FIR, and currently has bugs
that mean the result is an error type. Follow-on changes will fix the
error-type bug, and restore proper functionality for FIR.
2023-01-12 19:48:21 +09:00
Yahor Berdnikau 43eea47032 Mark compiler arguments that should generate deprecated kotlinOptions DSL
This will allow to keep backward compatiblity for deprecated
kotlinOptions DSL for already existing compiler arguments, but add a new
 one only into compilerOptions DSL.

^KT-53108 In Progress
2023-01-10 14:56:11 +00:00
Ilya Kirillov 20b81464be [Analysis API] fix IndexOutOfRangeException
Previously, the `KtFirUsualClassType.qualifiers` was empty for the local classes

The reason was a RawFirBuilder setting up a containingClassForLocalAttr
to the outer non-local class for the local class. It should be a null instead,
see the localClassType.kt as an example

^KT-55510 fixed
2023-01-10 12:54:18 +00:00
Anna Kozlova d7179d929f [LC] add isEquivalentTo implementation so LC can be referenced from java
otherwise references from java to ktElements won't be treated as references,
cause java references resolve to light elements and search can/should be called
on ktElements
2023-01-09 18:43:57 +00:00
Alexander Udalov ae6d4d268d Use short copyright from COPYRIGHT_HEADER in generated files 2023-01-02 22:52:18 +01:00
Alexander Udalov 7b8b6ef98f Use COPYRIGHT_HEADER in generateBuiltins
It's the same logic that is used in generateTests, and it prevents
master builds from failing as soon as the new year begins. The year in
the COPYRIGHT_HEADER should be updated manually anyway, after which all
the generators will need to be re-run.
2023-01-02 22:50:06 +01:00
Alexander Udalov 2d3f39d1f1 Minor, remove unneeded println in GenerateInterpreterMap 2023-01-02 22:50:06 +01:00
Alexander Udalov 5cb8428326 Minor, remove obsolete bunch file 2023-01-02 22:50:06 +01:00
Dmitrii Gridin 6db0aaef35 [SLC] rename test classes according to new directories 2023-01-02 15:05:45 +00:00
Dmitrii Gridin 3e36e51920 [LC] merge ultraLightFacades tests to lightClassByPsi 2023-01-02 15:05:42 +00:00
Dmitrii Gridin 0731780865 [LC] rename ultraLightClasses to lightClassByPsi 2023-01-02 15:05:38 +00:00
Dmitrii Gridin 742c3de112 [LC] rename lightClasses/lightClasses to lightClasses/lightClassByFqName 2023-01-02 15:05:37 +00:00
Dmitrii Gridin eb3ad7e6b1 [LC] move light class related tests to one directory 2023-01-02 15:05:36 +00:00
Yahor Berdnikau 860d3fda95 Undeprecate 'kotlinOptions' DSL
'@ReplaceWith' is not that flexible in this case and proper IDE support
required for smooth migration. After such migration in IDE will be added
 - deprecation should be restored.

 ^KT-54399 Fixed
2022-12-16 17:25:49 +00:00
Dmitrii Gridin b2c0a37050 [SLC] implement infrastructure for light class hierarchy tests 2022-12-13 16:54:25 +00:00
Alexander Udalov 25c5ad176c Minor, update instructions for installing protobuf261 + regenerate 2022-12-01 01:37:55 +01:00
Nikolay Lunyak 4b3dc008f0 [FIR] KT-54260: Fix the compiler crash
AllOpen plugin makes the properties all-open, but the annotation class
is left closed, because allopen for k2 literally checks
`classKind == CLASS`.

Since the properties are open, a
`NON_FINAL_MEMBER_IN_FINAL_CLASS` diagnostic is reported for them. It's
positioning strategy seeks for the explicit `open` modifier which is
not present.

The added test should not crash the compiler.

^KT-54260 Fixed
2022-11-22 20:25:38 +00:00
Ilya Chernikov fa0cda6236 FIR JS: enable full JS box tests with FIR 2022-11-12 14:34:07 +01:00
Ilya Kirillov 2378437b30 [Analysis API FIR] do not create resolved KtTypes for unresolved ones 2022-11-11 12:00:00 +01:00
Jinseong Jeon c9a2e10dd7 AA: merge single/multi modules tests for PsiTypeProvider
...because single-module test is also multi-module test
2022-11-02 17:38:16 +01:00
Jinseong Jeon d98081dce2 AA: introduce MPP tests for PsiTypeProvider 2022-11-02 17:38:16 +01:00
Ilya Kirillov e2416f48fe [Analysis API] add tests for containing declaration for delegated member scope 2022-10-26 19:19:04 +00:00
Ilya Kirillov 97df0a0902 [Analysis API] rework containing declaration provider
now it should work for non-source declarations
2022-10-26 19:19:00 +00:00
Yahor Berdnikau a7e1d36528 Drop compileOnly dependency on :kotlin-gradle-compiler-types in compiler
This dependency was only required for compiler options Gradle DSL
generation, but was leaking into runtime not-accessible classes.

^KT-54602 Fixed
2022-10-26 16:32:36 +02:00
Dmitrii Gridin b8a64d20ac [AA] restore Fe10IdeNormalAnalysisSourceModuleSymbolByReferenceTestGenerated
^KT-54311
^KT-54385
2022-10-17 14:59:50 +00:00
Sergej Jaskiewicz 227864c6ec [JS IR] Add a compiler option for generating name entries in sourcemaps 2022-10-14 10:09:39 +00:00
Yahor Berdnikau 023b9bf284 Align new compiler options names with api naming
Use Kotlin*CompilerOptions or Kotlin*CompilerToolOptions naming approach.

^KT-54306 Fixed
2022-10-13 12:19:08 +00:00
Kristoffer Andersen f765457e51 [K2] isUsedAsExpression analysis 2022-10-05 15:06:52 +00:00
Ilya Kirillov 49f2f85927 [Low Level FIR] fix exception when creating symbol by invalid code 2022-10-04 12:56:07 +00:00
Ilya Kirillov 2d7218b542 [Analysis API FIR] fix test generation 2022-10-03 16:02:23 +02:00
Ilya Gorbunov 34de2d9155 Trim trailing spaces in generated docs of builtins 2022-10-02 19:04:36 +00:00
Paŭlo Ebermann 418c530820 docs: mod/rem: clarify who is dividend and divisor 2022-09-30 15:41:55 +03:00
Alexander Udalov 8757988037 Minor, generate trailing comma in enums in Gradle compiler types
This both simplifies the generator code and makes the generated code
conform to the style guide (see
https://kotlinlang.org/docs/coding-conventions.html#trailing-commas), in
particular it improves version control diffs for generated enums.
2022-09-22 21:56:10 +02:00
Nikolay Krasko 1630386712 Move to JDK_X_Y variables 2022-09-21 22:53:19 +00:00
Yahor Berdnikau 136ccbd328 Remove JvmTarget.JVM_1_6 from Gradle DSL
This target is not available inside compiler and left for IDE
compatibility.

^KT-54103 Fixed
2022-09-21 13:34:26 +02:00
Ilya Kirillov cd5b9d6356 [Analysis API] do not generate standalone tests which use compiler plugin 2022-09-21 09:44:24 +02:00
Yahor Berdnikau 286d0d56af Introduce Kotlin compiler options with Gradle Properties API types
Old one is deprecated and delegates to new options. All new options
are marked with task input types, so they could be used as `@Nested`
input.

Generated options are using specific types in generated
compiler options. This should simplify code completion and provide
meaningful hints to user.

At this point repository compilation will fail.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 28dd3d4e71 Generate Gradle compiler types into separate project
This will allow to use them on the DSL generation.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 5eebcf8c77 Generate Js runtime diagnostic mode type
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau c1ed683ed8 Generate Js source map embed mode type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 626bd34319 Generate JS module kind type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 14f45b48b3 Generate JS main function execution mode type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 7772ab00cd Generate JvmTarget Gradle DSL object
This is generated based on JvmTarget compiler type without exposing
compiler internals.

^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 37c66837ee Make 'generateGradleOptions' task visible
Makes all generate* tasks easier to discover.

^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 6842842827 Generate KotlinVersion Gradle DSL object
To avoid exposing compiler internal types inside Gradle DSL public api.

ApiVersion and LanguageVersion in terms of compiler api is almost the
same. Actually ApiVersion is generated based on LanguageVersion. To
reduce user confusion what enum to use and what is the difference
- in Gradle DSL they are now exposed as single enum - KotlinVersion.

Mark KotlinVersion with DeprecationLevel.ERROR if related
LanguageVersion is unsupported and with DeprecationLevel.WARNING if
related LanguageVersion is deprecated.

^KT-27301 In Progress
2022-09-19 12:30:34 +02:00
Jinseong Jeon e50da634bc AA: add tests for resolution to built-ins 2022-09-17 16:43:12 +02:00
Anže Sodja 09d6dfc8bf [Assign plugin] Add a compiler plugin for overloading assign ('=') operator 2022-09-16 10:12:41 +03:00
Alexander Udalov d50cf81e42 Remove tests on incremental compilation with old JVM backend
#KT-48532 Fixed
2022-09-16 00:16:31 +02:00