google / google/xls

error message (Cannot convert expression to parametric) not in correct form

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

Description

**Describe the bug**
This error message is not in the correct form, and as a result, there are some problems with it:

- when compiling at the command line, we don't get an error that tells us which text cause the error
- when type checking with the DSLX language server, it can't report the problem to the IDE and the problem is hidden unless you dig into the log

```
E0116 00:42:07.901671 490782 command_line_utils.cc:47] Could not extract a textual position from error message: INVALID_ARGUMENT: Cannot convert expression to parametric: IS_SIGNED > u32:0: INVALID_ARGUMENT: Provided status is not in recognized error form: INVALID_ARGUMENT: Cannot convert expression to parametric: IS_SIGNED > u32:0
Error: INVALID_ARGUMENT: Cannot convert expression to parametric: IS_SIGNED > u32:0
```

**To Reproduce**
```
pub struct foo u32:0} > {
data: xN[sign][NUM_BITS],
}

#[test]
fn test_instantiate_foo() {
let _ = foo { data: u1:0};
}
```
compile the above

**Expected behavior**
I expect the error to be reported in the proper format, so that the issues identified above don't occur.

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.