Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid FC of Pi-types #3417

Open
spcfox opened this issue Nov 18, 2024 · 0 comments
Open

Invalid FC of Pi-types #3417

spcfox opened this issue Nov 18, 2024 · 0 comments

Comments

@spcfox
Copy link
Contributor

spcfox commented Nov 18, 2024

FC of Pi-type with named argument points to the name of the argument instead of whole type.

Steps to Reproduce

Main> getFC `((Nat) -> Nat)
MkFC (Virtual Interactive) (0, 8) (0, 20)
Main> getFC `((arg : Nat) -> Nat)
MkFC (Virtual Interactive) (0, 9) (0, 12)

This is the reason for the bad error messages. Example:

unnamed : ()
unnamed = (Nat) -> Nat

named : ()
named = (arg : Nat) -> Nat
Error: While processing right hand side of unnamed. When unifying:
    Type
and:
    ()
Mismatch between: Type and ().

BadMessages:4:11--4:23
 1 | module BadMessages
 2 | 
 3 | unnamed : ()
 4 | unnamed = (Nat) -> Nat
               ^^^^^^^^^^^^

Error: While processing right hand side of named. When unifying:
    Type
and:
    ()
Mismatch between: Type and ().

BadMessages:7:10--7:13
 3 | unnamed : ()
 4 | unnamed = (Nat) -> Nat
 5 | 
 6 | named : ()
 7 | named = (arg : Nat) -> Nat
              ^^^

Expected Behavior

FC points to whole type

Observed Behavior

FC points to the name of the argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant