Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: fix panic for struct field with new style @[attribute], with …
…an enum default value after it
- Loading branch information
Showing
3 changed files
with
18 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
6 changes: 6 additions & 0 deletions
6
...sts/expecting_type_declaration_for_new_attribute_field_followed_by_enum_default_value.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,6 @@ | ||
vlib/v/parser/tests/expecting_type_declaration_for_new_attribute_field_followed_by_enum_default_value.vv:9:23: error: expecting type declaration | ||
7 | s string | ||
8 | i int | ||
9 | e MyEnum @[required] = .a | ||
| ^ | ||
10 | } |
10 changes: 10 additions & 0 deletions
10
...ests/expecting_type_declaration_for_new_attribute_field_followed_by_enum_default_value.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,10 @@ | ||
enum MyEnum { | ||
a | ||
b | ||
} | ||
|
||
struct MyStruct { | ||
s string | ||
i int | ||
e MyEnum @[required] = .a | ||
} |