Commit Graph

80218 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh 742f1e0069 FIR: add replaceSource to all FIR tree nodes 2021-02-19 18:24:45 +03:00
Vladimir Dolzhenko b8d1bbdd0d Do not swallow PCE
#KT-39776 Fixed
2021-02-19 15:04:45 +00:00
Dmitriy Novozhilov d40777c28f [FIR] Fix calculating arguments of bare type with intersection type as base 2021-02-19 16:23:24 +03:00
Alexander Udalov 56f9e3360f JVM IR: do not generate invokeinterface hashCode if smart cast is present
#KT-45008 Fixed
2021-02-19 14:21:54 +01:00
Tianyu Geng 56854a8b1a FIR IDE: register quickfix for the following
1. NON_ABSTRACT_FUNCTION_WITH_NO_BODY
  2. ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS
  3. ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS
2021-02-19 13:16:42 +01:00
Dmitriy Novozhilov 88c43e7f7b [FE] Assume that effective visibility of sealed class constructor is internal
#KT-45033 Fixed
#KT-45043
2021-02-19 14:06:49 +03:00
Ilya Kirillov b08eb6cf4c FIR IDE: specify behaviour of HL API getOverriddenSymbols
- Split it into two functions getAllOverriddenSymbols and getDirectlyOverriddenSymbols
- Implement tests for getOverriddenSymbols
- temporary mute inheritance.kt light classes test
2021-02-19 11:49:57 +01:00