Skip to content

defineNoPrint cannot use unqualified return/seq/IO #236

@alt-romes

Description

@alt-romes

When evaluating expressions on the debuggee, we cannot assume anything about the environment in which the expressions will be run.
Specifically, whatever modules were imported at that module will be available when interpreting an expression like

let noPrintConstant x = x `seq` return () :: IO ()

The problem is that seq or return or IO could be ambiguous.

I ran into this when debugging the debugger itself:

[54 of 55] Compiling Main             ( /Users/romes/Developer/ghc-debugger/hdb/Main.hs, interpreted )[haskell-debugger-0.12.3.0-inplace-hdb]
<interactive>:1:33: error: [GHC-87543]
    Ambiguous occurrence `return'.
    It could refer to
       either `Prelude.return',
              imported from `Prelude'
              (and originally defined in `GHC.Internal.Base'),
           or `GHC.Debugger.Runtime.Eval.RemoteExpr.return',
              defined at /Users/romes/Developer/ghc-debugger/haskell-debugger/GHC/Debugger/Runtime/Eval/RemoteExpr.hs:127:1.

The solution is simple, just qualify the names in the interactive expression

I've got a patch already, pushing soon

CC @Saizan

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions