Commit Graph

90654 Commits

Author SHA1 Message Date
Dmitriy Novozhilov def799cc4e [FIR] Fix inference of postponed lambdas if containg call has explicit type arguments 2022-01-20 11:25:46 +03:00
Dmitriy Novozhilov fbab32c4dd [FIR] Remove redundant nullability from findFunctionalTypesInConstraints return type 2022-01-20 11:25:46 +03:00
Dmitriy Novozhilov 7d8a8d543f [FIR] Fix processing calls on unstable smartcasts with check not null call 2022-01-20 11:25:45 +03:00
Dmitriy Novozhilov 1a3841d66d [FIR] Properly enhance raw Class type in java annotations 2022-01-20 11:25:44 +03:00
Dmitriy Novozhilov 239a330ddd [FE 1.0] Add test for KT-50850 2022-01-20 11:25:41 +03:00
Xin Wang 56e5db9f0e JVM_IR KT-50074 generate tableswitch for literal string subject of when expression 2022-01-19 22:25:49 +03:00
Alexander Shabalin 69bb2587eb [K/N] Make GC scheduler less aggressive
^KT-48537

Merge-request: KT-MR-5319
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-19 19:11:15 +00:00
Alexander Udalov 3e7b1c027f IR: make IrConst.copyWithOffsets an extension function
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:36 +01:00
Alexander Udalov 785eb83822 IR: refactor IrMemberAccessExpression internals
The idea is to keep the subclasses as simple as possible, to simplify
transition to auto-generated IR.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:36 +01:00
Alexander Udalov 6f6bdd8aec IR: change acceptChildren/transformChildren order in IrClass
Traverse properties of supertypes first, and then handle thisReceiver.
This will simplify transition to auto-generated IR.
2022-01-19 17:50:35 +01:00
Alexander Udalov 4ecc5e517a IR: move some accept/acceptChildren/transformChildren to base classes
This will be helpful for the transition to auto-generated IR.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 886545262b IR: use mutable lists in IrStringConcatenation, IrTry, IrVararg
Make addArgument/addElement/putElement extension functions. This will
simplify transition to auto-generated IR.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 9ee570ae54 IR: update copyright in ir.tree declarations and expressions
To simplify review of the upcoming IR tree generator.

Note that copyright is dated 2021, since that's in
license/COPYRIGHT_HEADER.txt which is used by generators.
2022-01-19 17:50:35 +01:00
Alexander Udalov f17fc67683 IR: split files containing multiple classes/functions
This change only moves code around, no behavior is changed.
Specifically, ir.tree sources containing several declarations are split
into several files: one file per class, and one file for all extension
functions per package (IrDeclarations.kt, IrExpressions.kt,
IrVisitors.kt, IrConstructorCallTypeArguments.kt).

This is useful because after introducing IR tree generator, we can
easily see how generated sources are different from those which were
written manually, since Git will recognize file moves. Also, it will
keep Git history for sources which consisted of one big class + a couple
of extension functions (e.g. IrElementVisitorVoid.kt).
2022-01-19 17:50:35 +01:00
Alexander Udalov e4b63d4a2b IR: minor, rename some files to keep git history 2022-01-19 17:50:35 +01:00
Alexander Udalov 6445a29893 IR: remove type parameter in visitConst
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 81106526b1 IR: remove IrConstantObject.putArgument, IrConstantArray.putElement
Change `valueArguments` and `elements` types to be mutable lists. This
will simplify IR tree generator.
2022-01-19 17:50:35 +01:00
Pavel Punegov 816acaadc3 [K/N][samples] Properly disable HMPP for ^KT-50547
Properties file inside subproject isn't read. Moved to root
Fixup to 8d0b511e95
2022-01-19 16:10:10 +00:00
Yahor Berdnikau b3fba1faad Fix empty Android layout directories are not ignored
Kotlin Android extensions plugin adds layout directories as input to
KotlinCompile task when experimental flag is enabled. This breaks
cache relocation.

^KT-48849 Fixed
2022-01-19 15:47:33 +01:00
Ilya Gorbunov efa09cbd80 Update dokka version for building stdlib docs 2022-01-19 17:24:53 +03:00
Alexander Likhachev 5199981d96 [Gradle] Check JVM targets only if mixed Java/Kotlin sources are present
#KT-48408 Verification Pending
2022-01-19 14:16:19 +00:00
Alexander Likhachev b0d7c97ad2 [Gradle] Adjust test for KT-48408 to not fail without Kotlin sources 2022-01-19 14:16:18 +00:00
Alexander Likhachev d9b279e675 Revert "[Gradle, JVM] Validate JVM targets even if compiler isn't called"
This reverts commit aa52a60f
2022-01-19 14:16:18 +00:00
Igor Yakovlev c76e7bc9d8 [WASM] Any.toString implementation 2022-01-19 17:01:11 +03:00
Nikolay Krasko eb5df29834 Fix flaky CompilerClientIT.testSimpleScript tests
System property `compilerClasspath` in tests references absent file

cannot find (.../kotlin/prepare/compiler/build/libs/kotlin-compiler-1.6.255-SNAPSHOT.jar)
java.io.FileNotFoundException: cannot find (.../kotlin/prepare/compiler/build/libs/kotlin-compiler-1.6.255-SNAPSHOT.jar)
	at org.jetbrains.kotlin.compiler.client.CompilerClientIT.filesFromProp(CompilerClientIT.kt:63)
	at org.jetbrains.kotlin.compiler.client.CompilerClientIT.access$filesFromProp(CompilerClientIT.kt:40)
	at org.jetbrains.kotlin.compiler.client.CompilerClientIT$compilerClasspath$2.invoke(CompilerClientIT.kt:47)
	at org.jetbrains.kotlin.compiler.client.CompilerClientIT$compilerClasspath$2.invoke(CompilerClientIT.kt:46)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	...
2022-01-19 16:49:08 +03:00
Nikolay Krasko 22b5d86656 Stop double null instrumentation for modules with several source roots
KTI-754

For instrumentation only destination directory is relevant. So each
execution did own instrumentation, and there no internal mechanism for
preventing re-instrumentation included.

Replace InstrumentIdeaExtensions with Javac2 because
areJavaClassesCompiled=true in the base class.

https://github.com/JetBrains/intellij-community/blob/9c40bdd/java/compiler/javac2/src/com/intellij/ant/InstrumentIdeaExtensions.java
https://github.com/JetBrains/intellij-community/blob/9c40bdd/java/compiler/javac2/src/com/intellij/ant/Javac2.java
2022-01-19 16:49:07 +03:00
Alexander Korepanov 59173baf5a [JS IR] Pass forward -Xir-property-lazy-initialization option
Pass forward -Xir-property-lazy-initialization option
for the incremental cache.

^KT-50175 Fixed
2022-01-19 13:28:47 +00:00
Pavel Kunyavskiy 2f853175c7 [K/N] Get rid of using base class default values for annotations
They can be not available in incremental compilation case

^KT-50211
2022-01-19 13:17:17 +00:00
Dmitriy Novozhilov 473c6427be [Build] Add taks with tests for bootstrap configuration on TC 2022-01-19 15:26:25 +03:00
Dmitriy Novozhilov 345fdc214b [FIR] Store enhanced functions and properties in session component
Previously enhanced symbols were cached inside SignatureEnhancement,
  which is created independently for each enhancement scope. This may
  cause creation of multiple enhanced symbols for same java declaration
  in presence of multiple scope sessions (mutithread compiler, IDE,
  separate scope session for checkers)

^KT-50858 Fixed
2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov 4f967ce102 [FIR] Ignore test due to KT-50858 2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov e5275992d2 [FIR] Return scope session from LowLevelFirAnalyzerFacade instead of failing
This is needed for proper work of FirScopeDumpHandler for
  low level fir tests
2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov 6d8b1800e4 [FIR] Extract duplicated code of processing classifiers from intersection scope 2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov c80cfb0fdb [FIR] Replace single supertype scope with list of scopes of supertypes in use site scopes
This big refactoring is needed to cleanup building of overrides
  mappings and prevent creating redundant intersection overrides in
  cases when there is no need in them:

```kotlin
interface A {
    fun foo()
}

interface B {
    fun foo()
}

interface C : A, B {
    override fun foo()
}
```

Before this refactoring there was next override tree:
C.foo
  intersection override (A.foo, B.foo)
    A.foo
    B.foo

Also this commit fixes special mapping of overrides in jvm scopes
  for declarations which have kotlin builtins in supertypes with
  special java mapping rules (collections, for example)
2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov 17916d4a63 [FE] Return Name? instead of List<Name> from getBuiltinFunctionNamesByJvmName
This is much more correct, because we have one to one mapping for
  special java functions in this case, so using single nullable name
  instead of list of names makes code more readable
2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov 09a7a1c09f [FIR] Add ability to specify members in FirScopeDumpHandler 2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov d588b2e654 [FIR] Add toString to all type scopes 2022-01-19 15:24:43 +03:00
Dmitriy Novozhilov e4978d8022 [FIR] Move collecting classifiers from type intersection scope to context 2022-01-19 15:24:42 +03:00
Dmitriy Novozhilov 95a95450bf [FIR] Extract logic of creating intersection overrides into separate class 2022-01-19 15:24:42 +03:00
Pavel Punegov 3db341213b [K/N] Synchronize LLVM target initialization
Race conditions should be avoided during initialization.
See llvm/lib/Support/TargetRegistry.cpp in LLVM repo
2022-01-19 11:18:43 +00:00
Pavel Punegov a22e267b05 [K/N] Set JDK17 as a toolchain for endorsedLibs project
Older JDKs sometimes make build fail with obscure errors
2022-01-19 11:18:14 +00:00
Pavel Kirpichenkov b4c854429f [MPP] Permit const actual properties for non-const expects
It's safe as not having const is more restrictive, therefore can be
allowed in common. Otherwise, it's not possible to declare an expect
declaration for a platform property with `const` modifier in common

KT-18856
2022-01-19 13:22:47 +03:00
Pavel Kirpichenkov 8ad06ef725 Minor: reformat 2022-01-19 13:22:47 +03:00
Pavel Kirpichenkov a46e683c85 [MPP] Add tests for const vs non-const expect and actual properties
KT-18856
2022-01-19 13:22:46 +03:00
Denis.Zharkov b2543b7a26 Fix false negative UPPER_BOUND_VIOLATED with typealiases in supertypes
^KT-50797 Fixed
^KT-50798 Open
2022-01-19 09:52:16 +03:00
Pavel Punegov 8d0b511e95 [K/N][samples] Turn off hmpp and metadata due to ^KT-50547 2022-01-18 15:24:06 +00:00
Elena Lepilkina b8af589137 [K/N][perf] Added workaround to build benchmarks analyzer artifacts 2022-01-18 17:08:10 +03:00
Ilmir Usmanov b794b0f1be Check if there is bridge by signatures instead of IR
#KT-50649 Fixed
2022-01-18 16:57:00 +03:00
Alexander Korepanov 8fe4e9030f [JS IR] Add an implicit cast to int for the mod operation
^KT-45620 Fixed
2022-01-18 12:01:37 +00:00
Dmitriy Novozhilov 5fc1e2e0cb [FIR] Don't create DNN types for flexible simple types
^KT-50788
2022-01-18 13:41:31 +03:00