Issue #1079: A nullable type in a call’s type brackets does not parse: f[i64?](x)

Open and answer this issue on GitHub.

bug, ready · opened 2026-10-31 · updated 2026-10-31 · 0 comments

Found by the j2 builder of #1019 (grammar rules take type parameters). Where a type is expected, List[i64?] parses. In an expression, though, the brackets of a call are read as an index or a slice, so ? stops the parse. This holds for functions and grammar rules alike (G::entry[i64?](input)).

Probe:

fn id[T](x: T) -> T { return x }
fn main() {
    let a: i64? = id[i64?](null)
    print("${a ?? 0}")
}
Error: Expected `..` or `]` here, but found `?`.
  --> n.nika:3:25

Type arguments at a call take any type (Part II, generics), and no ADR refuses a nullable one, so this is a defect.

To build

Back to Open Issues