mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
19 lines
251 B
V
19 lines
251 B
V
type Foo = string
|
|
type Foo2 = string
|
|
|
|
fn (f Foo) + (f1 Foo2) Foo2 {
|
|
return Foo2(f + f1)
|
|
}
|
|
|
|
fn (f Foo) * (f1 Foo) Foo {
|
|
return Foo(f + f1)
|
|
}
|
|
|
|
fn main() {
|
|
mut f := Foo('fg')
|
|
f += 'fg'
|
|
f *= Foo2('2')
|
|
f -= Foo('fo')
|
|
println(f)
|
|
}
|