mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
lib.types: Make functor.wrapped deprecation work in unprocessed types
Otherwise nested types such as `attrsOf (attrsOf int)` won't have a backwards compatible `type.nestedTypes.elemType.functor.wrapped`. Follow-up work to https://github.com/NixOS/nixpkgs/pull/366015
This commit is contained in:
parent
7bbacbb11b
commit
64a1c1da3e
1 changed files with 11 additions and 2 deletions
|
@ -86,7 +86,7 @@ let
|
|||
else
|
||||
{ elemType = merged; };
|
||||
wrappedDeprecationMessage = { loc }: lib.warn ''
|
||||
The deprecated `type.functor.wrapped` attribute of the option `${showOption loc}` is accessed, use `type.nestedTypes.elemType` instead.
|
||||
The deprecated `${lib.optionalString (loc != null) "type."}functor.wrapped` attribute ${lib.optionalString (loc != null) "of the option `${showOption loc}` "}is accessed, use `${lib.optionalString (loc != null) "type."}nestedTypes.elemType` instead.
|
||||
'' payload.elemType;
|
||||
};
|
||||
|
||||
|
@ -227,7 +227,16 @@ rec {
|
|||
{ _type = "option-type";
|
||||
inherit
|
||||
name check merge emptyValue getSubOptions getSubModules substSubModules
|
||||
typeMerge functor deprecationMessage nestedTypes descriptionClass;
|
||||
typeMerge deprecationMessage nestedTypes descriptionClass;
|
||||
functor =
|
||||
if functor ? wrappedDeprecationMessage then
|
||||
functor // {
|
||||
wrapped = functor.wrappedDeprecationMessage {
|
||||
loc = null;
|
||||
};
|
||||
}
|
||||
else
|
||||
functor;
|
||||
description = if description == null then name else description;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue