From 43a24047076f24f371f2cb8f334da43f8ae6059f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 11 Jan 2023 11:23:52 -0800 Subject: Deprecate passing strings to non-string options Currently Meson allow the following (Muon does not): ```meson option('foo', type : 'boolean', value : 'true') option('bar', type : 'integer', value : '42') ``` This is possibly a holdover from very old code, but it's a bad idea and we should stop doing it. This deprecation is the first stop on that journey. --- docs/markdown/snippets/coercing_option_values_deprecated.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/markdown/snippets/coercing_option_values_deprecated.md (limited to 'docs') diff --git a/docs/markdown/snippets/coercing_option_values_deprecated.md b/docs/markdown/snippets/coercing_option_values_deprecated.md new file mode 100644 index 0000000..3621387 --- /dev/null +++ b/docs/markdown/snippets/coercing_option_values_deprecated.md @@ -0,0 +1,9 @@ +## coercing values in the option() function is deprecated + +Currently code such as: +```meson +option('foo', type : 'boolean', value : 'false') +``` +works, because Meson coerces `'false'` to `false`. + +This should be avoided, and will now result in a deprecation warning. -- cgit v1.1