You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Just having the if works, but adding the else results in a warning and ignoring the imports altogether.
System information
cabal 3.6.2.0
Additional context
For context, I am trying to work around the no multiple home units limitation. I am doing this because I want to be able to quickly run unit tests while editing both my lib and test units, i.e.:
reload/recompile fast when I make changes to lib
reload/recompile fast when I make changes to test
run unit tests by reloading the test Main file and running it
I was able to accomplish this by:
adding src to the test stanza's hs-source-dirs
copy over all build-depends from lib to test (they were transitive dependencies anyway)
and accomplish all I needed (i.e., fast reloads, run tests).
The problem now becomes, I would like to clean this up:
I dislike repeating the build-depends
I would rather have a flag that does the above and the addition to the tests' hs-source-dirs
So the way I tried was:
create a common stanza with the lib's build-depends
create a new flag
use that flag in test
The only problem is, the test stanza already has some common imports, so I can't merge them. I also can't move the if/else to the stanza, because I specifically need it to be always imported in lib but only when flag is set to `test.
The text was updated successfully, but these errors were encountered:
Describe the bug
I would like to be able to use
else
clauses inimport-if
statements.Related issue: #5563
Related PR: #5566
To Reproduce
A reasonably short repro is
Expected behavior
Just having the
if
works, but adding theelse
results in a warning and ignoring the imports altogether.System information
Additional context
For context, I am trying to work around the no multiple home units limitation. I am doing this because I want to be able to quickly run unit tests while editing both my lib and test units, i.e.:
I was able to accomplish this by:
src
to the test stanza'shs-source-dirs
build-depends
fromlib
totest
(they were transitive dependencies anyway)The above allows me to run something like
$ ghcid -a -c "cabal repl my-test-stanza -f -O0" --test Main.main
and accomplish all I needed (i.e., fast reloads, run tests).
The problem now becomes, I would like to clean this up:
build-depends
hs-source-dirs
So the way I tried was:
build-depends
The only problem is, the
test
stanza already has some common imports, so I can't merge them. I also can't move the if/else to the stanza, because I specifically need it to be always imported inlib
but only whenflag
is set to `test.The text was updated successfully, but these errors were encountered: