From 55ee7ab4a6b5281cf1c352bc714b07c59c4546ee Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 10 Mar 2022 20:25:49 +0100 Subject: [PATCH] lib.types.optionType: Only merge when necessary --- lib/tests/modules.sh | 3 +++ .../adhoc-freeformType-survives-type-merge.nix | 14 ++++++++++++++ lib/types.nix | 4 +++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 lib/tests/modules/adhoc-freeformType-survives-type-merge.nix diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index e4bb7ad21900..350fe85e7487 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -311,6 +311,9 @@ checkConfigOutput '^"hello"$' config.theOption.str ./optionTypeMerging.nix # Test that types.optionType correctly annotates option locations checkConfigError 'The option .theOption.nested. in .other.nix. is already declared in .optionTypeFile.nix.' config.theOption.nested ./optionTypeFile.nix +# Test that types.optionType leaves types untouched as long as they don't need to be merged +checkConfigOutput 'ok' config.freeformItems.foo.bar ./adhoc-freeformType-survives-type-merge.nix + cat <