Commit Graph

72919 Commits

Author SHA1 Message Date
Ilya Goncharov d9be59ea97 [JS IR] JS code in init block only for js ir backend test 2021-02-20 21:06:28 +03:00
Dmitriy Novozhilov 13dfa5a886 [FIR2IR] Add handling exceptions from Fir2Ir and reporting declaration where converter failed 2021-02-20 18:27:45 +03:00
Dmitriy Novozhilov ea2783eace [FIR] Fix generating this reference in delegated accessors
There was a problem with delegated extension property with dispatch
  receiver that `this` in `getValue` call was set to dispatch receiver
  instead of extension one
2021-02-20 18:27:43 +03:00
Victor Petukhov 4e5647090e Approximate captured types in contravariant positions properly
^KT-43802 Fixed
2021-02-20 16:57:07 +03:00
Dmitry Petrov 387d84f826 JVM_IR indy-SAM: KT-45069 box lambda 'Unit' return type if needed 2021-02-20 15:07:24 +03:00
Ilya Goncharov 187d4998fa [JS IR] Not cast to declaration parent in JsCodeOutlineLowering, use parent otherwise
^KT-45057 fixed
2021-02-20 13:08:45 +03:00
Ilya Goncharov bd2601f289 [JS IR] Extract adding of function call to another function
[JS IR] Add option for dce mode

[JS IR] Add logging to non useful declarations if appropriate dce mode

[JS IR] Add mode with throwing exception

[JS IR] unreachableDeclaration method is in rootDeclarations

[JS IR] Add js extra help arg with dce mode and include debug.kt to compile unreachableMethod

[JS IR] unreachableDeclaration as internal to not reproduce stdlib api

[JS IR] Fix description of dce mode argument

- Use console.error instead of console.log
- Use JsError instead Kotlin exception for lightweight

[JS IR] Remove body for throwing exception

[JS IR] Remove default parameter in unreachableDeclaration

[JS IR] Process without removing fields and declaration containers

[JS IR] Rename dce mode on dce runtime diagnostic

[JS IR] Use console.trace instead of console.error

[JS IR] Extract JsError

- Fix naming in prependFunctionCall
- Fix description on runtime diagnostic argument
- Using message collector instead of throwing exception

[JS IR] Distinguish unreachableMethods for log and exception

[JS IR] Extract checking of Kotlin packages of IrField

^KT-45059 fixed
2021-02-20 12:05:06 +03:00
Mikhail Glukhikh 5568ceef68 Add test for KT-37056 (already fixed) 2021-02-20 11:37:34 +03:00
Mikhail Glukhikh 6e46b0a1c4 Add test for KT-41917 (already fixed) 2021-02-20 11:37:33 +03:00
Denis.Zharkov 1fe0a1f160 FIR: Fix interface delegation case via type alias 2021-02-20 10:59:23 +03:00
Denis.Zharkov e4c851e3ce FIR2IR: Fix case of @JvmOverloads with subclass
Avoid generating synthetic overrides in subclass
It has been already working for PSI2IR because fake overrides there don't
inherit default values for parameters, while they do it in FIR
2021-02-20 10:59:22 +03:00
Denis.Zharkov 377a0aa237 FIR2IR: Adjust test data for updated overridden structure 2021-02-20 10:59:22 +03:00
Denis.Zharkov a750d9466e FIR2IR: Rework resulted overridden-relation structure
The difference is how we deal with intermediate fake overrides
E.g., in case

interface A { /* $1 */ fun foo() }
interface B : A {
     /* $2 */ fake_override fun foo()
}
interface C : B {
   /* $3 */ override fun foo()
}

We've got FIR declarations only for $1 and $3, but we've got
a fake override for $2 in IR.

Previously, override $3 had $1 as its overridden IR symbol, just because
FIR declaration of $3 doesn't know anything about $2.

Now, when generating IR for $2, we save the necessary information
and using it for $3, so it has $2 as overridden.

So, it's consistent with the overridden structure of FE 1.0 and this
structure is necessary prerequisite for proper building of bridges
for special built-ins.
2021-02-20 10:59:22 +03:00
Denis.Zharkov fd146e3eed FIR2IR: Copy annotations from original declarations to fake overrides 2021-02-20 10:59:22 +03:00
Denis.Zharkov a883833941 FIR2IR: Use IrDeclarationOrigin.FAKE_OVERRIDE for non-source classes 2021-02-20 10:59:21 +03:00
Denis.Zharkov d339096ac3 FIR2IR: Introduce and use declarationStorage.getOrCreateIrConstructor
It's necessary because constructors of LazyIrClass annotations may be
referenced before members are processed
2021-02-20 10:59:21 +03:00
Denis.Zharkov fb8314f6e7 FIR: Fix enhancement of property overrides accessors in Java 2021-02-20 10:59:21 +03:00
Denis.Zharkov 45018ea468 FIR: Rework loading overrides of special built-in methods from Java
Some of the changed data is correct, but some diagnostics are incorrect
Corner cases like having both contains(Object) and contains(String)
within implementation of Collection<String> is not supported
2021-02-20 10:59:21 +03:00
Denis.Zharkov 4b0aeb7105 FIR2IR: Support initialSignatureDescriptor
It will be used for overrides of renamed special built-ins during signature mapping
to obtain initial signature
2021-02-20 10:59:21 +03:00
Denis.Zharkov 23705a269f FIR: Fix supertype scopes for local classes
Do not use ClassId as it can't be a key for local classes
2021-02-20 10:59:21 +03:00
Denis.Zharkov 3e420ca4e3 FIR: Introduce FirDeclarationOrigin.BuiltIns 2021-02-20 10:59:21 +03:00
Denis.Zharkov 893b1045ba Move some common parts from BuiltinMethodsWithDifferentJvmName to SpecialGenericSignatures 2021-02-20 10:59:21 +03:00
Denis.Zharkov 5d5228cfc5 FIR: Require FirJavaClass in JavaScopeProvider 2021-02-20 10:59:20 +03:00
Denis.Zharkov 04f53d6a23 FIR: Simplify JavaScopeProvider
::wrapScopeWithJvmMapped is only needed for built-in classes defined in Kotlin
2021-02-20 10:59:20 +03:00
Denis.Zharkov 6766c8fe47 FIR: Simplify supertypes scopes computation 2021-02-20 10:59:20 +03:00
Denis.Zharkov 31b9be2d01 FIR: Extract ConeKotlinType::scopeForSupertype 2021-02-20 10:59:20 +03:00
Mikhail Glukhikh 1a0be3ee40 Fix FirAnnotationArgumentChecker (String + ... case) #KT-44995 Fixed 2021-02-20 10:31:26 +03:00
Dmitriy Novozhilov cd8f597e2f [FIR] Fix building callable reference adaptation against flexible types
#KT-45052 Fixed
2021-02-20 10:23:34 +03:00
Dmitriy Novozhilov 469252f6b4 [FIR] Don't create smartcast node if smartcasted type is equal to original type 2021-02-20 10:23:33 +03:00
Dmitriy Novozhilov 1c0d862e40 [FIR] Don't smartcast variables to invisible types
#KT-44802 Fixed
2021-02-20 10:23:33 +03:00
Dmitriy Novozhilov 026efca49f [Test] Add helpers file with functions for inference testing 2021-02-20 10:23:33 +03:00
Aleksei.Cherepanov d0eeb0535d Add synchronization to MultiClassFiles maps 2021-02-19 23:54:55 +03:00
Aleksei.Cherepanov aa683d3b2a JPS: Fix JvmMultifileClass processing for IR backend
#KT-44644 Fixed
2021-02-19 23:54:53 +03:00
Ilya Kirillov ca4ec997ee FIR IDE: split KtAnalysisSession into mixins 2021-02-19 19:52:46 +01:00
Ilya Kirillov 141b6b0e55 FIR IDE: use different .after testdata for AbstractHLIntentionTest.kt 2021-02-19 16:44:50 +01:00
Ilya Kirillov 42103b7363 FIR IDE: use correct denotable type approximator 2021-02-19 16:44:48 +01:00
Ilya Kirillov af4d300686 Use nullability from approximated local type in AbstractTypeApproximator 2021-02-19 16:44:47 +01:00
Mikhail Glukhikh 3571074da4 Update FIR-IDE diagnostic components 2021-02-19 18:24:49 +03:00
Mikhail Glukhikh 7c080395f2 FIR: minor test data fixes 2021-02-19 18:24:49 +03:00
Mikhail Glukhikh 7fdc1c7b21 Fix RawFirBuilderTotalKotlinTestCase.testPsiConsistency 2021-02-19 18:24:47 +03:00
Mikhail Glukhikh 54139b83ce FIR: fix EXPRESSION_REQUIRED positioning 2021-02-19 18:24:47 +03:00
Mikhail Glukhikh 588b1354f6 FIR IDE: fix reference shortening regarding new qualified sources 2021-02-19 18:24:47 +03:00
Mikhail Glukhikh 5066a90f6f FIR2IR: fix offsets for qualified expressions 2021-02-19 18:24:47 +03:00
Mikhail Glukhikh 239a44b30c FIR: forbid reporting inapplicable-likes on implicit constructors 2021-02-19 18:24:46 +03:00
Mikhail Glukhikh 34c90aab3b FIR: introduce & use REFERENCE_BY_QUALIFIER positioning strategy 2021-02-19 18:24:46 +03:00
Mikhail Glukhikh 0accaf0f30 FIR: report resolve-time errors on qualified access instead of reference 2021-02-19 18:24:46 +03:00
Mikhail Glukhikh 5ffa72f1fa FIR: change DOT_BY_SELECTOR to DOT_BY_QUALIFIED strategy 2021-02-19 18:24:46 +03:00
Mikhail Glukhikh 04caa5c612 Fix DEBUG_INFO_CALL positioning in FIR 2021-02-19 18:24:45 +03:00
Mikhail Glukhikh 5ca3ce9e37 FIR: introduce & use SELECTOR_BY_QUALIFIED positioning strategy 2021-02-19 18:24:45 +03:00
Mikhail Glukhikh 5892646a27 Change FirQualifiedAccess source to KtQualifiedExpression (if any) 2021-02-19 18:24:45 +03:00