Commit 5806d7e5 authored by mnislaih's avatar mnislaih
Browse files

Add test for type refinement with :print in GHCi

parent 7109d1e6
...@@ -33,3 +33,8 @@ instance Show Show1 where ...@@ -33,3 +33,8 @@ instance Show Show1 where
type Just1 = Maybe type Just1 = Maybe
data Unary = Unary
poly :: a -> ()
poly x = seq x ()
\ No newline at end of file
...@@ -17,3 +17,4 @@ test('print014', normal, ghci_script, ['print014.script']) ...@@ -17,3 +17,4 @@ test('print014', normal, ghci_script, ['print014.script'])
test('print015', normal, ghci_script, ['print015.script']) test('print015', normal, ghci_script, ['print015.script'])
test('print016', normal, ghci_script, ['print016.script']) test('print016', normal, ghci_script, ['print016.script'])
test('print017', normal, ghci_script, ['print017.script']) test('print017', normal, ghci_script, ['print017.script'])
test('print018', normal, ghci_script, ['print018.script'])
\ No newline at end of file
-- Test type reconstruction of Constants
-- Found by Bernie Pope
:set -fglasgow-exts
:set -fdebugging
:l ../Test
:break add Test.Test2 40
poly Unary
:p x
:t x
seq x ()
:p x
:t x
x
<interactive>:1:0:
No instance for (Show Unary)
arising from a use of `print' at <interactive>:1:0
Possible fix: add an instance declaration for (Show Unary)
In the expression: print it
In a 'do' expression: print it
Breakpoint set at main:Test.Test2:40:9
Stopped at a breakpoint in ../Test.hs:40. Local bindings in scope:
_result :: (), x :: a
../Test.hs:40:9-16> x = (_t1::a)
../Test.hs:40:9-16> x :: GHC.Base.Unknown
../Test.hs:40:9-16> ()
../Test.hs:40:9-16> x = Unary
../Test.hs:40:9-16> x :: Unary
../Test.hs:40:9-16> ../Test.hs:40:9-16> Returning to normal execution...
()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment