`INLINE_UNSAFE_COERCE`
15 Nov
2025
15 Nov
'25
11:42 p.m.
Hi! I recently saw a use of the pragma `INLINE_UNSAFE_COERCE` in the `reflection` package but couldn’t find any documentation for it. What is it for? All the best, Wolfgang
15 Nov
15 Nov
11:44 p.m.
It's a CPP macro, documented in the source code for reflection: -- Due to https://gitlab.haskell.org/ghc/ghc/issues/16893, inlining -- unsafeCoerce too aggressively can cause optimization to become unsound on -- old versions of GHC. As a workaround, we mark unsafeCoerce-using definitions -- as NOINLINE where necessary. -- See https://github.com/ekmett/reflection/issues/47. #if __GLASGOW_HASKELL__ >= 811 # define INLINE_UNSAFE_COERCE INLINE #else # define INLINE_UNSAFE_COERCE NOINLINE #endif
31
Age (days ago)
31
Last active (days ago)
1 comments
2 participants
participants (2)
-
Sam Derbyshire -
Wolfgang Jeltsch