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

generics: generic methods, cast to T

This commit is contained in:
Simon Heuser
2019-10-25 20:32:27 +02:00
committed by Alexander Medvednikov
parent 7d02eccbce
commit 280c7d396c
4 changed files with 75 additions and 26 deletions

View File

@ -1617,7 +1617,10 @@ fn (p mut Parser) name_expr() string {
}
p.gen('(')
mut typ := name
p.cast(name)
if typ in p.cur_fn.dispatch_of.inst.keys() {
typ = p.cur_fn.dispatch_of.inst[typ]
}
p.cast(typ)
p.gen(')')
for p.tok == .dot {
typ = p.dot(typ, ph)