Commit Graph

87804 Commits

Author SHA1 Message Date
Mikhail Glukhikh d16b5c8bd8 FE: make error message more precise #KT-49598 Fixed 2021-11-28 11:32:11 +03:00
Mikhail Glukhikh 0290ca07af FE: fix some error messages (filed -> field)
#KT-49600 Fixed
2021-11-28 11:32:10 +03:00
Mikhail Glukhikh 7fe08d5a38 FE: fix some error messages (must have only -> must only have)
#KT-49609 Fixed
2021-11-28 11:32:10 +03:00
Mikhail Glukhikh c15c7f7dc8 FE: fix visibility check in LazyImportScope #KT-23727 Fixed 2021-11-28 11:32:07 +03:00
Mikhail Glukhikh 4550999288 FE: use proper version in version requirement error message
#KT-48690 Fixed
2021-11-28 11:31:51 +03:00
Mikhail Glukhikh 2f1d415e4d FE: report DECLARATION_CANT_BE_INLINED at 'inline' modifier
#KT-44022 Fixed
2021-11-28 11:31:51 +03:00
Alexander Udalov 4df937ff7f JVM IR: keep property for $receiver field of optimized delegated properties
For properties which delegate to other property via the getValue
operator from stdlib (see KT-39054), we generate `$receiver` field which
stores the receiver of the property reference used in the delegate. The
problem was that this backing field was missing `correspondingProperty`.
It's needed because it is used as a map key to store static fields in
`JvmCachedDeclarations.getStaticBackingField`. If it's null, accesses to
the static $receiver fields are not remapped correctly in
`RemapObjectFieldAccesses` and
`MoveOrCopyCompanionObjectFieldsLowering`, which led to ICCE or NSFE.

 #KT-49793 Fixed
2021-11-26 19:21:16 +01:00
Alexander Udalov 29c1fe1be1 Minor, move tests on KT-39054 into a subdirectory 2021-11-26 19:18:25 +01:00
Denis.Zharkov 85e6c90052 FIR: Temporary adjust diagnostic tests
Elvis now is being resolved a bit differently and in case
of inconsistent types, the while expression has error type,
but no diagnostic is reported since the element has no valid source element

When one sets the source
https://github.com/JetBrains/kotlin/commit/817316cdc93457c1de7cf10c3b422e3a4b486e5b
it brings back the issue KT-45989 that was effectively unresolved but hidden
due to diagnostic loss

^KT-45989 Open
2021-11-26 19:39:52 +03:00
Denis.Zharkov 7eb758fab1 FIR: Avoid propagation of @Exact annotation through elvis 2021-11-26 19:39:52 +03:00
Denis.Zharkov 0d9ad62d4a Fix inference for lambdas with with extension function expected type
^KT-49832 Fixed
^KT-49836 Fixed
2021-11-26 19:39:51 +03:00
Denis.Zharkov 3fb17cfa9a Minor. Reformat PostponedArgumentInputTypesResolver.kt 2021-11-26 19:39:50 +03:00
Denis.Zharkov 61fe70b600 Minor. Rename isAnonymousFunction to isFunctionExpression 2021-11-26 19:39:50 +03:00
Denis.Zharkov c0a46eaefd FIR: Fix inference of nullable unit lambda at RHS of elvis 2021-11-26 19:39:49 +03:00
Denis.Zharkov 46217318c0 FIR: Load final static constant Java fields as non-nullable 2021-11-26 19:39:48 +03:00
Denis.Zharkov dba04bcf80 Fix extraction of type for start projected type
Some existing tests start failing after previous commits
2021-11-26 19:39:48 +03:00
Denis.Zharkov 07440ee4a1 FIR: Fix incorrect inference errors for <expr>::class
Do not use outer expect type for <expr>
2021-11-26 19:39:46 +03:00
Denis.Zharkov 3ec7866ead FIR: Fix inference for case of non-nullable RHS of elvis
Some existing tests start failing after previous commits adding @Exact
attribute to `?:`

They have a form:
var x: String? = nullable()

if (x == null) {
   x = nullable() ?: "" // considering @Exact the whole elvis is inferred to nullable from expect type
}

x.length // should be smart cast
2021-11-26 19:39:46 +03:00
Denis.Zharkov 883b18a0c6 FIR: Preserve non-custom attributes after substitution
The test is being fixed since synthetic call for elvis has @Exact-attribute on return type
2021-11-26 19:39:45 +03:00
Denis.Zharkov e26abbbbb0 FIR: Implement ConeTypeVariableType::equals/hashCode manually
`typeAttributes` are not considered as a part of equality for other type kinds
2021-11-26 19:39:44 +03:00
Denis.Zharkov c0b6a593e0 FIR: Fix incorrect type of block generated for inc operator
Previously, it was obtained from expected type of a variable being assigned,
but it's better to use the type of resulting expression

Initially this part was brought in 4ab0897d7d,
but as we see in commit message and tests it was all about unit-coercion
2021-11-26 19:39:38 +03:00
Denis.Zharkov a7859e0332 FIR: Fix wrong ACCIDENTAL_OVERRIDE on fake override property with JvmName 2021-11-26 19:39:36 +03:00
Denis.Zharkov 6f55d23bab FIR: Support nested light classes 2021-11-26 19:39:31 +03:00
Yahor Berdnikau 8ea97758c0 Make tasks outputs snapshot into zip file.
Kotlin's compilation task outputs usually contains a lot of small files,
which is not so performant to copy as-is into new location. In this
change coping was replaced by using zip archive with no compression.

From my test I see around 2x performance improvement on doing task
 outputs snapshot.

Further optimizations will be done via separate issue as they are
non-trivial and requires some changes on the compiler side.

^KT-49782 Fixed
2021-11-26 16:29:36 +01:00
Ivan Gavrilovic f6263e64e0 KT-49910: Fix adding sources for Android projects
Avoid adding ConfigurableFileTrees to sources as that causes
individual *.java files to be evaluated as sources roots. To
pass the dependency info, manual dependsOn is used, but in the
future SourceRoots should be fixed to carry the dependency info.
2021-11-26 16:00:25 +01:00
Dmitriy Novozhilov 4fb8ab052f Add workaround for KT-49925 2021-11-26 15:19:11 +03:00
Svyatoslav Scherbina 24e7a11abc Native: fix losing Worker.executeAfter jobs on scheduled time clash
The implementation was keeping delayed jobs in std::set sorted
only by the scheduled execution time (in microseconds since epoch).
So two jobs submitted to a worker and having the same scheduled time
were considered equivalent by the set, and one of them got lost.

Fix this by using std::multiset instead of std::set.
2021-11-26 11:59:40 +00:00
Andrey Uskov 95648f1a9e Fix incremental compilation in some compiler plugins
If compiler plugin removes source files between rounds of incremental
compilation, it may result into incorrect state of stubs. But rebuilding
stubs may require services available in UI mode only and cause
compiler failure.
This commit contains work-around allowing to avoid incorrect state of
stubs.
#KT-49340 Fixed
2021-11-26 14:25:45 +03:00
pyos a1be855d17 FIR: thread control flow through anonymous object init blocks
^KT-39646 Fixed
2021-11-26 14:21:29 +03:00
Pavel Punegov 19031c88d9 [Native][test] Fix task dependencies
Apply dependencies on build task, not its provider, because otherwise
dependencies are being set during the task creation that makes them
circular.
2021-11-26 10:13:06 +00:00
Pavel Punegov 918d47d110 [Native][test] Use Distribution instead 2021-11-26 10:13:06 +00:00
Pavel Punegov 6981d9955b [Native][test] Don't build dist if non default home is set
Also build crossDist target in case it is missing in the specified
native home dir.
2021-11-26 10:13:06 +00:00
Pavel Punegov 8be2196ea9 [Native][test] Fix testLibrary dependency 2021-11-26 10:13:05 +00:00
Pavel Punegov 666ecf4bfb [Native][build] Set properties for Konan plugin 2021-11-26 10:13:05 +00:00
Pavel Punegov d73f8ea44e [Native][Test] Fix platformLibs dependencies
Sanity tests should not run tests that depend on platform libs. Also
fix platform libs dependency setting
2021-11-26 10:13:04 +00:00
Ilya Goncharov cac286c915 [JS IR] Access with exported properties by its name, not accessor
[JS IR] Export properties to ts as getter/setter, not fields

[JS IR] Fix typescript tests



Merge-request: KT-MR-5074
2021-11-26 09:18:12 +00:00
Igor Chevdar 353f82f9e6 Revert "[K/N][runtime][interop] Refactoring to run cinterop in daemon"
This reverts commit 47858126da.
2021-11-26 14:05:59 +05:00
Igor Chevdar 0ccb271323 Revert "[K/N][interop] Made NativeMemoryAllocator lock-free"
This reverts commit d642cda8f0.
2021-11-26 14:05:02 +05:00
Igor Chevdar fed76a87af Revert "[K/N][build] Refactored K/N tool runner"
This reverts commit fa587a61fd.
2021-11-26 14:04:06 +05:00
Igor Chevdar 07adab561c Revert "[K/N][interop] A small optimization"
This reverts commit 2cbe946331.
2021-11-26 14:02:43 +05:00
Igor Chevdar 4b53a8e3c7 Revert "[K/N][gradle][interop] Refactored ToolConfig"
This reverts commit d9c1b1f6f7.
2021-11-26 14:01:40 +05:00
Igor Chevdar 031d92e21f Revert "[K/N][gradle] Automatic cleaning of the class loaders map"
This reverts commit 874b442a13.
2021-11-26 14:00:30 +05:00
Dmitriy Novozhilov 2b84e8e68f [FIR] Pass proper containing classes from context to type resolution for local classes 2021-11-26 11:26:24 +03:00
Dmitriy Novozhilov 98934e15c0 [Build] Fix dependency on JUnit in :pill:generate-all-tests 2021-11-26 11:26:22 +03:00
Dmitriy Novozhilov 330574cab6 [FIR] Properly support smartcasts on stable when subjects in when conditions
^KT-49860 Fixed
2021-11-26 11:26:21 +03:00
Dmitriy Novozhilov 20425fb458 [FIR] Add wrapped expressions for when subject expression with smartcast 2021-11-26 11:26:19 +03:00
Dmitriy Novozhilov 8707be51c9 [FIR] Report errors about invisible types from type resolution 2021-11-26 11:26:17 +03:00
Dmitriy Novozhilov f2c319c4ae [FIR] Add ability to safe proper ConeKotlinType in FirErrorTypeRef
This is needed for cases when some type ref is resolved to proper type
  but has some diagnostic (e.g. this type is invisible)
2021-11-26 11:26:16 +03:00
Artem Kobzar 08b0e17d47 feat(polyfills): use stdlib for js polyfills. 2021-11-26 08:14:34 +00:00
Mikhail Glukhikh 4a8f00bc7c FIR2IR: support reading of isNewPlaceForBodyGeneration in lazy class 2021-11-26 09:18:11 +03:00