Commit Graph

93092 Commits

Author SHA1 Message Date
Jinseong Jeon a2da690afd Test: add java source files as JavaSourceRoot
so that those can be properly populated in SingleJavaRootsIndex
2022-06-16 22:14:17 +02:00
Yuriy Artamonov cb2a54cef8 KT-50907 Update no-arg plugin to for jakarta persistence api namespace 2022-06-16 18:31:49 +00:00
Yan Zhulanow 191bac38a3 Fix 'PsiElement.getReference()' contract for Kotlin PSI (KT-52822)
As stated in JavaDoc for 'PsiElement' (formatting is slightly changed):

Returns the reference from this PSI element to another PSI element
(or elements), if one exists. If the element has multiple associated
references, returns the first associated reference.
2022-06-16 18:31:49 +00:00
Yan Zhulanow 3a6dd52833 [Pill] Update imported modules 2022-06-16 18:31:49 +00:00
Yan Zhulanow 28625e135d [Pill] Disallow 1.6 JVM target in generated facets 2022-06-16 18:31:48 +00:00
Romain Guy 02a3915fdf KT-48232: Implement kotlin.math.cbrt() (cubic roots)
cbrt() is the standard cubic root function that provides several advantages over pow(x, 1.0/3.0):
- Better precision
- Faster
- Behaves better with negative values
2022-06-16 20:27:43 +03:00
Dmitriy Novozhilov c79a485c8e [FIR2IR] Run IrGenerationExtensions before patching parents of external declarations and constant evaluation
^KT-52804 Fixed
2022-06-16 13:43:50 +00:00
Dmitriy Novozhilov 76622097e4 [IR] Introduce new functions for referencing declarations from IrPluginContext
Those functions take `ClassId` and `CallableId`, which is more correct
  than using just `FqName`.

Also implement those functions for `Fir2IrPluginContext`
2022-06-16 13:43:50 +00:00
Dmitriy Novozhilov a30216c655 [IR] Mark methods with descriptors of ReferenceSymbolTable with @ObsoleteDescriptorBasedAPI
Also remove optIn annotation from IrPluginContext.symbolTable
2022-06-16 13:43:49 +00:00
Nkolay Krasko 8227a35a33 [Build] Update containers 2022-06-16 13:12:32 +02:00
Sergej Jaskiewicz da7ff5b868 [JS IR] Fix replacing super.toString() call with a runtime function call
#KT-52553 Fixed
2022-06-16 10:03:14 +00:00
Sergej Jaskiewicz f2111c9dc8 [JS] Add some helpful documentation regarding testing to the readme. 2022-06-16 10:02:06 +00:00
Sergej Jaskiewicz 30b47b6902 [JS] Use absolute paths in sourcemaps for tests 2022-06-16 10:02:05 +00:00
Sergej Jaskiewicz 53233c487e [JS] Factor out source map path rewriting 2022-06-16 10:02:05 +00:00
Sergej Jaskiewicz 0320d49ddc [JS IR] Generate sourcemaps for JS IR tests 2022-06-16 10:02:04 +00:00
Alexander Shabalin 29f3445721 [K/N] Deprecated freezing ^KT-50541
Starting with 1.7.20 freezing is deprecated. See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#freezing-deprecation for details.

Merge-request: KT-MR-6399
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-06-16 09:04:14 +00:00
Pavel Kunyavskiy b482b0e86d [K/N] Temporary allow caches with non-default assertions mode
It was broken for a long time anyway, but returning error right now
requires too much effort.
2022-06-16 08:47:36 +00:00
Pavel Kunyavskiy 3233efdd04 [K/N] Disable freezing tests, when caches are enabled 2022-06-16 08:47:36 +00:00
Pavel Kunyavskiy a07066f98b [K/N] Make overridden runtime variables available during stdlib lto 2022-06-16 08:47:35 +00:00
Pavel Kunyavskiy ee2340842c [K/N] Refactor staticData to support several llvm modules 2022-06-16 08:47:34 +00:00
Pavel Kunyavskiy f562c127af [K/N] Improve consistency of using setConst vs override RuntimeGlobals 2022-06-16 08:47:33 +00:00
Mikhail Glukhikh fa914f20a4 Use nearest Java super qualifier for fields in IR converter
Related to KT-49507
2022-06-16 06:51:34 +00:00
Mikhail Glukhikh 8ae47d4c4d IR: slightly fix kotlin-like dumping of super qualifiers 2022-06-16 06:51:34 +00:00
Mikhail Glukhikh b0a6508d4b Handle Java base class field read properly in IR converters
For FE 1.0, we just change super qualifier symbol to
base class, if it's possible.
For FIR, we introduce using of super qualifier symbols for
field accesses and repeat FE 1.0 behavior here.

#KT-49507 Fixed
2022-06-16 06:51:33 +00:00
pyos c2ae74c7cd FIR CFG: when unifying flows, group statements by assignment
Consider a function `run2` that has 2 lambda arguments called in place.
We don't know the order in which they're called, so here:

    var x: Any? = something
    run2(
      { x = null },
      { x as String },
    )
    // <--

it's not correct to simply `&&` the statements together, as that would
produce `x is Nothing? && x is String && x is Any?`. Instead, statements
should be grouped by assignment first, and different groups are `||`-ed.
This means in the above example we now get `x is Nothing? || (x is Any?
&& x is String)` == `x is String?`.
2022-06-15 20:05:50 +00:00
pyos 25f66b4e0e FIR CFG: mark variables touched by not-in-place lambdas in all scopes 2022-06-15 20:05:49 +00:00
pyos 63b0708ed5 FIR CFG: join/unify data flow from postponed lambdas at each level
For example:

    foo(
        // `if` joins A & B
        if (condition)
            run { ... } // A
        else
            run { ... }, // B
        run { ... } // C
    ) // `foo` unifies `A & B` and `C`, so if it is not resolved itself,
      // further `if`s, `when`s, safe calls outside it, etc. continue
      // building the correct type predicate until the next completed
      // call.

^KT-44512 Fixed
2022-06-15 20:05:49 +00:00
pyos 755c54553a FIR CFG: add more KT-44512 related tests 2022-06-15 20:05:48 +00:00
Dmitriy Novozhilov 42df4bdda2 Advance bootstrap to 1.7.20-dev-2106 2022-06-15 20:02:48 +00:00
Alexander Udalov 2d29f0ad05 kotlinx-metadata: prepare for release 0.5.0 2022-06-15 21:59:45 +02:00
Alexander Udalov 61652c04e1 kotlinx-metadata: support experimental context receivers 2022-06-15 21:59:45 +02:00
Alexander Udalov 6abf14087c kotlinx-metadata: add Flag.Type.IS_DEFINITELY_NON_NULL 2022-06-15 21:59:45 +02:00
Yahor Berdnikau dca59b0876 Drop AGP_34 version usage
^KT-45747 Fixed
2022-06-15 18:09:09 +00:00
Yahor Berdnikau ef4e87e122 Add @GradleAndroidTest annotation
This allows to run parameterized tests against combination of different
Gradle and Android Gradle plugin versions.

By default, test is provided with minimal supported Gradle + AGP version
and maximum supported Gradle + AGP version.

Migrate AGP versions to enum with compatibility fields.

^KT-45747 In Progress
2022-06-15 18:09:09 +00:00
Mikhail Glukhikh abf72816e9 Fix property/enum entry ambiguity warning 2022-06-15 17:20:01 +00:00
Mikhail Glukhikh 5ca730e38c Add more tests for KT-49200
- exotic situation 1 field + 2 entries
- named import case
- exotic situation 2 fields + 1 entry
2022-06-15 17:20:00 +00:00
Mikhail Glukhikh d44f180aa9 FE 1.0: deprecate resolve to property when enum entry is at same level
See also KT-52802
#KT-49200 Fixed
2022-06-15 17:19:59 +00:00
Mikhail Glukhikh 088f472117 Add test for KT-49200 deprecation 2022-06-15 17:19:58 +00:00
Mads Ager a2e8ed0032 Do not use ThreadLocalRandom on Android until upcoming SDK 34.
On Android devices starting SDK 25, ThreadLocalRandom accidentally
started out from the same seed on all application starts. This
means that the same sequence of numbers is returned whenever the
application is started.

This will be fixed in SDK 34. We should avoid using
ThreadLocalRandom until then.

^KT-52618 Fixed
2022-06-15 14:52:09 +00:00
Steven Schäfer 194a1d1c6a JVM IR: Start fake variables for default lambdas after initialization
KT-52702
2022-06-15 16:49:22 +02:00
Alexander Udalov 08f18c2940 Fix metadata deserialization for context receivers with type table
In DeserializedClassDescriptor and MemberDeserializer, only the
`contextReceiverTypeList` field was used, and not
`contextReceiverTypeIdList` which is used when `-Xuse-type-table` is
enabled. The convention is to use a bunch of utilities declared in
`protoTypeTableUtil.kt` which deal with both methods of reading types.
Also, simplify the deserialization code in FIR (which was correct for
some reason).
2022-06-15 16:45:30 +02:00
Sergey Bogolepov 71f6c0b1b2 [K/N] Fix compilation of mips targets with the new MM
We have to link libatomic because the new MM (which is default)
requires intrinsics from this library.
2022-06-15 14:37:21 +00:00
Sergey Bogolepov 351249d3a8 Mute testBuildWithPublishedDependency test until k/n update
MIPS targets are not Linux-host exclusive anymore, but k/n
from 1.7.20-dev-1583 does not know about it yet.
2022-06-15 14:37:21 +00:00
Sergey Bogolepov f9d9dc58ff [K/N] Cross-compilation of MIPS targets from macOS and Windows hosts
Fixes KT-52226
2022-06-15 14:37:20 +00:00
Alexander Udalov a30a351fbb IR: make casts to nullable types in transformChildren stricter 2022-06-15 13:24:25 +00:00
Dmitriy Novozhilov 12ce433bc2 [FE] Don't report cycle on annotation parameters if argument is vararg or array
^KT-52742 Fixed
^KT-47932
2022-06-15 09:55:27 +00:00
Troels Bjerre Lund 4775855fd7 [K/N] Add two more benchmarks from the V8 suite 2022-06-15 09:25:56 +00:00
Yahor Berdnikau b6edf9a86e Shadow Gradle plugin 3rd party dependencies
Such dependencies will be embedded into plugin jar and their package
will be relocated. This is need to avoid dependency conflicts with
user build scripts dependencies or other Gradle plugins.

Kotlin project dependencies are not shadowed.

^KT-46034 Fixed
2022-06-15 10:57:56 +02:00
Yahor Berdnikau 236a0ca6f0 Move atomicfu plugin into common sourceset
This should fix missing classes in plugin variants artifacts

^KT-52777 Fixed
2022-06-15 10:01:18 +02:00
Dmitry Gridin bfe09de95f [light classes] LightClassBuilder: cleanup code
^KT-48773
2022-06-14 17:18:10 +00:00