Browse Source

fixed cast type parameter

Nicolas Cannasse 17 years ago
parent
commit
d15b0925ce
1 changed files with 2 additions and 2 deletions
  1. 2 2
      typer.ml

+ 2 - 2
typer.ml

@@ -1247,14 +1247,14 @@ and type_expr ctx ?(need_val=true) (e,p) =
 		let tname = (match follow t with
 		| TInst (_,params) | TEnum (_,params) ->
 			List.iter (fun pt ->
-				if pt != t_dynamic then error "Cast class parameter must be Dynamic" p;
+				if follow pt != t_dynamic then error "Cast type parameters must be Dynamic" p;
 			) params;
 			(match follow t with
 			| TInst (c,_) -> c.cl_path
 			| TEnum (e,_) -> e.e_path
 			| _ -> assert false);
 		| _ ->
-			error "Cast type must be a class" p
+			error "Cast type must be a class or an enum" p
 		) in
 		let make_type (path,name) =
 			match path with