From 3249eb451ffaa9d7af019ca821f043dbc5c7b714 Mon Sep 17 00:00:00 2001 From: Anderson Ferreira da Silva Date: Thu, 7 Mar 2024 14:52:34 -0600 Subject: [PATCH] Adding code from https://github.com/microsoft/Power-Fx/pull/2246 since this PR depends on it. --- .../Microsoft.PowerFx.Core/Binding/Binder.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs b/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs index 6b3cd5f810..2c512d7373 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs @@ -2873,12 +2873,20 @@ public override void Visit(FirstNameNode node) isConstantNamedFormula = formula.IsConstant; } } - else if (lookupInfo.Kind == BindKind.Data) - { - if (lookupInfo.Data is IExternalCdsDataSource or IExternalTabularDataSource) - { - _txb.SetMutable(node, true); - } + else if (lookupInfo.Kind == BindKind.Data) + { + if (lookupInfo.Data is IExternalCdsDataSource or IExternalTabularDataSource) + { + _txb.SetMutable(node, true); + } + else if (lookupInfo.Data is IExternalDataSource ds) + { + _txb.SetMutable(node, ds.IsWritable); + } + } + else if (lookupInfo.Kind == BindKind.ScopeCollection) + { + _txb.SetMutable(node, true); } Contracts.Assert(lookupInfo.Kind != BindKind.LambdaField);