google / google/xls

Better error message when using array ellipsis not type annotated

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

Description

Currently, array ellipsis need to have type annotation. When the type is not specified, an error is produce. Below is a sample error message.
```
0018: let test_me: Addr[2] = [ Addr: 0, ...];
~~~~~~~~~~~~~~~~~~~~~^------^ XlsTypeError: uN[64][2] vs uN[64][1]: Annotated type did not match inferred type of right hand side expression.
```

There are two possible solutions: 1- Perform type deduction on the rhs when the array uses ellipsis, 2- Use a better error message when array ellipsis are used (e.g. "XlsError: Please annotate the type when using array ellipsis.").

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.