google / google/xls

[enhancement:DSLX:type_system] Ensure parametric env map is completely populated on instantiation

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

Description

### What's hard to do? (limit 100 words)

Right now we accept situations where the caller doesn't fully populate the parametric env map. For example in this program:

```
fn p(y: uN[Y]) -> u32 { Y }
fn f() -> u32 { p(u7:0) }
```

We could eagerly state that X was not populated in the parametric environment and flag that as an issue.

There is some fallout to address when we try to tighten up this invariant, which is why I'm filing an issue for it instead of fixing it directly in the related issue #1473

### Current best alternative workaround (limit 100 words)

The current lenient policy is "ok" it just causes some failures at IR conversion time instead of eagerly presenting them at typechecking time as we would like.

### Your view of the "best case XLS enhancement" (limit 100 words)

We are able to eagerly flag all parametric environment bindings that have not been populated when they are instantiated.

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.