Commit Graph

90 Commits

Author SHA1 Message Date
Ilya Kirillov 5c3ce67648 Analysis API: introduce KtIntegerLiteralType 2021-09-30 01:46:00 +03:00
Ilya Kirillov 30b1487afc LL API: add checks to the compiler based tests to ensure ConeTypeVariableType are not leaked 2021-09-30 01:45:59 +03:00
Ilya Kirillov 8d15e0e824 Analysis API: use FirSession from star importing scope for resolving classifiers
Resolve should happen from the use-site of the file to which importing scope belongs to
2021-09-29 22:24:27 +02:00
Tianyu Geng 43257f7688 FIR IDE: rename SymbolKind: MEMBER -> CLASS_MEMBER 2021-09-29 22:24:27 +02:00
Tianyu Geng d968b2ba49 FIR IDE: fix getClosestAvailableParentContext
File could be physical yet the state is `FirModuleResolveStateDepended`
2021-09-29 22:24:27 +02:00
Tianyu Geng 0ade231898 FIR IDE: make KtSymbolProvider.getSymbol work for library symbols 2021-09-29 22:24:27 +02:00
Tianyu Geng 954926e0de FIR IDE: get containing symbol of KtTypeParameterSymbol
As part of this change, we now also allow HL API to get containing
symbol for any KtSymbols.
2021-09-29 22:24:26 +02:00
Tianyu Geng 7c3754f516 FIR IDE: output substitutor from checkExtensionIsSuitable 2021-09-29 22:24:26 +02:00
Tianyu Geng 18a23f26f5 FIR IDE: allow getting overridden symbols on any callable symbols
This way caller don't need to first check if the symbol is allowed to
override. The current API throws for cases like Java field, or enum
entry, which is not very user-friendly.
2021-09-29 22:24:26 +02:00
Tianyu Geng 54b32f6911 FIR IDE: allow get overriding symbols of members in anonymous object 2021-09-29 22:24:26 +02:00
Tianyu Geng 50166c776c FIR IDE: add KtClassInitializerSymbol 2021-09-29 22:24:26 +02:00
Tianyu Geng 6f9712a812 FIR IDE: get property as containing symbol for default accessors 2021-09-29 22:24:26 +02:00
Tianyu Geng 3b48103cd2 FIR IDE: Add API to get implicit receiver types at a position
This will be used in completion contribution.
2021-09-29 22:24:25 +02:00
Tianyu Geng 14452661cc FIR IDE: makes HL ref shortener tolerate missing type arg in type refs 2021-09-29 22:24:25 +02:00
Tianyu Geng 72a4687990 FIR IDE: fix KtFirNonStarImportingScope 2021-09-29 22:24:25 +02:00
Tianyu Geng 211544e790 FIR: rename FirResolvedImport.resolvedClassId|relativeClassName
These two fields references the parent of the import rather than the
classes that are imported. For example

```
import java.util.Map // resolvedClassId -> null
import java.util.Map.Entry // resolvedClassId -> java.util.Map
import java.util.Map.* // resolvedClassId -> java.util.Map
import java.util.Map.someStaticMethod // resolvedClassId -> java.util.Map
import kotlin.package.someTopLevelFuntion // resolvedClassId -> null
import kotlin.package.MyObject.someObjectFuntion // resolvedClassId -> kotlin.package.MyObject
```
2021-09-29 22:24:25 +02:00
Tianyu Geng e5b9d667c0 FIR IDE: collect snapshot of FirTowerDataContext for statements
ImplicitReceiverValue is mutable and FIR body resolve could alter it
while analysing code with smartcast. Hence, previously the IDE may see
inconsistent receiver values for a local scope. For example

```
open class A
interface Foo {
    fun foo()
}
fun A.bar() {
    if (this is Foo) {
        // scope here has implicit receiver type to be `A` rather than `it<A, Foo>`
    }
}
```

This change creates snapshots for local statements so later changes
during body resolve won't affect the collected context.
2021-09-29 22:24:25 +02:00
Jinseong Jeon aad02c1259 FIR LC: introduce modifier list for members
to simulate `default` modifier of methods in interface
2021-09-29 22:02:48 +02:00
Mikhail Glukhikh 3045a5e920 FIR: implement OPT_IN_MARKER_ON_WRONG_TARGET 2021-09-29 19:39:20 +03:00
Mark Punzalan 7425986bf0 Analysis API: Don't resolve references to @Deprecated(HIDDEN)
declarations.
2021-09-29 19:39:16 +03:00
Mark Punzalan 63cc18b095 FIR: Add test for candidate behind hidden property accessors.
See KT-48799.
2021-09-29 19:39:13 +03:00
Tianyu Geng f35680f0a4 FIR checker: resolve property with protected getter and public setter
Assuming Java class `Super` has a protected `getName` method and a
public `setName` method.

Then, in a subclass of `Super`, FE1.0 allows calls to `setName` via the
property syntax if the property is protected and invisible due to
dispatch receiver is not `this` or `super`.
2021-09-29 19:39:12 +03:00
Ilya Kirillov 7d4d035287 Analysis API: add validity assertions to diagnostics 2021-09-28 15:55:24 +03:00
Ilya Kirillov 9fd988d727 Analysis API: regenerate diagnostic classes 2021-09-28 15:55:22 +03:00
Ilya Kirillov 6c97393927 Analysis API: get rid of weak refs scheme for working with FIR internals for diagnostics 2021-09-28 15:55:19 +03:00
Ilya Kirillov d723916d67 Analysis API: get rid of weak refs scheme for working with FIR internals for KtScope 2021-09-28 15:55:18 +03:00
Ilya Kirillov d348c48e4f Analysis API: get rid of weak refs scheme for working with FIR internals for KtSymbol and KtType 2021-09-28 15:55:17 +03:00
Ilya Kirillov 2de4a6f924 Analysis API: fix reference resolving for implicit invoke calls 2021-09-28 15:55:16 +03:00
Dmitriy Novozhilov ce3562f0e8 Migrate all JDK 15 related tests to JDK 17 2021-09-28 13:01:45 +03:00
Victor Petukhov ee728b6902 Use the new type inference for top-level callable reference resolution
^KT-47797 Fixed
^KT-47987 Fixed
^KT-45034 Fixed
^KT-48446 Fixed
^KT-13934 Fixed
2021-09-27 16:12:27 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Jinseong Jeon ad18343413 FIR: resolve types in accessors when not resolving accessors 2021-09-24 18:56:23 +03:00
Denis.Zharkov 37785eb244 FIR: Rename KotlinDeserializedJvmSymbolsProvider -> JvmClassFileBasedSymbolProvider 2021-09-23 16:58:25 +03:00
Denis.Zharkov 54a97a860a FIR: Minor. Rename JavaClassConverter -> FirJavaFacade 2021-09-23 16:58:24 +03:00
Denis.Zharkov 1fc2f13a35 FIR: Pull creation of JavaClassConverter to session factory 2021-09-23 16:58:22 +03:00
Jinseong Jeon d9424fa092 FIR IDE/LC: rename origin of constant values 2021-09-23 00:11:26 +02:00
Jinseong Jeon d3d3aeacb4 FIR IDE: make compile-time constant evaluator an object
because it doesn't have any states.
2021-09-23 00:11:26 +02:00
Jinseong Jeon 414881403b FIR IDE: handle annotation array values properly 2021-09-23 00:11:26 +02:00
Jinseong Jeon ffd0a5ed14 FIR IDE: make constant values symbol-free 2021-09-23 00:11:26 +02:00
Jinseong Jeon f94dad7005 FIR IDE: migrate annotation parameter conversion util 2021-09-23 00:11:26 +02:00
Jinseong Jeon 0f16a2cb92 FIR IDE: rename some of constant values for consistency 2021-09-23 00:11:25 +02:00
Jinseong Jeon ce445700b8 FIR IDE: split conversion utils for KtConstantValue to its own object 2021-09-23 00:11:25 +02:00
Jinseong Jeon 4c8d975ae5 FIR LC: handle more kinds of annotation values 2021-09-23 00:11:25 +02:00
Jinseong Jeon 6ef2dad895 FIR IDE: more comprehensive abstractions of annotation values 2021-09-23 00:11:25 +02:00
Jinseong Jeon 744961bd00 FIR IDE: test resolution of various annotation values 2021-09-23 00:11:25 +02:00
Jinseong Jeon 150f066254 FIR LC: use property modifiers for backing field if lateinit 2021-09-23 00:11:25 +02:00
Ilya Kirillov d3dd9cd078 Analysis API: add KDoc to providers 2021-09-22 12:57:18 +02:00
Ilya Kirillov fb8044641b LL API: move DeclarationCopyBuilder out of public API 2021-09-22 12:57:16 +02:00
Ilya Kirillov 7c0a9230fd LL API: remove empty files 2021-09-22 12:57:16 +02:00
Ilya Kirillov 083dcc4ec6 Analysis API: refactoring, separate AbstractCompilerBasedTest.kt into multiple files 2021-09-22 12:57:15 +02:00