Skip to content

Draft: Use HsExpanded for untyped TH expression splices

Ryan Scott requested to merge wip/T21077 into master

This changes the way that untyped Template Haskell expression splices are handled such that they are folded into the HsExpanded machinery. This, in turn, makes splitHsApps look through TH splices, which fixes #21077 (closed).

TODO RGS: Add a more detailed description of the changes in the commit message, and add more documentation.

TODO RGS: This doesn't quite work yet, as the TH_1tuple test case's error message quality has mysteriously regressed:

=====> 1 of 1 [0, 0, 0]
Actual stderr output differs from expected:
--- th/TH_1tuple.run/TH_1tuple.stderr.normalised        2022-02-14 09:45:59.524219461 -0500
+++ th/TH_1tuple.run/TH_1tuple.comp.stderr.normalised   2022-02-14 09:45:59.524219461 -0500
@@ -4,4 +4,4 @@
       Expected a type, but ‘Solo’ has kind ‘* -> *’
      In an expression type signature: Solo
       In the expression: 1 :: Solo
-      In an equation for ‘y’: y = (1 :: Solo)
+      In the expression: 1 :: Solo
*** unexpected failure for TH_1tuple(normal)
=====> 1 of 1 [0, 1, 0]
Actual stderr output differs from expected:
--- th/TH_1tuple.run/TH_1tuple.stderr.normalised        2022-02-14 09:45:59.872230330 -0500
+++ th/TH_1tuple.run/TH_1tuple.comp.stderr.normalised   2022-02-14 09:45:59.872230330 -0500
@@ -4,4 +4,4 @@
       Expected a type, but ‘Solo’ has kind ‘* -> *’
      In an expression type signature: Solo
       In the expression: 1 :: Solo
-      In an equation for ‘y’: y = (1 :: Solo)
+      In the expression: 1 :: Solo
*** fragile test TH_1tuple(ext-interp) resulted in fail

Merge request reports