Commit Graph

71376 Commits

Author SHA1 Message Date
Igor Yakovlev c2bf124d86 [FIR IDE] File symbol scope and symbol test 2020-12-16 12:29:54 +03:00
Igor Yakovlev 2f4842b271 [FIR IDE] Add KtFileScope to support KtFileSymbol 2020-12-16 12:29:54 +03:00
Igor Yakovlev 2fa5ab6e31 [FIR IDE] LC Remove difficult caching from FirLightClassBase 2020-12-16 12:29:54 +03:00
Igor Yakovlev f282b721bc [FIR IDE] LC Fix test data 2020-12-16 12:29:53 +03:00
Igor Yakovlev f5d8ae0550 [FIR IDE] LC add caching to light facades 2020-12-16 12:29:53 +03:00
Igor Yakovlev da54dbba8e [FIR IDE] LC Add callable declarations to KtFileSymbol 2020-12-16 12:29:53 +03:00
Igor Yakovlev fb63b74b37 [FIR IDE] LC Add KtFileSymbol and fix facade annotations 2020-12-16 12:29:53 +03:00
Igor Yakovlev 46071c1925 [FIR IDE] LC fix annotations with special sites and nullability 2020-12-16 12:29:53 +03:00
Igor Yakovlev 2e7866ca86 [FIR IDE] LC Fix annotations and modifiers for class members 2020-12-16 12:29:52 +03:00
Igor Yakovlev 3019f439fb [FIR IDE] LC More accurate processing for JvmSynthetic and JvmHidden annotations 2020-12-16 12:29:52 +03:00
Igor Yakovlev 3895ad375c [FIR IDE] LC add jvmstatic method into companion object 2020-12-16 12:29:52 +03:00
Victor Petukhov d32d0a65f0 Revert "Report warning on @JvmStatic in private companion objects"
This reverts commit 9669ab14
2020-12-16 10:24:18 +03:00
Victor Petukhov 94deddef7f Revert "Minor: cover negative cases with test +m"
This reverts commit 04a4f9cd
2020-12-16 10:24:12 +03:00
Ilya Kirillov 5a9ff3471a FIR IDE: fix function targets on context element copy 2020-12-15 22:16:04 +01:00
Ilya Kirillov 67fc1bcb3d FIR IDE: add debug error message when not possible to find fir declarartion by psi 2020-12-15 22:16:03 +01:00
Ilya Kirillov 940ec06f5b FIR IDE: precalculate completion context on dependent analysis session creation 2020-12-15 22:16:02 +01:00
Ilya Kirillov 40b1a4df5a FIR IDE: temp mute failing find usages test 2020-12-15 22:16:01 +01:00
Ilya Kirillov 2d5b23b650 FIR IDE: separate KtExpressionTypeProvider into components 2020-12-15 22:16:00 +01:00
Ilya Kirillov 2101816f03 FIR IDE: add expected type calculation for function calls
does not work in case of incomplete call expression :(
2020-12-15 22:16:00 +01:00
Ilya Kirillov 7be8d69870 FIR IDE: add completion weighers tests for return/if/while 2020-12-15 22:15:59 +01:00
Ilya Kirillov b16ebe2dc4 FIR IDE: consider if & while conditions expected type as boolean 2020-12-15 22:15:57 +01:00
Ilya Kirillov c2d83353e8 FIR IDE: introduce builtin types container 2020-12-15 22:15:57 +01:00
Ilya Kirillov 835577383b FIR IDE: introduce expected type provider for return expressions 2020-12-15 22:15:56 +01:00
Ilya Kirillov 299f36183c FIR IDE: add tests for completion weighers from old testdata 2020-12-15 22:15:53 +01:00
Ilya Kirillov 19fff2b1e7 FIR IDE: implement expected type weigher for completion 2020-12-15 22:15:52 +01:00
Ilya Kirillov c61d4b5f9c FIR IDE: introduce return statement target provider 2020-12-15 22:15:51 +01:00
Ilya Kirillov a0ed14eafe FIR: use real source element for return statement
fix fir
2020-12-15 22:15:51 +01:00
Andrei Klunnyi 3af0257b38 KTIJ-664 [SealedClassInheritorsProvider]: IDE-specific implementation 2020-12-15 18:43:00 +01:00
Andrei Klunnyi f02b73103b KTIJ-650 [Code completion]: no "sealed" for classes with modifiers
annotation, data, enum, inner, open - classes supplied with these
modifiers cannot be sealed.

Commit fixes code completion - "sealed" is no longer suggested in
the mentioned case.
2020-12-15 18:43:00 +01:00
Andrei Klunnyi fe64b13140 KTIJ-650 [Code completion]: support for "sealed interface"
^KTIJ-650 fixed
2020-12-15 18:10:23 +01:00
Svyatoslav Kuzmich 602ed42b99 [Wasm] Move intrinsic generators to generators/wasm
Reason: avoid kotlin-stdlib-gen dependency on kotlinStdlib() via wasm.ir
2020-12-15 19:44:19 +03:00
Jinseong Jeon efeabac2c5 FIR: do not force coercion-to-Unit for nullable lambda return type
3d7d87ac should have been implemented as aafe41c did.
2020-12-15 17:52:49 +03:00
Jinseong Jeon 6239301f4e FIR: no constraint for coerced-to-Unit last expression of lambda 2020-12-15 17:52:49 +03:00
Jinseong Jeon 4ab0897d7d FIR: pass the explicit expected type to block type
This helps avoid adding redundant return Unit into block.
2020-12-15 17:52:48 +03:00
Jinseong Jeon 0ea6b32c01 NI: allow lower bound of flexible type for coercion-to-Unit
Example from
box/inference/coercionToUnitForLambdaReturnTypeWithFlexibleConstraint

// FILE: TestJ.java
public class TestJ {
  public static <T> In<T> materialize() { return null; }
}

// FILE: test.kt

class In<in T>

fun <T> inferred(e: In<T>?, l: () -> T): T = l()

fun box() {
  inferred(TestJ.materialize<Unit>(), { null })
}

`materialize` has flexible type, both for `In<T>` and `T`.
When analyzing `{ null }`, collected type constraints include:
ft<Unit?, Unit> <: T (from ft<In<ft<Unit, Unit?>>, In<ft<Unit, Unit?>>?>)

By allowing the lower bound of flexible type, FIR resolution can visit
`{ null }` with the expected type Unit, which will lead to proper
coercion to Unit at the end.
2020-12-15 17:52:48 +03:00
Dmitry Petrov b0f6461fa9 JVM_IR KT-42020 special IdSignature for some fake override members 2020-12-15 12:56:45 +03:00
Jinseong Jeon 12cfba9ca9 FIR BB: remove stale test ignoring tags in old language versions
Since bf06d381 (move old Java nullability assertion tests...),
these tests aren't used by (Fir|Ir)BlackBoxCodegenTest anymore.
2020-12-15 11:52:50 +03:00
Jinseong Jeon f7ade2b0b8 FIR2IR: introduce implicit casts for extension receivers 2020-12-15 11:52:49 +03:00
Dmitriy Dolovov 6e9ac6b333 [Commonizer] Internal tool for tracking memory usage 2020-12-15 09:48:27 +03:00
Igor Yakovlev 010a290132 [LC] Fix for light classes equivalence 2020-12-15 01:51:23 +03:00
Igor Yakovlev 45112a3c11 [ULC] Fix invalid positive inheritor for self checking
Fixed #KT-43824
2020-12-14 20:34:42 +03:00
Svyatoslav Scherbina 0f4173cdfa Fix running stdlib tests in worker on Native
Add `@SharedImmutable` or `@ThreadLocal` where required.
2020-12-14 19:03:06 +03:00
Ilya Gorbunov 8f4e4a4d40 Specify common sources for stdlib test compilation tasks
Some multiplatform tests are compiled in single-platform projects:
- in kotlin-stdlib-jdk7
- in kotlin-stdlib-jdk8
- in kotlin-stdlib-js-ir. The latter is technically MPP but with a
single platform, so its common sources are not considered as common.

Pass information about common sources to test compilation tasks in order
to use OptionalExpectation annotations there.

Co-authored-by: Svyatoslav Scherbina <svyatoslav.scherbina@jetbrains.com>
2020-12-14 19:03:04 +03:00
Svyatoslav Scherbina c094d77794 Fix DeepRecursiveFunction in worker on Native
Add `@SharedImmutable` to `UNDEFINED_RESULT` top-level property.
2020-12-14 19:03:03 +03:00
Svyatoslav Kuzmich b3d8c4a0fc [JS IR] Apply missing property for all tests tasks like jsIrTest and quickTest 2020-12-14 19:00:05 +03:00
Shagen Ogandzhanian 32cc95a3b0 [JS IR] Skip export annotations while generating default stubs 2020-12-14 16:41:27 +01:00
Svyatoslav Kuzmich 7efc95705a [Wasm] Publish stdlib klib to maven 2020-12-14 17:47:19 +03:00
Svyatoslav Kuzmich d37271bf35 [Wasm] Support packed integer array elements 2020-12-14 14:40:38 +03:00
Svyatoslav Kuzmich 51e8d782b0 [Wasm] Support packed integer class fields 2020-12-14 14:40:38 +03:00
Ilya Gorbunov 28168bf230 Correctly implement specialized MutableEntrySet.contains KT-41278
This is a workaround for the problem KT-43321.

Introduce an intermediate abstract set specialized for Map.Entry elements
and implement 'contains(Map.Entry)' method there.

Then inherit that intermediate set in entrysets of JS HashMap,
JS LinkedHashMap, JVM MapBuilder, that are specialized for
MutableMap.MutableEntry elements, so that no override of 'contains' is
required anymore.

This allows to avoid incorrect special 'contains' bridge being generated
that otherwise rejects all arguments except ones of MutableEntry type.
2020-12-14 12:42:47 +03:00