We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc0e117 commit 87c0155Copy full SHA for 87c0155
vlib/v/checker/checker.v
@@ -234,6 +234,17 @@ pub fn (c mut Checker) call_expr(call_expr mut ast.CallExpr) table.Type {
234
call_expr.return_type = method.return_type
235
return method.return_type
236
}
237
+ // TODO: str methods
238
+ if left_type_sym.kind == .map && method_name == 'str' {
239
+ call_expr.receiver_type = table.new_type(c.table.type_idxs['map_string'])
240
+ call_expr.return_type = table.string_type
241
+ return table.string_type
242
+ }
243
+ if left_type_sym.kind == .array && method_name == 'str' {
244
+ call_expr.receiver_type = left_type
245
246
247
248
c.error('unknown method: ${left_type_sym.name}.$method_name', call_expr.pos)
249
return table.void_type
250
0 commit comments