mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix tests
This commit is contained in:
parent
a182b5c531
commit
bcdb897f07
@ -685,7 +685,7 @@ fn (g mut Gen) expr(node ast.Expr) {
|
|||||||
receiver_name = typ_sym.name
|
receiver_name = typ_sym.name
|
||||||
if typ_sym.kind == .array && it.name in
|
if typ_sym.kind == .array && it.name in
|
||||||
// TODO performance, detect `array` method differently
|
// TODO performance, detect `array` method differently
|
||||||
['repeat', 'sort_with_compare', 'free', 'push_many', 'trim'] {
|
['repeat', 'sort_with_compare', 'free', 'push_many', 'trim', 'first', 'clone'] {
|
||||||
// && rec_sym.name == 'array' {
|
// && rec_sym.name == 'array' {
|
||||||
// && rec_sym.name == 'array' && receiver_name.starts_with('array') {
|
// && rec_sym.name == 'array' && receiver_name.starts_with('array') {
|
||||||
// `array_byte_clone` => `array_clone`
|
// `array_byte_clone` => `array_clone`
|
||||||
|
@ -56,7 +56,7 @@ int main() {
|
|||||||
Color color = Color_red;
|
Color color = Color_red;
|
||||||
localmod__pub_foo();
|
localmod__pub_foo();
|
||||||
int ten = localmod__get_int_10();
|
int ten = localmod__get_int_10();
|
||||||
println(localmod__pub_int_const);
|
println(int_str(localmod__pub_int_const));
|
||||||
int g = ((int)(3.0));
|
int g = ((int)(3.0));
|
||||||
byte* bytes = ((byte*)(0));
|
byte* bytes = ((byte*)(0));
|
||||||
User user_ptr = (User*)memdup(&(User){}, sizeof(User));
|
User user_ptr = (User*)memdup(&(User){}, sizeof(User));
|
||||||
@ -96,6 +96,7 @@ i < 10; i++) {
|
|||||||
bool b2 = (*(bool*)array_get(bools, 0)) || true;
|
bool b2 = (*(bool*)array_get(bools, 0)) || true;
|
||||||
bool b3 = get_bool() || true;
|
bool b3 = get_bool() || true;
|
||||||
int f = array_first(nums);
|
int f = array_first(nums);
|
||||||
|
array_int c = array_clone(nums);
|
||||||
string d = tos3("d");
|
string d = tos3("d");
|
||||||
println(string_add(s, d));
|
println(string_add(s, d));
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ fn foo(a int) {
|
|||||||
b2 := bools[0] || true
|
b2 := bools[0] || true
|
||||||
b3 := get_bool() || true
|
b3 := get_bool() || true
|
||||||
f := nums.first()
|
f := nums.first()
|
||||||
|
c := nums.clone()
|
||||||
d := 'd'
|
d := 'd'
|
||||||
println(s + d)
|
println(s + d)
|
||||||
//cloned = nums.clone()
|
//cloned = nums.clone()
|
||||||
|
Loading…
Reference in New Issue
Block a user