Commit Graph

285 Commits

Author SHA1 Message Date
Victor Petukhov 867ad24c86 [FE] Show causing types in the INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION diagnostic 2022-05-27 15:14:24 +00:00
Victor Petukhov 6a34b184ac [FE] Introduce warnings on possible empty intersection types, and improve errors reporting in general
^KT-52361 Fixed
2022-05-27 15:14:23 +00:00
Victor Petukhov c16ae81a48 [FIR] Report errors for upper bounded type variables by an empty intersection type
^KT-51221 Fixed
2022-04-27 19:50:21 +00:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Denis.Zharkov 41bc842b9d FIR: Support context receivers in Fir2Ir 2022-04-06 16:05:39 +00:00
Denis.Zharkov 512446843b FIR: Support typeRef-name label for this 2022-04-06 16:05:37 +00:00
Denis.Zharkov ef84dddc88 FIR: Add preliminary support for context receivers in resolution 2022-04-06 16:05:32 +00:00
Ivan Kochurkin c7122c1492 [FIR] Fix break/continue in try-finally in loop, ^KT-51759 2022-04-05 15:50:47 +00:00
Dmitriy Novozhilov effa3f197a [FIR] Move ReturnTypeCalculator to :fir:providers module
Also make it an abstract class and turn ReturnTypeCalculatorForFullBodyResolve
  into object (because it has no state and there is no need to create
  different instances of it)
2022-04-04 15:23:56 +00:00
Mikhail Glukhikh b327f5c731 Substitute type variables properly in ConeOverloadConflictResolver
#KT-46187 Fixed
2022-03-23 09:54:46 +00:00
Mikhail Glukhikh c8453ec8b4 FIR: report ambiguity-like errors in type resolve 2022-03-10 20:42:42 +00:00
Mikhail Glukhikh 981f8b1871 FIR: implement resolve of unqualified enum references in when
See KT-16768
2022-02-22 22:13:06 +03:00
Dmitriy Novozhilov 851305f981 [FIR] Allow smartcasts on member properties for classes from dependsOn dependencies 2022-02-18 17:44:37 +03:00
Dmitriy Novozhilov 0bd3e8f418 [FIR] Rename ConeClassErrorType to ConeErrorType, drop ConeKotlinErrorType alias 2022-02-07 13:36:33 +03:00
Denis.Zharkov 6f89f1ebf4 FIR: Allow selector of safe calls to be a FirStatement
It's necessary to allow a?.b += v be interpreted as a?.(b += v)
But currently FirAssignmentOperatorStatement is not FirQualifiedAccess

^KT-41034 In Progress
2022-02-01 13:12:45 +03:00
Ivan Kochurkin ee7e04b28e [FIR] Ignore smartcast for non-final members from Java, ^KT-50219 Fixed 2021-12-21 19:10:40 +03:00
Ivan Kochurkin 9e55e41d8b [FIR] Propagate non-null info for val members, ^KT-44560 Fixed 2021-12-21 19:10:38 +03:00
Ivan Kochurkin c5a03d0573 [FIR] Remove dependent data flow variables after receiver reassignment 2021-12-21 19:10:37 +03:00
Ivan Kochurkin 1f9ea50d1a [FIR] Rearrange arguments in VariableStorageImpl functions to make them consistent 2021-12-21 19:10:36 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Simon Ogorodnik b45b624945 FIR: Fix integrating DeclaredUpperBound positions in builder inference 2021-12-15 22:23:01 +03:00
Mikhail Glukhikh 4d9e919f7e FIR: preliminary refactoring of delegate resolve 2021-12-15 22:22:51 +03:00
Tianyu Geng 58067e0a1e FIR checker: carry original candidate in ConeDiagnosticWithCandidates
This is needed by IDE when resolving calls because candidates carry more
information than just the targeting symbol.
2021-12-06 12:40:42 +01:00
Dmitriy Novozhilov 1f0b62b25f [FIR] Add smartcasts from == if equals is from Any
^KT-49127 Fixed
2021-12-03 14:19:25 +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
pyos a1be855d17 FIR: thread control flow through anonymous object init blocks
^KT-39646 Fixed
2021-11-26 14:21:29 +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
Ivan Kochurkin aff885bcd1 [FIR] Prevent potential exponent complexity in isValidTypeParameterFromOuterDeclaration 2021-11-24 23:13:39 +03:00
Dmitriy Novozhilov 75b6f7ca00 [FIR] Make FirRegularClass.companionObject companionObjectSymbol field
This is needed for two reasons:
1. Before this change companion object appeared in FirRegularClass
  twice: in declarations list and in companionObject field. This may
  trigger twice transform of it
2. It's very hard to implement generation of companion object by plugins
  because if it is part of the tree then generated declaration must be
  registered in FirProvider, which is inconsistent with other generated
  declarations. Replacing FIR with symbol and removing custom logic of
  visiting/transforming companion FIR allows us to just replace companionSymbol
  in FirClass if plugin wants to generate it without any additional work
2021-11-23 15:01:05 +03:00
Ivan Kochurkin e52a410599 [FIR] Initialize outer type parameters for local classes 2021-11-12 15:20:42 +03:00
Ivan Kochurkin 38820d3e41 [FIR] Implement WRONG_NUMBER_OF_TYPE_ARGUMENTS for top level type aliases 2021-11-12 15:20:42 +03:00
Ilya Chernikov a65beb2dc5 Move Fir*SourceElement to frontend.common, rename to Kt* (complete) 2021-10-27 21:44:11 +02:00
Mikhail Glukhikh 79b98f9173 FIR: introduce synthetic property symbol hierarchy 2021-10-23 01:19:07 +03:00
Mikhail Glukhikh 7fc19520a5 FIR: substitute super type during tower building properly #KT-49301 Fixed 2021-10-20 12:17:04 +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