GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:50:31Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/7287Primops in RULES generate warnings2019-07-07T18:50:31Zrl@cse.unsw.edu.auPrimops in RULES generate warnings```
import GHC.Prim
{-# RULES
"int2Word#/word2Int#" forall x. int2Word# (word2Int# x) = x
#-}
```
produces the following warning:
```
Rule "int2Word#/word2Int#" may never fire
because `int2Word#' might inline first
Pr...```
import GHC.Prim
{-# RULES
"int2Word#/word2Int#" forall x. int2Word# (word2Int# x) = x
#-}
```
produces the following warning:
```
Rule "int2Word#/word2Int#" may never fire
because `int2Word#' might inline first
Probable fix: add an INLINE[n] or NOINLINE[n] pragma on `int2Word#'
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Primops in RULES generate warnings","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\nimport GHC.Prim\r\n\r\n{-# RULES\r\n\r\n\"int2Word#/word2Int#\" forall x. int2Word# (word2Int# x) = x\r\n\r\n #-}\r\n}}}\r\n\r\nproduces the following warning:\r\n\r\n{{{\r\n Rule \"int2Word#/word2Int#\" may never fire\r\n because `int2Word#' might inline first\r\n Probable fix: add an INLINE[n] or NOINLINE[n] pragma on `int2Word#'\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.6.2Simon Peyton JonesSimon Peyton Jones