mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
generics: fix errors & simplify
This commit is contained in:

committed by
Alexander Medvednikov

parent
82d4a731f3
commit
11aaee685a
@ -160,6 +160,12 @@ fn (p mut Parser) name_expr() string {
|
||||
}
|
||||
|
||||
mut name := p.lit
|
||||
|
||||
// generic type check
|
||||
if name in p.cur_fn.dispatch_of.inst.keys() {
|
||||
name = p.cur_fn.dispatch_of.inst[name]
|
||||
}
|
||||
|
||||
// Raw string (`s := r'hello \n ')
|
||||
if (name == 'r' || name == 'c') && p.peek() == .str && p.prev_tok != .dollar {
|
||||
p.string_expr()
|
||||
|
Reference in New Issue
Block a user