Skip to content

Commit

Permalink
Merge pull request #1307 from jaehyun1ee/main
Browse files Browse the repository at this point in the history
Identifiers declared as constants are local compile-time known
  • Loading branch information
jonathan-dilorenzo authored Sep 18, 2024
2 parents 7e28324 + c1868a5 commit 0b6c4b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p4-16/spec/P4-16-spec.mdk
Original file line number Diff line number Diff line change
Expand Up @@ -5115,7 +5115,7 @@ struct Version {
const Version version = { 32w0, 32w0 };
~ End P4Example

The `initializer` expression must be a compile-time known value.
The `initializer` expression must be a local compile-time known value.

## Variables { #sec-variables }

Expand Down Expand Up @@ -7739,6 +7739,7 @@ _local compile-time known values_ respectively.
The following are local compile-time known values:

- Integer literals, Boolean literals, and string literals.
- Identifiers declared as constants using the `const` keyword.
- Identifiers declared in an `error`, `enum`, or `match_kind` declaration.
- The `default` identifier.
- The `size` field of a value with type header stack.
Expand All @@ -7757,7 +7758,6 @@ The following are compile-time known values:

- All local compile-time known values.
- Constructor parameters (i.e., the declared parameters for a `parser`, `control`, etc.)
- Identifiers declared as constants using the `const` keyword.
- Tuple expression where all components are compile-time known values.
- Expressions evaluating to a list type, where all elements are compile-time known values.
- Structure-valued expressions, where all fields are compile-time known values.
Expand Down

0 comments on commit 0b6c4b7

Please sign in to comment.