-
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.
checker: disallow blank ident in const and global decl
- Loading branch information
Showing
5 changed files
with
37 additions
and
1 deletion.
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,3 @@ | ||
vlib/v/checker/tests/const_blank_ident_as_name_err.vv:1:7: error: cannot use `_` as a const name | ||
1 | const _ = 23 | ||
| ^ |
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 @@ | ||
const _ = 23 |
18 changes: 18 additions & 0 deletions
18
vlib/v/checker/tests/globals/global_blank_ident_as_name_err.out
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,18 @@ | ||
vlib/v/checker/tests/globals/global_blank_ident_as_name_err.vv:2:5: error: cannot use `_` as a global name | ||
1 | __global ( | ||
2 | _ = 23 | ||
| ^ | ||
3 | _ int | ||
4 | ) | ||
vlib/v/checker/tests/globals/global_blank_ident_as_name_err.vv:3:5: error: duplicate global `_` | ||
1 | __global ( | ||
2 | _ = 23 | ||
3 | _ int | ||
| ^ | ||
4 | ) | ||
vlib/v/checker/tests/globals/global_blank_ident_as_name_err.vv:3:5: error: cannot use `_` as a global name | ||
1 | __global ( | ||
2 | _ = 23 | ||
3 | _ int | ||
| ^ | ||
4 | ) |
4 changes: 4 additions & 0 deletions
4
vlib/v/checker/tests/globals/global_blank_ident_as_name_err.vv
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,4 @@ | ||
__global ( | ||
_ = 23 | ||
_ int | ||
) |