Commit Graph

98049 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich e109662cdc [Wasm] Enable warnings in stdlib and treat them as errors 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 72d9b8ddae [Wasm] stdlib NFC: Fix or suppress remaining warnings 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 238da4c793 [Wasm] stdlib NFC: Suppress cast warnings in org.w3c
Also fix dukat build and update copyright year in generated files.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 7fed003531 [Wasm] stdlib: Remove unchecked cast in PrimitiveClasses::functionClass
This half-stub function is used for compatibility with Kotlin/JS
lowering and doesn't need full KClassImpl<Any> return type.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich dba5d401bb [Wasm] fdlibm NFC: Remove dead code in expm1
Fixes warning that value of y is never used before it is read.

Removed dead code is not present in FreeBSD codebase since at least 1994
https://github.com/freebsd/freebsd-src/blame/34ac629b40e68e5394fe0a27e47c73a875d9f8cb/lib/msun/src/s_expm1.c#L141
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich d6a713ad39 [Wasm] fdlibm NFC: Remove dead code in __ieee754_pow
Fixes warnings.
i0 and i1 are not used in the original C code.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 3acf371f8a [Wasm] fdlibm NFC: Replace division by zero with inf and NaN constants
Fixes warnings.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 181e1023ed [Wasm] fdlibm NFC: Suppress name shadowing for "mutable parameters" 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 5faa430904 [Wasm] fdlibm NFC: Remove unnecessary variable initializers in
Fixes warnings.
These initializers were not in the original C code anyway.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich ffb8138ae2 [Wasm] stdlib NFC: Suppress warnings in _WasmArrays.kt 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 14cf0a0b3f [Wasm] stdlib NFC: Remove dead code in Number2String.kt
This fixes compiler warning
`w_exp` corresponds to unused field of `w` struct
in the original C code
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich d0b25e5a90 [Wasm] stdlib NFC: Suppress warnings for @WasmPrimitiveConstructor 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 8973ba294e [Wasm] stdlib API: Mark all Double and Float companion values as const
Make it consistent with core/builtins and K/N runtime
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 6efeee2037 [Wasm] stdlib API: remove bitwise Byte and Short operations from builtins
They shadow kotlin.experimental extensions
2023-01-24 14:54:59 +01:00
Stanislav Ruban 5cb31c4874 KT-55822: Add diagnostics test showing that issue is fixed in K2
^KT-55822: Fixed Target versions: K2
2023-01-24 13:44:28 +00:00
Justin Paupore 16f14a21e2 [AA] Render reflection functional types as class types.
Render KFunctionN and KSuspendFunctionN by their class names, rather
than using arrow syntax. These types have additional functionality
beyond purely being able to invoke them (e.g. getting the name of the
referred function), so using arrow syntax throws away that functionality
and may cause breakages in the resulting code.
2023-01-24 14:39:55 +01:00
Justin Paupore cd61f545a8 [AA] Clean up typos in KtTypeRenderer. 2023-01-24 14:39:55 +01:00
Justin Paupore eccbc66581 [AA] Add implementation for annotationApplicableTargets.
Adds implementation and tests for the new
KtClassOrObjectSymbol.annotationApplicableTargets property on
KtSymbolInfoProvider. This implementation delegates to the canonical
implementation in AnnotationChecker for FE1.0, and to the implementation
in FirAnnotationHelpers for FIR.

This change also includes direct tests for annotationApplicableTargets,
and a fix for FirClassLikeSymbol.getAllowedAnnotationTargets in
FirAnnotationHelpers.
2023-01-24 14:39:55 +01:00
Justin Paupore 3e80433356 [AA] Add stub annotationApplicableTargets extension.
Introduce an extension method to retrieve the set of applicable targets
for an annotation, given the annotation class's symbol.

This extension on `KtSymbolInfoProvider` causes a large amount of churn
in test data files, so this change starts off by introducing the
property and always making it return null. A future change will
introduce the actual behavior change, and will include the testdata
changes for the few tests that actually return useful data for this
property.
2023-01-24 14:39:54 +01:00
Mikhail Glukhikh 41966a745e Enum entries: add new tests with language feature ON & fix checker 2023-01-24 12:46:00 +00:00
Mikhail Glukhikh c534c54a1c FE: use WITH_STDLIB directive for Enum.entries tests 2023-01-24 12:46:00 +00:00
Mikhail Glukhikh 565adf3075 K1: don't filter Enum.entries in tower to report error later
After this commit we:
- preserve Enum.entries synthetic property in tower even in case the bound feature is OFF
- report an error on Enum.entries call in specific checker if the feature is OFF
- give this synthetic property lower priority, no matter feature ON or OFF

#KT-55251 Fixed
2023-01-24 12:45:59 +00:00
Mikhail Glukhikh 793df6234e FE: add test for KT-55251 2023-01-24 12:45:59 +00:00
Leonid Startsev 5999c2b324 Enhance documentation for KotlinClassMetadata 2023-01-24 11:07:45 +00:00
Leonid Startsev f327d68fe0 Refactor JvmMemberSignature:
- Deprecate asString() in favor of toString()
- Rename desc to descriptor with deprecation
2023-01-24 11:07:43 +00:00
Leonid Startsev 0fcb4c3fb0 Document @ExperimentalContextReceivers 2023-01-24 11:07:43 +00:00
Leonid Startsev 1828e293ea Provide @UnstableMetadataApi and mark kotlin_module related API with it,
as it is not finished yet.
2023-01-24 11:07:42 +00:00
Leonid Startsev 165e779e3e Change extension properties on ClassName into functions, to be more distinct from other String extensions. 2023-01-24 11:07:42 +00:00
Vladimir Sukharev db53b83822 [K/N] Improve native README for MacOS aarch64
Merge-request: KT-MR-8428
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-24 10:34:09 +00:00
Alexander Korepanov edbd05ba47 [JS IR] Hack IC invalidation test so it works with ES6 classes
Hack the IC invaliadtion test so the cross module references
 are invalidated in the same way as with ES6 classes and without.
2023-01-24 09:35:16 +00:00
Alexander Korepanov 0785b45426 [JS IR] Write JS files before verification of dirty JS in IC tests 2023-01-24 09:35:16 +00:00
Alexander Korepanov 1ec88ff560 [JS IR] Enable IR dump for IC invalidation tests
Support 'fd.kotlin.js.debugMode' property in IC invalidation tests.
2023-01-24 09:35:15 +00:00
Alexander Udalov c58314fddf Reflection: improve and optimize kotlinFunction/kotlinProperty
- Make the implementations very similar, to fix KT-54833 where the
  companion object case was forgotten for kotlinProperty.
- Optimize both functions to look up the function/property by name
  first, to cover the most probable case when the JVM name of a
  declaration is equal to its Kotlin name. This fixes KT-55937.

 #KT-54833 Fixed
 #KT-55937 Fixed
2023-01-23 20:43:00 +01:00
Alexander Udalov aa7b4cfbe6 Do not eagerly compute deserialized typealias constructors
Otherwise, when adding a typealias to core/builtins, it leads to an
exception "JvmBuiltins instance has not been initialized properly". It
happens because we start computing typealias constructors even before
the compiler has been initialized properly.

Basically we're creating the container, and as a part of it, we're
computing default imports, and for that we need to get all top-level
classifiers from scopes imported by default, which includes typealiases.
Eager call to `getTypeAliasConstructors` here results in computing
constructors of the class descriptor on the RHS of the type alias, which
is not possible if that class is built-in, since the container has not
yet been created and thus `JvmBuiltIns` has not been initialized yet.

No tests added, and no issue is affected because, as mentioned above,
the problem is only reproducible if we add something to core/builtins.
2023-01-23 20:35:11 +01:00
Sebastian Sellmair 0443ef0648 [Gradle] Only resolve hostSpecificMetadataConfiguration when konanTarget is enabled
^KT-56111 Verification Pending
2023-01-23 19:25:34 +00:00
Sebastian Sellmair 8f6a15e33e [Gradle] MetadataDependencyTransformationTask: Declare dependency to 'hostSpecificMetadataConfiguration's
^KT-56111 Verification Pending
2023-01-23 19:25:34 +00:00
Sebastian Sellmair 24db9f3680 [Gradle] Add MppCompositeBuildIT with host specific targets
... to cover KT-56111
2023-01-23 19:25:34 +00:00
Artem Daugel-Dauge c2e092fe4a [Gradle] Fix invalidating iOS framework after import
^KT-49430 Verification Pending
2023-01-23 18:52:03 +00:00
Artem Daugel-Dauge 8a34d1f430 Separate podgen & podinstall tasks
^KT-54161 Verification Pending
2023-01-23 18:52:03 +00:00
Alexander.Likhachev f144f8b6d3 [Gradle] Fix compilation error in CocoaPodsIT
Also add a Gradle version constraint for deprecation warnings suppressing
KT-55972 Related
2023-01-23 19:02:22 +01:00
Alexander.Likhachev 2e7e1625d3 [Gradle] Remove warnings suppression from more tests
KT-55972 Related
2023-01-23 17:21:17 +00:00
Alexander.Likhachev 9bb2a2468d [Gradle] Suppress warnings only for the Gradle versions that produce them
KT-55972 Related
2023-01-23 17:21:17 +00:00
Alexander.Likhachev 3373a1dd90 [Gradle] Add a warning mode assertion for the old test DSL tests
#KT-55972 Fixed
2023-01-23 17:21:17 +00:00
Alexander.Likhachev 1e7cf5571b [Gradle] Add a warning mode assertion for the new test DSL tests
#KT-55972 In Progress
2023-01-23 17:21:16 +00:00
Alexander.Likhachev dc24582a0b [Gradle] Apply gradle-warnings-detector to test projects
#KT-55972 In Progress
2023-01-23 17:21:16 +00:00
Alexander.Likhachev 7bcfa45c49 [Build] Add gradle-warnings-detector plugin for integration tests
#KT-55972 In Progress
2023-01-23 17:21:16 +00:00
Ilya Goncharov 7ae85ed68e [JS IR] Module descriptors depends on each other 2023-01-23 16:16:48 +00:00
Dmitriy Dolovov b42492cd4d [Native][tests] Mute failing ktor 1_5_4 and coroutines 1_5_0-RC-native-mt (KT-46697) Gradle IT 2023-01-23 16:11:06 +00:00
Roman Efremov 5bd76dbf0b Temporarily comment failing Enum.entries resolve in K/N C interop
See KT-53929
2023-01-23 12:53:07 +01:00
Roman Efremov 878608b7b2 Don't add Enum.entries to scope if it can't be called
^KT-53929 Fixed
2023-01-23 12:53:06 +01:00