From ed92925083ebe26e6e3a9cec6b1f3906f9ce2dd1 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 20 Aug 2010 17:14:47 -0700 Subject: Warn when the value of "spawn" is unused, as it's useless --- src/boot/fe/item.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/boot/fe/item.ml b/src/boot/fe/item.ml index 91a0c3dd..e9e0e62a 100644 --- a/src/boot/fe/item.ml +++ b/src/boot/fe/item.ml @@ -508,7 +508,11 @@ and parse_stmts (ps:pstate) : Ast.stmt array = let stmts = expand_tags_to_stmts ps item in spans ps stmts apos (Ast.STMT_decl decl) - | _ -> + | token -> + if token = SPAWN then + prerr_endline ("warning: \"spawn\" with unused result spawns a " ^ + "task that immediately dies"); + let (lstmts, lval) = ctxt "stmt: lval" parse_lval ps in let stmts = match peek ps with -- cgit v1.2.3