diff options
Diffstat (limited to 'v_windows/v/old/vlib/v/fmt/tests/import_selective_input.vv')
-rw-r--r-- | v_windows/v/old/vlib/v/fmt/tests/import_selective_input.vv | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/v_windows/v/old/vlib/v/fmt/tests/import_selective_input.vv b/v_windows/v/old/vlib/v/fmt/tests/import_selective_input.vv new file mode 100644 index 0000000..12a0812 --- /dev/null +++ b/v_windows/v/old/vlib/v/fmt/tests/import_selective_input.vv @@ -0,0 +1,71 @@ +import math { max, + min, +} + +import cli { Command } +import math.complex { complex, Complex } +import os { + input, user_os, file_ext } + +import mod { + Unused, + StructEmbed, StructField, StructRefField + StructMethodArg, + StructMethodRet + + InterfaceField, + InterfaceMethodArg, + InterfaceMethodRet, + + FnArg, + FnRet, + + RightOfIs, + RightOfAs, + + Enum +} + +struct Struct { + StructEmbed + v StructField + ref &StructRefField +} + +fn (s Struct) method(v StructMethodArg) StructMethodRet { + return {} +} + +interface Interface { + v InterfaceField + f(InterfaceMethodArg) InterfaceMethodRet +} + +fn f(v FnArg) FnRet { + if v is RightOfIs {} + _ = v as RightOfAs + + println(Enum.val) + + return {} +} + +struct App { + command &Command +} + +struct MyCommand { + Command +} + +fn imaginary(im f64) Complex { + return complex(0, im) +} + +fn main() { + println(max(0.1, 0.2)) + println(min(0.1, 0.2)) + println(user_os()) + println(file_ext('main.v')) + println(imaginary(1)) +} |