1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

remove u8 and i32 aliases

This commit is contained in:
Alexander Medvednikov
2019-09-01 22:37:22 +03:00
parent d078aa360b
commit 3bd7bcfac3
7 changed files with 27 additions and 51 deletions

View File

@@ -80,6 +80,7 @@ pub fn (nn u32) str() string {
return tos(buf + max - len, len)
}
/*
pub fn (nn u8) str() string {
mut n := nn
if n == u8(0) {
@@ -97,6 +98,7 @@ pub fn (nn u8) str() string {
}
return tos(buf + max - len, len)
}
*/
pub fn (nn i64) str() string {
mut n := nn

View File

@@ -1,22 +1,22 @@
const (
a = 3
u = u64(1)
)
u = u64(1)
)
fn test_const() {
b := (true && true) || false
assert b == true
assert a == 3
assert u == u64(1)
}
b := (true && true) || false
assert b == true
assert a == 3
assert u == u64(1)
}
fn test_str_methods() {
assert i8(1).str() == '1'
assert i8(-1).str() == '-1'
assert i16(1).str() == '1'
assert i16(-1).str() == '-1'
assert i32(1).str() == '1'
assert i32(-1).str() == '-1'
assert int(1).str() == '1'
assert int(-1).str() == '-1'
assert i64(1).str() == '1'
assert i64(-1).str() == '-1'
@@ -35,5 +35,5 @@ fn test_cmp() {
assert 1 ≠ 2
assert 1 ⩽ 2
assert 1 ⩾ 0
}
}
*/

View File

@@ -102,14 +102,6 @@ fn test_various_map_value() {
m4['test'] = i16(0)
assert m4['test'] == i16(0)
mut m5 := map[string]i32
m5['test'] = i32(0)
assert m5['test'] == i32(0)
mut m6 := map[string]u8
m6['test'] = u8(0)
assert m6['test'] == u8(0)
mut m7 := map[string]u16
m7['test'] = u16(0)
assert m7['test'] == u16(0)

View File

@@ -132,9 +132,6 @@ pub fn (s string) int() int {
return C.atoi(s.str)
}
pub fn (s string) i32() i32 {
return C.atol(s.str)
}
pub fn (s string) i64() i64 {
return C.atoll(s.str)
@@ -501,7 +498,7 @@ pub fn (s string) to_upper() string {
pub fn (s string) capitalize() string {
sl := s.to_lower()
cap := sl[0].str().to_upper() + sl.right(1)
return cap
return cap
}
pub fn (s string) title() string {