Commit Graph

93071 Commits

Author SHA1 Message Date
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
Dmitry Gridin 8a75aef8f5 [light classes] add registry key to forbid access to backend
^KT-48773
2022-06-14 17:18:10 +00:00
Dmitry Gridin f42528e354 [light classes] support DefaultImpls in ulc
^KT-48773
2022-06-14 17:18:09 +00:00
bennyhuo 20a9314b0b Embed 'kotlin-util-io' to fix the missing kotlinx.metadata.internal.konan.file.File problem in the published library 'kotlinx-metadata-klib' 2022-06-14 18:16:55 +03:00
Roman Golyshev 581ae5fcb7 [FIR IDE] Add a special type of KtCall for generic type qualifiers
^KTIJ-21672 Fixed
2022-06-14 15:00:13 +00:00
Roman Golyshev fe06070d23 [FIR IDE] Make AbstractResolveCallTest.kt more strict 2022-06-14 15:00:13 +00:00
Roman Golyshev 4d6b424280 [FIR IDE] Properly handle generic types qualifiers
In code like `foo.Bar<Bazz>`, `Bar<Bazz>` is considered to be
`KtCallExpression` from the PSI point

^KT-52779 Fixed
2022-06-14 15:00:12 +00:00
Troels Bjerre Lund 90754d11c1 [K/N] Code cleanup from deprecation warnings
No functionality change; just quieting some warnings
2022-06-14 13:32:24 +00:00
Margarita Bobova 71e617a7f5 Add changelog for 1.7.0 2022-06-14 13:07:32 +02:00
Dmitriy Dolovov 34129d54e5 [Native][tests] Choose the appropriate cache mode for the target under test 2022-06-14 11:01:25 +00:00
Yahor Berdnikau c495c07b1a Drop convention usage on accessing Java SourceSet
This is only valid for Gradle 7.1+, so new plugin variant was added -
"gradle71". For Gradle <=7.0 old convention approach is still used.

^KT-47047 In Progress
2022-06-14 10:53:20 +00:00
Sergey.Shanshin f192c2a541 Use EnumSerializer for explicitly serializable enum instead of auto-generated
Resolves Kotlin/kotlinx.serialization#683 Kotlin/kotlinx.serialization#1372
2022-06-14 10:21:48 +00:00
Ilya Kirillov f8310a4763 [analysis api] enable AnalysisApiMissingLifetimeCheck by default 2022-06-14 11:12:06 +02:00
Pavel Kunyavskiy df950d010a [K/N] Fix lambda naming in debugger tests
^KT-51883
2022-06-14 08:03:37 +00:00
Alexander Korepanov 9e780afdca [JS IR] Rework incremental cache invalidation
Replace loading the whole world IR with loading only exported (reachable) IR.

 For that purpose the direct and inverse dependency graph is used.
 It is stored in a cache directory and the cache updater keeps it up to date.
 If after loading it is found that other files must be also implicitly rebuilt
 (see rebuilt reasons below), IR for that files also will be loaded.
 This algorithm repeats until the number of implicitly rebuilt files is not 0.

 More rebuilt reasons (dirty state) have been added:
  - added file: this is a new file;
  - modified ir: ir of the file has been updated;
  - updated exports: exports from the file have been added or removed
    (e.g. a function has been used from another file);
  - updated inline imports: imported inline function has been modified
    (transitively);
  - removed inverse depends: a dependent file has been removed;
  - removed direct depends: a dependency file has been removed;
  - removed file: this file has been removed.

 Incremental cache tests has been refactored:
  - The supporting of all rebuilt reasons (dirty states) has been added;
  - New file name format "*.$suffix.kt" for the test steps has been allowed,
    so the syntax highlight works now;
  - Explicit stdlib dependency usage has been removed.
2022-06-13 20:04:05 +00:00
Alexander Udalov f003f19e1d IR tree gen: restore IrWhileLoop children visit order 2022-06-13 18:58:05 +02:00
Alexander Udalov bf5ab49342 IR tree gen: restore strict cast in IrProperty.transformChildren 2022-06-13 18:58:05 +02:00
mcpiroman 529c03ab08 Switch to auto generated IR tree
Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2022-06-13 18:58:05 +02:00
Alexander Udalov c6608de879 Minor, move some files in ir.tree from 'src' to 'gen'
To help git understand that they are moved in the subsequent commit.
2022-06-13 18:58:05 +02:00
mcpiroman c11d01bebb Extract some common source generator logic from FIR tree generator 2022-06-13 18:58:05 +02:00
Jinseong Jeon 2eab61d75f FIR CLI: remove redundant cast and run 2022-06-13 18:41:17 +02:00
Jinseong Jeon d2663cfb94 FIR CLI: fix typos in contentRootToVirtualFile util 2022-06-13 18:41:17 +02:00