Commit Graph

87511 Commits

Author SHA1 Message Date
Dmitriy Dolovov d13b4bfb25 [Native][tests] Minor. Simplify verification of expectations in LocalTestRunner 2021-11-18 13:29:10 +03:00
Dmitriy Dolovov 0f77c078e8 [Native][tests] Introduce TestRunner that knows how exactly to run an arbitrary test 2021-11-18 13:29:10 +03:00
Martin Petrov aedcfe78e1 [Native] Add -Xoverride-konan-properties to cinterop.
This aligns with the flag added to kotlinc in:
https://youtrack.jetbrains.com/issue/KT-40670

Hermetic builds would benefit from being able to override dependency paths or airplaneMode using this mechanism:

```
$ bin/cinterop -Xoverride-konan-properties "apple-llvm-20200714-macos-x64-essentials.default=/tmp/llvm;airplaneMode=true" -def baz.def
```
2021-11-18 13:18:14 +03:00
Artem Kobzar d5dd35cb20 feat(@JsExport for interfaces): add ability to export interfaces in TypeScript. 2021-11-18 10:07:38 +00:00
Nikolay Kasyanov 4dcfd38236 ObjCExport: remove KotlinUnit from suspend funs returning Unit (#4635)
With `unitSuspendFunctionObjCExport=proper` binary option,
for Unit-returning suspend functions ObjCExport now generates
completion handlers without redundant `KotlinUnit*` result parameter.

So Swift (5.5+) can import these functions as Void-returning async
functions.

^KT-47399 Fixed
2021-11-18 10:01:33 +03:00
Ilya Kirillov 7f6afcabf1 Analysis API: regenerate tests 2021-11-17 20:55:11 +01:00
Ilya Kirillov 7cb1f19a79 Analysis API: move component test classes to corresponding dirs 2021-11-17 20:55:10 +01:00
Ilya Kirillov 82db5fa443 Analysis API: refactor test generation dsl 2021-11-17 20:55:09 +01:00
Ilya Kirillov 6f6a33e852 Analysis API: move testdata to corresponding components folders 2021-11-17 20:55:08 +01:00
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Jiaxiang Chen f8262a2549 implement KtSymbolWithTypeParameters interface for KtPropertySymbol 2021-11-17 18:22:34 +01:00
Dmitry Petrov 30ceb49442 JVM_IR KT-48945 generate special bridge with unsubstituted signature 2021-11-17 17:44:01 +03:00
Yahor Berdnikau 4c3404888a Set minimal supported Gradle version to 6.7.1.
^KT-49733 Fixed
2021-11-17 14:10:24 +00:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Pavel Punegov 960ba3ffde [K/N] Excluded filecheck test on wasm32. See KT-49739 2021-11-17 09:40:52 +00:00
Ilya Goncharov fb6eb414ad [Gradle, JS] Fix afterEvaluate not inside task configuration 2021-11-17 12:19:39 +03:00
Dmitriy Novozhilov 8cdfec7c40 Regenerate tests 2021-11-17 09:43:27 +03:00
sebastian.sellmair bec2f89a07 [Gradle, MPP] Fix 'getCommonizerTarget' for source sets participating in multiple compilations of the same konanTarget
The previous implementation would return a 'SharedCommonizerTarget'
containing just a single leaf target. This would trigger the commonizer.
The new implementation will correctly return just a single
LeafCommonizerTarget instead.

^KT-49735 Verification Pending
2021-11-16 23:07:47 +00:00
konstantin.tskhovrebov cb37424831 Update K/N to "1.6.20-dev-5356". 2021-11-16 23:10:10 +03:00
Alexander Udalov a7fef487c1 JVM IR: fix support of cyclic module dependencies
Previous episode was at 987a3460 (KT-45915).

Apparently, it's not enough to run psi2ir for all modules, and then
backend for all modules. If there are several modules in the chunk, IR
in any one of them can reference IR of any other one after psi2ir.

So we would end up in a situation where we're running codegen for the
first module, but the second module is completely unlowered. This would
break some assumptions in the codegen, for example in KT-49575, codegen
would see a reference to a top-level function from another module, and
would fail because the function has no containing class (since file
facades have not been generated yet!), and thus must be an intrinsic,
yet no such intrinsic is known to the codegen.

The solution is to run lowerings first on all modules, and then run
codegen on all modules. The kind of error explained above shouldn't be
possible anymore, because lowerings have to deal both with lowered and
unlowered code from other files all the time, so lowerings can't assume
that reference from other module is lowered either (or unlowered).

The code is not very nice, but hopefully it can be improved as soon as
we get rid of the old JVM backend (and maybe later with the migration to
FIR too).

 #KT-49575 Fixed
2021-11-16 20:20:20 +01:00
Alexander Udalov 5012aeba7c JVM IR: move codegen out of the main phases
This is needed in order to be able to invoke lowerings and codegen
separately, for cyclically dependent modules (KT-49575).

A side effect is that the two codegen phases are no longer configurable
via the phaser, i.e. absent in the -Xlist-phases and can't be disabled
or made verbose.
2021-11-16 20:20:19 +01:00
Alexander Udalov f701f04326 JVM IR: move jvmPhases to backend.jvm.entrypoint
This will be used for two purposes:
1) call lowerings and codegen separately from
   KotlinToJVMBytecodeCompiler to support cyclical module dependencies
   (KT-49575)
2) split lowerings and codegen into separate modules
2021-11-16 20:20:19 +01:00
Roman Golyshev 79f9bd9c29 Add javadoc to KtAnnotation 2021-11-16 21:34:57 +03:00
Artem Kobzar af924fd3d1 feat: add implicit export support for Kotlin/JS 2021-11-16 16:59:18 +00:00
Ivan Kochurkin f05436b939 [FIR] Fix false positive case of CANNOT_CHECK_FOR_ERASED
Restore CANNOT_CHECK_FOR_ERASED as error
2021-11-16 18:15:49 +03:00
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Dmitriy Novozhilov 2aa027639c [FIR] Fix access to fields from super class
^KT-49654 Fixed
2021-11-16 15:48:08 +03:00
Dmitriy Novozhilov e7c9d76163 [FIR] Use SupertypeSupplier in type resolver for calculating supertypes
This is needed to avoid problems with checking visibility of types which
  are used in supertypes during supertypes resolution in IDE, when
  supertypes of some class can be already computed, but not saved in
  class itself, but still lay in supertypeComputationSession

There were 4 failing tests before this changes (all in
  `DiagnosisCompilerTestFE10TestdataTestGenerated$Tests$Exposed`):
- testInternal
- testInternalAndProtected
- testProtected
- testProtectedSameWay
2021-11-16 15:48:07 +03:00
Dmitriy Novozhilov 499b97d51e [FIR] Fix setting file in supertypes resolution
^KT-49652 Fixed
2021-11-16 15:48:06 +03:00
Svyatoslav Scherbina e11ffc75e4 IR: remove default undefined offsets from createTemporaryVariableDeclaration
Scope.createTemporaryVariableDeclaration has default values for
startOffset and endOffset parameters, which are UNDEFINED_OFFSET.

This is error-prone. Caller should typically be able to pass proper
offsets. If not, let using undefined offsets at least be explicit.

Remove default values for startOffset and endOffset parameters in
Scope.createTemporaryVariableDeclaration
2021-11-16 11:59:56 +00:00
Svyatoslav Scherbina 2f5706597a IR: fix offsets in irTemporary
The variable generated by IrStatementBuilder.irTemporary doesn't inherit
startOffset and endOffset from the builder. In particular, as a result,
temporary variables generated for elvis operator left operand have
UNDEFINED_OFFSET.

Additionally, ProvisionalFunctionExpressionLowering copies the offsets
of a variable to lowered lambda in the variable initializer. With the
problem described above, this causes invalid debug information in
Kotlin/Native, see KT-49360.

Fix irTemporary by using builder's offsets for the variable.

^KT-49360 Fixed
2021-11-16 11:59:55 +00:00
Mikhail Glukhikh fb859c0270 FIR: add error messages for new inference errors 2021-11-16 14:18:25 +03:00
Mikhail Glukhikh 4ad790874e Drop empty FirDefaultErrorMessages.kt 2021-11-16 14:18:25 +03:00
Elena Lepilkina c06875b8e9 [K/N] Added test for exceptions behaviour in case of dynamic libs (KT-47828) 2021-11-16 10:44:53 +00:00
Dmitriy Novozhilov 167a4c6b97 [Build] Add dependency on :core:descriptors.runtime to spec tests
This is needed to run those tests via JPS
2021-11-16 13:29:13 +03:00
Dmitriy Novozhilov 62b774b2e3 [FE 1.0] Properly report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE
^KT-38895
2021-11-16 13:29:12 +03:00
Pavel Kunyavskiy 21444d6be8 [K/N] Optimize and get rid of recursion in SCC search in Devirtualization 2021-11-16 08:27:41 +00:00
Alexander Udalov 38273e6b3c Minor, remove comments in JvmContentRoots.kt, suppress unused
The kdocs were almost self-evident, as opposed to the fact that
JvmClasspathRoot is unused in the project, which could make it a victim
of an innocent refactoring.
2021-11-16 02:20:52 +01:00
aragos 466acc6132 Allow the usage of virtual JVM content roots in kotlinc (#4645) 2021-11-16 02:20:40 +01:00
Ivan Kochurkin 6ec0d94f1d [FIR] Temporary convert CANNOT_CHECK_FOR_ERASED to warning 2021-11-16 01:07:37 +03:00
Nikolay Krasko 4dc45a4118 Drop sources and javadoc artifacts for kotlin-test-wasm
There's a source and javadoc validation in sonatype that
once *-sources.jar or *-javadoc.jar is found expect main
jar must be present as well.

This doesn't work when instead of jar we publish klib.
2021-11-15 19:54:56 +03:00
Igor Yakovlev 71bf36b613 [JS] Fix test testdata for InlineMultiFile.testTrait test 2021-11-15 19:53:50 +03:00
Igor Yakovlev a7f0f62f69 [WASM] Generate missing WASM tests and mute failing ones 2021-11-15 19:53:49 +03:00
Igor Yakovlev ec9fcce1bc [WASM] Add hashCode, equals and toString to KClass and KType implementations 2021-11-15 19:53:48 +03:00
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +03:00
Igor Yakovlev 39a389c49a [WASM] Implementation qualifiedOrSimpleName 2021-11-15 19:53:47 +03:00
Igor Yakovlev ce360bb10b [WASM] Implementation of Class references 2021-11-15 19:53:46 +03:00
Igor Yakovlev d9f2bd7963 Revert "[Wasm][Temporary] Stubs for typeOf and ::class constructs"
This reverts commit 8dc81b6c57.
2021-11-15 19:53:45 +03:00
sebastian.sellmair 7d56ef1925 [Gradle, MPP] Implement kotlin.mpp.absentAndroidTarget.nowarn flag
^KT-41641 Verification Pending
2021-11-15 16:15:18 +00:00
sebastian.sellmair c56c503426 [Gradle] Implement 'Project.kotlinPropertiesProvider' extension
This extension should increase discoverability over the previous
'PropertiesProvider(project)' API
2021-11-15 16:15:17 +00:00