diff --git a/compiler/GHC/Runtime/Context.hs b/compiler/GHC/Runtime/Context.hs
index a69e358e32ae309b10a2b6ef6230dc781b80cb67..243624553df7a8b08370046e7370c254a2e6abdb 100644
--- a/compiler/GHC/Runtime/Context.hs
+++ b/compiler/GHC/Runtime/Context.hs
@@ -31,6 +31,7 @@ import GHC.Core.Type
 
 import GHC.Types.Avail
 import GHC.Types.Fixity.Env
+import GHC.Types.Id ( isRecordSelector )
 import GHC.Types.Id.Info ( IdDetails(..) )
 import GHC.Types.Name
 import GHC.Types.Name.Env
@@ -342,7 +343,9 @@ extendInteractiveContextWithIds ictxt new_ids
 shadowed_by :: [Id] -> TyThing -> Bool
 shadowed_by ids = shadowed
   where
-    shadowed id = getOccName id `elemOccSet` new_occs
+    -- Keep record selectors because they might be needed by HasField (#19322)
+    shadowed (AnId id) | isRecordSelector id = False
+    shadowed tything = getOccName tything `elemOccSet` new_occs
     new_occs = mkOccSet (map getOccName ids)
 
 setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext
diff --git a/testsuite/tests/overloadedrecflds/ghci/T19322.script b/testsuite/tests/overloadedrecflds/ghci/T19322.script
new file mode 100644
index 0000000000000000000000000000000000000000..5a9e2c3407dbb8147026b40324c2a8a404f3989c
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/ghci/T19322.script
@@ -0,0 +1,5 @@
+:set -XTypeApplications -XDataKinds
+import GHC.Records
+data X = X { name :: String }
+data Y = Y { name :: String }
+getField @"name" $ X "Tom"
diff --git a/testsuite/tests/overloadedrecflds/ghci/T19322.stdout b/testsuite/tests/overloadedrecflds/ghci/T19322.stdout
new file mode 100644
index 0000000000000000000000000000000000000000..11988ec731d3bb138ab708aefc92e3ab206a71d1
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/ghci/T19322.stdout
@@ -0,0 +1 @@
+"Tom"
diff --git a/testsuite/tests/overloadedrecflds/ghci/all.T b/testsuite/tests/overloadedrecflds/ghci/all.T
index 7bddafd6fbc6031b14e7fe4cf0269bafffda6694..f0d2544c0e9de483811b7df85e5aee72eead6f25 100644
--- a/testsuite/tests/overloadedrecflds/ghci/all.T
+++ b/testsuite/tests/overloadedrecflds/ghci/all.T
@@ -2,3 +2,4 @@ test('duplicaterecfldsghci01', combined_output, ghci_script, ['duplicaterecfldsg
 test('overloadedlabelsghci01', combined_output, ghci_script, ['overloadedlabelsghci01.script'])
 test('T13438', [expect_broken(13438), combined_output], ghci_script, ['T13438.script'])
 test('GHCiDRF', [extra_files(['GHCiDRF.hs']), combined_output], ghci_script, ['GHCiDRF.script'])
+test('T19322', combined_output, ghci_script, ['T19322.script'])