Commit Graph

96260 Commits

Author SHA1 Message Date
Pavel Kunyavskiy cf80a86855 [K/N] Some strange fix to make wasm target happy 2022-11-22 13:51:20 +00:00
Anna Kozlova 1906a41d9a fix testdata after merge 2022-11-22 13:31:41 +01:00
Marco Pennekamp 93f560eb4d [Analysis API] Add call resolution tests for KTIJ-23373
- The Java functions aren't recognized as candidates during the test
  (`FULL_JDK` isn't helping), so I've replicated the tests with local
  extension functions and confirmed that they uncover the same
  exception.
2022-11-22 13:13:35 +01:00
Marco Pennekamp 60dbe73f60 [Analysis API] Create substitutor from type arguments defensively
- Call candidate collection sometimes provides candidate symbols to
  `createConeSubstitutorFromTypeArguments` with fewer type parameters
  than type arguments provided by `FirQualifiedAccess`, which lead to
  an NPE. Because call candidates collected for the purposes of the
  Analysis API are best-effort guesses, we can ignore the additional
  type arguments.

^KTIJ-23373 fixed
^KTIJ-21506 fixed
2022-11-22 13:13:35 +01:00
Pavel Kirpichenkov ad6582160b Add test for KT-55019 2022-11-22 10:56:25 +00:00
Nikolay Lunyak c5469d5fb5 [FIR] KT-53988: Report ILLEGAL_SELECTOR for constants as selectors
Merge-request: KT-MR-7756
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>

^KT-53988 Fixed
2022-11-22 10:54:09 +00:00
Leonid Startsev f627d81d53 Make diagnostic for @MetaSerializable on nested annotation
K2 plugin API has a limitation that meta annotations from plugin predicates
can't be used on nested annotations because their resolve process includes supertypes
resolve, that can be affected by the plugin itself. Therefore, @MetaSerializable
can't be applied to nested annotation classes in K2, which is reflected by
this diagnostic.

For old FE, diagnostic is lowered to WARNING with deprecation message.
2022-11-22 10:53:28 +00:00
Leonid Startsev 9586bf74e0 Use .fullyExpandedType to get serializable annotation from inside typealias
to correctly handle 'global customization via typealias' feature
in K2 serialization plugin.
2022-11-22 10:53:28 +00:00
Leonid Startsev 76fc7ce0ad Fix creating FirSerializableProperties for external classes.
External classes do not have primary constructor, so we need to use 0 as
value parameter count for them to be externally serializable when possible.
2022-11-22 10:53:27 +00:00
Leonid Startsev 56cd150554 Enable FIR plugin in SerializationComponentRegistrar
so real projects can be built with K2 and serialization.

Correctly register renderer for serialization plugin errors.
2022-11-22 10:53:27 +00:00
Anna Kozlova 702d0b4d54 [compiler] missed type parameters in local properties (KTIJ-23583)
even though local variables won't contain type parameters,
let's build fir for them
2022-11-22 10:47:45 +00:00
Anna Kozlova 3fdd0aacd3 [compiler] preserve fir receiver in tree
when selector is invalid expression,
ensure that fir tree still contains receiver as well as selector

KTIJ-23578
2022-11-22 10:46:59 +00:00
Mikhail Glukhikh 1aae9d6456 FIR2IR: generate this reference to non-source class properly
#KT-53983 Fixed
2022-11-22 10:01:16 +00:00
Andrei.Tyrin dc8ac50ddf [Gradle][MPP] Flag for suppressing warning for Android Style folders
^KT-54464 Verification Pending
2022-11-22 09:51:53 +00:00
Sebastian Sellmair ace17c71e7 [Gradle] Implement IdeNativePlatformDependencyResolver.test - non native source sets
KT-54974
2022-11-22 09:48:31 +00:00
Sebastian Sellmair 4bcd8b4b66 [Gradle] Implement IdeNativePlatformDependencyResolver
KT-54974
2022-11-22 09:48:31 +00:00
Ivan Kylchik e3f8aa255a Fix StackOverflow in interpreter for case with recursive enum init
#KT-54884 Fixed
2022-11-21 20:03:18 +00:00
Alexander Shabalin d512420204 [K/N] Refactor Executor out of ExecutorService without gradle dependency
Merge-request: KT-MR-7622
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-11-21 19:52:29 +00:00
Igor Chevdar e16cfd5485 [K/N][IR] Suspend tail call optimization for coroutines
Even if a coroutine class has to be built for a suspend function, we
still can perform tail call optimization for it.
2022-11-21 19:32:41 +00:00
Igor Chevdar b100dfe8be [K/N][IR] Implemented suspend tail call optimization
If for a suspend function all calls to other suspend functions a tail calls,
it is not needed to build the coroutine implementation.
2022-11-21 19:32:40 +00:00
Igor Chevdar 68e6317159 [K/N][tests] Added FileCheck tests on suspend tail call optimization 2022-11-21 19:32:39 +00:00
Jaebaek Seo c55efe62a3 [AA] handles FIR isUsedAsExpression for return within function block
For the following example:

```
fun foo(bar: Int) {
  <expr>if (bar == 4) return "Four"
  else return "Int"</expr>
}
```

AA FE1.0 `isUsedAsExpression` returns `false`.
Since the current AA FIR `isUsedAsExpression` returns `true` for the
above example, this commit fixes it.
2022-11-21 18:26:41 +01:00
Ilya Kirillov b6481ed891 [FIR] do not use FirValueParameter for function type parameter
As it is a different abstraction, introduced FirFunctionTypeParameter instead

Also, fix syntax checkers for function type parameter

^KT-55035 fixed
2022-11-21 16:17:51 +00:00
Leonid Startsev 1b9fdeadfe Do not enable serialization plugin intrinsics in K2
because they lead to an unbound symbol errors
2022-11-21 16:15:46 +00:00
Leonid Startsev 715a730819 Insert a runtime exception if star-projection type is encountered in serializer<T>() intrinsic
This makes behavior consistent with non-intrinsified version of this function and serializer(KType).

#KT-54878 Fixed
2022-11-21 16:15:46 +00:00
Aleksei.Cherepanov de5fd767d4 Suppress warning for mvn+kapt+jdk9
Suppress the warning about lack of tools.jar, as this jar does not present in JDK9+

#KT-47110 Fixed
2022-11-21 15:22:27 +00:00
Jinseong Jeon f2bc25c71d SLC: fix visibility/static modifer of property in companion 2022-11-21 15:55:13 +01:00
Jinseong Jeon e2901c81ac SLC: populate fields from companion in annotation 2022-11-21 15:55:12 +01:00
Sebastian Sellmair f02fd2e04e [Gradle] Implement smoke test for external android target prototype resolving sdk
KT-54981
2022-11-21 14:11:27 +00:00
Sebastian Sellmair 83af85706d [Gradle] ExternalKotlinTarget Api: Implement 'configureIdeImport' API
^KT-55010 Verification Pending
2022-11-21 14:11:27 +00:00
Yahor Berdnikau 19f4e39ee7 Fix toolchain test fails jvm target validation
Happens after changes for KT-54933 was merged earlier than for KT-55004.
2022-11-21 14:59:01 +01:00
Anna Kozlova f937a85fb8 [tests] split by FILE directive to avoid artificial errors
during parsing psi
2022-11-21 13:07:14 +01:00
Sebastian Sellmair 17c20bff92 [Gradle] Implement integration test for KT-54981
^KT-54981 Verification Pending
2022-11-21 10:14:04 +00:00
Sebastian Sellmair 55ef9a6bad [Gradle] Only add 'directly included' source sets to metadata compile tasks
Contrary to platform compilations, metadata based compile tasks
are expected to only compile the directly associated source sets w/o
their dependsOn closure. DependsOn source sets will be represented
as .klib binary dependencies instead.

^KT-54981 Verification Pending
2022-11-21 10:14:04 +00:00
Roman Efremov 9330018390 Add comment with reference to K2 implementation of opt-in check
^KTIJ-23369 Fixed
2022-11-21 13:09:40 +03:00
Yahor Berdnikau f6dd302dc7 Fix child default toolchain configuration overwrites parent one
Caused by configure actions ordering - parent are applied first.

^KT-55004 Fixed
2022-11-21 09:53:19 +00:00
Mikhail Glukhikh 1d76bce3dd K2: fix outerClassSymbol behavior for local classes #KT-55018 Fixed 2022-11-21 09:23:54 +00:00
Nikolay Lunyak fb09f139dd [FIR] Unmute receiver annotations tests
These tests were muted in 89f8821d. Seems they began to work after the
introduction of `FirReceiverParameter` in KT-54417.
2022-11-21 08:51:43 +00:00
Sebastian Sellmair bc531610f7 [Gradle] ExternalKotlinTarget Api: Add initial APIs to configure publications
KT-54981
2022-11-21 07:33:17 +00:00
Sebastian Sellmair c33b172988 [Gradle] Introduce InternalKotlinTarget
KT-54981
2022-11-21 07:33:17 +00:00
Sebastian Sellmair e5398e6be7 [Gradle][Minor] Move KotlinTargetComponent into separate source file
KT-54981
2022-11-21 07:33:17 +00:00
Sebastian Sellmair 7368752c24 [Gradle] ExternalKotlinTargetApi: Configure apiElements and runtimeElements configurations
KT-54981
2022-11-21 07:33:16 +00:00
Igor Yakovlev c8306f1a3b [Wasm] Mark rotate functions with WasExperimental 2022-11-19 11:49:06 +01:00
vladislav.grechko 5ec2f1ad92 Get rid of redundant boxing when comparing inline class instances
^KT-33722: Fixed
2022-11-18 23:14:03 +00:00
Anna Kozlova e5ce32feeb [ANALYSIS API] introduce dedicated KtCall for incomplete code
KTIJ-23505 and duplicates
2022-11-18 20:59:31 +01:00
Artem Kobzar 725a224f74 [K/JS] Make available transitive reexport for ES modules 2022-11-18 16:54:10 +00:00
Zalim Bashorov d2b63c8c31 [Wasm] Use common logic for eqeq and eqeqeq
So, now it generates better code when null literals are passed to `eqeqeq`,
same as for `eqeq`.
2022-11-18 17:30:11 +01:00
Zalim Bashorov 96b02c9b66 [Wasm] Minor: move part of code of eqeqSymbol processing in BuiltInsLowering 2022-11-18 17:30:11 +01:00
Zalim Bashorov 0529ba9a87 [Wasm] Extract common some logic of eqeqSymbol processing in BuiltInsLowering 2022-11-18 17:30:10 +01:00
Zalim Bashorov 919029f34f [Wasm] Add fast path for null in externRefToAny
- Introduce new intrinsics `wasm_ref_cast_null` & `wasm_ref_test_null`.
- Support getting type for immediate from generic argument.
- Remove redundant null check in `tryGetOrSetExternrefBox`.
2022-11-18 17:30:10 +01:00