Test that hsc2hs works with promoted data constructors
authorAndrew Martin <andrew.thaddeus@gmail.com>
Mon, 21 Jan 2019 21:04:30 +0000 (16:04 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 28 Jan 2019 04:30:47 +0000 (23:30 -0500)
testsuite/tests/hsc2hs/Makefile
testsuite/tests/hsc2hs/T11004.hsc [new file with mode: 0644]
testsuite/tests/hsc2hs/all.T
utils/hsc2hs

index b0751f1..9291e4b 100644 (file)
@@ -41,6 +41,11 @@ T10272:
        '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make $@
        ./$@
 
+.PHONY: T11004
+T11004:
+       LANG=C '$(HSC2HS)' $@.hsc
+       '$(TEST_HC)' $(TEST_HC_OPTS) -c $@.hs
+
 .PHONY: T12504
 T12504:
        '$(HSC2HS)' T12504/path/to/$@.hsc
diff --git a/testsuite/tests/hsc2hs/T11004.hsc b/testsuite/tests/hsc2hs/T11004.hsc
new file mode 100644 (file)
index 0000000..796d35a
--- /dev/null
@@ -0,0 +1,13 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE KindSignatures #-}
+
+module T11004 where
+
+import Data.Kind (Type)
+
+data Foo = Foo' | Bar
+
+data Indexed :: Foo -> Type where
+  IndexedA :: Indexed ' Foo'
+  IndexedB :: Indexed 'Bar
index f237d9a..d42f385 100644 (file)
@@ -14,6 +14,8 @@ test('T4340', [], run_command, ['$MAKE -s --no-print-directory T4340'])
 
 test('T10272', [], run_command, ['$MAKE -s --no-print-directory T10272'])
 
+test('T11004', [], run_command, ['$MAKE -s --no-print-directory T11004'])
+
 test('T12504', [extra_files(['T12504']), ignore_stdout], run_command,
      ['$MAKE -s --no-print-directory T12504'])
 
index a816333..fac8b62 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a816333ae67c54b98cce4ed22621242714967b3e
+Subproject commit fac8b62e48f4c99cfe8f3efff63c8fcd94b2a1d6