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

Strange behaviour with reflected primitives #2471

Open
AlecsFerra opened this issue Jan 13, 2025 · 10 comments
Open

Strange behaviour with reflected primitives #2471

AlecsFerra opened this issue Jan 13, 2025 · 10 comments

Comments

@AlecsFerra
Copy link
Contributor

This code passes verification:

{-# OPTIONS_GHC -fplugin=LiquidHaskell #-}

{-@ LIQUID "--ple"               @-}
{-@ LIQUID "--reflection"        @-}

module Reg where

{-@ reflect || @-}

note = True || False

But if the function note is commented out we get the following error:

test/Reg.hs:8:13: error:
    Cannot lift Haskell function `||` to logic
    Symbol exists but is not defined in the current file, and no unfolding is available in the interface files

I'm pretty sure this is a regression as before it was working

@AlecsFerra
Copy link
Contributor Author

My guess is that this is caused by the new logical aliases thing.
cc @clayrat

@AlecsFerra
Copy link
Contributor Author

With commit 791567f5cf468ab786abd982d65c51ae7914cbcd it works as expected

@facundominguez
Copy link
Collaborator

I cannot reproduce this. Maybe it is worth adding the test to the testsuite.

@AlecsFerra
Copy link
Contributor Author

I cannot reproduce this. Maybe it is worth adding the test to the testsuite.

Also Alex is having some issue in reproducing the issue

The steps are clone liquid Haskell
Create test/Reg.hs

cabal build && cabal exec ghc -- test/Reg.hs

@clayrat
Copy link
Contributor

clayrat commented Jan 13, 2025

Yes, I also can't reproduce it either by running it as a standalone file or as a mini-project.

@clayrat
Copy link
Contributor

clayrat commented Jan 13, 2025

Ok, after running cabal update, I can get it too.

The error also goes away if you add import GHC.Classes (and remove note), so I guess some import logic isn't firing properly now.

@clayrat
Copy link
Contributor

clayrat commented Jan 13, 2025

It does reproduce for me on 791567f this way however as well, so it looks unrelated to the aliases PR.

@AlecsFerra
Copy link
Contributor Author

Ok its not a regression and just a bug

@clayrat
Copy link
Contributor

clayrat commented Jan 13, 2025

Yes, the bug seems to manifest itself as far back as a5acdd3, so I'm inclined to think it's more or less always been there.

@AlecsFerra
Copy link
Contributor Author

I guess it's related to this

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

3 participants