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

Expand type aliases in dependent pairs #2445

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

facundominguez
Copy link
Collaborator

Before this patch, the following test would fail

{-@ type Id = {v:Int | v >= 0} @-}
{-@ lemma :: l:Id -> (id::Id, { true }) @-}
lemma :: Int -> (Int, ())
lemma x = (x, ())

with

Test.hs:6:27: error:
    Uh oh.
    CallStack (from HasCallStack):
  panic, called at src/Language/Haskell/Liquid/Bare/Resolve.hs:972:37 in liquidhaskell-boot-0.9.10.1-inplace:Language.Haskell.Liquid.Bare.Resolve
    lookupTyThing: cannot resolve a LHRLogic name "Id"
  |
6 | {-@ lemma :: l:Id -> (id::Id, { true }) @-}
  |                           ^^

@@ -410,7 +420,7 @@ expandBareType rtEnv _ = go
go t@RHole{} = t
go t@RVar{} = t
go t@RExprArg{} = t
goRef (RProp ss t) = RProp ss (go t)
goRef (RProp ss t) = RProp (map (expand rtEnv l <$>) ss) (go t)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summoning @nikivazou, in case there is a good reason why types in ss were not expanded.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason that I can remember!

@facundominguez facundominguez force-pushed the fd/expand-aliases-dependent-pairs branch from d0444de to f22e30a Compare November 20, 2024 17:57
@facundominguez
Copy link
Collaborator Author

cc @clayrat

@nikivazou nikivazou merged commit b7c7959 into develop Nov 21, 2024
4 checks passed
@nikivazou nikivazou deleted the fd/expand-aliases-dependent-pairs branch November 21, 2024 13:09
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

Successfully merging this pull request may close these issues.

2 participants