Просмотр исходного кода

[java/cs] Silly Option.get fix

Cauê Waneck 11 лет назад
Родитель
Сommit
8219759912
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      gencommon.ml

+ 5 - 1
gencommon.ml

@@ -9942,8 +9942,12 @@ struct
                   let rec replace_args e = match e.eexpr with
                     | TLocal(v) -> (try
                       let v2,o = List.assq v arg_assoc in
+                      let o = match o with
+                        | None -> raise Not_found
+                        | Some o -> o
+                      in
                       let e = { e with eexpr = TLocal v2; etype = basic.tnull e.etype } in
-                      let const = mk_cast e.etype { e with eexpr = TConst(Option.get o); etype = v.v_type } in
+                      let const = mk_cast e.etype { e with eexpr = TConst(o); etype = v.v_type } in
                       found := true;
                       { e with eexpr = TIf({
                         eexpr = TBinop(Ast.OpEq, e, null e.etype e.epos);