Commit Graph

87184 Commits

Author SHA1 Message Date
Sergey Bogolepov 2f6a9519c0 [K/N] Don't check UniqId because it is an obsolete extension 2021-10-06 04:40:06 +00:00
Roman Artemev ba759fb61b [IR] Fix compatibility mode
- pass corresponding flag to mangler
 - properly handle local declarations in field initializers
 - fix KT-48912
2021-10-06 03:47:20 +03:00
Roman Artemev 8f8c59e748 [JS IR] Fix passing abiVersion to compiler in tet runner 2021-10-06 03:47:18 +03:00
Roman Artemev 1d39b37c90 [IR] Add test describes case from KT-48912
It actually doesn't check behaviour because we don't have proper infra
for that but explains a bit a problem for further investigations.
2021-10-06 03:47:17 +03:00
Nikolay Lunyak 8496729597 [FIR] Remove the type parameters scope duplicate 2021-10-05 19:37:57 +03:00
Nikolay Lunyak e5d5e5be44 [FIR] Reorder scopes for KT-34822 2021-10-05 19:37:53 +03:00
Nikolay Krasko 1d2c1140a4 Minor: rewrite testResolveWithRuntime without !! 2021-10-05 17:51:50 +03:00
Nikolay Krasko 1d42d86537 Minor: unify kotlin version used in MavenResolverTest 2021-10-05 17:51:50 +03:00
Nikolay Krasko 824c227d81 Stop removing libraries from local maven in MavenResolverTest
While it's a good practice to remove all files that were downloaded
during the test execution, here we delete files in common directory
without checking that files were not present before test start.

This might be dangerous as we might fail other tests and programs.
As we manipulate common maven directory it's better to leave downloaded
files untouched
2021-10-05 17:51:50 +03:00
Nikolay Krasko 31e30dc852 Fix external issue with org.uberfire library in MavenResolverTest
Use kotlin library instead.

java.lang.AssertionError: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.uberfire:uberfire-io:jar:7.39.0.Final -> org.uberfire:uberfire-nio2-model:jar:7.39.0.Final -> com.thoughtworks.xstream:xstream:jar:1.4.11.1 -> xmlpull:xmlpull:jar:1.2.0
2021-10-05 17:51:48 +03:00
Ilya Goncharov 464331d196 rra/ilgonmic/lazy-init-with-js-fun
[JS IR] Use initializer of field to use in js fun

[JS IR] Use string folding to consider const-like string vals as pure

Merge-request: KT-MR-4677
2021-10-05 13:37:06 +00:00
Dmitry Petrov 1dae2aca4c JVM_IR KT-48954 prohibit indy reference creation in some cases 2021-10-05 15:38:46 +03:00
Sergey Bogolepov 7552767d85 [K/N] Add munmap to the calls checker 2021-10-05 12:37:03 +00:00
Tianyu Geng 5ccc5591f5 FIR: add isImplicit to FirThisReceiverExpression 2021-10-05 15:30:40 +03:00
Tianyu Geng a297ee66d4 FIR: suppress VARIABLE_EXPECTED for error reference 2021-10-05 15:30:39 +03:00
Tianyu Geng c572bf05b5 FIR checker: honor DSL marker annotation on the function type
It seems the original function type gets lost during resolution. Hence
thie change added a custom attribute to recover the original function
type on an anonymous function
2021-10-05 15:30:38 +03:00
Tianyu Geng 826ea122a9 FIR checker: DSL_SCOPE_VIOLATION 2021-10-05 15:30:37 +03:00
Tianyu Geng 7aaac2573c FIR: preserve diagnostics in createResolvedNamedReference 2021-10-05 15:30:35 +03:00
Tianyu Geng 1b6fa4303f FIR: make ConeVariableExpectedError an object 2021-10-05 15:30:34 +03:00
Roman Golyshev 9b9c51bc8d [FIR] Fix dispatch receivers on inner classes' constructors
1. Inner class constructor should have its outer class as a dispatch
receiver, since it is necessary for the call. Before it was null
2. Substituted inner class constructor should have its original dispatch
 receiver type with the proper substitution. Before it was set to the
 class itself (since the class was usually passed as a new dispatch
 receiver)

Also, modify FIR renderer, so it properly renders the dispatch receiver
of the constructors
2021-10-05 12:17:08 +00:00
Roman Golyshev 8673819260 [FIR] Add requirement to checkUpperBoundViolated function 2021-10-05 12:17:08 +00:00
pyos 337cbeded1 JVM_IR: do not move receivers on functions with inline class parameters
^KT-48993 Fixed
2021-10-05 13:34:32 +02:00
Denis.Zharkov 3eb3015688 FIR: Do not fail when trying to apply attributes to stub types 2021-10-05 13:48:54 +03:00
Denis.Zharkov 0a3c950e7f FIR: Fix resolution scope of constructor delegation calls 2021-10-05 13:48:53 +03:00
Denis.Zharkov f038b575f1 FIR: Merge FirAbstractTreeTransformerWithSuperTypes and FirTypeResolveTransformer 2021-10-05 13:48:51 +03:00
Alexander Udalov b6ebed0c96 IR serialization: cleanup/optimize DescriptorExportCheckerVisitor
Check if visibility is public API first, then check if declaration is
annotated with `@PublishedApi`. This is needed because loading
annotations and iterating over them can be slow.
2021-10-05 12:18:07 +02:00
Alexander Udalov 4da4719246 IR: slightly optimize IdSignature calculation in SymbolTable
Do not compute IdSignature for descriptor a second time when adding a
new symbol. Instead, pass the calculated signature to the lambda in
declare/declareIfNotExists/referenced, and use it in `reference*`
methods.
2021-10-05 12:18:06 +02:00
Alexander Udalov 1c735948d1 IR: cleanup SymbolTable
Extract duplicated code, remove unused methods and unneeded OptIn.

Also, check original for descriptors only in case the symbol is not
computed yet. Checking it on every access is not needed.
2021-10-05 12:16:24 +02:00
Alexander Udalov eb28d662d4 IR: use HashMap instead of LinkedHashMap in SymbolTable
It's not important for these maps to be linked hash maps because they
are not iterated over.
2021-10-05 12:16:24 +02:00
Alexander Udalov 6e93006a94 JVM IR: slightly optimize keepTrackOfOverridesForPossiblyClashingFakeOverride
Collecting all outer classes into a hash set and looking up classifiers
in that set for each type of each fake override is noticeably slow.
Instead, check that function types reference any type parameter whose
container is a class; if the function is not local, it means such type
parameter belongs to one of the outer classes.

 #KT-42020
2021-10-05 12:16:24 +02:00
nataliya.valtman d3dc9b19b8 KT-48620: Avoid build scan listener creation without --scan property 2021-10-05 09:06:21 +00:00
Dmitriy Novozhilov a80445bf78 Add link to Kotlin Compiler Test Helper to ReadMe.md 2021-10-05 11:55:27 +03:00
Ilya Matveev 2a74f63954 [K/N][build] Fix compdb task after Gradle upgrade 2021-10-05 09:50:27 +03:00
Igor Chevdar 0cece79856 [K/N][IR][codegen] Use LazyIr for cached libraries
It's not that simple because we still need inline functions bodies
and classes fields which aren't present in Lazy IR. To overcome this,
save additional binary info for a cached library and then use it when needed
2021-10-05 10:47:52 +05:00
Igor Chevdar f865238062 [K/N][codegen] Bug fix in debug info generator 2021-10-05 10:47:33 +05:00
Igor Chevdar 3eb7d32b21 [K/N][codegen] Reworked fields building 2021-10-04 23:54:17 +05:00
Mark Punzalan 56cc40f639 FIR: Rename SAM constructor parameter name from "block" to "function".
This matches FE 1.0 (see
core/descriptors/src/org/jetbrains/kotlin/resolve/sam/samConstructorUtils.kt).
2021-10-04 19:38:44 +03:00
Mark Punzalan d16454b9af FIR: Set resolve phase to BODY_RESOLVE for SAM constructor value
parameters.

This was causing exceptions with analysis API trying to resolve the
synthetic FirValueParameter because it could not find a KtDeclaration
for it. Using BODY_RESOLVE should be safe; the SAM constructor function
is also on BODY_RESOLVE and the type of the value parameter is known.
2021-10-04 19:38:43 +03:00
Ivan Gavrilovic 32bf7f33a7 KT-49066: Use correct moduleName in the incremental compilation
When storing mapping from moduleName to module information, ensure
that values from kotlinOptions DSL objects are taken into
consideration.

Fixes #KT-49066
Test: KotlinAndroid70GradleIT.testCustomModuleName
2021-10-04 18:41:52 +03:00
Mikhail Zarechenskiy 472eceb13c Mark KtDestructuringDeclarationReference as multi reference entity
This change fixes tests related to components:
 - org.jetbrains.kotlin.idea.codeInsight.InsertImportOnPasteTestGenerated$Copy.testMultiDeclaration
 - org.jetbrains.kotlin.idea.codeInsight.InsertImportOnPasteTestGenerated$Cut.testMultiDeclaration

 Initially, it was marked as multi reference in https://github.com/JetBrains/intellij-community/blob/388ff78e61a7e0599c85b07766a03d956d7583da/plugins/kotlin/frontend-independent/src/org/jetbrains/kotlin/idea/references/KtDestructuringDeclarationReference.kt#L14

 But then this change was lost during commonization of this
implementation with FIR

 ^KTIJ-19815 Fixed
2021-10-04 18:17:18 +03:00
Igor Chevdar 232608e300 [box-tests] Added a test 2021-10-04 14:34:56 +00:00
Igor Chevdar 75d2757d3c [K/N][IR] Fix for https://youtrack.jetbrains.com/issue/KT-43210 2021-10-04 14:34:54 +00:00
Victor Petukhov 6ee1599efa Provide proxy for deprecated org.jetbrains.kotlin.resolve.calls.callUtil.getValueArgumentForExpression 2021-10-04 15:01:09 +03:00
Pavel Punegov ee65026866 [K/N][Test] Executor extension 2021-10-04 10:49:39 +00:00
Pavel Punegov 2c7a6d5f45 [K/N][Test] Add missing annotations required by Gradle 7 2021-10-04 10:49:39 +00:00
Svyatoslav Kuzmich 4dd4853c31 [Wasm] Use common StringConcatenationLowering 2021-10-04 08:51:43 +00:00
Elena Lepilkina 62dfd528e3 [K/N][perf] Added benchmarks for unsigned arrays for-loops 2021-10-04 06:12:22 +00:00
Igor Chevdar e64140af08 Added a test on unsigned arrays 2021-10-04 06:12:22 +00:00
Igor Chevdar acc1643fe4 [K/N][IR] Supported loop over unsigned array, indices, withIndex 2021-10-04 06:12:21 +00:00
Ivan Kochurkin 75b40e4b75 [FIR] Add INVISIBLE_SETTER 2021-10-03 17:10:06 +03:00