Commit Graph

45118 Commits

Author SHA1 Message Date
Yahor Berdnikau e80988d98c [Gradle] Don't collect module-info on using new IC/JVM approach
Collecting 'moduleInfo' is required for the old history-file-based
incremental compilation approach. And the way how it is being collected
violates Gradle project-isolation feature as it accesses all Kotlin
compile tasks from other Gradle subprojects.

When the new IC based on classpath snapshot is enabled, the plugin will
not collect 'moduleInfo' making it compatible with project isolation.

^KT-59826 Fixed
2023-08-29 15:21:57 +00:00
Johan Bay 0a612e4268 [klib] Add an option to write out header klibs
The header klib is supposed to only contain the public abi of the module
similar to jvm-abi-gen. It is intended to be used as a dependency for other
klib compilations instead of the full klib for compilation avoidance.

^KT-60807
2023-08-29 13:25:07 +00:00
Alexander.Likhachev 2570be129f [Gradle, BT] Move script definitions scanning into the build tools API
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Alexander.Likhachev 6cfa165ddb [Gradle, Build] Publish an artifact with unpublished compiler modules for KGP
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Alexander.Likhachev c3f8706fe2 Use kotlin-stdlib to fully read a reader in CompilerOutputParser
The `FileUtil` requires additional dependency on intellij util artifacts
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Alexander.Likhachev b4e8e27a6f Apply reformatting to CompilerOutputParser.kt 2023-08-29 13:00:15 +00:00
Alexander.Likhachev 3fb1f7bf42 [Gradle] Migrate from ChangesFiles to SourcesChanges
It allows getting rid of the dependency on `:compiler:incremental-compilation-impl`
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Ilmir Usmanov e333716fbe JVM: Optimize isPrimitiveBoxing and isPrimitiveUnboxing
Precompute internal names and method descriptors instead of computing
on every access.
2023-08-29 12:15:31 +00:00
Alexander Udalov 3246b0a6bd JVM IR: inherit some lowerings from ClassLoweringPass
This slightly simplifies code, but has no other immediate benefits. In
the future though, we may end up optimizing all ClassLoweringPass
JVM IR phases by making them traverse only one list of all classes in
the module, instead of traversing the whole IR tree each time.
2023-08-29 11:32:41 +00:00
Kirill Rakhman a42cb2f37f [FIR] Allow treating candidates from the same non-source module as equivalent
This situation occurs in Native metadata compilation and lead to
false-positive OVERLOAD_RESOLUTION_AMBIGUITY reports.

#KT-61461 Fixed
2023-08-29 09:29:52 +00:00
Artem Kobzar 9d00dfd76e [K/JS] Unmute custom binaries tests for JS because of fixed KT-54905 2023-08-29 09:17:17 +00:00
Egor Kulikov d7f2f22b4b [FIR] Fix errors related to expect classes/delegated constructors
^KT-60384 fixed

Merge-request: KT-MR-11835
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-08-29 08:39:36 +00:00
Iaroslav Postovalov 9c8b215bbb [JVM IR] Don't track fake override methods in JvmSignatureClashDetector
trackFakeOverrideMethod in JvmSignatureClashDetector is modified to
ignore fake overrides to prevent duplicate tracking of such methods,
improving efficiency
2023-08-29 04:22:59 +00:00
Brian Norman 833072e1fb [FIR] Add checker for MISSING_DEPENDENCY_CLASS
#KT-59371 Fixed
2023-08-28 15:00:04 +00:00
Mikhail Glukhikh 6ce096f0ed K2: handle extra value parameter in FirCallCompleter properly
#KT-60450 Fixed
2023-08-28 14:02:56 +00:00
Nikolay Lunyak 13a7bb95b3 [FIR] Relax MULTIPLE_DEFAULTS_* to account for the K1 behavior
^KT-56442
^KT-36188
2023-08-28 10:57:40 +00:00
Nikolay Lunyak 3f1bf6112f [FIR] Report MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
Reporting it for `VIRTUAL_MEMBER_HIDDEN`
is ok, because `VIRTUAL_MEMBER_HIDDEN`
has always been an error, so we are
allowed to treat these as overrides
implicitly.

^KT-59408 Fixed
^KT-59419 Fixed
^KT-57076 Fixed
2023-08-28 10:57:40 +00:00
Dmitriy Novozhilov 0dd36ad456 [FIR2IR] Rename entrypoint function of Fir2IrConverter
Originally it was named createModuleFragmentWithSignaturesIfNeeded, because
  there was a counterpart `...WithoutSignatures`. Now that function has
  gone and there is only one entrypoint left
2023-08-28 10:22:04 +00:00
Dmitriy Novozhilov cb0d61309a [FIR2IR] Move initialization of Fir2IrComponentsStorage into its constructor 2023-08-28 10:22:04 +00:00
Mikhail Glukhikh 3e330241b4 K1/K2: add a test to fix state of KT-55168 2023-08-28 09:40:26 +00:00
Ivan Kochurkin d9b5d37baf [K2, MPP] Forbid matching actual callable with dynamic return type
to expect callable with non-dynamic return type

^KT-59251 Fixed
2023-08-28 09:29:05 +00:00
Kirill Rakhman c30ce4aabe [FIR] Print operator keyword and token to unresolved diagnostic message
#KT-55672 Fixed
2023-08-28 08:12:25 +00:00
Kirill Rakhman 85bb7faf10 [FIR] Report WRONG_NUMBER_OF_TYPE_ARGUMENTS on typealias in super types
#KT-59893 Fixed
2023-08-28 08:02:31 +00:00
Kirill Rakhman bb8a46c3a0 [Test] Parallelize test generation 2023-08-28 08:02:05 +00:00
Dmitriy Novozhilov 3013e3549c [FIR2IR] Merge declareParameters and bindAndDeclareParameters functions 2023-08-25 21:06:15 +00:00
Dmitriy Novozhilov d4f55894b4 [FIR2IR] Properly calculate dispatch receiver type for fake overrides
If some function is not fake-override, then its type should be just
  default type of containing class
For fake overrides the default type calculated in the following way:
1. Find first overridden function, which is not fake override
2. Take its containing class
3. Find supertype of current containing class with type constructor of
   class from step 2

^KT-60252 Fixed
2023-08-25 21:06:15 +00:00
Dmitriy Novozhilov e28f97cf6d [FIR2IR] Extract setting of declaration parent from bindAndDeclareParameters function
Setting parent has nothing in common with declaring parameters
2023-08-25 21:06:15 +00:00
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