diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Revision history for auto-split
 
+## 0.1.0.5 -- 2025-09-07
+
+* Fix a bug with out of scope constructors
+
 ## 0.1.0.4 -- 2025-03-29
 
 * Add FIELDS pattern for autocompletion of missing record fields
diff --git a/auto-split.cabal b/auto-split.cabal
--- a/auto-split.cabal
+++ b/auto-split.cabal
@@ -1,6 +1,6 @@
 cabal-version:      3.0
 name:               auto-split
-version:            0.1.0.4
+version:            0.1.0.5
 synopsis: Case splitting plugin
 description: A GHC plugin that performs automatic case splitting
 license:            BSD-3-Clause
diff --git a/src/AutoSplit/Shared.hs b/src/AutoSplit/Shared.hs
--- a/src/AutoSplit/Shared.hs
+++ b/src/AutoSplit/Shared.hs
@@ -50,13 +50,15 @@
       | Just gre <- find greMatches gres
       , rdrName : _ <- Ghc.greRdrNames gre
       -> rdrName
+    Just _ ->
+      Ghc.mkRdrQual (Ghc.mkModuleName "NOT_IN_SCOPE") occName
     Nothing
       | not (Ghc.isWiredInName n)
       , not (Ghc.isBuiltInSyntax n)
       , not (Ghc.isSystemName n)
       , not (Ghc.isInternalName n)
       -> Ghc.mkRdrQual (Ghc.mkModuleName "NOT_IN_SCOPE") occName
-    _ -> Ghc.nameRdrName n
+    Nothing -> Ghc.nameRdrName n -- built in thing that doesn't need to be imported
   where
     occName = Ghc.getOccName n
     greMatches gre = Ghc.greToName gre == n
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -31,6 +31,7 @@
     , testCase "17" $ runTest "Case17.hs"
     , testCase "18" $ runTest "Case18.hs"
     , testCase "19" $ runTest "Case19.hs"
+    , testCase "20" $ runTest "Case20.hs"
     ]
   , testGroup "lambda case"
     [ testCase "1" $ runTest "LambdaCase1.hs"
