Coq关于Let定义的隐式参数的不一致行为

use*_*348 5 coq

我发现了Coq关于隐式参数的某种不一致行为.

Section foo.
  Let id1 {t : Set} (x : t) := x.
  Let id2 {t : Set} (x : t) : t. assumption. Qed.
  Check id2 (1:nat).
  Check id1 (1:nat). (* Fails with "The term "1:nat" has type "nat" while it is expected to have type "Set"." *)
End foo.
Run Code Online (Sandbox Code Playgroud)

Let定义id1似乎并没有让t隐式的,而当你更换LetDefinition不会发生错误.我有什么不对或这是一个错误吗?

Rob*_*een 4

我认为这是一个错误,是的。在 id1 的情况下,声明隐式参数的符号将被忽略,正如您在Print Implicit id1命令中看到的那样。