Commit Graph

101197 Commits

Author SHA1 Message Date
Jinseong Jeon b42d2e56a4 AA: use nameFilter of KtFileScope#get*Symbols 2023-05-15 19:25:05 +02:00
Nataliya.Valtman f87fdb43fa KT-57224: Add kotlin language version to file report 2023-05-15 16:23:59 +00:00
Sergej Jaskiewicz 3deea96b53 [IR] Introduce DumpIrTreeOptions for customizing IR dump
We plan to add more options => using a data class is better
than multiple function parameters
2023-05-15 15:47:34 +00:00
Sergej Jaskiewicz 1a8d5056bf [test] Mute an irText test on JS_IR instead of making it JVM-only
The test is not in any way JVM-specific, but it fails on the JS BE
because of different fq-names of stdlib symbols on JVM and JS.

The fix is in progress. Mute the test until the fix is ready.
2023-05-15 15:40:25 +00:00
Nikolay Lunyak 200fb1e5ce [FIR] KT-54874: Ensure this code is red
^KT-54874 Fixed
2023-05-15 14:44:10 +00:00
Mads Ager 6117f76a8c Discourage the use of LANGUAGE_VERSION directive.
Pinning the language version is rarely the right thing to do.
This changes makes it harder to do so by requiring an additional
directive with a name that indicates to developers that they are
likely doing something dangerous.
2023-05-15 14:29:48 +00:00
Icyrockton df8e9206d2 remove duplicate import scope create 2023-05-15 17:18:36 +03:00
Vladimir Dolzhenko 8ad781987e Optimize file extensions usage
#KTIJ-25470

Merge-request: KT-MR-10135
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-05-15 13:59:24 +00:00
Jinseong Jeon 41473a948d SLC: implement PsiAnnotation#find(Declared)AttributeValue
^KT-58448 Fixed
2023-05-15 14:16:14 +02:00
Sebastian Sellmair 08f3d56d9b [Gradle] KotlinCompilationAssociator: Restore 1.8.10 behaviour for KotlinWithJavaTarget
^KT-58280 Verification Pending
2023-05-15 12:11:00 +00:00
Sebastian Sellmair 3196981799 [Gradle] Implement KT58280JvmWithJavaTestCompileClasspath to cover KT-58280 2023-05-15 12:10:59 +00:00
Svyatoslav Scherbina 1a1cc224a8 Bump Kotlin/Native version to 1.9.20-dev-1523 2023-05-15 12:07:53 +00:00
Yahor Berdnikau a2c874572a [Gradle] Fix adding additional res dirs to KotlinSourceSet does not work
In case of "org.jetbrains.kotlin.jvm" plugin Java SourceSet will create
ProcessResources task copying all registered resources.

^KT-36904  Fixed
2023-05-15 11:59:57 +00:00
Dmitrii Krasnov 958b0e6ebc refactored CommandLineArguments assertions functions
#KT-51553 In Progress
2023-05-15 11:02:20 +00:00
Denis.Zharkov c3ac2e44a0 Adjust test data for enabling ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
^KT-55388 Fixed
2023-05-15 10:43:19 +00:00
Denis.Zharkov fa85cbfe74 Enable ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated in 1.9
^KT-36770 Related
^KT-53041 Fixed
^KT-55388 In Progress
2023-05-15 10:43:19 +00:00
Svyatoslav Scherbina 43b4791fd2 Native: mark -no-endorsed-libs compiler flag as deprecated
It no longer has any effect, and there is no intention to change that.
2023-05-15 10:10:57 +00:00
Svyatoslav Scherbina 16acb72521 Native: don't pack endorsed libraries (namely kotlinx.cli) into dist
The overall concept of "endorsed" libraries is currently unmaintained
and non-reviewed.
kotlinx-cli is in its alpha, and is available from Maven.

See also KT-54098.
2023-05-15 10:10:56 +00:00
Nikolay Lunyak 7b45f75213 [FIR] KT-58523: Check the companion presence when resolving type-aliases
The change in `QualifiedNameResolution.kt` is
backed by `starImportOnTypeAlias.fir.kt` and
`javaStaticMembersViaTypeAlias.fir.kt`.
Note that referencing inner classes via type-aliases is
prohibited, but referencing enum entries is not.

^KT-58523 Fixed
2023-05-15 10:03:19 +00:00
Nikolay Lunyak 99ff36c77a [FIR] KT-58523: Ensure the compiler resolves to the typealias 2023-05-15 10:03:18 +00:00
Ilya Goncharov 1b9ed568bb [Gradle, JS] Default stdOutput and errOutput on dry run with JS tests 2023-05-15 09:29:42 +00:00
Ivan Kylchik 3d4f3d2f57 [IR] Visit file annotations in IR interpreter
#KT-55866 Fixed
2023-05-15 08:32:37 +00:00
Mikhail Glukhikh 1ba900be44 FIR2IR: change origin & operator flag in data classes making them closer to K1
Related to KT-54887
2023-05-15 08:16:24 +00:00
Mikhail Glukhikh 5d35bfd88d Add IR text test for KT-54887 2023-05-15 08:16:24 +00:00
Mikhail Glukhikh a86279b766 IR text: add a test with data object 2023-05-15 08:16:24 +00:00
Alexander Udalov 98fb4f1f45 Stdlib tests: annotate serialized lambdas explicitly
Behavior is going to change in KT-45375 and lambdas will no longer be
serializable by default.
2023-05-12 19:55:25 +00:00
Evgeniy.Zhelenskiy 07576b03c4 [IR] Fix inline class constructors having MFVC parameters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-05-12 18:36:49 +00:00
Evgeniy.Zhelenskiy 2535a87f85 [IR] Change value classes lowering dispatching strategy
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-05-12 18:36:49 +00:00
Evgeniy.Zhelenskiy c1ac580031 [IR] Fix MFVC fields not yet moved from their companions
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-05-12 18:36:49 +00:00
Roman Golyshev 90a0b34bf7 [AA FIR] KT-58503 Use resolvedStatus to access modality only in case of Status Transformers present
ATM unconditional `resolvedStatus` call in `modality` causes a
performance degradation in our completion tests

Since `resolvedStatus` is called to make sure that all the
status-transforming compiler plugins had finished their job, it doesn't
make sense to call `resolvedStatus` if there are no such compiler
plugins registered

N.B. After KT-56551 is fixed, this optimization might become obsolete
and can be removed if proved so
2023-05-12 16:22:48 +00:00
Leonid Startsev c4255f9a9e [K2] Instantiation of annotations having default values for properties
This commit adds missing pieces for the puzzle:

Annotation instantiation feature uses IrProperty's initializer to instantiate
properties from other modules that have default values which weren't
specified on call site.

To support this feature properly, Fir2IrVisitor should fill LazyIrProperty's
backing field initializer with information from Fir.

To get this information into Fir, FirMemberDeserializer should be able to read
it from KotlinJvmBinaryClass with AnnotationLoaderVisitorImpl. (klibs are unsupported for now)

There's a catch with enum entries references: we can't access session.SymbolProvider to resolve it
because we're still at the deserialization stage, and it can cause StackOverflow if enum is nested in the
same class (see RequiresOptIn.Level). To mitigate this, a new FirEnumEntryDeserializedAccessExpression is produced
instead; it is later replaced with the correct reference in the Fir2IrVisitor.

^KT-58137 Fixed

Also add test to loadJava folder with annotations default values that
verifies metadata loading
2023-05-12 16:08:02 +00:00
Alexander Udalov d757847ed6 JVM: enable -Xlambdas=class for some backend tests
These tests are checking the specifics of the class-generated lambdas.
2023-05-12 15:21:00 +00:00
Nikolay Lunyak 834ba397ad [FIR] KT-58284: Prevent missing diagnostics on for loops
^KT-58284 Fixed
2023-05-12 14:47:24 +00:00
Dmitrii Krasnov 606ffa7273 fixed test, which started to fail on WINDOWS env after test migration 2023-05-12 14:35:37 +00:00
Ivan Kochurkin d06d3ff467 [FIR2IR] Consider isExpect value of super members during fake-overrides generating
It's important for FIR2IR and IrActualizer

Because `isExpect` is a part of signature, and it's considered during actualization
2023-05-12 14:03:15 +00:00
Alexander Udalov 41cb2ce3d8 K/N: enable -Xlambdas=class for :kotlin-native:Interop:Indexer
`staticCFunction` is used a few times in this module, and it uses
kotlin-reflect to inspect the lambda parameter, which is only possible
for class-generated lambdas.

This is needed to enable indy lambdas in the project.
2023-05-12 14:01:30 +00:00
Dmitriy Dolovov 42a8b28337 [Native][tests] Don't track used memory when running in TeamCity 2023-05-12 13:58:18 +00:00
Dmitriy Dolovov 6f249ab615 [Native][tests] Minor. Fix condition for generating intermediate build dir 2023-05-12 13:58:18 +00:00
Dmitriy Dolovov bb5c1eea90 [Native][tests] Minor. Use "default" module name in AbstractNativeObjCExportTest 2023-05-12 13:58:18 +00:00
Dmitriy Dolovov 82984d782a [Native][tests] Unify work with build directories across BB & Simple tests
* Drop 'SimpleTestDirectories' in favor of 'Binaries'
* Make 'Binaries' lazy
2023-05-12 13:58:18 +00:00
Dmitriy Dolovov f7848133a6 [Native][tests] Fix generated framework log file name
$frameworkName.log -> $frameworkName.framework.log
2023-05-12 13:58:18 +00:00
Nikita Bobko 9a65dcb664 MUST_BE_INITIALIZED: take into account containingDeclaration's modality
^KT-58587 Fixed
Review: https://jetbrains.team/p/kt/reviews/10136

This commit is important in scope of KT-57553. It makes the migration
more smooth.

Other related tests:
- testUninitializedOrReassignedVariables
- testAugmentedAssignmentInInitializer
2023-05-12 13:48:49 +00:00
Dmitrii Gridin 4807a714ec [CODEOWNERS] introduce owner for light classes 2023-05-12 13:41:29 +00:00
Pavel Kargashinsky 603e30965b [MPP] Mute ExternalAndroidTargetPrototypeSmokeTest on Windows. 2023-05-12 13:26:40 +00:00
Pavel Kargashinsky 4b6ed128a2 [MPP] Use android.sdk from kotlin/dependencies for functionalTests 2023-05-12 13:26:40 +00:00
Alexander.Likhachev 877438b1f3 Remove LV/AV customization for the compiler CLI modules
The customization was added for compatibility with Gradle. That isn't a problem anymore, as we don't use it from KGP and soon we will eliminate the direct dependency on kotlin-compiler from KGP.
2023-05-12 12:59:39 +00:00
Alexander.Likhachev 44d9a2136b Bump language version for Gradle plugins' dependencies to 1.5
#KT-58569 Fixed
2023-05-12 12:59:39 +00:00
Bogdan Mukvich 3de59e3f17 Fix kotlinx-atomicfu-runtime sonatype publication
^KT-56400
2023-05-12 12:54:52 +00:00
Dmitrii Gridin 1d974b1ef7 [LL FIR] LLFirSuperTypeTargetResolver: propagate looped types more accurately
'forceSkipResolvedClasses' is wrong here, because nested class (`CC`)
won't be marked as cycle but the outer is.
Instead of this, we should check
canHaveLoopInSupertypesHierarchy recursively

```kotlin
open class C : <!CYCLIC_INHERITANCE_HIERARCHY!>D<!>() {
    open class CC
}
open class D : <!CYCLIC_INHERITANCE_HIERARCHY!>C.CC<!>()
```

Also, this commit adds an optimization to avoid hierarchy search
for non-source classes (forceSkipResolvedClasses was introduced for this before)
2023-05-12 11:36:43 +00:00
Yahor Berdnikau 2b27fe4e65 [Gradle] Fix moduleName is not possible to set in MPP project
^KT-57959 Fixed
2023-05-12 10:50:38 +00:00