lib/modules: Fix type checks not being done before merging
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
This commit is contained in:
@@ -416,10 +416,9 @@ rec {
|
||||
# Type-check the remaining definitions, and merge them. Or throw if no definitions.
|
||||
mergedValue =
|
||||
if isDefined then
|
||||
foldl' (res: def:
|
||||
if type.check def.value then res
|
||||
else throw "The option value `${showOption loc}' in `${def.file}' is not of type `${type.description}'."
|
||||
) (type.merge loc defsFinal) defsFinal
|
||||
if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
|
||||
else let firstInvalid = findFirst (def: ! type.check def.value) null defsFinal;
|
||||
in throw "The option value `${showOption loc}' in `${firstInvalid.file}' is not of type `${type.description}'."
|
||||
else
|
||||
# (nixos-option detects this specific error message and gives it special
|
||||
# handling. If changed here, please change it there too.)
|
||||
|
||||
Reference in New Issue
Block a user