forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate value_set element types (p4lang#3351)
Signed-off-by: Mihai Budiu <[email protected]>
- Loading branch information
1 parent
b757ea9
commit 2cc379c
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parser MyParser1(in bit<6> v) { | ||
value_set<int>(4) myvs; | ||
state start { | ||
transition select(v) { | ||
myvs: accept; | ||
_: reject; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
parser MyParser1(in bit<6> v) { | ||
value_set<int>(4) myvs; | ||
state start { | ||
transition select(v) { | ||
myvs: accept; | ||
default: reject; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
issue3346.p4(2): [--Werror=type-error] error: int: Illegal type for value_set element type | ||
value_set<int>(4) myvs; | ||
^^^ |