Comments (3)
@andreasabel If I remove the import, I get:
<interactive>:33:1: error:
Variable not in scope: inferParamSchemaTypes
But I suppose you are right, it would be a more minimal test case without it, since this error is probably only shown because it fails to compile, even though it shouldn't. I just added the import because it wasn't totally clear to me whether the module was automatically imported into the doctest session.
from doctest.
I fetched the module from your reproduction repository:
module Data.UsesList () where
-- $setup
-- >>> import Data.UsesList
-- |
--
-- >>> inferParamSchemaTypes
-- []
inferParamSchemaTypes :: [Int]
inferParamSchemaTypes = (concat :: Foldable f => f [Int] -> [Int]) []
The $setup
step should not be needed here, but I suppose it is needed in your application, right?
from doctest.
My first thought was that this is somehow related to https://gitlab.haskell.org/ghc/ghc/-/issues/20670. However, I can't reproduce this with a regular cabal repl
GHCi session. So not sure.
@andreasabel it doesn't really matter whether the $setup
is needed, or not. If doctest
behaves different from ghci
then that's a bug by definition. We would at least want to understand why that is.
I'll not have time to work on this. If somebody feels inclined to investigate this, then I think you would want to understand what exactly doctest
is doing differently from ghci
and try to reproduce with a plain ghci
session.
Ideally we would want to look at the --verbose
output from doctest
, but I think this is currently not possible, as we can't pass arguments to doctest
via cabal repl
. Maybe a wrapper script would work, not sure. Alternatively, for the purpose of testing, modify the source to always be verbose.
from doctest.
Related Issues (20)
- "not in scope" errors when running with GHC 9 + stack test; redux HOT 20
- Disable test without changing rendering HOT 1
- 0.20.0 doesn't build on ghc 9.4.2 HOT 6
- Invalid platform constants HOT 2
- Extra `type-defaults` warnings (from `OverloadedStrings`) make doctests fail HOT 10
- Build failure on GHC 9.6 HOT 1
- How to pass `--fast` when going via `cabal repl`? HOT 1
- `doctest` in multi-GHC setting HOT 6
- One test fails with GHC 9.6.1 HOT 1
- Ci: ubuntu-18.04 will be discontinued soon HOT 1
- Can I focus doctest on a particular function in a module or can I exclude functions from being tested? HOT 2
- GHC 9.4.5, doctest 0.22.0 `$setup import …` does only work with `cabal repl --with-ghc=doctest` HOT 1
- `cabal test` integration (GHC 9.4.5) HOT 7
- cabal repl --enable-multi-repl --with-ghc=doctest fails with "unrecognized option `-unit'" HOT 4
- Unexpected Kind errors when building tests
- Build failure with GHC 9.6 HOT 1
- Could we have multiline expectations? HOT 1
- Support GHC 9.10 HOT 3
- Add `cabal-doctest`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctest.