diff options
Diffstat (limited to 'v_windows/v/vlib/v/checker/tests/method_op_alias_err.vv')
-rw-r--r-- | v_windows/v/vlib/v/checker/tests/method_op_alias_err.vv | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/checker/tests/method_op_alias_err.vv b/v_windows/v/vlib/v/checker/tests/method_op_alias_err.vv new file mode 100644 index 0000000..d5b4ecd --- /dev/null +++ b/v_windows/v/vlib/v/checker/tests/method_op_alias_err.vv @@ -0,0 +1,18 @@ +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) +} |