Commit Graph

18 Commits

Author SHA1 Message Date
Nikolay Lunyak afd8895e51 [FIR] Introduce the PluginGenerated source kind
Make parcelize work consistently with
`FirOverrideChecker`.

Actually, there is a philosophical question about
what to do when a plugin generates a class
in a new package, and this class is red code
(for instance, doesn't implement an abstract
member from a supertype). There's no source
to report such an error, but we probably do
want to run checkers to avoid trying to
compile red code to binaries (because it may
crash in backend, or it may silently work).
2024-02-15 16:10:13 +00:00
Brian Norman 20340f94d4 [Parcelize] WriteWith Parceler type argument must be subtype of property
K2 checks that the entire Parceler of the WriteWith annotation is a
subtype of the expected Parceler for the property, while K1 only checks
that the type argument of the WriteWith Parceler is a subtype of the
property type. This mismatch leads to inconsistencies between K1 and K2
diagnostic reporting. Switch K2 to K1 behavior so diagnostics are
consistent.

^KT-60019 Fixed
2024-01-16 13:58:48 +00:00
Brian Norman 9ec469e3c3 [Parcel] Expand types from TypeParceler annotation to support aliases
Class properties are being expanded before checking for custom
parcelers, which makes custom parcelers of type alias unable to be
found. To maintain K1 behavior, the custom parceler type must also be
expanded, so even the aliased type is supported when used in its raw
form as a class property.

^KT-64707 Fixed
2024-01-04 19:59:56 +00:00
Brian Norman 645970fa7a [Parcelize] Fix subclass check of deprecated Parceler interface
^KT-59949 Fixed
^KT-60090 Fixed
2023-12-14 16:36:07 +00:00
Brian Norman 0d36462c58 [Parcelize] Align checker and generator on valid Parcelize classes
A previous fix to the generator made the generator and checker
validation of classes which could be parcelized different. The checker
would report error in cases where the generator would not generate
anything. Align these checks, with improved code sharing, so errors are
not reported on classes which will not have parcelize components
generated.

^KT-63086 Fixed
2023-11-08 14:35:28 +00:00
Brian Norman f8ee8adfde [Parcelize] Fully expand type aliases when checking for RawValue
^KT-61432 Fixed
2023-11-08 12:48:36 +00:00
Kirill Rakhman 5b9c35de2e [Tests] Update test data with error suppression warnings
#KT-61129 Fixed
2023-08-18 13:29:20 +00:00
Brian Norman b595328192 [Parcelize] Ignore all sealed classes in Parcelize FIR generator
Sealed classes are inherently abstract and should not have Parcelable
functions added via the FIR declaration generator.

#KT-59112 Fixed
2023-06-08 12:58:32 +00:00
Kirill Rakhman 9dda5e4fcd [Test] Remove redundant FIR_DISABLE_LAZY_RESOLVE_CHECKS directives
KT-56177
2023-02-28 10:19:18 +00:00
Dmitriy Novozhilov 36bb418049 [Parcelize] Add test for KT-47074 2023-01-31 07:53:08 +00:00
Dmitriy Novozhilov 4f3add8f7a [FIR] Fix resolution of plugin annotations if only meta annotations are registered 2023-01-04 11:02:01 +00:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Steven Schäfer 58e51919bd Parcelize: Add missing FIR diagnostics 2022-07-26 09:34:10 +00:00
Ivan Kochurkin 8c7fad9a5e [FIR] Support of type arguments in annotations ^KT-48444 Fixed 2022-04-18 15:36:19 +00:00
Steven Schäfer 58c687e42d Parcelize: Support @IgnoreOnParcel primary constructor parameters...
...with default values.

See https://issuetracker.google.com/177850560
2021-12-08 11:07:10 +01: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
Dmitriy Novozhilov 40d8451698 Add compiler diagnostic tests for parcelize checkers 2021-11-23 15:01:26 +03:00
Dmitriy Novozhilov b84ee64994 Move parcelize checkers testdata to :parcelize-compiler module 2021-11-23 15:01:23 +03:00