Skip to content

Refact constants into separate type #889

@heaths

Description

@heaths

I think this could be folded into defaultValue as a new Constant type (might be useful elsewhere).

/** Constant defines a Rust const declaration */
export interface Constant {
  kind: 'constant';

  /** the name of the const */
  name: string;

  /** the value of the const */
  value: Literal;

  /** indicates the visibility of the const */
  visibility: Visibility;
}

Then we can update the definition accordingly.

  defaultValue?: Constant | string;

Originally posted by @jhendrixMSFT in #887 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    CodeGenIssues that relate to code generation

    Type

    No type

    Projects

    Status

    Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions