Commit Graph

81079 Commits

Author SHA1 Message Date
Mikhail Glukhikh f0ff9ad5a7 FIR: rename AMBIGUITY to OVERLOAD_RESOLUTION_AMBIGUITY to match FE 1.0 2021-04-02 16:22:01 +03:00
Alexander Shabalin 71397a06fb Add Stop-the-World Mark & Sweep GC for single-threaded programs.
GC implementation for testing purposes

* Only works for a single mutator
* Runs on the same thread as the mutator
* Runs every nth checkpoint and after every m bytes are allocated
* Runs finalizers after sweeping on the mutator thread.
2021-04-02 12:13:44 +00:00
Mikhail Glukhikh e7102cd63f FIR: fix FQ_NAMES_IN_TYPES renderer 2021-04-02 15:11:02 +03:00
Tianyu Geng 761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +03:00
Tianyu Geng fc8d0e3ee0 FIR checkers: report VAL_REASSIGNMENT for assignment operators
Currently VAL_REASSIGNMENT are only reported on direct assignments.
Reassignments in the form of, for example, `+=` are reported as
`VARIABLE_EXPECTED`, which differs from FE1.0.
2021-04-02 13:33:52 +03:00
Vladimir Ivanov b87a943efd [Native] Add test for -Xexport-kdoc (#4249)
(*) Fix exported kdoc indentation and extra blank lines
2021-04-02 12:10:09 +03:00
Dmitry Petrov eefb6e94a9 Minor: update tests to pass on Android 2021-04-02 10:53:30 +03:00
Mikhail Glukhikh 42d53dd954 FIR: introduce delegated & overridden conflict checks 2021-04-02 10:24:20 +03:00
Mikhail Glukhikh 566dc434cc FIR: introduce MANY_*_MEMBER_NOT_IMPLEMENTED diagnostic 2021-04-02 10:24:20 +03:00
Mikhail Glukhikh 9f27362ee1 Match triangle & diamond intersections in FirTypeIntersectionScope 2021-04-02 10:24:20 +03:00
Anton Yalyshev a7a1b678bd Enable for AS possibility to collect FUS data 2021-04-02 10:03:38 +03:00
Dmitriy Dolovov 003d07b51e [K/N][IR] Ref to expect property in actual declaration is not remapped
^KT-36880
2021-04-02 09:35:46 +03:00
Elena Lepilkina 393aaac2b9 [Native] Removed old gradle properties for kotlin repo and versions 2021-04-02 05:42:13 +00:00
Dmitry Petrov 19fb7ebfd5 JVM_IR fix local class names for files with @JvmPackageName 2021-04-02 00:08:55 +03:00
Alexander Udalov c4b2b7e0da Add underlying property name & type for inline class to kotlinx-metadata
#KT-45635 Fixed
2021-04-01 22:34:53 +02:00
Alexander Udalov 9b5bbb95e7 Refactor CirConstantValue similarly to KmAnnotationArgument
Introduce LiteralValue with generic value, and remove `value` from
enum/array/null subclasses.
2021-04-01 22:34:53 +02:00
Alexander Udalov 5f7f4a4ac8 Improve API of annotation arguments in kotlinx-metadata
See changes in ChangeLog.md for more information
2021-04-01 22:34:53 +02:00
Alexander Udalov 1a82158472 Fix array of KClass annotation arguments in kotlinx-metadata-jvm
#KT-45594 Fixed
2021-04-01 22:34:53 +02:00
Ilya Kirillov e2084a180b FIR IDE: fix invalid FirSessionWithModificationTracker.isValid 2021-04-01 21:16:18 +02:00
Ilya Kirillov ea451fa7ae Revert: "FIR IDE: do not run STATUS phase under lock" 2021-04-01 21:16:17 +02:00
Ilya Kirillov 5f4b42a309 FIR IDE: temporary do not fail on non-resolved reference while resolving calls 2021-04-01 21:16:17 +02:00
Alexander Udalov ce0c0ad2e3 JVM IR: get rid of toIrBasedKotlinType in MethodSignatureMapper
Commonize (in terms of TypeSystemCommonBackendContext implementations
for KotlinType/IrType) code that computes optimal TypeMappingMode to
apply to different positions where inline class types can be present.
2021-04-01 20:17:45 +02:00
Alexander Udalov b59ac5d8f6 JVM IR: do not use old KotlinTypeMapper when coercing inline classes
KotlinTypeMapper.mapInlineClassTypeAsDeclaration and
mapUnderlyingTypeOfInlineClassType invoked mapType which is defined in
descriptorBasedTypeSignatureMapping.kt and works on KotlinType.

It didn't lead to any problems, other than the fact that we were
constructing IrBasedClassDescriptor in JVM IR, and then KotlinType to
pass it to mapType, on each call to StackValue.boxInlineClass or
unboxInlineClass, which seems wasteful.

Instead of this, refactor these utilities to use type markers instead,
pass IrType and IrTypeMapper directly from JVM IR, and move the "static
type mapper" logic (which is used only in the old backend) out of
KotlinTypeMapper.
2021-04-01 20:17:45 +02:00
Ilmir Usmanov b5ecccb610 Enable suspend in fun interfaces by default
#KT-45836 Fixed
2021-04-01 20:26:42 +03:00
Jinseong Jeon 572c0b2ade Raw FIR: make sure loop target preparation and loop configuration match
by using the generated loop target during preparation in a message
passing fashion
2021-04-01 20:07:53 +03:00
Jinseong Jeon bb242f022f FIR renderer: avoid StackOverflow when rendering loop jump condition
For example,
```
do {
  ...
} while(
    when (...) {
      ... -> break
    }
)
```
That `break` condition is `when` expression, and while visiting its
branch result, we will see the same `break` again.
2021-04-01 20:07:52 +03:00
Jinseong Jeon b4a5eec5f4 Raw FIR: correct loop target for break/continue in do-while loop condition
As shown in KT-44412 (or KT-45319 or KT-17728):
```
fun test5() {
    var i = 0
    Outer@while (true) {
        ++i
        var j = 0
        Inner@do {
            ++j
        } while (if (j >= 3) false else break) // break@Inner
        if (i == 3) break
    }
}
```

To properly set the loop target for `break` in do-while loop condition,
the loop target for that do-while loop should be ready before parsing
the loop condition.

Previously, Raw FIR loop building configures loop target after visiting
loop conditions. This commit splits the configuration and lets the
builders prepare the loop target for do-while loop only.
2021-04-01 20:07:50 +03:00
Jinseong Jeon 81999117dc FIR2IR: force return type of loop body block as Unit 2021-04-01 20:07:49 +03:00
Jinseong Jeon 7898d167f3 FIR2IR: wrap do-while loop in IrBlock
"so that variables declared in loop body are not visible outside of the
loop" (from commit d096f1d)
2021-04-01 20:07:47 +03:00
Ilya Kirillov 08670114c8 Remove old j2k tests 2021-04-01 18:27:20 +02:00
Ilya Kirillov 9eb6b785c6 FIR IDE: encapsulate isInsideAnalysisContext check into ReadActionConfinementValidityTokenFactory 2021-04-01 18:26:40 +02:00
Ilya Kirillov 0d12110112 FIR IDE: introduce ValidityToken for light classes
To make all light classes stuff available from EDT
2021-04-01 18:26:39 +02:00
Stanislav Erokhin 8ffb822c3c Add way to create the FirAnalysisSession with custom token
This way should be used only for old FE wrappers.
It is important that Fir session with custom token should be cached,
because otherwise session with incorrect validity token could be
returned from cache inside analyze call
2021-04-01 18:26:38 +02:00
Ilya Kirillov 29bebae37d FIR IDE: add validity check of analysis component that it is valid only in analysis context 2021-04-01 18:26:38 +02:00
Ilya Kirillov bd38363077 FIR IDE: use IGNORE_FIR instead of FIR_COMPARISON in hl quick fix tests
To explicitly specify which test are failing
2021-04-01 18:24:17 +02:00
Ilya Kirillov 18ab9c7b25 Move HLApplicator from fir ide module to frontend-independent 2021-04-01 18:24:17 +02:00
Denis.Zharkov 5cbfb172a4 Ignore new FIR box test on android 2021-04-01 14:52:05 +03:00
sebastian.sellmair 3f3e51f36e CInteropCommonization: Filter out illegal dependencies
^KT-45832 Fixed
2021-04-01 10:30:23 +00:00
Ilya Kirillov c775508f64 FIR IDE: cache function symbols in FirIdeBuiltinSymbolProvider 2021-04-01 11:31:43 +02:00
Ilya Kirillov d5951bc97d FIR IDE: use EntityWasGarbageCollectedException instead of ISE in ReadOnlyWeakRef 2021-04-01 11:31:43 +02:00
Denis.Zharkov d685e2aac7 FIR2IR: Fix inheritance case from built-in interface with default methods 2021-04-01 12:11:37 +03:00
Alexander Shabalin e5ea7f5b4e Do not freeze enum in new MM 2021-04-01 08:41:08 +00:00
Ilmir Usmanov 786999bcfe Minor. Add regression tests
#KT-44143
2021-04-01 00:51:08 +03:00
Ilya Goncharov 03fed85447 [IR] Change copy method into shallowCopy in Native 2021-03-31 20:14:56 +03:00
Ilya Goncharov 368ac36204 [IR] Remove IrExpressionWithCopy and replace with shallowCopy method 2021-03-31 20:14:55 +03:00
Ilya Goncharov 084d824984 [IR] Use deepCopyWithSymbols in IrTypeOperatorCall 2021-03-31 20:14:54 +03:00
Ilya Goncharov 7046f9badd [IR] canHaveSideEffects more robust
By default copyable (IrExpressionWithCopy) declarations is considered as side-effects.

^KT-45655 fixed

[IR] isTrivial more robust

By default copyable (IrExpressionWithCopy) declarations is considered as trivials.

[IR] Use one source of truth for triviality of IrExpression
2021-03-31 20:14:53 +03:00
Ilya Goncharov 47f1a8a0bb [IR] Make IrTypeOperatorCall copyable
^KT-45655 fixed
2021-03-31 20:14:52 +03:00
Ivan Kylchik 2a5153f0fd Move visualizer black box tests generator to separate class 2021-03-31 19:46:23 +03:00
Ilya Gorbunov 94240f7b21 Stabilize unsigned types KT-45653
Deprecate specialized unsigned iterators for removal.

Fix compiler tests:
- drop unsignedLiteralsOn1_2 because apiVersion 1.2 is no longer supported
- drop experimental unsigned literals diagnostic test
2021-03-31 19:05:04 +03:00