-
Notifications
You must be signed in to change notification settings - Fork 14
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
unboxedTupleNameDegree_maybe
doesn't work with GHC 9.10
#213
Comments
We should also check for things like |
This patch changes `unboxedTupleNameDegree_maybe` to handle non-punning tuple names introduced in GHC 9.10, such as `Unit#`, `Solo#`, `Tuple2#`, `Tuple3#`, etc. This is because `''(##)` is now syntactic sugar for `''Unit#`, `''(#,#)` is now syntactic sugar for `Tuple2#`, and so on, so it is important to be able to recognize both forms. Similarly, this patch changes `unboxedSumNameDegree_maybe` to handle `Sum2#`, `Sum3#`, etc. Fixes #213.
This patch changes `unboxedTupleNameDegree_maybe` to handle non-punning tuple names introduced in GHC 9.10, such as `Unit#`, `Solo#`, `Tuple2#`, `Tuple3#`, etc. This is because `''(##)` is now syntactic sugar for `''Unit#`, `''(#,#)` is now syntactic sugar for `Tuple2#`, and so on, so it is important to be able to recognize both forms. Similarly, this patch changes `unboxedSumNameDegree_maybe` to handle `Sum2#`, `Sum3#`, etc. Fixes #213.
Sigh... my testing in #215 wasn't thorough enough. While the example in #213 (comment) is now fixed, making a small tweak to it causes it to fail again: {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UnboxedTuples #-}
module Main where
import Language.Haskell.TH
import Language.Haskell.TH.Desugar
main :: IO ()
main = print $ unboxedTupleNameDegree_maybe $ unboxedTupleTypeName 2
This one is really weird, as it turns out that
See GHC#24750. This is unfortunate from a My hope is that we can fix GHC#24750 upstream so that this example Just Works™. If not, we'll need to add a special case for the (non-existent) |
Among other things, this checks for the program that failed in #213 (comment).
The fix for GHC#24750 is present in GHC 9.10.1, which means that the program in #213 (comment) now works as expected. I've added that program (among others) as regression tests in 8179363. |
This reverts commit 8179363. `haskell-ci` only includes pre-release versions of GHC 9.10, which do not have the necessary fixes needed to make these test cases pass on GHC 9.10.
Among other things, this checks for the program that failed in #213 (comment).
If you run this program with GHC 9.8 or earlier:
You will get this output, as expected:
With GHC 9.10, however, you will instead get:
Ultimately, this happens due to the fact that the names of unboxed tuple type constructors have changed in GHC 9.10. In GHC 9.8, we have:
But in GHC 9.10, we have:
The code for parsing unboxed tuple type constructors, however, assumes that only the former name will be used. We need to update this code to account for the possibility of names like
Tuple2#
.The text was updated successfully, but these errors were encountered: