Commit Graph

103962 Commits

Author SHA1 Message Date
Ivan Kylchik adce2c9a78 [WASM] Replace deprecated Char.toInt() with Char.code 2023-08-24 08:59:49 +00:00
Ivan Kylchik ee973c0ede [Generator] Generate Char class 2023-08-24 08:59:49 +00:00
Ivan Kylchik 38e434bc07 [Generator] Generate Boolean class 2023-08-24 08:59:49 +00:00
Ilya Gorbunov 3f3cd2e87a [Generator] Set up body for rangeTo and rangeUntil by default
Also use expression body formatting for `rangeTo`.
2023-08-24 08:59:49 +00:00
Ivan Kylchik 097535aeea [Generator] Replace IntrinsicConstEvaluation string with const property 2023-08-24 08:59:49 +00:00
Alexander Shabalin ba49879b5e [K/N] Disable tests with aux threads with tsan 2023-08-24 08:33:38 +00:00
Alexander Shabalin aac53b699e [K/N] Make hostRuntimeTests for arm64 macOS also run x64-tsan 2023-08-24 08:33:38 +00:00
Yan Zhulanow 3e12693f94 [fir2ir] Ensure the property is resolved before mapping its initializer
In partial module compilation, especially inside the IDE, only a few
files from the project are passed to fir2ir. FIR in these files might
contain references to declarations from other files.

As the FE doesn't usually care about called property initializers,
called properties might be resolved to 'CONTRACTS' or even 'STATUS'.
The backend, however, might need to inline constant expressions from
properties.
2023-08-24 07:54:57 +00:00
Yan Zhulanow 981dde26ea [LL API] Migrate type reference check to FirExpression.type
'FirExpression.typeRef' is deprecated. Its new, temporary replacement
is not passed to visitors, so the reference-handling code became dead.
2023-08-24 07:54:57 +00:00
Yan Zhulanow d70dbbc4cf [LL API] Resolve properties called inside code fragments
'CodeFragmentCapturedValueAnalyzer' assumes the analyzed code fragment
is then passed to the backend. For property calls, there are several
code generation strategies (field, accessor, delegate). In order to
be able to choose one, the whole property, including its possibly
'const' initializer, must be resolved.

The commit fixes a plenty of 'FirIdeNormalAnalysisSourceModuleCompilerF\
acilityTestGenerated.CodeFragments.Capturing' tests that broke after
the 'FirExpression.type' refactoring.
2023-08-24 07:54:57 +00:00
Kirill Rakhman 7fde5af7f8 [FIR] Rename FirExpression.coneType to resolvedType 2023-08-24 07:54:57 +00:00
Kirill Rakhman ab6d87a1a2 [FIR] Introduce deprecated FirExpression.typeRef property for compatibility with Compose
#KT-59855
2023-08-24 07:54:57 +00:00
Kirill Rakhman a5cff6ae36 [FIR] Make type of special expressions immutable 2023-08-24 07:54:57 +00:00
Kirill Rakhman 8d7c5b375e [FIR] Replace usages of FirExpression.typeRef with coneTypeOrNull
#KT-59855 Fixed
2023-08-24 07:54:57 +00:00
Kirill Rakhman f60d81097c [FIR] Adapt FIR renderer after FirExpression.coneTypeOrNull introduction
#KT-59855
2023-08-24 07:54:57 +00:00
Kirill Rakhman bc27feace4 [FIR] Adapt FIR utilities after FirExpression.coneTypeOrNull introduction
#KT-59855
2023-08-24 07:54:57 +00:00
Kirill Rakhman 7223cd1bf3 [FIR] Update custom FIR implementations after FirExpression.coneTypeOrNull introduction
#KT-59855
2023-08-24 07:54:57 +00:00
Kirill Rakhman b24afa0177 [FIR] Regenerate FIR tree after FirExpression.coneTypeOrNull introduction
#KT-59855
2023-08-24 07:54:57 +00:00
Kirill Rakhman bec39a9258 [FIR] Change FIR structure by replacing FirExpression.typeRef with cone type
#KT-59855
2023-08-24 07:54:56 +00:00
Kirill Rakhman 270aa1656f [FIR] Add default parameter values to ClassId.constructClassLikeType
#KT-59855
2023-08-24 07:54:56 +00:00
Kirill Rakhman e50025f21f [FIR2IR] Replace FirExpression.typeRef.toIrType with coneType.toIrType
#KT-59855
2023-08-24 07:54:56 +00:00
Kirill Rakhman 9ec814b7ad [FIR] Replace FirExpression.typeRef.coneType (and variants) with FirExpression.coneType
#KT-59855
2023-08-24 07:54:56 +00:00
Kirill Rakhman 1472b21993 [FIR] Don't use called declaration as source for call typeRef
Otherwise, we end up with sources pointing to different files.

#KT-60760 Fixed
2023-08-24 07:54:56 +00:00
Nikolay Lunyak 82c18ff26b [FIR] Report NON_MEMBER_FUNCTION_NO_BODY
^KT-59944 Fixed
2023-08-24 07:49:20 +00:00
Ilya Gorbunov e103318432 kotlin-test-js: assemble sources jar that combines common and platform sources, KT-61315, KTIJ-23784 2023-08-24 01:24:07 +00:00
Dmitrii Gridin 2cb6ee81a1 [LL FIR] add guards to type resolver
We should protect return types from value parameters/property accessors
and backing fields from repeatable modifications.
Such declarations can be modified during type resolution by
`transformTypeToArrayType` or property getter type propagation,
so we should be able to restore the original reference in the case of
exceptions (PCE for instance)

^KT-61422
2023-08-23 20:05:18 +02:00
Dmitrii Gridin 2f8a64fff2 [AA FIR] fix exception from vararg parameter with invalid type
It is true that for vararg parameter `arrayElementType` always have to
be not null, but it required resolution to TYPES phase. But in case of
the error type, the type reference is treated as resolved, so we are not
obligatory to resolve such reference to TYPES, because we already have
the resolved type.
So we can make the rule of KtFirValueParameterSymbol#returnType less
strict, and varargElementType will effectively do the same as
lazy resolve + arrayElementType

^KT-61422 Fixed
2023-08-23 20:05:18 +02:00
Leonid Startsev 6e4d033f89 Promote deprecation on Flags API to ERROR
#KT-59440
2023-08-23 16:47:05 +00:00
Leonid Startsev 06c471d413 Remove deprecated Flag usages in MetadataDeclarationsComparator.kt
#KT-59440
2023-08-23 16:47:05 +00:00
Pavel Punegov 2b6ca6d8e1 [K/N] Exclude a part of the test that fails due to the ^KT-61418 2023-08-23 15:40:07 +00:00
Jingbo Yang 7a13173e6a Support fileAccessHistoryReportFile in KAPT
This change expanded KAPT to support a new param
'fileAccessHistoryReportFile', which reports all the classes used during
 annotation processing into a file, in the form of a list of URIs.

This is useful for build speed improvements described in https://engineering.fb.com/2017/11/09/android/rethinking-android-app-compilation-with-buck/.
Essentially, using the list of used classes, we can compile only
the dependencies that are really affected by the developer's
code changes and improve Kotlin build speed.

^KT-52853
2023-08-23 14:59:59 +00:00
Dmitriy Novozhilov 1b49ae3aab [Build] Update verification-metadata.xml 2023-08-23 14:57:22 +00:00
Dmitriy Novozhilov b193dc50b4 [Build] Exclude :scripting:dependencies-maven-all from JPS compilation 2023-08-23 14:57:22 +00:00
Dmitriy Novozhilov 20c46738b4 Advance bootstrap to 1.9.30-dev-1098 2023-08-23 14:57:21 +00:00
Troels Bjerre Lund f67ec22c24 [K/N] Fix the native performance benchmark build
kotlin.native.concurrent.FreezableAtomicReference was depricated, so it
has been replaced by a kotlin.concurrent.AtomicReference
2023-08-23 14:29:29 +00:00
Alexander Shabalin efa59eb589 [K/N] Adjust values for the initial and minimum heap sizes ^KT-61092 2023-08-23 14:00:32 +00:00
Mikhail Glukhikh 5ee50f50b5 K2/LC: set hasBackingField to false for expect properties
#KT-61173 Fixed
2023-08-23 13:48:48 +00:00
Roman Efremov 6b217369a8 [FE1.0] Fix false reporting of non-matching annotations in IDE...
...when typealiased expect class used in class literal.

^KTIJ-26700 Fixed
2023-08-23 13:15:20 +00:00
Roman Efremov 3124cbcbad [FE, IR] Refactor: rename areAnnotationArgumentsEqual parameters
Rename to "expect" and "actual" annotation.
This will be needed in next commit to make it clear that
only expect annotation value needs special handling.

^KTIJ-26700
2023-08-23 13:15:20 +00:00
Roman Efremov 77ab13400e [FE1.0] Fix false reporting of non-matching actual annotations in IDE
It was reported because in composite module analysis we have both expect
and actual annotation descriptors, which may differ.
This may lead to bugs in the checker of ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT
diagnostic.

`fqName` comparison can be safely removed, because we already check
types in `areCompatibleExpectActualTypes`.

Tests:
- typealiasedAnnotation.kt - for annotation use (so it has different
ClassId)
- typealiasedAnnotationAsArgument.kt - when typealiased annotation
used in another annotation as argument
- sourceRetentionAnnotationsWhenTypealias.kt - tests same as
compiler/testData/diagnostics/tests/multiplatform/annotationMatching/sourceRetentionAnnotationsWhenTypealias.kt

No special test added for opt-in, because it's prohibited to have
expect/actual opt-ins by EXPECT_ACTUAL_OPT_IN_ANNOTATION checker.

^KTIJ-26700
2023-08-23 13:15:20 +00:00
Nataliya.Valtman dce1c1c70a Fix flaky tests with ConcurrentModificationException 2023-08-23 13:01:47 +00:00
Nikolay Lunyak 6e732f2f4d [FIR] Report NON_SOURCE_ANNOTATION_ON_INLINED_LAMBDA_EXPRESSION
^KT-59422 Fixed
2023-08-23 12:39:23 +00:00
Nikolay Lunyak ed6a0af0a6 [FIR] Report DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE
^KT-59418 Fixed
2023-08-23 12:38:38 +00:00
Yahor Berdnikau 7d48a7934f [Gradle] Fix tryK2 was not applied to Kotlin/JS gradle plugin
^KT-61193 Fixed
2023-08-23 12:36:46 +00:00
Nikita Bobko c42d19f0e5 Cover KT-60646 with regression tests
This behavior wasn't intended during KT-15470 coding. I only intended to
prohibit `@get:` target on things different from properties. But I
accidentally prohibited `@property` on things different from properties
too

But it's a bug fix anyway, so let's keep it.

I also re-checked the implementation of KT-15470, I don't see any other
unintentional prohibitions
2023-08-23 12:35:51 +00:00
Nikita Bobko 7e4f9def83 Fix that INAPPLICABLE_TARGET_ON_PROPERTY_WARNING diagnostic is considered as an error
It was a stupid copy-paste typo. Please notice that this bug is only
presented in K2. In K1, INAPPLICABLE_TARGET_ON_PROPERTY_WARNING is a
warning.

But in K2, INAPPLICABLE_TARGET_ON_PROPERTY_WARNING doesn't matter as
much because it's only possible when LV <= 1.9. But K2 frontend doesn't
guarantee support of language flags that are < 2.0, anyway.

There are no tests because the test would be too trivial.
2023-08-23 12:35:50 +00:00
vmishenev 5c0c8ed2d5 Update Dokka to 1.9.10-dev
- Use analysis plugin configuration instead of `StdLibAnalysisConfigurationPlugin`
- Change SamplesTransformer plugin after Dokka refactoring
2023-08-23 12:33:40 +00:00
Alexander Shabalin 18fb2ec476 [K/N] Don't build distribution for deprecated targets ^KT-59008 2023-08-23 11:46:59 +00:00
Kirill Rakhman e96dcef571 [FIR2IR] Convert annotations on local delegated properties
#KT-60292 Fixed
2023-08-23 11:09:35 +00:00
Ilya Chernikov 85ca5294ef K2: add test for already fixed missing diagnostic issue
#KT-55956
2023-08-23 09:40:45 +00:00