Constexpr evaluation in impl methods doesn't always work
Open
dslx
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
**Describe the bug**
`const_assert!()` doesn't seem to be able to constexpr-evaluate function parametrics.
**To Reproduce**
```
pub struct A {}
impl A {
fn B() -> bool {
const_assert!(C >= u32:4);
true
}
}
```
**Expected behavior**
It should typecheck and the assertion should pass or fail base on invocation.
Instead, I get `TypeInferenceError: const_assert! expression is not constexpr` regardless of the invocations of `A::B<...>()`.
Contributor guide
Assessment
This issue has not been assessed yet.