Commit Graph

41929 Commits

Author SHA1 Message Date
Mikhail Glukhikh ad29fb349f FirRepeatableAnnotationChecker: expand some annotation class ids
Related to KT-55615
2023-01-05 13:00:35 +00:00
Sergej Jaskiewicz a66950b629 [klib] Finish refactoring of ZipUtil 2023-01-05 10:13:38 +00:00
Mikhail Glukhikh 1344a9b1bb ConeTypeIntersector: preserve raw & dynamic types as is 2023-01-04 18:29:34 +00:00
Mikhail Glukhikh 55fdb43620 ConeTypeIntersector: drop obsolete comment 2023-01-04 18:29:34 +00:00
Mikhail Glukhikh b5111d101e ConeTypeIntersector: reuse isNullableType from type context 2023-01-04 18:29:34 +00:00
pyos ee6af9af5f FIR: intersect flexible type bounds separately
^KT-54522 Fixed
2023-01-04 18:29:33 +00:00
Mikhail Glukhikh 8bc9fd91d5 ConeTypeIntersector: inline flatIntersectionTypes 2023-01-04 18:29:33 +00:00
pyos 45e884ec67 FIR: refactor ConeTypeIntersector 2023-01-04 18:29:33 +00:00
Ilya Gorbunov 916f733f73 Make k.c.Volatile since 1.9 in JVM and Common KT-55268, KT-55609
Leave it experimental since 1.8 for K/Native.
2023-01-04 17:28:46 +00:00
Igor Yakovlev f7940a2d46 [Wasm] Fix invalid cast generation for inline classes 2023-01-04 17:16:04 +00:00
Vladimir Sukharev 924898afb7 [K/N] KFC-446: K2 platform: Native alpha
Merge-request: KT-MR-7905
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-04 16:10:40 +00:00
Artem Kobzar 97be632c9a [K/JS] Add @ts-ignore for the case when there is a class with a private primary constructor (or excluded from export) which has an exported subclass ^Fixed KT-52563 2023-01-04 15:21:40 +00:00
Kirill Rakhman 2a724787f0 K2: fix SUPERTYPE_NOT_INITIALIZED not being reported on object expressions ^KT-55597 Fixed 2023-01-04 15:09:26 +00:00
Kirill Rakhman 868fe913f1 reformat test data 2023-01-04 15:09:26 +00:00
Kirill Rakhman 721a37f7e7 K2: implement FirLateinitIntrinsicApplicabilityChecker ^KT-55495 Fixed 2023-01-04 14:42:43 +00:00
Mikhail Zarechenskiy dc9193893e Add a test to check Java behavior with entries members
Note that there is a questionable behavior that will be fixed later.

 Right now it's not fully clear because for the same situation in Kotlin, the compiler reports warnings at declaration-site and it's not possible to do so for Java

 ^KT-53153
2023-01-04 13:17:11 +00:00
Mikhail Zarechenskiy 3cdbb4876f Add a warning for conflicting entries member
^KT-53153
2023-01-04 13:17:11 +00:00
Mikhail Zarechenskiy cf4b415a20 Add a warning for name shadowing case with Enum.entries
^KT-53153
2023-01-04 13:17:11 +00:00
Mikhail Zarechenskiy c70a1b1884 Add a warning for a custom Enum.entries entry
^KT-53153
2023-01-04 13:17:10 +00:00
Mikhail Zarechenskiy 989fc886e1 Add a warning for a user-defined entries property call
^KT-53153
2023-01-04 13:17:10 +00:00
Mikhail Zarechenskiy 695a538529 Move test about Enum.entries to a more specific folder 2023-01-04 13:17:10 +00:00
Ilya Kirillov 5b9a7c4976 [FIR] do not consider delegate field as local
Otherwise, lazy resolve will never resolve it
2023-01-04 12:50:58 +00:00
Marco Pennekamp a777ffcd8a [AA] KT-55566 StandaloneProjectFactory: Setup JDK default module roots
- Setup JDK default module roots in `StandaloneProjectFactory` (compare
  with `KotlinCoreEnvironment`). The implementation is a distilled
  version of `ClasspathRootsResolver`'s default module handling.
- This fixes an issue where some LL FIR tests with JDK 17 and 11 had
  mismatched types between Kotlin and Java sources.

^KT-55566 fixed
2023-01-04 11:46:11 +00:00
Marco Pennekamp e68111c218 [AA] KT-55566 StandaloneProjectFactory: Setup Java language level before Java files are parsed
- LL FIR tests with Java `record` classes and other new syntax features
  failed because `file.packageName` in `findJvmRootsForJavaFiles`
  caused the Java file to be parsed before the Java language level was
  configured. The Java language level is now set up in
  `registerJavaPsiFacade`, which is early enough.
2023-01-04 11:46:10 +00:00
Pavel Mikhailovskii fed86a57e3 Fix isValidJavaFqName 2023-01-04 11:28:08 +00:00
Dmitriy Novozhilov 4f3add8f7a [FIR] Fix resolution of plugin annotations if only meta annotations are registered 2023-01-04 11:02:01 +00:00
Mikhail Glukhikh 0d50f71fb8 K2: expand type aliases in annotation position #KT-55615 Fixed 2023-01-04 10:06:39 +00:00
Stanislav Ruban ca8cfa4596 KT-55335: Add diagnostics test showing that issue is fixed in K2
^KT-55335: Fixed
2023-01-04 08:08:33 +00:00
Stanislav Ruban 965015bb1e KT-55288: Add diagnostics test showing that issue is fixed in K2
^KT-55288: Fixed
2023-01-04 08:08:32 +00:00
Stanislav Ruban 0f179e8949 KT-33132: Add diagnostics test showing that issue is fixed in K2
^KT-33132: Fixed
2023-01-04 08:08:32 +00:00
Vladimir Dolzhenko 4542b3947b Clean up: rename Jet* to Kt* 2023-01-03 16:36:53 +01:00
Alexander Udalov 397cafcbe8 Remove unneeded runReadAction in getExceptionMessage
Read action is not needed because at the only call site where we try to
read the PSI element text we do it via `Document.getCharsSequence` which
does not require read action.

 #KT-54971 Fixed
2023-01-03 14:23:35 +00:00
Alexander Korepanov 3744fbb31b [JS IR] Write IrFile fingerprints to KotlinJs klib manifest
The file fingerprints are going to be used for
 a cache invalidation in JS IR incremental cache.

 It should reduce an incremental rebuild time in JS BE.

 CityHash128 is used as IrFile fingerprint.
2023-01-03 12:30:23 +00:00
Vladimir Dolzhenko 511e05adec Fix test data
Test data had to be adjusted together with a main change

#KTIJ-912
2023-01-03 11:46:20 +00:00
Ilya Kirillov 4a31f82b14 [FIR] use whileAnalysing instead of direct exception handling 2023-01-03 10:23:50 +00:00
Ilya Kirillov 79fe4100aa [FIR] extract exception handing into a service to have additional implementation for the ide 2023-01-03 10:23:50 +00:00
Ilya Kirillov 90436abb23 [FIR] add FirSession parameter to whileAnalysing
It will be needed in the following commits
2023-01-03 10:23:49 +00:00
Alexander Udalov ae6d4d268d Use short copyright from COPYRIGHT_HEADER in generated files 2023-01-02 22:52:18 +01:00
Alexander Udalov 3c4b5529af Update year to 2023 in COPYRIGHT_HEADER.txt
This commit is the result of changing the year to 2023 in
COPYRIGHT_HEADER.txt and running all `generate*` tasks in
`generators/build.gradle.kts`.
2023-01-02 22:52:15 +01:00
Ilya Chernikov 19a0a1fcd8 K2: add missing MPP warning in LightTree mode 2023-01-02 19:54:57 +00:00
Ilya Chernikov 73e0a5ccd3 K2: Use LightTree by default in modularized tests 2023-01-02 19:54:57 +00:00
Ilya Chernikov 47a4532ea0 K2: update LightTree support in modularized tests 2023-01-02 19:54:56 +00:00
Ilya Chernikov 1a373317ed K2: temporarily disable scripts compilation in LT mode
Should be addressed in the new K2 scripting support soon
2023-01-02 19:54:56 +00:00
Ilya Chernikov 23a27864e5 K2: introduce LT mode config property 2023-01-02 19:54:56 +00:00
Ilya Chernikov 16f52f4c50 K2: use LightTree by default with K2 2023-01-02 19:54:55 +00:00
Marco Pennekamp 5f554d0065 [FIR] KT-54980 Fix resolvability of too few/too many type arguments
- If too few or too many type arguments were provided, they were all
  thrown away in `TypeArgumentMapping`,
  `FirCallCompletionResultsWriterTransformer`, and `KtFirCallResolver`.
  The fix handles type arguments of the wrong arity more gracefully.
  - Note for `TypeArgumentMapping`: Excess type arguments are not needed
    for candidate resolution. Excess type arguments are still resolved
    due to the handling in `FirCallCompletionResultsWriterTransformer`.
- Post-processing in `AllCandidatesResolver`: When all candidates are
  resolved in `AllCandidatesResolver.getAllCandidates`, the function
  builds a FIR file. During that resolution, the
  `generic<String, String>` call (in example
  `functionCallWithTooFewTypeArguments.kt`) is correctly marked as
  inapplicable, but the missing type argument is inferred as an error
  type. `firFile` then contains a function call
  `generic<String, String, ERROR>` instead of `generic<String, String>`.
  This call is still marked as inapplicable. Despite that, the
  *subsequent* resolution by
  `bodyResolveComponents.callResolve.collectAllCandidates` disregards
  the call's inapplicability and resolves successfully into an
  applicable candidate. This is because `CandidateFactory` doesn't make
  any guarantees for already inapplicable calls. The fix adds
  post-processing to `AllCandidatesResolver` to preserve candidate
  inapplicability.
- Most tests that this commit changes had slightly different results due
  to type arguments becoming resolvable.
- `wrongNumberOfTypeArguments.kt` and
  `wrongNumberOfArgumentsInTypeAliasConstructor.kt`:
  `ConeDiagnostic.toFirDiagnostics` prefers specific errors. Because
  `ARGUMENT_TYPE_MISMATCH` is specific and `INAPPLICABLE_CANDIDATE` is
  not, only the former is reported. I see no reason to pass an illegally
  typed argument in either test, so the change reduces the errors to
  `INAPPLICABLE_CANDIDATE`.
- `typeAliasSamAdapterConstructors2.fir.kt`: See KT-55007.
- Disable `mismatchTypeParameters` JS backend test due to its handling
  of excess type arguments. See KT-55250.

^KT-54980 fixed
2023-01-02 16:36:02 +00:00
Alexander Udalov 7a9c59aeb5 JVM IR: do not serialize metadata for actualized optional expectations
Optional-expectation annotations which have an actual counterpart should
have never been serialized to the kotlin_module's proto. See for example
the original (correct) implementation in the old JVM backend in
`PackageCodegenImpl.addDescriptorToOptionalAnnotationsIfNeeded`.

 #KT-55611 Fixed
2023-01-02 15:30:27 +00:00
Alexander Udalov 11504fda18 Minor, slightly improve rendering for -Xlist-phases
Remove ':' after phase name, render "(Disabled)" instead of "(Enabled)".
2023-01-02 15:26:07 +00:00
Alexander Udalov 3f2b51151f Remove -Xexclude-from-dumping
Apparently the underlying logic was removed in b07690fccf and no one
noticed.
2023-01-02 15:26:07 +00:00
Dmitrii Gridin 251a4363f5 [LC][tests] drop outdated '//RELEASE_COROUTINE_NEEDED' directive 2023-01-02 15:05:44 +00:00