Skip to content

Commit

Permalink
compiler: fix deprecation message for u8.
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman authored and medvednikov committed Sep 2, 2019
1 parent 510fb2a commit d681e1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/parser.v
Original file line number Diff line number Diff line change
Expand Up @@ -1627,8 +1627,8 @@ fn (p mut Parser) name_expr() string {
if orig_name == 'i32' {
println('`i32` alias was removed, use `int` instead')
}
if orig_name == 'byte' {
println('`byte` alias was removed, use `byte` instead')
if orig_name == 'u8' {
println('`u8` alias was removed, use `byte` instead')
}
p.error('undefined: `$orig_name`')
}
Expand Down

4 comments on commit d681e1c

@X1aSheng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? you say u8 alias was removed, use byte instead' in commit 59ba551

@M4SSD35TRUCT10N
Copy link
Contributor

@M4SSD35TRUCT10N M4SSD35TRUCT10N commented on d681e1c Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove u8 and i32 instead of int / byte? This breaks consistency in naming of the basic data types as mentioned in #1718 .

@avitkauskas
Copy link
Contributor

@avitkauskas avitkauskas commented on d681e1c Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this surprises me as well. I know @medvednikov prefers int, but i32, u8 etc. are consistent and clear. And also fits well will "one way" principle. With int and byte the types are not named "one way" :)

@medvednikov
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This decision is not final yet, it'll be possible to easily switch to i32 and u8 with the help of vfmt.

To me personally []byte is more readable and clear than []u8 when used for bytes arrays (probably ~90% of cases).

Please sign in to comment.