Commit Graph

227 Commits

Author SHA1 Message Date
Dmitriy Novozhilov ed867af01d [AA LC] Expand aliases of type arguments during conversion to KtType
^KT-55781
2023-01-12 17:45:09 +00:00
Dmitriy Novozhilov bd26c29229 [FIR] Resolve arguments of error types during type resolution 2023-01-12 17:45:06 +00:00
Dmitriy Novozhilov c44993e586 [FE] Use FQN instead of KClass in TypeRegistry
TypeRegistry is the static map which contains mapping between type of
  session component and its index in the session array. Originally
  `KClass` of a component was used as a key in this map, which worked
  pretty well for compiler components. But there was a problem with
  components from plugins and Kotlin daemon: in compilation with daemon
  we keep TypeRegistry between compilations. But for each compilation
  we load plugins from jar, which brings to the situation when after N
  compilations there is N entries in TypeRegistry map with different
  KClass'es for same extension component. This not only causes AIOBE
  but also introduces the memory leak, because we keep reference to
  KClass which is not used anymore

So to fix this issue it's enough to just store FQN of component in
  TypeRegistry instead of KClass

There are no tests in this commit, but they will be added in next
  commit relevant to scripting. With those commits we will have gradle
  integration tests which uses Kotlin compiler daemon and registers
  a compiler plugin for scripting

^KT-55023 Fixed
2022-12-21 10:33:03 +00:00
pyos 02fedeb9ed FIR DFA: revalidate reassigned variables after loops
If a certain type statement is true on loop entry and all continue
paths, then it is also true on exit if the condition did not reassign
the variable.

^KT-7676 tag fixed-in-k2
2022-12-08 10:19:27 +00:00
Denis.Zharkov 5cc31114cd FIR: Support special scope for raw types
^KT-46369 Fixed
^KT-41794 Fixed
^KT-49351 Fixed
2022-10-31 14:28:50 +00:00
Dmitriy Novozhilov be3f8e7eb0 [FIR] Remove redundant opt-ins to ExperimentalStdlibApi in FIR modules 2022-10-19 11:09:33 +00:00
Mikhail Glukhikh e36091b926 K2: introduce even more readable renderer for types in messages
#KT-53343 Fixed
2022-09-13 09:05:48 +00:00
Dmitriy Novozhilov 671083c701 [Serialization] Implement serialization checker for K2 version of plugin
^KT-53178 Fixed
2022-09-07 07:57:38 +00:00
Mikhail Glukhikh 42b3adf33a Extract separate ConeIdRenderer and get rid of FirRenderer.RenderMode 2022-07-14 09:38:42 +00:00
Mikhail Glukhikh 7c27e6f843 FirRenderer: partially get rid of RenderMode 2022-07-14 09:38:37 +00:00
Mikhail Glukhikh a82baf87cb FIR renderer: extract separate ConeTypeRenderer 2022-07-14 09:38:33 +00:00
Mikhail Glukhikh 38f4a35be2 FIR: introduce flexible types pretty rendering for no arguments case
#KT-52020 Fixed
2022-06-29 16:50:05 +00:00
Mikhail Glukhikh 31ec10142b FirRenderer: add renderAllModifiers and renderDetailedTypeReferences
Related to KT-52020
2022-06-29 16:50:04 +00:00
Mikhail Glukhikh b2a9ad079d Fix unreachable branch in ConeKotlinType.render() 2022-06-29 16:50:03 +00:00
Jinseong Jeon b6371a5b9a AA/FIR: differentiate dynamic type rendering 2022-06-22 20:14:39 +02:00
Ivan Kochurkin 1a398e89ec [FIR] Add attributes to ConeErrorType for correct annotations resolving 2022-06-17 23:26:19 +00:00
Nikolay Lunyak be9e97d044 [FIR] Introduce ConeDynamicType 2022-06-02 13:47:23 +00:00
Denis.Zharkov 3967699430 FIR: Fix applying SAM conversion in case of DNN types
See org.jetbrains.kotlin.test.runners.codegen.FirBlackBoxCodegenTestGenerated.Sam.testPassSubtypeOfFunctionSamConversion

^KT-52152 Related
2022-05-19 16:54:03 +00:00
Denis.Zharkov 550d24f8c6 FIR: Introduce ContextFunctionTypeParams type attribute 2022-04-06 16:05:26 +00:00
Denis.Zharkov f3e28c3767 FIR: Prepare ConeAttribute infrastructure for non-singleton attrs 2022-04-06 16:05:25 +00:00
Dmitriy Novozhilov 52b72a7dac [FIR] Implement Int -> Long conversions for literals and operators over them
^KT-38895
^KT-50996 Fixed
^KT-51000 Fixed
^KT-51003 Fixed
^KT-51018 Fixed
2022-02-07 13:36:36 +03:00
Dmitriy Novozhilov b980f5ab32 [FIR] Introduce new kind of integer literal types for constant operator calls 2022-02-07 13:36:35 +03:00
Dmitriy Novozhilov 10c38ba47c [FIR] Reorganize cone type utilities
Make some overrides of members of Cone types final
2022-02-07 13:36:34 +03:00
Dmitriy Novozhilov 0bd3e8f418 [FIR] Rename ConeClassErrorType to ConeErrorType, drop ConeKotlinErrorType alias 2022-02-07 13:36:33 +03:00
Dmitriy Novozhilov 9c6292db6f [FIR] Split cone types declarations into multiple files 2022-02-07 13:36:33 +03:00
Mikhail Glukhikh 27d4c745cb ConeSimpleKotlinType: introduce & use unwrapDefinitelyNotNull 2022-02-03 19:12:17 +03:00
Mikhail Glukhikh 81ff9b820a FIR: make ConeSimpleKotlinType the only original for definitely not-null 2022-02-03 19:12:16 +03:00
Irene Dea 3c4989b672 Address JDK8/JDK6 issues with computeIfAbsent 2022-01-08 15:26:44 +03:00
Irene Dea 62bde2d686 Move AttributeArray to compiler.common so frontend extension can share it 2022-01-08 15:25:06 +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 9e8727e6a8 FIR Minor: Reformat 2021-12-15 22:23:14 +03:00
Simon Ogorodnik bb13583862 FIR: Rename stub type for builder inference 2021-12-15 22:23:13 +03:00
Simon Ogorodnik df9da371cb FIR: Fix synthetic type variables to independent stub types 2021-12-15 22:23:11 +03:00
Simon Ogorodnik 3fadf1cb46 FIR: Avoid creating new stub type constructors on nullability replacing 2021-12-15 22:22:59 +03:00
Simon Ogorodnik 196be93d42 FIR: Add separate type constructor to stub types 2021-12-15 22:22:54 +03:00
Mikhail Glukhikh 2ba2453062 ConeFlexibleType: statically require to have simple bounds 2021-12-06 18:07:19 +03:00
Denis.Zharkov e26abbbbb0 FIR: Implement ConeTypeVariableType::equals/hashCode manually
`typeAttributes` are not considered as a part of equality for other type kinds
2021-11-26 19:39:44 +03:00
Dmitriy Novozhilov 8cdddbfd9d [FIR] Implement checkers for FIR parcelize plugin
There is one of checks left unimplemented (FirParcelizePropertyChecker.checkParcelableClassProperty)
  because it requires huge commonization of detecting which type can be
  serialized and which not, which is not prioritized job for now
2021-11-23 15:01:31 +03:00
Ivan Kochurkin 291bc74676 [FIR] Add CANNOT_CHECK_FOR_ERASED 2021-11-12 15:20:43 +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
Mark Punzalan 4f0b52b653 FIR: Transform annotations on type arguments during body resolve. 2021-10-12 18:56:32 +03:00
Dmitriy Novozhilov 38877ba842 [FIR] Implement extension for providing additional type attributes 2021-10-12 17:26:32 +03:00
Dmitriy Novozhilov 26fa772846 [FIR] Add ability to generate members and nested classifiers for existing classes 2021-10-12 17:26:30 +03:00
Ilya Kirillov cdde765ad9 FIR: precise lookupTag parameter of ConeTypeVariableType as it always accepts ConeTypeVariableTypeConstructor 2021-09-30 01:45:55 +03: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 951812f130 FIR checker: record whether type mismatch is due to nullability
This is useful for downstream quickfixes.
2021-09-17 01:59:01 +03:00
Dmitriy Novozhilov 37b427c656 [FIR] Combine type attributes in typealias expansion
^KT-48651 Fixed
2021-09-15 17:11:31 +03:00
Dmitriy Novozhilov 5c2a3bb78e [FIR] Move duplicating names and classIds to StandardClassIds 2021-09-15 17:11:29 +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
Mark Punzalan 16eabf0ff1 FIR: Add ConeDiagnosticWithCandidates and
ConeDiagnosticWithSingleCandidate to ConeDiagnostic type hierarchy.
2021-08-31 14:59:06 +03:00