-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not allow arguments with type table, control, etc (#3901)
* Do not allow arguments with type table, control, etc Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
- Loading branch information
Mihai Budiu
authored
Mar 3, 2023
1 parent
9eeba09
commit facc5ed
Showing
17 changed files
with
116 additions
and
61 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
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,17 @@ | ||
action NoAction(){} | ||
|
||
extern f<T> | ||
{ | ||
f(); | ||
void g(in T a); | ||
} | ||
control eq0(f<_> tt) | ||
{ | ||
table t { | ||
const size = 100; | ||
actions = {NoAction;} | ||
} | ||
apply { | ||
tt.g(t); | ||
} | ||
} |
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,13 @@ | ||
action NoAction(){} | ||
|
||
extern void f<T>(in T a); | ||
control eq0() | ||
{ | ||
table t { | ||
const size = 100; | ||
actions = {NoAction;} | ||
} | ||
apply { | ||
f<_>(t); | ||
} | ||
} |
File renamed without changes.
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
issue2454.p4(3): [--Werror=type-error] error: t: parameter cannot have type control C | ||
void f<T>(T t) {} | ||
^ | ||
issue2454.p4(8): [--Werror=type-error] error: c: argument cannot have type control C | ||
f(c); | ||
^ | ||
issue2454.p4(1) | ||
control C() { apply { } } | ||
^ | ||
issue2454.p4(3): [--Werror=type-error] error: Error while analyzing f | ||
void f<T>(T t) {} | ||
^ |
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,19 @@ | ||
action NoAction() { | ||
} | ||
extern f<T> { | ||
f(); | ||
void g(in T a); | ||
} | ||
|
||
control eq0(f<_> tt) { | ||
table t { | ||
const size = 100; | ||
actions = { | ||
NoAction; | ||
} | ||
} | ||
apply { | ||
tt.g(t); | ||
} | ||
} | ||
|
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,6 @@ | ||
issue3808-1.p4(15): [--Werror=type-error] error: t: Could not infer a type for parameter a (inferred type is don't care '_') | ||
tt.g(t); | ||
^ | ||
issue3808-1.p4(6) | ||
void g(in T a); | ||
^ |
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,15 @@ | ||
action NoAction() { | ||
} | ||
extern void f<T>(in T a); | ||
control eq0() { | ||
table t { | ||
const size = 100; | ||
actions = { | ||
NoAction; | ||
} | ||
} | ||
apply { | ||
f<_>(t); | ||
} | ||
} | ||
|
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 @@ | ||
issue3808.p4(11): [--Werror=type-error] error: t: argument cannot have type Type_Table | ||
f<_>(t); | ||
^ |
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
File renamed without changes.
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,6 @@ | ||
methodArgDontcare.p4(9): [--Werror=type-error] error: 0: Could not infer a type for parameter arg (inferred type is don't care '_') | ||
e.f(0); | ||
^ | ||
methodArgDontcare.p4(3) | ||
void f(in T arg); | ||
^^^ |
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
testdata/p4_16_samples_outputs/methodArgDontcare-frontend.p4
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
testdata/p4_16_samples_outputs/methodArgDontcare-midend.p4
This file was deleted.
Oops, something went wrong.
Empty file.