瀏覽代碼

[python] minor

Dan Korostelev 10 年之前
父節點
當前提交
0a86dbe33b
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      genpy.ml

+ 3 - 4
genpy.ml

@@ -1856,8 +1856,8 @@ module Generator = struct
 	let gen_class_constructor ctx c cf =
 	let gen_class_constructor ctx c cf =
 		let member_inits = get_members_with_init_expr c in
 		let member_inits = get_members_with_init_expr c in
 		let py_metas = filter_py_metas cf.cf_meta in
 		let py_metas = filter_py_metas cf.cf_meta in
-		begin match member_inits,cf.cf_expr with
-			| _,Some ({eexpr = TFunction f} as ef) ->
+		begin match cf.cf_expr with
+			| Some ({eexpr = TFunction f} as ef) ->
 				let ethis = mk (TConst TThis) (TInst(c,List.map snd c.cl_params)) cf.cf_pos in
 				let ethis = mk (TConst TThis) (TInst(c,List.map snd c.cl_params)) cf.cf_pos in
 				let member_data = List.map (fun cf ->
 				let member_data = List.map (fun cf ->
 					let ef = mk (TField(ethis,FInstance(c,[],cf))) cf.cf_type cf.cf_pos in (* TODO *)
 					let ef = mk (TField(ethis,FInstance(c,[],cf))) cf.cf_type cf.cf_pos in (* TODO *)
@@ -1866,8 +1866,7 @@ module Generator = struct
 				let e = {f.tf_expr with eexpr = TBlock (member_data @ [f.tf_expr])} in
 				let e = {f.tf_expr with eexpr = TBlock (member_data @ [f.tf_expr])} in
 				cf.cf_expr <- Some {ef with eexpr = TFunction {f with tf_expr = e}};
 				cf.cf_expr <- Some {ef with eexpr = TFunction {f with tf_expr = e}};
 			| _ ->
 			| _ ->
-				(* TODO: is this correct? *)
-				()
+				assert false
 		end;
 		end;
 		newline ctx;
 		newline ctx;
 		newline ctx;
 		newline ctx;