From 5c39c4e94267fbd56f4983eb4f336118f56d02cd Mon Sep 17 00:00:00 2001 From: tee3 Date: Tue, 1 Jun 2021 08:04:35 -0400 Subject: [PATCH] property: Fix print in error condition in `property.find`. (#35) * property: Add a test to show the issue with property.find. * property: Fix property.find to print the ambiguous key --- src/build/property.jam | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/build/property.jam b/src/build/property.jam index b95e604ae..43a8b6951 100644 --- a/src/build/property.jam +++ b/src/build/property.jam @@ -808,6 +808,7 @@ class property-map if $(best[2]) { import errors : error : errors.error ; + properties = [ $(property-set).raw ] ; errors.error "Ambiguous key $(properties:J= :E=)" ; } return $(best) ; @@ -969,6 +970,10 @@ rule __test__ ( ) $(pm).insert gcc NT : obj ; $(pm).insert gcc CYGWIN : obj ; + try ; + $(pm).find [ new property-set gcc NT CYGWIN ] ; + catch "Ambiguous key gcc NT CYGWIN" ; + assert.equal o : [ $(pm).find-replace gcc ] ; assert.equal obj : [ $(pm).find-replace gcc NT ] ;