Commit Graph

91104 Commits

Author SHA1 Message Date
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
Alexander Udalov 25edf64daf Psi2ir: support mode without generation of bodies
This is needed for kapt + JVM IR.

 #KT-49682
2022-02-08 20:15:14 +01:00
Alexander Udalov b3820564b0 Kapt: never generate enums as final
Behavior differs between JVM and JVM_IR backends here because in JVM,
the class descriptor comes from the frontend, and its modality for enum
is never final. For JVM IR, the class descriptor is based on IrClass,
whose modality is sometimes final for enum, presumably because it's
easier for backends (see `ClassGenerator.getEffectiveModality`).

 #KT-49682
2022-02-08 20:15:14 +01:00
Alexander Udalov fc2c0eea27 JVM IR: generate source-retained annotations in kapt mode
#KT-49682
2022-02-08 20:15:13 +01:00
Alexander Udalov 1df2851611 IR: use names $this/$receiver for receivers in copied static functions
Similarly to the other places in the IR backend (e.g. see
`copyValueParametersToStatic` in the same file).

In JVM IR, these names are used for example for receiver parameters of
methods copied to DefaultImpls classes. Since Java stub code generated
by kapt mentions them, it fixes a few issues in tests on kapt + JVM IR
(KT-49682).
2022-02-08 20:15:13 +01:00
Alexander Udalov f6d3bb5b1b Kapt: add JVM IR expectations for some tests
All of these have a different order of declarations and/or extra
`@NotNull` annotations on fields, both of which doesn't seem like a
problem.

 #KT-49682
2022-02-08 20:15:13 +01:00
Alexander Udalov bcd221f714 Kapt: use descriptorBasedTypeMapping for type mapping
Since all anonymous types are approximated to a supertype in kapt, type
mapping doesn't require backend information (mapping of anonymous types
to class names) and can be performed statically, independently from
particular JVM backend internals, via descriptorBasedTypeMapping.

 #KT-49682
2022-02-08 20:15:13 +01:00
Alexander Udalov 754ad100a9 Minor, cleanup kapt tests
Fix inspections, reformat
2022-02-08 20:15:13 +01:00
Alexander Udalov 62c1c33ee3 Kapt: slightly improve CustomJdkTestLauncher
- Include stdout & stderr dump to the exception message if the Java
  command fails
- Support running JVM_IR tests
- Do not print anything to the stdout of the test itself in case it's
  successful

 #KT-49682
2022-02-08 20:15:13 +01:00
Alexander Udalov ebb9659e03 Add mode to run kapt with JVM IR, use in tests
Currently JVM IR is not supported in kapt, so almost all tests are
failing, and thus are muted with IGNORE_BACKEND.

 #KT-49682
2022-02-08 20:15:13 +01:00
nataliya.valtman d089d27bef Add proper kotlin version into http reports 2022-02-08 16:24:15 +00:00
Svyatoslav Scherbina cd62b5b3b3 ObjCExport: optimize receiving autoreleased references from Obj-C/Swift
when the callee supports this.
2022-02-08 15:17:06 +00:00
Svyatoslav Scherbina 874cc6c51c Native: add LLVMSetNoTailCall to LLVM C API 2022-02-08 15:17:05 +00:00
Svyatoslav Scherbina 085e2448cd ObjCExport: don't use autorelease when sending arguments to Swift/Obj-C 2022-02-08 15:17:04 +00:00
Svyatoslav Scherbina 9326978327 ObjCExport: fix noAutorelease tests for the new MM 2022-02-08 15:17:04 +00:00
Svyatoslav Scherbina d161108be3 ObjCExport: fix noAutorelease/testReceiveBlockFromSwiftAndCall
The test expects to track block result lifetime in Swift, so we should
add it to the tracker.

Also fix the same problem for testReceiveBlockFromKotlinAndCall
(which didn't fail because we added the block itself to the tracker).
2022-02-08 15:17:04 +00:00
Hung Nguyen d018031cbf KT-45777: Clean up build cache tests for incremental compilation
- Clean up BuildCacheRelocationIT.testKotlinIncrementalCompilation
 - Delete BuildCacheIT.testKotlinCompileIncrementalBuildWithoutRelocation
   as it is already covered by the test in BuildCacheRelocationIT
 - Add BuildCacheRelocationIT.testKotlinIncrementalCompilation_withClasspathSnapshot
- Updated BuildCacheRelocationIT.testKotlinIncrementalCompilation_withClasspathSnapshot
2022-02-08 18:07:38 +03:00
sebastian.sellmair 200cc9f75f [Gradle][MPP] Disabled CInteorp warning: Show cinterops instead of compilations
KT-51176
2022-02-08 09:22:15 +01:00
sebastian.sellmair 56de13fe2f [Gradle][MPP] Show (potential) warning on disabled cinterop commonization
^KT-51176 Verification Pending
2022-02-08 09:22:15 +01:00
Roman Golyshev 42010282d5 [FIR IDE] Use correct extension receiver FIR expression in completion
`getOrBuildFir` does not record `FirCheckedSafeCallSubject`
expression, and it would be impossible to get them anyway
since there are no PSI corresponding to "not null receiver"
in expressions like `foo?.bar` - there is only `foo`,
which is considered nullable by FIR

`FirCheckedSafeCallSubject` wrapper has non-null type during
resolve, and it becomes very important in
`KtFirCompletionCandidateChecker`. If we loose the wrapper,
then it would be impossible to call extensions on nullable
types using `?.` syntax

^KTIJ-21021 Fixed
2022-02-07 22:06:28 +00:00
Ivan Kochurkin f32c355190 [FIR] Correct resolving of sam with suspend function from another module, ^KT-51007 Fixed
Ignore fir ide test probably because of KT-50732
2022-02-07 17:22:02 +03:00
Ivan Kochurkin 17c64cf955 [FIR] Add INV to UNARY_OPERATION_NAMES, ^KT-50998 Fixed 2022-02-07 17:22:02 +03:00
Ivan Kochurkin 30871fc08f [FIR] Infer labeled type for lambda in return in catch ^KT-51009 Fixed 2022-02-07 17:22:01 +03:00
Ivan Kochurkin d82dff0e75 [FIR] Refactor findMaximallySpecificCall
Remove generic and function arguments from methods
2022-02-07 17:22:01 +03:00
Ivan Kochurkin 635166c969 [FIR] Get rid of excess allocations in FlatSignature 2022-02-07 17:22:00 +03:00
Ivan Kochurkin a0510f4a67 [FIR] Fixed Replace ConeTypeVariable on ConeTypeParameter ^KT-51017
in AbstractConeCallConflictResolver.computeParameterTypes
2022-02-07 17:21:59 +03:00