diff --git a/vlib/gx/gx.v b/vlib/gx/gx.v index f770fadbe2..53440b5866 100644 --- a/vlib/gx/gx.v +++ b/vlib/gx/gx.v @@ -49,6 +49,7 @@ pub const ( pub const ( align_left = 1 + align_right = 4 ALIGN_RIGHT = 4 ) diff --git a/vlib/net/http/http.v b/vlib/net/http/http.v index e9f658b7fd..61ffca492a 100644 --- a/vlib/net/http/http.v +++ b/vlib/net/http/http.v @@ -44,6 +44,14 @@ pub: status_code int } +pub fn new_request(method, url, data string) ?Request{ + return Request{ + method: method + url: url + data: data + } +} + pub fn get(url string) ?Response { return fetch_with_method('GET', url, FetchConfig{}) } diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index e0676782e1..ad71e948d2 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -523,7 +523,11 @@ fn (mut c Checker) fail_if_immutable(expr ast.Expr) { match typ_sym.kind { .struct_ { struct_info := typ_sym.info as table.Struct - field_info := struct_info.get_field(it.field_name) + field_info := struct_info.find_field(it.field_name) or { + type_str := c.table.type_to_str(it.expr_type) + c.error('unknown field `${type_str}.$it.field_name`', it.pos) + return + } if !field_info.is_mut { type_str := c.table.type_to_str(it.expr_type) c.error('field `$it.field_name` of struct `${type_str}` is immutable', it.pos)