agra
45e69ac1bb
fix: reject non-type expression in type position instead of fabricating {} (issue 0189)
...
Two type-resolution paths silently resolved a non-type AST node in type
position to a zero-field `{}` struct that reached codegen with no
diagnostic:
- a dotted `type_expr` / field-access (`g.a`, `g` a runtime value) whose
prefix is not a namespace alias
- an `error_type_expr` (`!Name`) whose `Name` is not a declared error set
Now both reject loudly:
- `resolveTypeWithBindings` (lower.zig): "expected a type, found a value
'<name>' in type position" + `.unresolved`
- `checkTypeNodeForUnknown` (semantic_diagnostics.zig): validates a named
`!E` against the declared error-set names — "unknown error set
'<name>'" / "expected an error set after '!', found type '<name>'".
A bare `!` (void channel) and a declared `!E` in return position stay
valid; namespace-qualified types (`pkg.Type`) are unaffected.
Regression: examples/diagnostics/1195-diagnostics-non-type-in-type-position.
2026-06-25 20:35:02 +03:00
..
2026-06-21 14:41:34 +03:00
2026-06-25 17:53:57 +03:00
2026-06-21 14:41:34 +03:00
2026-06-25 20:35:02 +03:00
2026-06-21 14:41:34 +03:00
2026-06-25 17:53:57 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-25 18:41:22 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-25 17:53:57 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-25 17:53:57 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-22 11:55:19 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-21 14:41:34 +03:00
2026-06-22 09:45:17 +03:00
2026-06-22 10:15:18 +03:00
2026-06-22 17:55:18 +03:00
2026-06-22 21:04:05 +03:00
2026-06-25 20:35:02 +03:00
2026-06-23 00:25:28 +03:00
2026-06-23 02:13:30 +03:00
2026-06-23 02:13:30 +03:00
2026-06-23 02:47:51 +03:00
2026-06-23 03:31:58 +03:00
2026-06-23 08:48:31 +03:00
2026-06-25 17:53:57 +03:00
2026-06-23 17:29:12 +03:00
2026-06-23 19:29:11 +03:00