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

v2: short struct init syntax; .xxx enum checks; unions; assert

This commit is contained in:
Alexander Medvednikov
2020-02-26 15:51:05 +01:00
parent c26016b132
commit 857cbfb0d2
10 changed files with 128 additions and 67 deletions

View File

@ -2522,8 +2522,8 @@ fn (p mut Parser) indot_expr() string {
if is_map && typ != 'string' {
p.error('bad element type: expecting `string`')
}
T := p.table.find_type(arr_typ)
if !is_map && !T.has_method('contains') {
arr_typ2 := p.table.find_type(arr_typ)
if !is_map && !arr_typ2.has_method('contains') {
p.error('$arr_typ has no method `contains`')
}
// `typ` is element's type