Commit Graph

85613 Commits

Author SHA1 Message Date
Dmitry Gridin 8b5d6827c9 [ULC] fix compatibility with java analyzer for repeatable annotation
* imitate `getReferenceName` to provide interop with existed java analyzer [AnnotationsHighlightUtil.java:238](https://github.com/JetBrains/intellij-community/blob/ad7c664356b2f21af1fa204d5b7b014d8af10fd3/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java#L238)

^KTIJ-19318
2021-09-07 12:47:25 +00:00
Dmitry Gridin 11e71e4e27 [ULC] support repeatable annotation and container
^KTIJ-19318
2021-09-07 12:47:24 +00:00
sebastian.sellmair a3d60f8ed2 [Commonizer] Minor: Don't unnecessarily capture size as local property 2021-09-07 11:36:48 +00:00
sebastian.sellmair f3e55aeac0 [Commonizer] Rename type parameter from 'Context' to 'T'
NullableContextualSingleInvocationCommonizer:
Naming the type parameter 'Context' might provoke different/
misleading intuitions for many.

https://jetbrains.team/im/code/KFc0x1LxezP?message=BDpl60SJkVM&channel=2Ty4Ld4L0Aer

^KT-48567
2021-09-07 11:36:48 +00:00
sebastian.sellmair 2e053be703 [Commonizer] ReturnTypeCommonizer: Only allow covariant nullability for covariant types
The return type of any property with a setter can be considered invariant
and should enable covariant nullability commonization

^KT-48567
2021-09-07 11:36:47 +00:00
sebastian.sellmair 9e34382db5 [Commonizer] Implement TypeNullabilityCommonizer and ReturnTypeCommonizer
^KT-48567 Verification Pending
2021-09-07 11:36:47 +00:00
sebastian.sellmair b13f3599cf [Commonizer] Initial implementation for nullable return type commonization
^KT-48567
2021-09-07 11:36:46 +00:00
sebastian.sellmair f56419cbf8 [Commonizer] Implement ReturnTypeNullabilityCommonizationTest
^KT-48567
2021-09-07 11:36:46 +00:00
Dmitriy Novozhilov 661d89c67f [FIR] Fix diagnostic message rendering for OVERRIDE_DEPRECATION 2021-09-07 14:11:46 +03:00
Dmitriy Novozhilov 9f4abd8ff7 [FE 1.0] Fix diagnostic message rendering for OVERRIDE_DEPRECATION 2021-09-07 14:11:45 +03:00
Dmitriy Novozhilov 9844671ded [FIR] Add KDoc about thread safety rules of FirDeclarationAttributes 2021-09-07 12:38:02 +03:00
Dmitriy Novozhilov a13696072d [FIR-IDE] Properly calculate return type for fake overrides 2021-09-07 12:38:01 +03:00
Dmitriy Novozhilov 37a34e12d0 [FIR] Make Forced FakeOverrideTypeCalculator thread safe 2021-09-07 12:38:00 +03:00
Dmitriy Novozhilov 4f99140c2d [FIR] Split fake override storage to three different components 2021-09-07 12:38:00 +03:00
Dmitriy Novozhilov 9a8ad059d5 [FIR] Minor: rename firSession to session 2021-09-07 12:37:59 +03:00
Dmitriy Novozhilov c8bd6d3203 [FIR] Store SAM constructors in global session component 2021-09-07 12:37:58 +03:00
Dmitriy Novozhilov b832242c36 [FIR] Use NullableMap in FirSamResolver 2021-09-07 12:37:58 +03:00
Dmitriy Novozhilov 5bcd854bee [FIR] Store intersection overrides in global session component 2021-09-07 12:37:57 +03:00
Dmitriy Novozhilov 38a2af0c92 [FIR] Store substitution overrides in global session component 2021-09-07 12:37:56 +03:00
Igor Chevdar e67a78abaf [K/N][codegen] Fix for https://youtrack.jetbrains.com/issue/KT-48543
Sometimes an interface contains final methods, they shouldn't be in its itable
cause they can't be called virtually
2021-09-07 12:04:26 +05:00
Sergey Bogolepov 479e7a5169 [K/N] Fix KT-48566 by falling back to the old behavior
In 1.5.20 HostManager.host started to check host architecture and it
leads to regressing in case of os+arch combination that is not supported
by HostManager.
Before 1.5.20 HostManager.host was determined only by OS. It is
not correct, but Gradle plugin uses HostManager even if there are
no Native targets. We fallback to this behavior to workaround this
regression.
2021-09-07 04:42:01 +00:00
Georgy Bronnikov bf62e98a1a JVM_IR: protect LookupTracker use by a lock 2021-09-06 23:39:12 +03:00
Dmitry Petrov 860c80d210 JVM_IR add bytecode shape check to all relevant for-loop tests 2021-09-06 22:16:41 +03:00
Dmitry Petrov d9e4dec810 JVM_IR reuse loop variable as index variable should happen after LDL
We can't apply "reuse loop variable as index variable" transformation
before local declarations lowering, otherwise it will affect captured
loop variable behavior, resulting in KT-48626.

Since it's JVM-specific, move it to JvmOptimizationLowering.
2021-09-06 22:16:40 +03:00
Sergej Jaskiewicz f62ffeaa0a [JS, Frontend] Forbid @JsExporting inline/value classes
Previously the compiler would just crash.

#KT-46202 Fixed
2021-09-06 16:13:00 +03:00
Sergej Jaskiewicz 5eaea04bc8 [JS, Frontend] Fix a typo in an error message
The single apostrophe was eaten, resulting in the wrong
spelling "cant".
2021-09-06 16:13:00 +03:00
Sergej Jaskiewicz cb3d5f90e6 [JS IR] Export protected members too
#KT-47524 Fixed
#KT-47525 Fixed
2021-09-06 12:46:25 +00:00
Philipp Smorygo 6abd3bf589 Fix CocoaPodsIT 2021-09-06 12:32:25 +00:00
Roman Golyshev 90c88273c3 [FIR IDE] Refactor functions for qualifiers traversing in KtFirReferenceShortener
The code is more coherent when `qualifiedTypesWithSelf` and
`qualifiedExpressionsWithSelf` both do not contain unqualified psi
elements
2021-09-06 14:58:24 +03:00
Roman Golyshev 7a37a7b2a0 [FIR IDE] Refactor KtFirReferenceShortener::findClassifierElementsToShorten
Instead of filtering lambda, pass only qualified elements to the
function (because non-qualified elements cannot possibly be shortened)
2021-09-06 14:42:04 +03:00
pyos 9ee0d6b60a FE: don't use an experimental stdlib function
...for compatibility? idk.
2021-09-06 13:11:21 +03:00
pyos 0d78bcebca FE: rename an extension to avoid conflicts with FIR member 2021-09-06 13:11:20 +03:00
pyos 476513fe96 FIR: rename type parameter: Annotation -> TAnnotation 2021-09-06 13:11:18 +03:00
pyos c522543e44 FIR: mute a blackbox test that fails due to another case of #3747 2021-09-06 13:11:17 +03:00
pyos 9bb7a29baa FIR: disregard enhancements for warnings
Warnings are not implemented yet, so don't produce errors either.
2021-09-06 13:11:16 +03:00
pyos a475453a01 FIR: enable useCorrectedNullabilityForFlexibleTypeParameters
It's necessary for correct substitution of `T & Any` with `T = V..V?`.
2021-09-06 13:11:16 +03:00
pyos bbc476f44e FIR: in computeJvmDescriptor, convert type parameter bounds too
Note the sheer amount of TODOs, though - I'm honestly surprised that
function works at all.
2021-09-06 13:11:15 +03:00
pyos a2e2545e3f FIR: update loadJava tests 2021-09-06 13:11:14 +03:00
pyos 8163acb964 FIR: rearrange some stuff in Java type conversion code 2021-09-06 13:11:14 +03:00
pyos 090b90f62e FIR: load type qualifiers from module, package, and parent classes 2021-09-06 13:11:13 +03:00
pyos 24210aacc8 FIR: use JSR-305 state from command line flags 2021-09-06 13:11:13 +03:00
pyos bff4b8639b FIR: remove FirJavaEnhancementContext 2021-09-06 13:11:12 +03:00
pyos 6f4b5cc73a FIR: expect Java type parameter bounds to be converted first 2021-09-06 13:11:11 +03:00
pyos ba1fc81b96 FIR: remove extra layers of caching above JavaSymbolProvider
There needs to be exactly one postcompute-aware cache in order to avoid
breaking recursive calls to getClassLikeSymbolByFqName.
2021-09-06 13:11:10 +03:00
pyos 09c34eaa7b FIR: unmute some more blackbox tests 2021-09-06 13:11:09 +03:00
pyos 2847de10ac FIR: enhance Java super types 2021-09-06 13:11:09 +03:00
pyos 03304bce96 FIR: enhance Java type parameter bounds
This also fixes handling of self-recursive types.

TODO: fix jspecify/{strict,warn}Mode/Captured.fir.kt
2021-09-06 13:11:08 +03:00
pyos e2a48d3945 FIR: use frontend-independent Java type qualifier computation 2021-09-06 13:11:07 +03:00
pyos e385484994 FIR: when translating raw types, reuse computed upper bounds
Also, don't bother ensuring that the upper bound has the same tree size
as the lower bound; the new index computation can handle it when some
subtrees of the lower bound are replaced by star projections in the
upper bound.
2021-09-06 13:11:06 +03:00
pyos 4654bdb199 FIR: replace 3 flags in Java type conversion with 1 enum 2021-09-06 13:11:05 +03:00