v2 / vlib / v / fmt / tests / old_attrs_to_new_expected.vv
26 lines · 21 sloc · 511 bytes · f7b9e4eafd25974e1e8d5dc60d799de8d75ce1d4
Raw
1module main
2
3import os
4
5@[export: 'Java_io_vlang_V_callStaticMethods']
6@[tom: 'jerry']
7@[direct_array_access; inline; unsafe]
8fn heavily_tagged() {}
9
10// a console attribute to force-open a console for easier diagnostics on windows
11// also it's not safe to use
12@[a_console; unsafe]
13fn dangerous_console() {}
14
15@[attribute_on_struct]
16struct Generic[T] {
17 x T @[required]
18}
19
20struct Abc {
21 f fn () int = fn () int {
22 return 456 + os.args.len
23 } @[atr1; atr2]
24 //
25 g Generic[int] = Generic[int]{123} @[atr3; atr4]
26}
27