Commit Graph

291 Commits

Author SHA1 Message Date
Dmitriy Novozhilov e431a96897 [FIR2IR] Properly calculate overridden functions for lazy fake overrides
For detailed explanation see the comment to `computeBaseSymbolsWithContainingClass`
  function in `FakeOverrideGenerator.kt`

^KT-65592
2024-02-22 15:56:57 +00:00
Mikhail Glukhikh 9b2fc061e5 K2: drop unused ConeStubTypeForSyntheticFixation 2024-02-09 11:38:34 +00:00
Artem Kobzar 8d1a90c23c [K/JS] Support essential Kotlin collections (List, MutableList, Set, MutableSet, Map, MutableMap) for exporting into JS
^KT-34995 Fixed
^KT-44871 Fixed
2024-01-24 11:14:46 +00:00
Dmitriy Novozhilov c4e4776c5e [FIR] Part 2. Setup running platform checkers in tests
^KT-58881
2024-01-24 10:45:00 +02:00
Kirill Rakhman cf494ada0b [FIR] Flatten ConeAttributeWithConeType when transforming
This is necessary to prevent exponential growth of the attribute
structure.
Since we usually care for the most inner value of a
ConeAttributeWithConeType like EnhancedTypeForWarningAttribute, this
shouldn't alter any behavior.
2024-01-18 08:27:10 +00:00
Kirill Rakhman c39262195d [FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality
This is required for EnhancedTypeForWarningAttribute because scopes
should not be reused between cone types with different values of
this attribute.

#KT-63208

(cherry picked from commit 9189154cae)
2024-01-18 08:27:10 +00:00
Kirill Rakhman 8c04206709 Revert "[FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality"
This reverts commit 9189154cae.
2024-01-16 09:14:22 +01:00
Kirill Rakhman 9189154cae [FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality
This is required for EnhancedTypeForWarningAttribute because scopes
should not be reused between cone types with different values of
this attribute.

#KT-63208
2024-01-15 12:23:26 +00:00
Alejandro Serrano Mena b077293396 [FIR] Allow, but also warn, KMutableProperty with captured types
^KT-63589 Fixed
2024-01-12 10:07:14 +00:00
Denis.Zharkov 276f5b26d8 K2: Implement partially constrained lambda analysis (PCLA)
It's expected to partially mimic the behavior of what
previously was called builder inference, but with more clear contracts
(documentation is in progress, though)

See a lot of fixed issues in the later commits with test data,
especially [red-to-green]

^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Kirill Rakhman d5ed922208 [FIR] Make rendering of cone type attributes in diagnostic messages opt-in per attribute
#KT-63228 Fixed
2024-01-02 15:17:01 +00:00
Kirill Rakhman 2c74a2356a [FIR] Fix IOOBE in ConeTypeRenderer for bad extension function types 2023-12-13 16:46:24 +00:00
Mikhail Glukhikh 37789cf7f5 K2: introduce unwrapFlexibleAndDefinitelyNotNull 2023-12-12 13:52:29 +00:00
Mikhail Glukhikh 06ce57ea56 K2: report MISSING_DEPENDENCY_CLASS for lambda parameters if needed
#KT-62525 Fixed
2023-12-05 18:16:52 +00:00
Anastasia.Nekrasova 85cff98a38 [K2] Disappeared UNSUPPORTED
Prohibit Array<Nothing>

^KT-59881
2023-12-01 12:05:12 +00:00
Ivan Kochurkin 0935e2b270 [FIR] Make originalIfDefinitelyNotNullable more universal
It takes `ConeSimpleKotlinType` but not `ConeKotlinType` as input parameter
2023-11-16 19:29:58 +00:00
Kirill Rakhman 7910e8ad24 [FIR] Implement a special type of attribute that contains a cone type that can be transformed 2023-11-15 08:43:55 +00:00
Kirill Rakhman 8ebd2fd1b7 [FIR] Implement add in AbbreviatedTypeAttribute 2023-11-15 08:43:55 +00:00
Kirill Rakhman ad4d021cbf [FIR] Reformat AbbreviatedTypeAttribute 2023-11-15 08:43:55 +00:00
Mikhail Glukhikh 53ab32e0fb Rename: ConeTypeVariableType.lookupTag -> typeConstructor 2023-11-13 15:10:48 +00:00
Mikhail Glukhikh 1ceec4d6d7 K2: make type variable based types not class like
#KT-57921 Fixed
#KT-62420 Fixed
2023-11-13 15:10:48 +00:00
Brian Norman e9983a947f [FIR] Add checker for EXPANSIVE_INHERITANCE
^KT-59402 Fixed
2023-11-01 13:53:57 +00:00
Mikhail Glukhikh cebb6747e3 K2: drop unnecessary attributes when inferring declaration types
Related to KT-62578
2023-10-20 12:38:19 +00:00
Mikhail Glukhikh 90eaf5f70f K2: introduce val ConeAttribute.keepInInferredDeclarationType 2023-10-20 12:38:19 +00:00
Simon Ogorodnik 13b6653899 [FIR] Add todo to remove violation of lookup tag contract 2023-10-12 12:27:54 +00:00
Simon Ogorodnik 024e94a479 [K2] Document KMP implementation in the K2 Compiler
Add comprehensive documentation explaining the implementation and
functions of the Kotlin multiplatform (KMP) support in the K2 Compiler.
2023-10-12 12:27:54 +00:00
Ilya Kirillov 80f86a3527 [FIR] Render flexible types as A..B instead of cryptic ft<A, B>` in diagnostic messages
^KT-62032 fixed
2023-09-22 10:48:31 +00:00
Ilya Kirillov 252c59a8a3 [FIR] Render k2-specific flexible types in a more compact way in diagnostic messages
^KT-62031 fixed
2023-09-22 10:48:31 +00:00
Ilya Kirillov d98da87278 [FIR] Render dot-separated FQNs instead of slash-separated ones in diagnostics
^KT-62030 fixed
2023-09-22 10:48:31 +00:00
Kirill Rakhman 4e1dfcd2a8 [FIR] Improve readability of rendered types in diagnostics
#KT-61824 Fixed
#KT-61688 Fixed
2023-09-21 07:18:19 +00:00
Kirill Rakhman 99b852adf8 [FIR] Refactor constructors of ConeTypeRenders 2023-09-21 07:18:19 +00:00
Kirill Rakhman da0308806a [FIR] Rename ConeTypeRendererWithJavaFlexibleTypes to ConeTypeRendererForReadability 2023-09-21 07:18:19 +00:00
Kirill Rakhman 5b4409e34c [FIR] Store abbreviated type in deserialized declarations as attribute
#KT-58542 Fixed
2023-09-20 09:31:29 +00:00
Dmitriy Novozhilov 3f2e996803 [FIR2IR] Load builtin classes instead of creating them on the fly
This change uncovered KT-61282, which was hidden because of incorrect
  module fragments used as parent for builtin classes
2023-08-22 18:36:20 +00:00
Ilya Kirillov e763e71515 [FIR] optimize ConeTypeProjection[] RAM usage for empty arrays
On the snapshot from ^KTIJ-26260 empty ConeTypeProjection arrays take about 10mb
2023-08-18 11:36:42 +00:00
Ilya Kirillov bdfc68468f [FIR] optimize direct allocation of empty ConeTypeProjection arrays
On the snapshot from KTIJ-26260 empty ConeTypeProjection arrays take about 10mb
2023-08-18 11:36:42 +00:00
Ivan Kochurkin f4e4c5e724 [FIR] Fix missing type mismatch with array literals
Clarify existing type mismatch errors on array literals

^KT-60474 Fixed

Remove ResolutionMode.TransformingArrayLiterals
2023-07-27 17:53:44 +00:00
Kirill Rakhman ff6b3350ae [FIR] Resolve array literal with non-primitive-array expected type as arrayOf call
This lets us properly complete the call which fixes some issues with
false-positive type mismatches.
This change doesn't apply to array literals in annotation calls yet
because they are resolved as context-dependent.
This will be adapted in a following commit.

#KT-59581
2023-07-19 13:34:58 +00:00
Dmitrii Gridin 4366164b65 [FIR] ConeAttributes: fix plus method
The 'plus' method was actually creating a new 'ConeAttributes' with
only one new attribute due to a typo inside 'buildList'

^KT-60451
^KT-60504
2023-07-19 10:40:03 +00:00
Mikhail Glukhikh 00b4ae6ae9 K2: expand type before isSomeType checks properly
Related to KT-60229
2023-07-14 16:38:47 +00:00
Mikhail Glukhikh c839cd3c11 K2: don't use debugging type renderer in error messages 2023-07-13 09:07:39 +00:00
Denis.Zharkov e98890cece K2: Remove a bunch of unused declarations 2023-07-11 13:12:22 +00:00
Dmitrii Gridin f74d4494aa [LL FIR] fix designation path for synthetic declarations
A designation path for synthetic declarations like fake override
or member delegate contained the wrong FirFile, because it
was provided by the original declaration that is wrong.
So we should pick up the file from our path, because it shouldn't be
synthetic

^KT-59505 Fixed
2023-06-22 10:22:37 +00:00
Pavel Mikhailovskii 16644c1a3b FIR Preserve nullability of ConeErrorType when possible 2023-06-16 08:09:04 +00:00
Dmitriy Novozhilov 8b7cfcda10 [FIR] Add toString() methods to some ConeSubstitutor implementation
This is needed only for pleasant debugging
2023-06-09 22:51:31 +00:00
Kirill Rakhman a4c9a4f150 [FIR] Use optimized stdlib version of reversed list 2023-05-30 09:22:50 +00:00
Mads Ager a5157aa239 [FIR] Render attributes on function types.
Only render if there are non-compiler attributes to reduce
noise from extension function types.
2023-05-12 10:49:43 +00:00
Kirill Rakhman 0c3d5c11b1 [FIR] Render integer literal types as Int in diagnostic messages
#KT-55662 Fixed
2023-05-02 15:10:55 +00:00
Dmitrii Gridin 6b3e49e824 [AA FIR] correctly restore declaration with annotation with argument inside some type from symbol pointer
ConeAttributes can have some non-stable info, so we shouldn't render it

Also reduce resolve from IMPLICIT_TYPES_BODY_RESOLVE to TYPES where it is possible

^KT-58141 Fixed
2023-04-21 17:21:36 +00:00
Kirill Rakhman f08da86cfd [FIR] Improve comment for ConeIntersectionType 2023-04-20 08:12:49 +00:00