diff --git a/confutils.nim b/confutils.nim index 19f5d5a..adca701 100644 --- a/confutils.nim +++ b/confutils.nim @@ -893,7 +893,7 @@ proc loadImpl[C, SecondarySources]( quitOnFailure = true, secondarySourcesRef: ref SecondarySources, secondarySources: proc (config: Configuration, - sources: ref SecondarySources) = nil, + sources: ref SecondarySources) {.gcsafe.} = nil, envVarsPrefix = getAppFilename()): Configuration = ## Loads a program configuration by parsing command-line arguments ## and a standard set of config files that can specify: diff --git a/tests/test_config_file.nim b/tests/test_config_file.nim index c42575c..4422791 100644 --- a/tests/test_config_file.nim +++ b/tests/test_config_file.nim @@ -182,7 +182,11 @@ proc testConfigFile() = putEnv("PREFIX_DATA_DIR", "ENV VAR DATADIR") test "basic config file": - let conf = TestConf.load(envVarsPrefix="prefix", secondarySources = proc (config: TestConf, sources: auto) = + let conf = TestConf.load( + envVarsPrefix="prefix", + secondarySources = proc ( + config: TestConf, sources: ref SecondarySources + ) {.raises: [ConfigurationError].} = if config.configFile.isSome: sources.addConfigFile(Toml, config.configFile.get) else: