Commit Graph

106 Commits

Author SHA1 Message Date
Victor Petukhov 697ef03d57 [FIR] Make FirPlaceholderProjection having source element 2021-11-01 13:03:31 +03:00
Denis.Zharkov f441024fd4 FIR: Derive FirMemberDeclaration from FirAnnotatedDeclaration
It's necessary to have the sane logic that FirMemberDeclaration is a subtype of FirDeclaration
The only kind of controversial change here is making FirAnonymousObject
also be FirMemberDeclaration, thus having its own declaration status
2021-10-20 22:05:20 +03:00
Dmitriy Novozhilov bee44c6e0f [FIR] Split :compiler:fir:resolve module into three different modules
Those modules are:
- :compiler:fir:providers, which contains Fir and Symbol providers,
    scopes, and different utilities used by them
- :compiler:fir:semantics, which contains different abstractions and
    entities which are used in resolution and in checkers
- :compiler:fir:resolve, which contains all stuff related to resolution
    and inference

There are two pros of this change:
1. It may increase gradle build, because it allows to compile :fir:resolve
  and :fir:checkers modules in parallel
2. Logic of working FIR (scopes, providers, DFA logic system, etc) is
  now separated from logic of resolution phases, so for example checkers,
  which are depend on scopes physically will not be able to run resolve
  in any way
2021-10-18 11:10:47 +03: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
Dmitriy Novozhilov 70e8d23d6b Fix new warnings in project code 2021-09-12 16:19:33 +03:00
Denis.Zharkov dc79d8641b Change rendering for definitely non-nullable types from T!! to T & Any
^KT-26245 In Progress
2021-08-31 15:41:14 +03:00
Simon Ogorodnik a353719a6b [FIR] Add dump for fir blocks 2021-08-02 11:24:56 +03:00
Dmitriy Novozhilov f3116cb64a Fix NON_EXHAUSTIVE_WHEN_STATEMENT warnings in project code 2021-07-20 13:33:46 +03:00
Dmitriy Novozhilov f33f3c769f Fix USELESS_IS_CHECK warnings in compiler code 2021-07-13 10:35:05 +03:00
Dmitriy Novozhilov 5816d7ae9f [FIR] Rename FirStatusOwner back to FirMemberDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov f400477c70 [FIR] Remove generic parameter from FirDeclaration 2021-06-29 21:03:30 +03:00
Dmitriy Novozhilov 725be466f0 [FIR] Move declaration utils to separate package 2021-06-29 21:03:29 +03:00
Dmitriy Novozhilov 1324e9223f [FIR] Make FirDeclaration an abstract class 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov b3e5c6e079 [FIR] Add symbol to all declarations. Get rid of FirSymbolOwner 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov 39cd1c8504 [FIR] Squash AbstractFirBasedSymbol with FirBasedSymbol 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov 823cbc59b7 [FIR] Split FirAnonymousFunction to expression and declaration 2021-06-29 21:03:28 +03:00
Dmitriy Novozhilov 85b844c748 [FIR] Split FirAnonymousObject to expression and declaration 2021-06-29 21:03:27 +03:00
Dmitriy Novozhilov 5cfa8694d4 [FIR] Fix all usages of declarationSiteSession 2021-05-14 14:30:27 +03:00
Jinseong Jeon bb37728e4f FIR: use withNullability with type context whenever possible
It could simplify flexible type cases.
2021-05-05 17:35:48 +03:00
Dmitriy Novozhilov c3b1be1a39 [FIR] Rename FirDeclaration.session to declarationSiteSession 2021-04-22 14:32:02 +03:00
Tianyu Geng 454ae3b17a FIR checker: report UNSAFE_CALL for overloaded function calls
Previously if an unsafe call is to an overloaded function, FIR checkers
report NONE_APPLICABLE. This change instead report them as UNSAFE_CALL
or its variants.
2021-04-19 15:11:13 +03:00
Abduqodiri Qurbonzoda 40d1849f33 Migrate compiler, idea and others to new case conversion api 2021-04-08 03:22:02 +03:00
Nikolay Krasko b903f87704 Drop kotin/kotlinx and kotlin/kotlinx.html bintray usages (KTI-528) 2021-03-26 21:08:45 +03:00
Jinseong Jeon 5e150d62ea FIR checker: differentiate UNSAFE_IMPLICIT_INVOKE_CALL from UNSAFE_CALL 2021-02-10 17:38:44 +03:00
Stanislav Erokhin d24331955e Rename FirConstKind to ConstantValueKind and move it to compiler.common 2021-01-14 12:12:25 +01:00
Alexander Udalov 221f44da5f Fix warnings in stdlib/compiler/plugins/test code 2021-01-13 19:18:20 +01:00
Alexander Udalov b3e79d36df Fix compiler warnings and some inspections 2020-11-03 14:00:53 +01:00
Dmitriy Novozhilov a05d6da43b Move descriptor-independent Visibilities to common modules 2020-09-04 11:42:50 +03:00
Dmitriy Novozhilov 94d58c714a [FIR] Cleanup dependencies for fir modules 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov 59b2cb6393 [NI] Split KotlinCallDiagnostics and inference errors to different hierarchies 2020-08-28 10:59:50 +03:00
Dmitriy Novozhilov 18ae593700 [FIR] Rename new visibilities to CamelCase
It's more convenient since they are objects now instead of
  const fields in FE 1.0
2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov 43821b681c [FIR] Introduce new Visibility class which not depends on descriptors 2020-08-25 10:31:35 +03:00
Mikhail Glukhikh 0804c6a0f3 [FIR] Introduce TYPE_ARGUMENTS_NOT_ALLOWED & some other type errors
This commit introduces several different things, in particular:
- check type arguments in expressions
- new TypeArgumentList node to deal with diagnostic source
- ConeDiagnostic was moved to fir:cones
- ConeIntermediateDiagnostic to use in inference (?) without reporting
- detailed diagnostics on error type
2020-08-02 18:19:44 +03:00
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00
Ivan Kylchik 8b9fb6a6cd [FIR] Remove FirOperatorCall node from fir tree 2020-07-21 13:54:19 +03:00
Ivan Kylchik d77d733244 [FIR] Complement fir rendering with newly created nodes 2020-07-21 13:54:17 +03:00
Dmitriy Novozhilov 59bedaaa55 [FIR] Rename FirElvisCall to FirElvisExpression
FirElvisCall is not a FirCall, so FirElvisExpression is more
  convenient name
2020-07-03 17:09:29 +03:00
Dmitriy Novozhilov 102c9c08d0 [FIR] Resolve elvis call as special synthetic call
Before that commit we desugared `a ?: b` as

when (val elvis = a) {
    null -> b
    else -> elvis
}

It was incorrect, because `a` should be resolved in dependent mode,
  but when it was `elvis` initializer it was resolved in independent
  mode, so we can't infer type for `a` in some complex cases
2020-07-02 15:10:51 +03:00
Denis Zharkov 7a22827af4 FIR: Unify all references to FIR nodes from non-parents 2020-06-03 10:43:37 +03:00
Denis Zharkov 291afd8448 FIR: Remove FirQualifiedAcces.safe in non-generated code
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov 755b846877 FIR: Support safe-calls in renderers
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Dmitriy Novozhilov 60fd505a9c [FIR] Get rid of FirSealedClass node
Now list of inheritors is hold in attributes of `FirRegularClass`
2020-05-29 10:22:00 +03:00
simon.ogorodnik 49d361b6eb [FIR] Improve type-parameter rendering in html dump 2020-04-13 20:26:15 +03:00
simon.ogorodnik cb00a4c136 [FIR] Update type parameter use-sites to use type parameter refs 2020-04-13 20:26:15 +03:00
simon.ogorodnik d2fd377605 [FIR] Add rendering of delegating constructor calls to html dump 2020-04-08 14:56:16 +03:00
simon.ogorodnik 42a48ef312 [FIR] Improve constraint errors rendering in html dump 2020-04-07 16:24:59 +03:00
simon.ogorodnik 2c8a9bf437 [FIR] Fix nullability rendering for class like types in html dump 2020-04-07 16:24:59 +03:00
simon.ogorodnik 7d3b2558f0 [FIR] Improve rendering for unsigned literals in html dump 2020-04-07 16:24:58 +03:00
Dmitriy Novozhilov 1a3fef5fa1 [FIR] Switch names of FirDiagnostic and ConeDiagnostic 2020-03-25 11:35:43 +03:00
simon.ogorodnik 27136ef8be [FIR] Support unsigned integer literals 2020-03-24 18:58:18 +03:00