From 220d5aa7ba76afef511e87aa6b67fcccc5f4071d Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 12 Oct 2021 17:17:05 +0200 Subject: interpreter: Fix missing holder entry (fixes #9389) --- mesonbuild/interpreter/interpreter.py | 2 ++ test cases/common/188 dict/meson.build | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 9f2c705..ba6bf11 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -19,6 +19,7 @@ from .. import mlog from .. import build from .. import optinterpreter from .. import compilers +from .. import envconfig from ..wrap import wrap, WrapMode from .. import mesonlib from ..mesonlib import MesonBugException, HoldableObject, FileMode, MachineChoice, OptionKey, listify, extract_as_list, has_path_sep @@ -419,6 +420,7 @@ class Interpreter(InterpreterBase, HoldableObject): compilers.RunResult: compilerOBJ.TryRunResultHolder, dependencies.ExternalLibrary: OBJ.ExternalLibraryHolder, coredata.UserFeatureOption: OBJ.FeatureOptionHolder, + envconfig.MachineInfo: OBJ.MachineHolder, }) ''' diff --git a/test cases/common/188 dict/meson.build b/test cases/common/188 dict/meson.build index dacf01d..2f4c4c9 100644 --- a/test cases/common/188 dict/meson.build +++ b/test cases/common/188 dict/meson.build @@ -69,3 +69,14 @@ assert(d[k2] == 2, 'Incorrect expression evaluation in dictionary key') d = {'a' + 'b' : 1} assert(d['a' + 'b'] == 1, 'Incorrect expression evaluation in dictionary key') assert(d['ab'] == 1, 'Incorrect expression evaluation in dictionary key') + +# Complex types +d = { + 'sanity': 1, + 'host': host_machine, + 'meson': meson, +} + +assert(d['sanity'] == 1) +assert(not is_disabler(d['meson'])) +assert(not is_disabler(d['host'])) -- cgit v1.1