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

Use info tables to get context #46

Merged
merged 3 commits into from
Jan 26, 2024
Merged

Use info tables to get context #46

merged 3 commits into from
Jan 26, 2024

Conversation

coot
Copy link
Contributor

@coot coot commented Jan 26, 2024

Since GHC-9.4 we can use GHC.InfoProv.whereFrom to get source
information of terms. It is actually available in GHC-9.2 too, but we don't support the earlier version of it.

@coot coot linked an issue Jan 26, 2024 that may be closed by this pull request
coot added 3 commits January 26, 2024 16:07
Since `GHC-9.2` we can use `GHC.InfoProv.whereFrom` to get source
information of terms.
* Allow `containers-0.7`.
@coot coot force-pushed the coot/info-tables branch from 81530aa to 202179e Compare January 26, 2024 15:09
@coot coot requested a review from bolt12 January 26, 2024 15:11
@coot coot added this pull request to the merge queue Jan 26, 2024
Merged via the queue into master with commit 6e0b3fd Jan 26, 2024
7 checks passed
@coot coot deleted the coot/info-tables branch January 26, 2024 15:28
@coot
Copy link
Contributor Author

coot commented Jan 26, 2024

This is the new output vs the default one which I got by running the test suite with -finfo-table-map -fdistinct-constructor-tables:

            176 ┃       Hedgehog.diff isNF compareInfo (modelUnexpected [] m)
                ┃       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                ┃       │ ━━━ Failed (- lhs) (+ rhs) ━━━
                ┃       │   Just
                ┃       │ -   ThunkInfo
                ┃       │ -     { thunkContext =
                ┃       │ -         [ "fromModel :: Int @ test/Test/NoThunks/Class.hs:195:53-84" ]
                ┃       │ -     }
                ┃       │ +   [ "Int" ]

@coot
Copy link
Contributor Author

coot commented Jan 27, 2024

I modified the output to:

            179 ┃       Hedgehog.diff isNF compareInfo (modelUnexpected [] m)
                ┃       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                ┃       │ ━━━ Failed (- lhs) (+ rhs) ━━━
                ┃       │   Just
                ┃       │ -   ThunkInfo
                ┃       │ -     { thunkInfo =
                ┃       │ -         Right "fromModel :: Int @ test/Test/NoThunks/Class.hs:198:53-84"
                ┃       │ -     }
                ┃       │ +   [ "Int" , "field2" , "Record" ]

e.g. only show the location of the thunk itself rather than all the indirections. See #47.

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.

Report source locations in ghc 9.2
2 participants