google / google/xls

Bad error message for incorrect sizeof usage

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

Description

foo.x
```
pub type foo_t = u32;
```

main.x
```
import std;
import foo;

fn f() -> () {
let s: u32 = std::sizeof(foo::foo_t);
}
```

Repro:
```
$ interpreter_main bad.x --dslx_path .
E1030 13:03:32.587061 991027 deduce_invocation.cc:237] INTERNAL: XLS_RET_CHECK failure (third_party/xls/dslx/type_system/deduce_invocation.cc:237) !type->IsMeta() parametric arg: foo::foo_t type: typeof(uN[32])
=== Source Location Trace: ===
third_party/xls/common/status/status_builder.cc:197

0x5601c71a5cc9: xabsl::StatusBuilder::CreateStatusAndConditionallyLog()
0x5601c4049097: xls::dslx::AppendArgsForInstantiation()
0x5601c404957f: xls::dslx::DeduceInvocation()
0x5601c402cc7e: xls::dslx::(anonymous namespace)::DeduceVisitor::HandleInvocation()
...

```

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.