Describe the bug
I have .hsc file, it doesn't compile from clean build. I edit the file fixing the error but it still doesn't compile with the same error because cabal doesn't re-run preprocessing since #10534.
To Reproduce
Please refer to readme at https://github.com/random-random-stuff/simple-cabal-project-with-hsc.
- Initial version doesn’t compile
$ cabal build
...
[1 of 2] Compiling Bar.Baz
src/Bar/Baz.hsc:18:9: error: [GHC-25897]
• Couldn't match expected type ‘a’ with actual type ‘CDoubleTyp’
Type synonyms expanded:
Expected type: a
Actual type: Double
‘a’ is a rigid type variable bound by
the type signature for:
baz :: forall a. Double -> a
at src/Bar/Baz.hsc:17:1-18
• In the expression: sinFunc x
In an equation for ‘baz’: baz x = sinFunc x
• Relevant bindings include
baz :: Double -> a (bound at src/Bar/Baz.hsc:18:1)
|
18 | baz x = sinFunc x
| ^^^^^^^^^
...
- Fix
$ sed -i -re 's,baz :: Double -> a,baz :: Double -> CDoubleTyp,' src/Bar/Baz.hsc
- Try to build again
cabal build
...
[1 of 2] Compiling Bar.Baz
src/Bar/Baz.hsc:18:9: error: [GHC-25897]
• Couldn't match expected type ‘a’ with actual type ‘CDoubleTyp’
Type synonyms expanded:
Expected type: a
Actual type: Double
‘a’ is a rigid type variable bound by
the type signature for:
baz :: forall a. Double -> a
at src/Bar/Baz.hsc:17:1-18
• In the expression: sinFunc x
In an equation for ‘baz’: baz x = sinFunc x
• Relevant bindings include
baz :: Double -> a (bound at src/Bar/Baz.hsc:18:1)
|
18 | baz x = sinFunc x
| ^^^^^^^^^
...
Same error because cabal didn’t re-run preprocessing on src/Bar/Baz.hsc
Just before the PR it was OK, but now cabal sees that Baz.hs file and doesn't check that its source is newer and it should be regenerated.
Expected behavior
Modification of .hsc file leads to regeneration of the corresponding .hs file.
System information
- Operating system Linux
cabal version - master
ghc version - 9.14
Describe the bug
I have
.hscfile, it doesn't compile from clean build. I edit the file fixing the error but it still doesn't compile with the same error because cabal doesn't re-run preprocessing since #10534.To Reproduce
Please refer to readme at https://github.com/random-random-stuff/simple-cabal-project-with-hsc.
Same error because cabal didn’t re-run preprocessing on
src/Bar/Baz.hscJust before the PR it was OK, but now cabal sees that
Baz.hsfile and doesn't check that its source is newer and it should be regenerated.Expected behavior
Modification of
.hscfile leads to regeneration of the corresponding.hsfile.System information
cabalversion - masterghcversion - 9.14