Commit Graph

104019 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 2ee0d6a4c1 [FIR2IR] Get rid of all usages of IrSymbol.owner from FirIrProvider
^KT-60924
2023-08-25 14:23:42 +00:00
Dmitriy Novozhilov 0cbce42185 [FIR2IR] Refactor Fir2IrVisitor.visitThisReceiverExpression
Extract processing of different kinds of bound symbol into separate
  functions to improve readability
2023-08-25 14:23:42 +00:00
Dmitriy Novozhilov 5148c70579 [FIR2IR] Get rid of all usages of IrSymbol.owner from Fir2IrVisitor
^KT-60924
2023-08-25 14:23:42 +00:00
Dmitriy Novozhilov ba4b84a7d0 [FIR2IR] Safely access IrSymbol.owner in Fir2IrImplicitCastInserter
^KT-60924
2023-08-25 14:23:42 +00:00
Dmitriy Novozhilov 8b9e3789b4 [FIR2IR] Restrict FirReference.toSymbolForCall utility with FirResolvedNamedReference only
Previously it handled `FirResolvedNamedReference` and `FirThisReceiverReference`,
  but the second one effectively was never passed to this function. It
  happened because `FirThisReceiverReference` is present only in `FirThisReceiverExpression`,
  which is processed separately in `Fir2IrVisitor.visitThisReceiverExpression`,
  and its implementation don't call `toSymbolForCall`
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov fa3e9c615b [FIR2IR] Get rid of all usages of IrSymbol.owner from ConversionUtils
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov 55a6b1ef9f [FIR2IR] Move utilities for creating fake overrides to FakeOverrideGenerator 2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov ddde2b760a [FIR2IR] Get rid of all usages of IrSymbol.owner from Fir2IrConverter
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov fd7fec2fc9 [FIR2IR] Get rid of all usages of IrSymbol.owner from OperatorExpressionGenerator
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov 42dd29aade [FIR2IR] Introduce shortcut utilities for unsubstituted and declared scopes 2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov 5355f0f705 [FIR2IR] Get rid of all usages of IrSymbol.owner from AdapterGenerator
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov 39195146a9 [FIR2IR] Generate bodies of synthetic data/value class members after f/o creation 2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov 76d3c0e804 [FIR2IR] Get rid of all usages of IrSymbol.owner from DataClassMembersGenerator
This change uncovered the following problem in pipeline: we have a contract,
  that all bodies will be generated after all fake overrides will be preprocessed.
  But DataClassMembersGenerator generates bodies before f/o creation,
  which leads to the problem, if data class has forward reference to some
  class which was not processed before (because in this case generator
  of `hashCode` function will try to reference f/o, which is not created yet,
  which leads to `SymbolAlreadyBound` problem)

```
data class Some(val a: A) {
    generated fun hashCode(): Int {
        return a.hashCode() // (1) is not generated yet
    }
}

class A {
    fake-override fun hashCode(): Int // (1)
}
```

This problem will be fixed in the next commit

(related test is compiler/testData/codegen/box/ir/kt52677.kt)

^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov b38de13696 [IR] Mark some IR utilities with IrSymbolInternals
Those utilities have symbol as input and output, but call `owner` under the hood

^KT-60923
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov a76c5a68f6 [FIR2IR] Use symbol instead of IR in Fir2IrDeclarationStorage.enter/leaveScope
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov ea3378566d [FIR2IR] Get rid of all usages of IrSymbol.owner from ClassMemberGenerator
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov 100b158678 [FIR2IR] Relax opt-in to IrSymbolInternals for Fir2IrAnnotationsFromPluginRegistrar
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov d847d00d6f [FIR2IR] Get rid of most of usages IrSymbol.owner from CallAndReferenceGenerator
^KT-60924
2023-08-25 14:23:41 +00:00
Dmitriy Novozhilov ff1c38872e [FIR2IR] Introduce an ability to lookup for accessors and backing field without accessing owner of property symbol
^KT-60924
2023-08-25 14:23:40 +00:00
Bogdan Mukvich 7b00323b89 [Build] Update guava
Fix some reports from "Show Vulnerable Dependencies"

^KTI-1342
2023-08-25 14:10:37 +00:00
Bogdan Mukvich dbb5072a26 [Build] Update dependencies
Fix some reports from "Show Vulnerable Dependencies"

^KTI-1342
2023-08-25 14:10:37 +00:00
Bogdan Mukvich 62a6bb1a31 [Build] Update dependencies in test-mutes module
^KTI-1342
2023-08-25 14:10:37 +00:00
Stanislav Ruban a03f65e06b !fixup [tests] BI (1P&1TV/1TIO): add tests for target types
failing legacy JVM backend tests for
LocalClass.kt and GenericLocalClass.kt test data
were not initially muted
2023-08-25 14:01:56 +00:00
Stanislav Ruban 44a4c4ee1c [tests] BI (1P&1TV/1TIO): add tests for target types
single builder parameter
single postponed type variable
single origin of type information

relevant issues:
KT-60719
KT-60720
KT-60855
KT-60877
KT-60880
2023-08-25 14:01:56 +00:00
Sebastian Sellmair bfe54942d3 [Gradle] IdeProjectToProjectCInteropDependencyResolver: Resolve dependencies leniently
^KT-61466 Verification Pending
2023-08-25 13:58:52 +00:00
Sebastian Sellmair 8bb64040c0 [Gradle] Implement test native project dependencies resolve leniently to cover KT-61466 2023-08-25 13:58:52 +00:00
Nikolay Lunyak 77feb86a85 [FIR] Report the use of inline on primary constructor parameters
^KT-59664 Fixed
2023-08-25 12:23:56 +00:00
Ilya Gorbunov 6c4f6907ea Update ant version in legacy dokka docs build 2023-08-25 11:28:46 +00:00
Yahor Berdnikau 0c0507c25f [Gradle] Fallback to the highest supported Kotlin JVM target
If used toolchain JavaVersion is not yet supported by the current Kotlin
compiler, we are now fallback to the highest supported JVM target
version instead of failing the build.

^KT-58987 Fixed
2023-08-25 10:38:56 +00:00
Kirill Rakhman 844ab4ee74 [FIR] Remove FirExpression.typeRef
#KT-61312 Fixed
2023-08-25 10:16:41 +00:00
Mikhail Glukhikh c4fbbe7338 Fix old JS BE tests in MultiplatformJpsTestWithGenerated by using K1 2023-08-25 08:57:53 +00:00
Mikhail Glukhikh 824208e7f5 Use LV 1.9 in ImportsDumperTest 2023-08-25 08:57:53 +00:00
Mikhail Glukhikh 4f5a00ac2a Use language version 1.9 in (JsIr)AnalysisHandlerExtensionTest 2023-08-25 08:57:53 +00:00
Mikhail Glukhikh 64d8df0a61 Use language version 1.9 in JsProtoComparisonTestGenerated 2023-08-25 08:57:53 +00:00
Mikhail Glukhikh f9c7a88175 Add -Xuse-fir-lt=false to some scripting tests
make them compatible with K2
2023-08-25 08:57:53 +00:00
Mikhail Glukhikh 6144ae7a6f Run CLI tests around EnumEntries not enabled with LV 1.9 2023-08-25 08:57:53 +00:00
Ilya Chernikov 063f81ed36 MPP, Maven: remove mpp test from maven plugin
The MPP should be removed from the maven plugin soon, and since
this test fails on K2 anyway, it was decided to remove it.
related to #KT-61285
2023-08-25 08:57:53 +00:00
Ilya Chernikov afd7186680 Fix scripting test with cycle detection 2023-08-25 08:57:53 +00:00
Ilya Chernikov cb3af906cd K2: Do not check import conflicts for implicit imports
fixes scripting resolve tests in LV20 branch
2023-08-25 08:57:53 +00:00
Ivan Kochurkin a5b530d505 [K2] Use real path in LibraryList
Fix `testDirectoryWithRelativePath` in the LV20 branch

^KT-60886 Fixed
2023-08-25 08:57:53 +00:00
Mikhail Glukhikh a73442f90f K2: add a check for duplicate source root 2023-08-25 08:57:53 +00:00
Mikhail Glukhikh 9bff7e3045 K2: introduce "no source files" CLI check 2023-08-25 08:57:52 +00:00
Ilya Chernikov b821009617 K2: add missing checks for integral parameter type on implicit coercion
#KT-61418 fixed
#KT-61442 fixed
#KT-61441 fixed
2023-08-25 08:55:58 +00:00
Abduqodiri Qurbonzoda 84c6333b23 Introduce Common String.toCharArray(destination) #KT-60657
Merge-request: KT-MR-11340
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-08-25 03:11:13 +00:00
aleksandrina-streltsova aa0eca6d6d [AA] Provide KtCallableSymbol for static Java members
^KTIJ-25126 Fixed
2023-08-24 22:17:48 +03:00
Nikita Bobko b87958d04a Cleanup: drop unused ExpectActualCompatibility.Incompatible.Unknown 2023-08-24 16:56:53 +00:00
Anton Bannykh c09fa093fc [JS] set LV=1.9 in a K1 IC test 2023-08-24 16:00:54 +00:00
Svyatoslav Scherbina 0a2348e595 Native: add debugger test for inspecting string variables
We just had no tests checking that debugger can properly show values
of string-typed variables. This commit adds such a test.
2023-08-24 15:03:27 +00:00
Svyatoslav Scherbina 4774912fdc Native: don't use aliases for kclass:* globals, fix KT-61417
Currently, when generating a TypeInfo with a vtable attached, the K/N
compiler generates two globals to the resulting LLVM module:
- "ktypeglobal:$fqName#internal" -- an internal global of the aggregate
type (TypeInfo+vtable)
- "kclass:$fqName" -- an internal or hidden alias pointing to the
TypeInfo part of that global

The reason for emitting two globals is to have everything strict-typed,
since other LLVM modules might import the kclass as a TypeInfo.
Importing an aggregate TypeInfo+vtable global as a TypeInfo global works
too, of course. It is just a little bit less clean.

The new Xcode 15 linker now emits symbols for the ktypeglobal to the
symbol table, including an STSYM. This happens for classes compiled to
cache, when the kclass is hidden, not internal.

The problem is: for some reason, such an STSYM for
"ktypeglobal:kotlin.String#internal" makes lldb find a wrong address
(0xffffffffffffffff) for "kclass:kotlin.String", despite those being
two different symbol names. This seems to be related to them having
the same address though.
The K/N lldb script, konan_lldb.py, uses "kclass:kotlin.String" to
determine if an object is a string, in order to display it properly.

Therefore, using the new Xcode 15 linker when compiling with caches
makes the debugger unable to display string variables properly. As a
side effect, this also breaks displaying array-typed variables (because
the script first checks if an object is a string).

This commit fixes this by removing ktypeglobals completely, making the
compiler emit only a kclass as an aggregate global directly.

Now, there are other ways to fix the problem. For example, making the
ktypeglobal private instead of internal, or making konan_lldb.py use a
runtime function instead of querying "kclass:kotlin.String" directly.
But it seems that LLVM aliases are not common on darwin platforms. For
example, Clang doesn't support `__attribute__((alias(...)))` on these
platforms.
So it is safer to just stop using aliases here.

^KT-61417
2023-08-24 15:03:27 +00:00
Nikita Bobko 070f0197fc Cleanup: put expect actual parameters in the same order
Motivation: Consistency with `checkExpectActualScopeDiff` function
2023-08-24 12:43:46 +00:00