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

Bad error message when missing top-level signature #19

Open
arendsee opened this issue Feb 25, 2024 · 0 comments
Open

Bad error message when missing top-level signature #19

arendsee opened this issue Feb 25, 2024 · 0 comments
Assignees

Comments

@arendsee
Copy link
Collaborator

In the flu case study of commit d6c2aba, in the function definition:

plotCladeTree :: FluConfig -> RootedTree Str e (a, Clade) -> ()
plotCladeTree config = plotTree config@treefile . mapLeaf setLeafName 

where plotTree, mapLeaf, and setLeafName have the following signatures:

plotTree :: Filename -> RootedTree n Real Str -> ()
setLeafName :: (JsonObj, Sequence) -> Str
mapLeaf :: (l -> l') -> RootedTree n e l -> RootedTree n e l'

Removal of the signature causes the following error to be raised the following error:

morloc: Bug in expressPolyExpr - this should be unreachable

Obviously this case is not unreachable. The type signature ought to be mostly inferrable. The sticky bit is the record FluConfig. All that can be inferred without that annotation is that some record with the field treefile :: Filename exists. Currently partially inferred types like this are not supported, so an error should be raised here. This is a user error. The problem is simply that a type annotation is required. The error message should indicate this.

@arendsee arendsee self-assigned this Feb 25, 2024
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