google / google/xls

parser should be able to resolve array type that uses imported types

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

Description

**Describe the bug**

Seems like dslx_fmt (and the parser?) don't manage to resolve array type that uses imported types.

**To Reproduce**

the following expression:
```
float32::F32[2][3]:[
[float32::one(), float32::zero(u1:0)],
[float32::one(), float32::zero(u1:0)],
[float32::one(), float32::zero(u1:0)],
]
```
will produces this error:
```
Type before ':' for presumed array literal was not a type definition; got `float32::F32[2]

```

**Workaround**

alias the type locally w/
```
type F32 = float32::F32;
```
and use:
```
F32[2][3]:[
[float32::one(), float32::zero(u1:0)],
[float32::one(), float32::zero(u1:0)],
[float32::one(), float32::zero(u1:0)],
]
```

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.