mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: replace generic <> with [] - part 2 (#16536)
This commit is contained in:
@@ -125,7 +125,7 @@ fn main() {
|
||||
}
|
||||
// webhook server mode
|
||||
if flag_options.serve {
|
||||
vweb.run<WebhookServer>(&WebhookServer{}, flag_options.port)
|
||||
vweb.run[WebhookServer](&WebhookServer{}, flag_options.port)
|
||||
} else {
|
||||
// cmd mode
|
||||
mut gen_vc := new_gen_vc(flag_options)
|
||||
|
||||
@@ -336,7 +336,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
|
||||
}
|
||||
tls_bench.no_cstep = true
|
||||
tls_bench.njobs = ts.benchmark.njobs
|
||||
mut relative_file := os.real_path(p.get_item<string>(idx))
|
||||
mut relative_file := os.real_path(p.get_item[string](idx))
|
||||
mut cmd_options := [ts.vargs]
|
||||
mut run_js := false
|
||||
|
||||
|
||||
@@ -109,23 +109,23 @@ fn defer_fn() {
|
||||
}
|
||||
|
||||
// generic function
|
||||
fn g_fn<T>(p T) T {
|
||||
fn g_fn[T](p T) T {
|
||||
return p
|
||||
}
|
||||
|
||||
// generic struct
|
||||
struct GenericStruct<T> {
|
||||
struct GenericStruct[T] {
|
||||
point Point
|
||||
mut:
|
||||
model T
|
||||
}
|
||||
|
||||
// generic interface
|
||||
interface Gettable<T> {
|
||||
interface Gettable[T] {
|
||||
get() T
|
||||
}
|
||||
|
||||
// generic sumtype
|
||||
struct None {}
|
||||
|
||||
type MyOption<T> = Error | None | T
|
||||
type MyOption[T] = Error | None | T
|
||||
|
||||
@@ -228,7 +228,7 @@ fn (t Tree) token_node(tok_kind token.Kind) &Node {
|
||||
}
|
||||
|
||||
// enum type node
|
||||
fn (t Tree) enum_node<T>(value T) &Node {
|
||||
fn (t Tree) enum_node[T](value T) &Node {
|
||||
return t.string_node('enum:${int(value)}(${value})')
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ fn (vd VDoc) work_processor(mut work sync.Channel, mut wg sync.WaitGroup) {
|
||||
|
||||
fn (vd VDoc) render_parallel(out Output) {
|
||||
vjobs := runtime.nr_jobs()
|
||||
mut work := sync.new_channel<ParallelDoc>(u32(vd.docs.len))
|
||||
mut work := sync.new_channel[ParallelDoc](u32(vd.docs.len))
|
||||
mut wg := sync.new_waitgroup()
|
||||
for i in 0 .. vd.docs.len {
|
||||
p_doc := ParallelDoc{vd.docs[i], out}
|
||||
|
||||
Reference in New Issue
Block a user