google / google/xls

[enhancement][DSLX] Type errors should show the function stack, if there is one

Open
#1,826 0 comments 0 reactions 0 assignees View on GitHub
dslx enhancement
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

### What's hard to do? (limit 100 words)

If you get a type error in a helper routine, e.g. that uses parametrics, a type error will be identified in the leaf, but we don't currently display the calling context. We do maintain this information during typechecking (in DeduceCtx::fn_stack), so it would be good to capture/display it when producing an error message display.

### Current best alternative workaround (limit 100 words)

It's tricky to figure out where things are coming from as it seems like we don't have `trace_fmt!` emit output at constexpr evaluation time right now.

### Your view of the "best case XLS enhancement" (limit 100 words)

We'd display the function stack that led to the type error (in the leaf function) as part of the error display.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.