Skip to content

Fix nested type splices in hie files

Matthew Pickering requested to merge wip/21619 into ghc-9.4

The issue is that when we compile a typed bracket we replace the splice with HsSpliced (unTypeCode ...).

Then when computing types for

[|| T $$(...) ||]

GHC is asked to compute the type of T $$(..), which panics because of the bogus type of T applied to HsSpliced, which is not type correct.

The fix is to not attempt to compute the type for HsSpliceE constructors if we come across them as they should have either been already evaluated or lifted into a splice environment.

As part of the patch I made hie files traverse into the splice environments so now we also get type information for things used inside nested splices.

Fixes #21619 (closed)

Edited by Matthew Pickering

Merge request reports