microsoft / microsoft/Power-Fx

better error message in ReadOnlySymbolTable.ValidateAccepts

Open
#2,058 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Description

In SymbolValue.Set(slot, value) , we will call ReadOnlySymbolTable.ValidateAccepts to verify a type match.

This gives cryptic errors like:
System.InvalidOperationException: 'Can't change ''Products:NLPayload_37368736'' from Microsoft.PowerFx.Types.TableType to *[ID:w, Name:s, Price:w].'

Make this message easier to debug. At least include both the name and destination types (or ideally the recent field comparison checks to tell us which fields don't match)

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.

Research direction

Start at SymbolValue.Set and ReadOnlySymbolTable.ValidateAccepts, where the type mismatch is checked and the cryptic exception is produced. Improve the error so it includes both the source and destination types, or identifies mismatched fields when available. Done means the resulting message is easier to debug for the reported TableType example.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.