diff --git a/doctest.cabal b/doctest.cabal
--- a/doctest.cabal
+++ b/doctest.cabal
@@ -1,5 +1,5 @@
 name:             doctest
-version:          0.9.0
+version:          0.9.1
 synopsis:         Test interactive Haskell examples
 description:      The doctest program checks examples in source code comments.
                   It is modeled after doctest for Python
diff --git a/src/Extract.hs b/src/Extract.hs
--- a/src/Extract.hs
+++ b/src/Extract.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving, DeriveFunctor #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, StandaloneDeriving, DeriveFunctor #-}
 module Extract (Module(..), extract) where
 
 import           Prelude hiding (mod, concat)
@@ -185,6 +185,11 @@
 
   -- undefined before type checking
   `extQ` (ignore :: Selector Coercion)
+
+#if __GLASGOW_HASKELL__ >= 706
+  -- hswb_kvs and hswb_tvs may be error thunks
+  `extQ` (ignore :: Selector (HsWithBndrs [LHsType RdrName]))
+#endif
   )
   where
     fromLHsDecl :: Selector (LHsDecl RdrName)
