Skip to content

Conversation

@gregli-msft
Copy link
Contributor

@gregli-msft gregli-msft commented Sep 11, 2025

Currently, UDFs and UDTs have a restricted type list in UserDefinitions.cs that is not customizable per host. It includes Decimal which makes sense for Canvas but doesn't work for C# hosts. We need to generalize this.

  • Canvas doesn't want Decimal.
  • C# interpreter doesn't want TimeZoneTZInd. Crashes if used.
  • Dataverse formula columns want both of these.

This PR uses the Engine.PrimitiveTypes list, to be set by a host that cares about UDFs, UDTs, or JSON serialization. It is null by default, and if a host doesn't use these features, it doesn't matter. RecalcEngine will provide PrimitiveTypes that the interpreter can support, so any hosts using it, which is most hosts, don't need to make a change.

@jas-valgotar
Copy link
Contributor

Public API changes:
❌CP0002 M:Microsoft.PowerFx.Engine.set_PrimitiveTypes(Microsoft.PowerFx.ReadOnlySymbolTable)

1 similar comment
@jas-valgotar
Copy link
Contributor

Public API changes:
❌CP0002 M:Microsoft.PowerFx.Engine.set_PrimitiveTypes(Microsoft.PowerFx.ReadOnlySymbolTable)

@gregli-msft gregli-msft marked this pull request as ready for review September 12, 2025 19:57
@gregli-msft gregli-msft requested a review from a team as a code owner September 12, 2025 19:57
@jas-valgotar
Copy link
Contributor

✅ No public API change.

2 similar comments
@jas-valgotar
Copy link
Contributor

✅ No public API change.

@jas-valgotar
Copy link
Contributor

✅ No public API change.

@gregli-msft gregli-msft marked this pull request as draft September 14, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants