Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions haskell-debugger/GHC/Debugger/Stopped/Variables.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ termToVarInfo key term0 = do
-- We only want to return @SpecificVariable@ (which allows expansion) for
-- values with sub-fields or thunks.
varRef <- do
if GHCI.isFullyEvaluatedTerm term ||
-- Even if it is already evaluated, we do want to display a
-- structure as long if it is not a "boring type" (one that does not
if -- Display a structure as long it is not a "boring type" (one that does not
-- provide useful information from being expanded)
-- (e.g. consider how awkward it is to expand Char# 10 and I# 20)
(not isThunk && (isBoringTy ty || not (hasDirectSubTerms term)))
Expand Down
11 changes: 11 additions & 0 deletions test/integration-tests/data/T110/T110.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Main where

data T = T !Int !Int
deriving Show

main = do
y (T 333 34)

y :: T -> IO ()
y t = do
print t
22 changes: 22 additions & 0 deletions test/integration-tests/test/adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,28 @@ describe("Debug Adapter Tests", function () {
const m2 = await getMutVarValue()
assert.strictEqual(m2.value, "True")
})

it('inspect fully evaluated type (issue #110)', async () => {
let config = mkConfig({
projectRoot: "/data/T110",
entryFile: "T110.hs",
entryPoint: "main",
entryArgs: [],
extraGhcArgs: []
})

const expected = { path: config.projectRoot + "/" + config.entryFile, line: 11 }
await dc.hitBreakpoint(config, { path: config.entryFile, line: 11 }, expected, expected);

let locals = await fetchLocalVars();
const tVar = await forceLazy(locals.get('t'));
assert.strictEqual(tVar.value, "T")
const tChild = await expandVar(tVar); // No force needed, is fully evaluated and can expand
const _1Var = await tChild.get('_1');
const _2Var = await tChild.get('_2');
assert.strictEqual(_1Var.value, '333');
assert.strictEqual(_2Var.value, '34');
})
})
describe("Stepping out (step-out)", function () {

Expand Down
Loading