From 5f5360470f386bbb669c1cf7b4f4c86d14e89345 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Wed, 25 Apr 2018 23:02:21 +0100 Subject: [PATCH] Clarify that configuration_data()'s copy is immutable --- docs/markdown/Configuration.md | 1 + test cases/failing/75 configuration immutable/input | 0 .../failing/75 configuration immutable/meson.build | 12 ++++++++++++ 3 files changed, 13 insertions(+) create mode 100644 test cases/failing/75 configuration immutable/input create mode 100644 test cases/failing/75 configuration immutable/meson.build diff --git a/docs/markdown/Configuration.md b/docs/markdown/Configuration.md index d8fa54e65..89f423c58 100644 --- a/docs/markdown/Configuration.md +++ b/docs/markdown/Configuration.md @@ -39,6 +39,7 @@ use a single `configuration_data` object as many times as you like, but it becomes immutable after being passed to the `configure_file` function. That is, after it has been used once to generate output the `set` function becomes unusable and trying to call it causes an error. +Copy of immutable `configuration_data` is still immutable. For more complex configuration file generation Meson provides a second form. To use it, put a line like this in your configuration file. diff --git a/test cases/failing/75 configuration immutable/input b/test cases/failing/75 configuration immutable/input new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/75 configuration immutable/meson.build b/test cases/failing/75 configuration immutable/meson.build new file mode 100644 index 000000000..b6cac4126 --- /dev/null +++ b/test cases/failing/75 configuration immutable/meson.build @@ -0,0 +1,12 @@ +project('configuration_data is immutable') + +a = configuration_data() + +configure_file( + configuration : a, + input : 'input', + output : 'output', +) + +still_immutable = a +still_immutable.set('hello', 'world')