From e1620def9f4e1da73f798f5deb3d8dbe410fce90 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 11 Jul 2011 17:26:40 -0700 Subject: In typeck, check for dynamically sized by-value arguments to thunks A check in trans didn't have a corresponding check in typeck, causing some programs (to wit, compile-fail/chan-parameterized-args.rs - part of this commit) to fail with an assertion failure in trans instead of a type error. Fixed it. In short, arguments that are future thunk arguments (any spawn arguments, and _ arguments in bind) need to either not contain type params or type vars, or be by-reference. Closes #665. --- src/comp/util/common.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/comp/util') diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs index 04243a204c9..c2281739bf5 100644 --- a/src/comp/util/common.rs +++ b/src/comp/util/common.rs @@ -182,6 +182,19 @@ fn any[T](&fn(&T) -> bool f, &vec[T] v) -> bool { ret false; } +tag call_kind { + kind_call; + kind_spawn; + kind_bind; +} + +fn call_kind_str(call_kind c) -> str { + alt (c) { + case (kind_call) { "Call" } + case (kind_spawn) { "Spawn" } + case (kind_bind) { "Bind" } + } +} // // Local Variables: // mode: rust -- cgit 1.4.1-3-g733a5