From 19a3bafe2be052cdda4ce0ce8b408b728fdce72d Mon Sep 17 00:00:00 2001 From: Predrag Gruevski Date: Sat, 15 Jun 2024 21:57:30 +0000 Subject: [PATCH] Fix the error message if `@recurse` is used on a property. It used to incorrectly say the problematic directive is `@optional`, not `@recurse`. --- trustfall_core/src/frontend/mod.rs | 2 +- .../frontend_errors/recurse_used_on_property.frontend-error.ron | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trustfall_core/src/frontend/mod.rs b/trustfall_core/src/frontend/mod.rs index b0a281f1..5fb42c90 100644 --- a/trustfall_core/src/frontend/mod.rs +++ b/trustfall_core/src/frontend/mod.rs @@ -981,7 +981,7 @@ where // @recurse is not allowed on a property if connection.recurse.is_some() { errors.push(FrontendError::UnsupportedDirectiveOnProperty( - "@optional".into(), + "@recurse".into(), subfield.name.to_string(), )); } diff --git a/trustfall_core/test_data/tests/frontend_errors/recurse_used_on_property.frontend-error.ron b/trustfall_core/test_data/tests/frontend_errors/recurse_used_on_property.frontend-error.ron index 09b48389..fa808382 100644 --- a/trustfall_core/test_data/tests/frontend_errors/recurse_used_on_property.frontend-error.ron +++ b/trustfall_core/test_data/tests/frontend_errors/recurse_used_on_property.frontend-error.ron @@ -1 +1 @@ -Err(UnsupportedDirectiveOnProperty("@optional", "vowelsInName")) +Err(UnsupportedDirectiveOnProperty("@recurse", "vowelsInName"))