Skip to content

make noreturn type more like the "zero" type #3257

Closed
@vi

Description

@vi
  • ?noreturn is not allowed instead of being void-equivalent (always null). Like u0 is currently void-equivalent.
  • Empty unions are disallowed instead of being noreturn-equivalent.
  • unreachable code error is too strict, preventing instantiating generic code with T=noreturn
  • Using noreturn for union variant does still allocate a tag for such variant

Java gets unit and zero types wrong. Rust gets unit and zero types (relatively) right. Zig gets unit type right, but zero type wrong. Shall it be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions