-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Description
I was surprised to see that giving no val declaration isn't equivalent to giving one without refinements or effects, as illustrated in the example below.
module M
#set-options "--log_types --print_effect_args"
assume new type p: int -> Type0
assume val f: n:int{p n} -> int
//The three declarations below are equivalent and with all of them g fails to typecheck
//val g: unit -> int
//val g: unit -> ML int
//val g: unit -> ALL int (fun post _ -> forall a h. post a h)
//Inferred type and effect when no declaration is given; with it g typechecks
//val g: unit -> ALL int (fun post _ -> p 0 /\ (forall a h. post a h))
let g () = f 0This isn't the case with --stratified. It was confusing for me and at least one other person run into this problem when playing with ex1a-safe-read-write.fst in the tutorial.
Is this really the behaviour we want?
If we prefer to have a consistent behaviour, which one to choose?