GhcPlugins: Fix lookup of TH names

Authored by bgamari on Jan 19 2019, 12:59 PM.

Description

GhcPlugins: Fix lookup of TH names

Previously thNameToGhcName was calling lookupOrigNameCache directly, which
failed to handle the case that the name wasn't already in the name cache. This
happens, for instance, when the name was in scope in a plugin being used during
compilation but not in scope in the module being compiled. In this case we the
interface file containing the name won't be loaded and lookupOrigNameCache
fails. This was the cause of Trac #16104.

The solution is simple: use the nicely packaged lookupOrigIO instead.

(cherry picked from commit 0d9f105ba423af4f2ca215a18d04d4c8e2c372a8)

Details

Committed
bgamariFeb 10 2019, 6:56 PM
Parents
rGHC8c2dbc161572: testsuite: Add test for #16104
Branches
Unknown
Tags
Unknown