Commit Graph

91129 Commits

Author SHA1 Message Date
Mark Punzalan f1623347d8 Analysis API: Use stub FirDataFlowAnalyzer when getting candidates. 2022-02-11 13:22:58 +01:00
Mark Punzalan 3f3873dc50 Analysis API: Return KtCallCandidateInfo instead of KtCallInfo in
KtCallResolver.collectAllCandidates().
2022-02-11 13:22:58 +01:00
Mark Punzalan b8cdfc5aad Analysis API: Move AllCandidatesResolver closer to
SingleCandidateResolver and share common code.
2022-02-11 13:22:58 +01:00
Mark Punzalan 7a1ef25333 Analysis API: Rename resolveCandidates to collectCallCandidates.
Didn't bother to rename the directory in the test data.
2022-02-11 13:22:58 +01:00
Mark Punzalan 58c6c25fe9 Analysis API: Handle other FirElements in
KtCallResolver.resolveCandidates() and copy over remaining tests.
2022-02-11 13:22:58 +01:00
Mark Punzalan 9b9da94a09 Analysis API: Fix issues related to implicit invoke calls:
- Correctly set explicit receiver value.
- Restore original function call from FirImplicitFunctionCall (i.e.,
calls implicitly resolved to `invoke`) to get the correct name for
getting all candidates.
- Collect candidates at all tower levels.

Also make order of candidate calls in tests deterministic.
2022-02-11 13:22:58 +01:00
Mark Punzalan ace826c570 Analysis API: Get argument mapping from candidate and type parameters
from candidate symbol.
2022-02-11 13:22:58 +01:00
Mark Punzalan 0ed802bca4 Analysis API: Add tests for KtCallResolver.resolveCandidates(). 2022-02-11 13:22:57 +01:00
Mark Punzalan f62bdf5826 Analysis API: Move AbstractResolveCallTest from fir to components
package.
2022-02-11 13:22:57 +01:00
Mark Punzalan 4a09abc418 Analysis API: Add API functions to get all the candidates (with argument
mapping and substitutor) for a function call.
2022-02-11 13:22:57 +01:00
Yahor Berdnikau 322b10f1bb Fix changes in Android layout resources breaks incremental compilation
This only happens when project has 'kotlin-android-extensions' plugin
applied and 'experimental = true' flag is set. On changes in android
layout resources task was running full compilation instead running
incrementally.

^KT-51177 Fixed
2022-02-11 10:32:07 +00:00
Svyatoslav Scherbina ad72545647 ObjCExport: deprecate exporting data class componentN methods to Obj-C
The Objective-C methods for Kotlin data class componentN methods
shouldn't have been generated in the first place -- the corresponding
Kotlin methods are required to make the destructuring work in Kotlin,
and don't help in Objective-C or Swift.

Calling them manually from Objective-C or Swift doesn't make much sense.
So now we deprecate this, in order to remove these methods from
Objective-C header completely later.

^KT-42641
^KT-49516 Fixed
2022-02-11 06:55:47 +00:00
Svyatoslav Kuzmich 4636f71076 [Wasm] Loader improvements
- Output ES modules instead of plain files
- Support -Xwasm-launcher=d8 for d8 shell used in tests and benchmarks.
- Reuse launcher generation logic in CLI and box tests runners.
- Create separate output directory for each box since
  there are multiple output files generated for each test.
- Stop using absolute paths in generate JS files
  to simplify running generated code on different machine
- Remove ">>>" from println output


Merge-request: KT-MR-5729
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-02-10 22:59:44 +00:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Vladimir Dolzhenko 4de9de5fc5 Escape special Name used as parameter, custom function names etc
#EA-209929
#KT-51248 Fixed
2022-02-10 21:20:47 +00:00
konstantin.tskhovrebov c08d42d6bb KT-50106 Add gradle property with global K/N linker flags
Clean NativePlatformLibsIT code
2022-02-10 20:22:50 +03:00
Pavel Punegov 4f981ff745 [K/N] Use toBits() in Float and Double hashCode()
toBits() is aware of NaNs comparing to bits()
2022-02-10 16:25:18 +00:00
Alexander Udalov 17c8ac5440 IR: make IrLazyValueParameter.type/varargElementType lazy
This makes it a bit more apparent, in profiler snapshots, where
parameter types are really needed. Also, hopefully it will improve
performance somewhat in cases where types are not needed.

For example, before this change about 1/3 of the time of
`DefaultArgumentStubGenerator.lower` on JVM was actually computing types
of parameters from dependencies, even though the actual types were not
needed, only the presence of defaultValue was used. This made it the
most time-consuming lowering phase on JVM.

After this change, default argument lowering is thus 50% faster, however
this time is in part distributed among other lowerings that visit the
whole override hierarchy for all methods and really need the types of
parameters, e.g. BridgeLowering, SyntheticAccessorLowering. So the
profiler snapshots are now more "honest".
2022-02-10 14:49:30 +01:00
Alexander Udalov 7c172f5798 IR: minor, extract IrLazyValueParameter to a separate file 2022-02-10 14:49:30 +01:00
Sergey Bogolepov f7cc23a13b [K/N] Mention test_compile_only in HACKING.md 2022-02-10 13:38:48 +00:00
Sergey Bogolepov 072acf688e [K/N] Support compile-only mode for legacy test infra 2022-02-10 13:38:48 +00:00
Mads Ager c8cade5bf3 [FIR] Ensure qualifier resolution takes place for type aliases.
When resolving a name that is used as a receiver and all
candidates are classifier symbols, we need to perform
qualifier resolution. The code used to only do that for
regular classes, and would not perform qualifier resolution if
there was a type alias candidate.

^KT-51171 Fixed
2022-02-10 16:27:32 +03:00
Roman Golyshev ca72790962 [FIR IDE] Hack checkIsInheritor until KT-51240 is fixed
We do not know for sure if there is any dependency between the
two classes passed to `checkIsInheritor`. To avoid the problem described
in KT-51240, we try to analyse them both and hope that the dependency
in some direction exists.

`NoCacheForModuleException` is introduced to signal about this
particular problem and avoid catching just any `NoSuchElementException`.

This hack is mainly done to fix very annoying KT-51240 for the time
being.

^KTIJ-20852 Fixed
2022-02-10 16:24:44 +03:00
Shumaf Lovpache 729afb6149 Docs: fix typos and references
Fix reference to fir_basics
2022-02-10 13:55:11 +01:00
Abduqodiri Qurbonzoda 0d46d0d69b [WASM] Sync stdlib-gen template with actual source code 2022-02-10 10:23:22 +00:00
Ilmir Usmanov 47ee0e5b0a Get type arguments from supertype in supercall
Otherwise, when the function has inline class parameter, we get ICE.
We do not get the error without inline class parameter, since we
substitute type parameters in limited situations, which includes
inline class lowering.

 #KT-51157 Fixed
2022-02-10 10:40:55 +01:00
Jinseong Jeon 02cfc8b821 AA: reuse CoreJarFileSystem from KotlinCoreEnvironment 2022-02-09 23:11:45 +01:00
Jinseong Jeon 6b4c4457d8 LL: fix a typo in LLFirSessionFactory 2022-02-09 23:11:45 +01:00
Jinseong Jeon 9be6520c96 AA: avoid NPE in compile-time constant evaluator 2022-02-09 23:11:44 +01:00
Jinseong Jeon a986aff429 AA: refactor service registrations
such that AA standalone mode doesn't need to unregister services that
were already registered by pre-analysis handlers
2022-02-09 23:11:44 +01:00
Jinseong Jeon 26e923e3ae AA: introduce static project structure provider by compiler configuration
Also add standalone mode utils to configure Application/Project environments
2022-02-09 23:11:43 +01:00
Jinseong Jeon d219de0f88 AA: avoid FIR dependency in frontend-independent module 2022-02-09 23:11:43 +01:00
Jinseong Jeon 6afd665c8d AA: rename the file according to the static factory in it 2022-02-09 23:11:42 +01:00
Jinseong Jeon fac4e5b243 LL: remove identical test impl for SealedClassInheritorsProvider 2022-02-09 23:11:42 +01:00
Dmitriy Novozhilov 0eb526a8b4 [FE 1.0] Report warning about conflict in inherited members from deserialized dependencies
^KT-51194
^KT-51223 Fixed
2022-02-09 19:35:56 +03:00
Dmitriy Novozhilov c6994768d7 [Test] Drop redundant Condition class 2022-02-09 19:35:54 +03:00
Dmitriy Novozhilov 3abac1d56a [Test] Allow to enable some diagnostics in tests if it's severity is disabled 2022-02-09 19:35:53 +03:00
Dmitry Petrov 1d28e4e307 JVM_IR fix counter loop optimization with Composable 2022-02-09 15:51:34 +00:00
Svyatoslav Scherbina 62c1bd0044 Native: fix using nested expect enum entry in a default argument
^KT-51156 Fixed
2022-02-09 14:41:11 +00:00
sebastian.sellmair 0a85f0dd34 [Gradle] Implement ideaImportDependsOn API for KTIJ-20989
This will rely on a task called `prepareKotlinIdeaImport` which,
if present, will be invoked by the IDE before import.


Co-authored-by: Sergey Igushkin <Sergey.Igushkin@jetbrains.com>

Merge-request: KT-MR-5688
Merged-by: Sebastian Sellmair <Sebastian.sellmair@jetbrains.com>
2022-02-09 13:43:29 +00:00
konstantin.tskhovrebov 003cb156bf KT-50106 Add gradle property with global K/N linker flags 2022-02-09 16:23:31 +03:00
Svyatoslav Scherbina ff85d54c93 [Native][tests] Add full path to CLI compiler to the log
So the log now has a command to be run in terminal as is.
2022-02-09 12:47:20 +00:00
Svyatoslav Scherbina eb78f5e1ca Native: make xcrun failures a bit more useful again
^KT-50923
2022-02-09 12:46:19 +00:00
Mads Ager 66bf5b08ba Allow versionNeededToExtract between 0 and 20 in Zip impl.
In the Android eco-system, there are jars with entries with a
versionNeededToExtract of 0. That should probably have been 10,
but will be hard to fix. This change proposes to just check
that the versionNeededToExtract is between 0 and 20.
2022-02-09 13:01:12 +03:00
Svyatoslav Scherbina 76672a4abf Native: terminate if cinterop ObjC reference conversion throws exception
To avoid forwarding Obj-C exceptions to Kotlin or vice versa.
Otherwise this might lead to a crash or other undesirable behaviour.

^KT-50648 Fixed
2022-02-09 07:47:42 +00:00
Svyatoslav Scherbina d235fc4dbe Native: add thread state switches to blockToKotlinImp 2022-02-09 07:47:42 +00:00
Svyatoslav Scherbina 925e7801aa Native: improve message when Obj-C block can't be converted to Any 2022-02-09 07:47:41 +00:00
Denis.Zharkov baa287d6ee Unmute previously failing piece of test at definitelyNotNullAsArgument.kt
^KT-49419 Obsolete
2022-02-09 00:30:53 +03:00
Alexander Udalov 032d69aa41 Kapt: handle special names correctly
Parameter names of some methods are different in JVM IR, for example
extension receivers of property `$annotations` methods are named
`<this>`, which made the `Name.identifier` call fail. It seems fine to
use the "p + index" name for this instead.

 #KT-49682
2022-02-08 20:15:14 +01:00
Alexander Udalov 07d3e3a5bd Kapt: support property $annotations methods for JVM IR
`is PropertyDescriptor` check doesn't work for JVM IR where descriptor
is created on-the-fly and is an `IrBasedSimpleFunctionDescriptor`.

 #KT-49682
2022-02-08 20:15:14 +01:00