Skip to content

Check foreign imports using the GHC stage restriction

Ryan Scott requested to merge wip/T25189 into master

GHC was applying the stage restriction to top-level functions, class methods, and other sorts of identifiers, but it was not applying them to foreign imports. The reason is because tcTopSrcDecls was not populating thr tcl_th_bndrs of the TcLclEnv with foreign import names, so the GHC stage restriction would skip over any foreign import names. This adds the necessary plumbing to ensure that the tcl_th_bndrs cover foreign imports as well, thereby ensuring that the GHC stage restriction check applies to them as well.

Fixes #25189.

Merge request reports

Loading