Commit Graph

101905 Commits

Author SHA1 Message Date
Abduqodiri Qurbonzoda 295fdc36ce Enum.valueOf throws inconsistent exception across multiple platforms #KT-35116 2023-06-16 22:18:20 +00:00
Abduqodiri Qurbonzoda d6867917c9 Enum entry hashCode() should return identity hash code #KT-59223 2023-06-16 22:18:20 +00:00
Timofey Solonin 19c6622ff6 [MPP] Remove obsolete targets from NewMultiplatformIT and ConfigurationCacheIT
^KT-58822
2023-06-16 18:44:03 +00:00
Hung Nguyen 078356164b IC: Fix regression in detecting constants in KotlinClassInfo.kt
A constant is a static final field with non-null value. In a previous
commit (0b09be7), we accidentally removed the *non-null value*
filter when looking for constants in the bytecode.

This commit re-adds that filter to make sure the detection is correct.

Test: Added KotlinOnlyClasspathChangesComputerTest.testDelegatedProperties

^KT-58986: Fixed
2023-06-16 18:40:01 +00:00
Hung Nguyen ff612f15cf IC: Small cleanup in KotlinClassInfo.kt
This is to address the not-yet-resolved comments in
https://github.com/JetBrains/kotlin/pull/5127, plus a few other small
(non-functional) changes.

^KT-58986: In progress
2023-06-16 18:40:00 +00:00
Timofey Solonin cba7154e8a [MPP] Remove broken execution test and replace obsolete targets in CommonizerIT with curl
^KT-58822
2023-06-16 18:05:54 +00:00
Mikhail Glukhikh d5a02960d8 K2 plugins: set proper 'expect' flag for all member declarations
Related to KT-59299
2023-06-16 17:55:46 +00:00
Mikhail Glukhikh 8e882ea797 K2 plugins: create companions with same expect/actual as their owners
#KT-59299 Fixed
2023-06-16 17:55:45 +00:00
Vyacheslav Gerasimov 77e5f077f3 Update Dependency verification section in ReadMe.md 2023-06-16 17:27:32 +00:00
Timofey Solonin 5df50c0fca [MPP] Remove obsolete targets from CommonizerHierarchicalIT.commonizeHierarchically
^KT-58822
2023-06-16 17:20:58 +00:00
Brian Norman 0ff9982b31 [FIR] Additional errors to distinguish resolution to classifier cases
When a call is resolved to a classifier, only a single error message was
being used for multiple cases. This lead to confusion as the default
message may not be applicable to a given error case. Added additional
errors and messages to distinguish between these error cases.

#KT-57251 Fixed
2023-06-16 16:26:50 +00:00
Alexander.Likhachev ac79633590 [Gradle] Register default kapt classes dir as an output
#KT-59256 Fixed
2023-06-16 15:42:59 +00:00
Alexander.Likhachev b23b9ab287 [Gradle] Add an integration test for KT-59256 2023-06-16 15:42:59 +00:00
Dmitrii Gridin 13732881a6 [AA FIR] reduce resolve calls
^KT-59266
2023-06-16 14:47:49 +00:00
Dmitrii Gridin 87ca9e4203 [LL FIR] reduce resolution inside getOrBuildFirFor
We can avoid body resolution in some cases because it is more
than out contract is required

So ANNOTATIONS_ARGUMENTS_MAPPING should be enough for all
non-body parts of a declaration to return fully-resolved FirElement
Body parts incudes: body and default values

^KT-59266 Fixed
2023-06-16 14:47:49 +00:00
Dmitrii Gridin b9e24e9b19 [LL FIR] add more tests on getOrBuildFirFor
^KT-59266
2023-06-16 14:47:49 +00:00
Dmitrii Gridin aad99fd6eb [LL FIR] getOrBuildFir tests should render fir file
We need it to see how many declarations were resolved

^KT-59266
2023-06-16 14:47:48 +00:00
Anna Kozlova 8c2f1acc7e [LL] take originalDeclaration when exists to detect module kind
Fixes KTIJ-24609.
When completion happens outside the content root,
module kind should be detected by the original file.
Otherwise, module would not be the same because outside the content root,
each file has its own module.
Actual #findSourceFirSymbol also does search over originalDeclaration when present.
Added FirCompletionOutsideSourceRootTest in IJ monorepo
2023-06-16 13:28:26 +00:00
Vyacheslav Gerasimov b06ec464d9 Minor: .idea/dictionaries update 2023-06-16 12:19:01 +00:00
Vyacheslav Gerasimov 61664c6c4d Build: Add webassembly wabt and test suite to cachedDependencies
#KTI-72
2023-06-16 12:19:01 +00:00
Vyacheslav Gerasimov 80758b36e3 Build: Add NodeJs to implicitDependencies
#KTI-72
2023-06-16 12:19:01 +00:00
Vyacheslav Gerasimov 8a6548cd7a Build: Add dokka to implicitDependencies
#KTI-72
2023-06-16 12:19:00 +00:00
Vyacheslav Gerasimov e15a299196 Build: Add Mozilla jshell to implicitDependencies
#KTI-72
2023-06-16 12:19:00 +00:00
Vyacheslav Gerasimov 02489dcd75 Build: Add android sdk to implicitDependencies
#KTI-72
2023-06-16 12:19:00 +00:00
Vyacheslav Gerasimov 01b6af452f Build: Introduce resolveDependencies task
It is used on the build server to pre-download all dependencies and
check that verification-metadata.xml is up-to-date
 #KTI-72
2023-06-16 12:19:00 +00:00
Vyacheslav Gerasimov 7c1ffc4eb2 Build: Introduce global implicitDependencies configuration
It is used to pre-download all dependencies and check that
verification-metadata.xml is up-to-date
 #KTI-72
2023-06-16 12:19:00 +00:00
Anton Lakotka 4a66279f00 fixup! Fix 'commonMain cant depend on androidInstrumentedTest' test 2023-06-16 12:11:38 +00:00
Anton Lakotka deb4ed5e39 [Gradle] Add KotlinSourceSetDependsOnDefaultCompilationSourceSet diagnostic
Default Kotlin Source sets should not have any dependents.

^KT-47144 Verification Pending
2023-06-16 12:11:38 +00:00
Anton Lakotka 4084fc62ee fixup! add cycle check 2023-06-16 12:11:38 +00:00
Anton Lakotka 52cfd01380 fixup! add long diamond source set dependencies test case 2023-06-16 12:11:38 +00:00
Anton Lakotka 765c489eca fixup! Add : 2023-06-16 12:11:38 +00:00
Anton Lakotka 4a869e42c2 fixup! Remove unused import 2023-06-16 12:11:38 +00:00
Anton Lakotka 3774bafc72 fixup! Ignore other diagnostics that can appear during test run
For example when commonMain depends on commonTest there will be
CommonMainWithDependsOnDiagnostic diagnostic reported.

Or running gradle build on linux with apple targets inside will report
DisabledKotlinNativeTargets diagnostic.

KotlinSourceSetTreeDependsOnMismatchTest is not interested in them
2023-06-16 12:11:38 +00:00
Anton Lakotka acf8f5b26b [Gradle] Include android source sets to source set depends on checker
Excluding android source sets can actually bring unexpected behaviour
when, for example, androidInstrumentedTest get depends on commonMain.
In this case "nativeMain" will be reported as checked skipped android
source sets, but they are still present in dependsOn edges.

Another important aspect is that mpp+android is a majority and their
cases should be checked as well

^KT-47144 Verification Pending
2023-06-16 12:11:38 +00:00
Anton Lakotka a4705050b1 [Gradle] Improve KotlinSourceSetTreeDependsOnMismatch heuristic
Introduce "White Crow" heuristic that will report incorrect dependency
edge when there is only one source set with different Source Set Tree.

Otherwise, report all source sets from all Source Set Tree groups
to user to choose which of them are incorrect.

And cover with more tests.

^KT-47144 Verification Pending
2023-06-16 12:11:38 +00:00
Anton Lakotka 681305c8e9 [Gradle] Add KotlinSourceSetTreeDependsOnMismatch diagnostic
In Kotlin Multiplatform it is not possible to have
source set dependencies between two different SourceSet Trees.

For example commonTest can't dependOn commonMain as SourceSet dependency
instead binaries of commonMain should be included as dependency to
commonTest. Which is implemented through different mechanisms

^KT-47144 Verification Pending
2023-06-16 12:11:38 +00:00
Vladimir Sukharev 05e22e56d3 [K/N] Mark rest of reflection related tests as jvm-only
^KT-59057

Merge-request: KT-MR-10570
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-16 11:50:03 +00:00
Brian Norman 269dfc61c8 [FIR] Display actual type for argument type mismatch error
Previously the argument type was being used for the actual type error
display. However, safe-call arguments are unwrapped which causes
nullable types to be displayed as non-null. Change to use the actual
type provided by the diagnostic instead of extracting the type from
the argument.

#KT-58844 Fixed
2023-06-16 11:44:14 +00:00
Pavel Kirpichenkov a7ff0cfc9d Remove deprecated CInteropSettings#getDependencyConfigurationName
KT-55908
2023-06-16 11:00:42 +00:00
Sergej Jaskiewicz fd094835a4 [test] Add the NATIVE backend to non-JVM check blocks in signature tests
(see KT-59204)
2023-06-16 10:01:54 +00:00
Sergej Jaskiewicz 6064012efa [test] Print NATIVE for newly generated check blocks in signature tests
Since we know that in most cases signatures for JS and NATIVE are
the same, when running a signature test for the first time, let's print
`// CHECK JS NATIVE:` instead of `// CHECK JS:` or `// CHECK NATIVE:`.

^KT-59204 Fixed
2023-06-16 10:01:54 +00:00
Anna Kozlova 09f4f0af66 [AA] delegate to resolveToFirSymbol to avoid decompilation
`getReturnTypeForKtDeclaration` is called by UAST on probably compiled declarations.
In order to avoid redundant decompilation + building raw FIR + resolve,
let's delegate to deserialized FIR which is already prepared in stubs

Fixes KTIJ-24810

When `findSourceNonLocalFirDeclaration` is called on non-physical property accessor e.g.,
during completion, then traverse tree should allow drilling into FirProperty;
otherwise, no FIR would be found
2023-06-16 09:00:09 +00:00
Pavel Mikhailovskii 16644c1a3b FIR Preserve nullability of ConeErrorType when possible 2023-06-16 08:09:04 +00:00
Vladimir Sukharev 217550d10e [K/N] Enable passed MPP K1/N tests
^KT-59057

Merge-request: KT-MR-10526
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-16 07:45:01 +00:00
Vladimir Sukharev 1e05cb308c [K/N] Convert and enable some tests using System.out?.println()
^KT-59057

Merge-request: KT-MR-10546
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-15 20:00:27 +00:00
Vladimir Sukharev 67b00f86b7 [K/N] Remove "IGNORE_BACKEND: NATIVE" from tests already ignored due to incompatible language setting found in test
^KT-59057

Merge-request: KT-MR-10587
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-15 19:58:04 +00:00
Anna Kozlova dd059a1e63 [LL] find fir by psi: allow fallthrough to traverse tree for invalid code
In case of broken code e.g., duplicated classes provider would return first class,
though we definitely need some code insight in this case
at least to add navigation fixes, etc.
Similar to this, a file copy is created during completion,
where additional elements might appear and we need to search for them.

Added test cases for duplicated classes.
2023-06-15 17:32:40 +00:00
Anna Kozlova 70b9af0566 [LL] don't request provider with non-physical element
Otherwise, if fir was requested with non-physical element
 inside existing analysis session (not on-air, e.g.,
`FirPositionCompletionContextDetector#analyzeInContext` with
 `FirSimpleParameterPositionContext`) all consequent requests
 would return fir with that non-physical source,
 which might be already invalidated.

 On-air sessions should be protected from invalidation problem but some clients
 might expect original elements anyway and in this case, it would be
 impossible to retrieve correct fir for them.

 In order to find parameters, allow to traverse tree till functions.
2023-06-15 17:32:40 +00:00
Anna Kozlova 3fc334d2eb [decompiler] additional logging for ByDescriptorIndexer 2023-06-15 15:47:17 +00:00
Dmitrii Krasnov c1026a759a Migrated cocoapods tests to new test dsl (junit 5 and gradle test kit) 2023-06-15 15:28:07 +00:00