user code can easily infer int<int<#N>>
fn used<T>(n: int<T>) -> T {
true
}
fn uses() -> bool {
let n: int<5> = used(0);
true
}
bug: Inferred int<int<5>> for integer literal
┌─ test.spade:6:24
│
6 │ let n: int<5> = used(0);
│ ^
│
= note: This is an internal bug in the compiler.
We would appreciate if you opened an issue in the repository:
https://gitlab.com/spade-lang/spade/-/issues/new?issuable_template=Internal%20bug
= note: Triggered at spade-typeinference/src/requirements.rs:314
IMO this specific case shouldn't be a compiler bug, since the written code quite literally tries to use the type int<int<5>>