Files
ViperC/App
TermiNexus 8c72adde88 feat(gen): nullable T? types and non-null analysis in strict CWA files
A strict CWA file (`from __future__ import __cwa__`) now distinguishes
nullable from non-nullable types:

- `name: T?` resolves to `Ptr(T)` and records the slot as nullable
  (a per-function slot table, like the released-slot table).
- assigning `None` to a non-nullable declaration, plain assignment,
  annotated attribute/subscript target or return type fails fast with a
  TypeError; `T?` accepts it.
- class-name extraction unwraps `NullableT[...]`, so field lookup,
  method dispatch and `AnnotClassName` still see the class.

Non-strict files keep the previous behavior (`T* = None` is accepted);
`T?` also parses there as `Ptr(T)`, it just carries no enforcement.

Probe: strict `p: A? = None` / `p = new heap hlife A()` / `p = None`
works and null comparisons run; `p: A = None`, `p: A* = None`,
`q = None` on a non-nullable variable and `-> T*` + `return None` all
fail fast; `-> A?` and field `next: A?` work; the same `T* = None`
still compiles outside strict mode. Self-host 110/110; ListTest,
GenericTest3, PtrOpProbe, HashLibTest, NewTest, NewLifetimeTest,
StructTest and EscapeOkTest pass.
2026-11-02 15:47:36 +08:00
..