Method to determine if Formula Types can be copied

Open
#1,758 1 comment 0 reactions 1 assignee View on GitHub

@anderson-joyle is already working on this.

Since Aug 15, 2023.

Assessment

This issue has not been assessed yet.

Description

Set(x, dataverseRecord) will fail since dataverseRecord is not a copyable type. (enforced with #1633)
But really, we should be blocking this at time of creating variable 'x' if it's a non-copyable type.

Here's the check we do in Set() to block this
https://github.com/microsoft/Power-Fx/blob/ee877354b4c0392d7e0d8244e6348fa5ce399d61/src/libraries/Microsoft.PowerFx.Interpreter/Functions/SetFunction.cs#L92C30-L92C54

This should be using a public property on FormulaType that hosts can check as well.

More broadly, there may be other open issues here:

  1. do we need the check in Set()? Or should it just be blocked at creating the variable.
  2. be sure to check for nested types. Set(x, {nested: dataverseRecord}) should fail too.
Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/Power-Fx

All issues in microsoft/Power-Fx

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.