google / google/xls

[DSLX] Using types where we expect expressions causes internal error

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

Description

**Describe the bug**

```
$ cat /tmp/simple.x
import apfloat;

type BF16 = apfloat::APFloat;
```

```
E0224 10:49:57.210159 1008868 command_line_utils.cc:47] Could not extract a textual position from error message: INTERNAL: XLS_RET_CHECK failure (xls/dslx/type_system/deduce.cc:1752) std::holds_alternative(eot) : INVALID_ARGUMENT: Provided status is not in recognized error form: INTERNAL: XLS_RET_CHECK failure (xls/dslx/type_system/deduce.cc:1752) std::holds_alternative(eot)
Error: INTERNAL: XLS_RET_CHECK failure (xls/dslx/type_system/deduce.cc:1752) std::holds_alternative(eot)
```

**To Reproduce**
Put the content above in a .x file and run `dslx_interpreter_main` on it with a DSLX standard library available.

**Expected behavior**
No internal error, good error message. Note this is likely to be fixed in TIv2 but we can make a test case for it regardless in the bridge time until TIv2 is the default.

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.