google / google/xls

Improve error message of "Cannot bind PARAM: it has no associated type" in parametric_bind.cc

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

Description

If you encounter this error message, then it's quite hard to find the cause of the problem:

```
E0110 16:05:18.217114 3 command_line_utils.cc:45] Could not extract a textual position from error message: INTERNAL: XLS_RET_CHECK failure (xls/dslx/type_system/parametric_bind.cc:107) ctx.parametric_binding_types.contains(pdim_name) Cannot bind ID_W : it has no associated type.: INVALID_ARGUMENT: Provided status is not in recognized error form: INTERNAL: XLS_RET_CHECK failure (xls/dslx/type_system/parametric_bind.cc:107) ctx.parametric_binding_types.contains(pdim_name) Cannot bind ID_W : it has no associated type.
Error parsing and type checking DSLX source file: xls/modules/dma/frontend_writer.x
Error: INTERNAL: XLS_RET_CHECK failure (xls/dslx/type_system/parametric_bind.cc:107) ctx.parametric_binding_types.contains(pdim_name) Cannot bind ID_W : it has no associated type.Target //xls/modules/dma:test_frontend_writer failed to build
```

It would be far easier to locate issue with a wrong parametric if the error message contained number of line in the DSLX description file. If possible, could you add a line like below to the error message? Or is there a larger problem behind "Could not extract a textual position from error message"?

```
PARAM in line of file: path/to/file.x couldn't be bound.
```

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.