From c1868a56947f6a0a8cf3fa9d0b15acd82e60f12e Mon Sep 17 00:00:00 2001 From: Jaehyun Lee <99jaehyunlee@gmail.com> Date: Sat, 14 Sep 2024 12:02:43 +0900 Subject: [PATCH] Identifiers declared as constants are local compile-time known Signed-off-by: Jaehyun Lee <99jaehyunlee@gmail.com> --- p4-16/spec/P4-16-spec.mdk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p4-16/spec/P4-16-spec.mdk b/p4-16/spec/P4-16-spec.mdk index 162372f2b6..374de6dd8a 100644 --- a/p4-16/spec/P4-16-spec.mdk +++ b/p4-16/spec/P4-16-spec.mdk @@ -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 } @@ -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. @@ -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.