1
0
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:
joe-conigliaro
2019-11-30 00:46:43 +11:00
committed by Alexander Medvednikov
parent 82d4a731f3
commit 11aaee685a
5 changed files with 84 additions and 110 deletions

View File

@ -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()