cgen: add an earlier error, to pin point the use of closures on windows

pull/13422/head
Delyan Angelov 2022-02-09 08:35:11 +02:00
parent dd835acb8d
commit 356ccf247f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 3 additions and 0 deletions

View File

@ -286,6 +286,9 @@ fn (mut g Gen) gen_fn_decl(node &ast.FnDecl, skip bool) {
g.definitions.write_string(s)
g.write(s)
g.nr_closures++
if g.pref.os == .windows {
g.error('closures are not yet implemented on windows', node.pos)
}
}
arg_str := g.out.after(arg_start_pos)
if node.no_body || ((g.pref.use_cache && g.pref.build_mode != .build_module) && node.is_builtin