Skip to content

Commit

Permalink
spare __init__ from the precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif committed Oct 15, 2022
1 parent 8bb8858 commit ed66529
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/viper/trans.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ let rec extract_invariants : item list -> (par -> invariants -> invariants) = fu
let rec adorn_invariants (is : par -> invariants -> invariants) = function
| [] -> []
| { it = MethodI (d, (self :: _ as i), o, r, e, b); _ } as m :: p ->
let m = { m with it = MethodI (d, i, o, is self r, is self e, b) } in
let pre_is = function
| "__init__" -> fun _ l -> l
| _ -> is in
let m = { m with it = MethodI (d, i, o, pre_is d.it self r, is self e, b) } in
m :: adorn_invariants is p
| i :: p -> i :: adorn_invariants is p

Expand Down

0 comments on commit ed66529

Please sign in to comment.