Commit Graph

419 Commits

Author SHA1 Message Date
Ilya Kirillov 985c6fa0b8 Analysis API: rework KtSymbol hierarchy
- make some symbols to be KtPossiblyMemberSymbols
- introduce KtDeclarationSymbol for declarations
2021-12-02 20:09:19 +01:00
Ilya Kirillov 22e31ea414 Analysis API FE1.0: fix invalid file scope 2021-12-02 20:09:19 +01:00
Ilya Kirillov d5f6809f76 Analysis API FIR: fix rendering FirField 2021-12-02 20:09:18 +01:00
Ilya Kirillov 68e3c72a64 Analysis API FIR: fix missing type aliases in KtFirFileScope 2021-12-02 20:09:18 +01:00
Ilya Kirillov aef52323a8 Analysis API FIR/FE1.0: fix backing field rendering & resolving 2021-12-02 20:09:18 +01:00
Ilya Kirillov 0a5bbc0096 Analysis API: update rendering testdata after changing renderer 2021-12-02 20:09:18 +01:00
Ilya Kirillov 5cffcfaf9f Analysis API FE1.0: consider rendering parameters when rendering annotations 2021-12-02 20:09:18 +01:00
Ilya Kirillov 2d032112fd Analysis API FE1.0: fix rendering of enum entry 2021-12-02 20:09:18 +01:00
Ilya Kirillov 19dec92247 Analysis API: rework declaration renderer
- refactor code to use PrettyPrinter instead of ad-hoc one
- do not print nested local declarations as this does not seem to have use-cases
2021-12-02 20:09:18 +01:00
Ilya Kirillov 908a47810b Analysis API: make KtClassifierSymbol to be a KtPossibleMemberSymbol 2021-12-02 20:09:17 +01:00
Ilya Kirillov 9cb950a2ae Analysis API: extract PrettyPrinter from DebugSymbolRenderer to utils 2021-12-02 20:09:17 +01:00
Ilya Kirillov 8cb5283a7d Analysis API: fix file symbol restore 2021-12-02 20:09:17 +01:00
Ilya Kirillov c4e5ec2ff2 Analysis API: fix unsigned constant value creation for fe1.0 2021-12-02 20:09:17 +01:00
Ilya Kirillov 7919dae558 Analysis API: improve rendering of constant values 2021-12-02 20:09:17 +01:00
Ilya Kirillov e608f8d8dc Analysis API: fix invalid constant value kind for unsigned numbers 2021-12-02 20:09:17 +01:00
Ilya Kirillov 673459580c Analysis API: introduce annotation value for KClass 2021-12-02 20:09:16 +01:00
Ilya Kirillov f722a54c78 Analysis API: separate constant values from annotation values 2021-12-02 20:09:16 +01:00
Ilya Kirillov 47c1da2845 FIR IDE: separate KtAnnotationApplication and KtAnnotationApplicationValue 2021-12-02 20:09:16 +01:00
Ilya Kirillov b1c8a9e886 Analysis API: rename KtConstantValue -> KtAnnotationValue as it is annotation specific 2021-12-02 20:09:14 +01:00
Anastasiya Shadrina 2b30c1eb5d [FE] Do not change original semantics in LabelResolver 2021-12-02 20:25:00 +03:00
Anastasiya Shadrina a70036c945 [Tests] Add a test with type parameter as a context receiver 2021-12-02 20:24:58 +03:00
Anastasiya Shadrina 752bc299f1 [FE, Tests] Passing context(A, B) where context(B, A) expected 2021-12-02 20:24:56 +03:00
Anastasiya Shadrina ac27fda965 [FE] Report ambiguity when label can refer to multiple receivers 2021-12-02 20:24:44 +03:00
Anastasiya Shadrina 7ab9b68ad5 [FE] Move type-related checks to TypeResolver 2021-12-02 20:24:41 +03:00
Anastasiya Shadrina 3a9cf042d7 [Tests] Fix FirDiagnosticTestSpecGenerated and FirIdeSpecTest 2021-12-02 20:24:33 +03:00
Anastasiya Shadrina b3591e77be [FE] Prohibit explicit @ContextFunctionTypeParams usage 2021-12-02 20:24:20 +03:00
Anastasiya Shadrina a091b345a0 [FE] Provide overloadability for candidates with different CR 2021-12-02 20:24:19 +03:00
Anastasiya Shadrina d8faa9686d [Tests] Test samples from KEEP 2021-12-02 20:24:14 +03:00
Anastasiya Shadrina e3f987459c [PSI, FE] Support functional types 2021-12-02 20:24:11 +03:00
Anastasiya Shadrina f427265739 [FE] Resolve overload conflict between contextual and non-contextual declarations 2021-12-02 20:24:03 +03:00
Anastasiya Shadrina 814777ba8c [FE] Report ambiguity in all possible cases 2021-12-02 20:23:58 +03:00
Anastasiya Shadrina 37495bcba0 [FE] Change resolution scheme 2021-12-02 20:23:57 +03:00
Anastasiya Shadrina 37a981cc29 [Tests] Add missing tests 2021-12-02 20:23:55 +03:00
Anastasiya Shadrina dcb3fc5508 [Tests] Add missing tests 2021-12-02 20:23:43 +03:00
Tianyu Geng 18f7a760bb FIR checker: report unresolved reference in imports
Compared to FE1.0, instead of using UNRESOLVED_REFERENCE, a new
UNRESOLVED_IMPORT diagnostic is introduced. This is so that we can use a
different positioning strategy to highlight the last part of the import
if the entire import is passed.

Also, this change fixed some incorrectly rejected imports in FIR. Such
cases are covered the newly added test file staticFunAndPropertyImport.kt
2021-12-01 23:45:18 +03:00
Ilya Kirillov a70c336c2c Analysis API: fix constructor return type for FE1.0 implementation 2021-11-30 18:02:33 +01:00
Tianyu Geng 6e555e1d28 FE1.0 Analysis API: fix getReturnTypeForKtDeclaration for setter parameter 2021-11-30 18:02:33 +01:00
Tianyu Geng f1d0791f15 Analysis API: add test for KtDeclaration.getReturnKtType
FE1.0 always return kotlin.Unit as return type for constructors while
FIR returns the constructed class type. I am not sure which is more
desirable. Also, I am not sure how to make FE1.0 behave the same way.
2021-11-30 18:02:33 +01:00
Dmitriy Novozhilov ce218b8a0b [FIR] Make FirExtensionRegistrar a proper extension point
After that commit it's allowed to register any FIR plugin using
  existing extension infrastructure (`-Xplugin` CLI argument,
  plugin.xml for IDE plugins, etc)
2021-11-30 12:57:50 +03:00
Denis.Zharkov 7eb758fab1 FIR: Avoid propagation of @Exact annotation through elvis 2021-11-26 19:39:52 +03:00
Denis.Zharkov 0d9ad62d4a Fix inference for lambdas with with extension function expected type
^KT-49832 Fixed
^KT-49836 Fixed
2021-11-26 19:39:51 +03:00
Denis.Zharkov c0a46eaefd FIR: Fix inference of nullable unit lambda at RHS of elvis 2021-11-26 19:39:49 +03:00
Denis.Zharkov 46217318c0 FIR: Load final static constant Java fields as non-nullable 2021-11-26 19:39:48 +03:00
Denis.Zharkov 883b18a0c6 FIR: Preserve non-custom attributes after substitution
The test is being fixed since synthetic call for elvis has @Exact-attribute on return type
2021-11-26 19:39:45 +03:00
Denis.Zharkov c0b6a593e0 FIR: Fix incorrect type of block generated for inc operator
Previously, it was obtained from expected type of a variable being assigned,
but it's better to use the type of resulting expression

Initially this part was brought in 4ab0897d7d,
but as we see in commit message and tests it was all about unit-coercion
2021-11-26 19:39:38 +03:00
Denis.Zharkov 6f55d23bab FIR: Support nested light classes 2021-11-26 19:39:31 +03:00
Dmitriy Novozhilov 4fb8ab052f Add workaround for KT-49925 2021-11-26 15:19:11 +03:00
Dmitriy Novozhilov 2b84e8e68f [FIR] Pass proper containing classes from context to type resolution for local classes 2021-11-26 11:26:24 +03:00
Dmitriy Novozhilov 330574cab6 [FIR] Properly support smartcasts on stable when subjects in when conditions
^KT-49860 Fixed
2021-11-26 11:26:21 +03:00
Dmitriy Novozhilov 8707be51c9 [FIR] Report errors about invisible types from type resolution 2021-11-26 11:26:17 +03:00