Make unboxedTuple{Type,Data}Name support 0- and 1-tuples
authorRyan Scott <ryan.gl.scott@gmail.com>
Wed, 14 Dec 2016 21:47:53 +0000 (16:47 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 15 Dec 2016 15:42:25 +0000 (10:42 -0500)
commit9550b8d810c3ce9fcf3419da367041124e2673de
treee9abfa4cbc4b90364a22d4f4c528c43561eb0dc6
parentfe5d68ad1ae5faaaf786f334edf251295195ef6d
Make unboxedTuple{Type,Data}Name support 0- and 1-tuples

Previously, these functions were hardcoded so as to always `error`
whenever given an argument of 0 or 1. This restriction can be lifted
pretty easily, however.

This requires a slight tweak to `isBuiltInOcc_maybe` in `TysWiredIn` to
allow it to recognize `Unit#` (which is the hard-wired `OccName` for
unboxed 1-tuples).

Fixes #12977.

Test Plan: make test TEST=12977

Reviewers: austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2847

GHC Trac Issues: #12977
compiler/prelude/TysWiredIn.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/changelog.md
testsuite/tests/th/T12977.hs [new file with mode: 0644]
testsuite/tests/th/all.T