Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #7154: Application: check for sufficient arity before checking ta…
…rget Closes #7154
- Loading branch information
1 parent
d959b19
commit 57c1a84
Showing
3 changed files
with
42 additions
and
0 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,34 @@ | ||
-- Andreas, 2024-03-01, issue #7154 | ||
-- reported and test case by Amy. | ||
-- | ||
-- Regression in 2.5.4 concerning error message | ||
-- given when non-function is applied. | ||
|
||
-- {-# OPTIONS -v tc.term.args:30 #-} | ||
|
||
data Nat : Set where | ||
zero : Nat | ||
suc : Nat → Nat | ||
|
||
record T : Set where | ||
field | ||
f : Nat → Nat | ||
|
||
foo : T | ||
foo .T.f = suc | ||
|
||
test : Nat | ||
test = foo zero | ||
|
||
-- Wrong error (since Agda 2.5.4) | ||
-- | ||
-- T !=< Nat of type Set | ||
-- when checking that the inferred type of an application | ||
-- T | ||
-- matches the expected type | ||
-- Nat | ||
-- | ||
-- Expected error (given until Agda 2.5.3): | ||
-- | ||
-- T should be a function type, but it isn't | ||
-- when checking that zero is a valid argument to a function of type T |
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,3 @@ | ||
Issue7154.agda:21,8-11 | ||
T should be a function type, but it isn't | ||
when checking that zero is a valid argument to a function of type T |