Skip to content

are zero field/variant enum/bundle types legal #208

@programmerjake

Description

@programmerjake

afaict the specification doesn't specify if you can have an enumeration type with no variants {||} (the grammar allows it, but I'm not sure if that's intentional, since uninhabited types behave very oddly).
The specification says you can have a bundle type with no fields but the grammar doesn't allow it:

firrtl-spec/spec.md

Lines 4406 to 4415 in 9b0357e

(* Bundle Types *)
type_bundle = "{" , type_bundle_field , { type_bundle_field } , "}" ;
type_bundle_field = [ "flip" ] , id , ":" , type ;
(* Vec Types *)
type_vec = type , "[" , int , "]" ;
(* Enum Types *)
type_enum = "{|" , { type_enum_alt } , "|}" ;
type_enum_alt = id, [ ":" , type_constable ] ;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions