Bug 189755 - [WHLSL] Enum types with no zero value can’t be zero-initialized
Summary: [WHLSL] Enum types with no zero value can’t be zero-initialized
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Thomas Denney
URL:
Keywords:
Depends on:
Blocks: 189202
  Show dependency treegraph
 
Reported: 2018-09-19 10:22 PDT by Thomas Denney
Modified: 2018-10-13 15:00 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Denney 2018-09-19 10:22:16 PDT
See EnumType.populateDefaultValue. Consider the enum type

enum A { B = 1, C = 2 }

Currently an A value will be initialized with zero, which isn’t a valid value of the enum. We need to specify this behavior, update the interpreter, and update the compiler.
Comment 1 Thomas Denney 2018-09-20 17:12:23 PDT
Closing this because Checker verifies that an enum cannot be declared without a zero value.
Comment 2 Myles C. Maxfield 2018-10-13 15:00:37 PDT
Migrated to https://github.com/gpuweb/WHLSL/issues/33