parser: fix x.function_pointer()
parent
2096018b00
commit
a38a0f4fb7
|
@ -2009,7 +2009,7 @@ pub:
|
||||||
if base.starts_with('fn ') && p.peek() == .lpar {
|
if base.starts_with('fn ') && p.peek() == .lpar {
|
||||||
tmp_typ := p.table.find_type(base)
|
tmp_typ := p.table.find_type(base)
|
||||||
mut f := tmp_typ.func
|
mut f := tmp_typ.func
|
||||||
p.gen('.$field.name')
|
p.gen('$dot$field.name')
|
||||||
p.gen('(')
|
p.gen('(')
|
||||||
p.check(.name)
|
p.check(.name)
|
||||||
p.fn_call_args(mut f)
|
p.fn_call_args(mut f)
|
||||||
|
|
|
@ -157,6 +157,9 @@ fn test_fn_type_call() {
|
||||||
|
|
||||||
st := MySt{f:test}
|
st := MySt{f:test}
|
||||||
assert st.f(10) == 1010
|
assert st.f(10) == 1010
|
||||||
|
|
||||||
|
st1 := &MySt{f:test}
|
||||||
|
assert st1.f(10) == 1010
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue