Skip to content

Commit 03a1558

Browse files
Merge pull request #1342 from jaehyun1ee/ctk-access-adoc
Specify compile-time evaluation of field and index accesses
2 parents a45fd71 + 2c0378b commit 03a1558

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

p4-16/spec/P4-16-spec.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8101,6 +8101,8 @@ The following are local compile-time known values:
81018101
- Structure-valued expressions, where all fields are local compile-time known values.
81028102
- Expressions evaluating to a list type, where all elements are local compile-time known values.
81038103
- Legal casts applied to local compile-time known values.
8104+
- Indexing a local compile-time known stack or tuple value with a local compile-time known index.
8105+
- Accessing a field of a local compile-time known struct, header, or header union value.
81048106
- The following expressions (`+`, `-`, `|+|`, `|-|`, `*`, `/ `, `%`, `!`, `&`, `|`, `^`, `&&`, `||`, `<< `, `>>`, `~`, `/`, `>`, `<`, `==`, `!=`, `<=`, `>=`, `++`, `[:]`, `?:`) when their operands are all local compile-time known values.
81058107
- Expressions of the form `e.minSizeInBits()`, `e.minSizeInBytes()`, `e.maxSizeInBits()` and `e.maxSizeInBytes()` where the type of `e` is not generic.
81068108

@@ -8113,6 +8115,8 @@ The following are compile-time known values:
81138115
- Structure-valued expressions, where all fields are compile-time known values.
81148116
- Expressions evaluating to a list type, where all elements are compile-time known values.
81158117
- Legal casts applied to compile-time known values.
8118+
- Indexing a compile-time known stack or tuple value with a compile-time known index.
8119+
- Accessing a field of a compile-time known struct, header, or header union value.
81168120
- The following expressions (`+`, `-`, `|+|`, `|-|`, `*`, `/ `, `%`, `cast`, `!`, `&`, `|`, `^`, `&&`, `||`, `<< `, `>> `, `~`, `/`, `>`, `<`, `==`, `!=`, `<=`, `>=`, `++`, `[:]`, `?:`) when their operands are all compile-time known values.
81178121
- Expressions of the form `e.minSizeInBits()`, `e.minSizeInBytes()`, `e.maxSizeInBits()` and `e.maxSizeInBytes()` where the the type of `e` is generic.
81188122

0 commit comments

Comments
 (0)