forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ltac2: incorporate type information in a nicer order for let rec
Fix coq#15687
- Loading branch information
1 parent
de18f22
commit 3cc8cbb
Showing
3 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
File "./output/bug_15687.v", line 7, characters 11-16: | ||
The command has indeed failed with message: | ||
This expression has type int -> 'a but an expression was expected of type | ||
int | ||
File "./output/bug_15687.v", line 10, characters 11-16: | ||
The command has indeed failed with message: | ||
This expression has type int -> bool but an expression was expected of type | ||
int | ||
File "./output/bug_15687.v", line 18, characters 55-65: | ||
The command has indeed failed with message: | ||
This expression should not be a function, the expected type is | ||
int. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Require Import Ltac2.Ltac2. | ||
|
||
Fail Ltac2 rec foo(i: int)(j: int) := | ||
foo i (bar j) | ||
(*^^^*) | ||
with bar(i: int) := | ||
Int.add (foo i (*i*)) 1. | ||
|
||
Fail Ltac2 rec bar(i: int) := | ||
Int.add (foo i (*i*)) 1 | ||
with foo(i: int)(j: int) : bool := | ||
foo i (bar j). | ||
|
||
(* The location is not great if we write "fun x y => x" but that's | ||
unrelated to what we're testing here. | ||
Also the toplevel "Ltac2 rec foo :=" is currently not smart enough to recognize a function with type annotation. *) | ||
Fail Ltac2 foo := let rec foo : int -> int := fun x => fun y => x in foo. |