Commit 22bcd5e6 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Wibbles following fix to Trac #8278

The error message for ghci052 and ghci053 are (still)
terrible, because there is shadowing going on in the
interactive context.  But that's a separate matter.
parent bc5f6f54
--Testing data type and constructor shadowing with functions
-- Very unsatisfactory error messages
data Planet = Mercury | Venus | Earth
let pn Mercury = "M" ; pn Venus = "V" ; pn Earth = "E"
pn Mercury
......
<interactive>:7:4:
<interactive>:9:4:
Couldn't match expected type ‛main::Interactive.Planet’
with actual type ‛Planet’
NB: ‛main::Interactive.Planet’ is defined in ‛:Interactive’
‛Planet’ is defined in ‛:Interactive’
In the first argument of ‛pn’, namely ‛Mercury’
In the expression: pn Mercury
<interactive>:8:4:
<interactive>:10:4:
Couldn't match expected type ‛main::Interactive.Planet’
with actual type ‛Planet’
NB: ‛main::Interactive.Planet’ is defined in ‛:Interactive’
‛Planet’ is defined in ‛:Interactive’
In the first argument of ‛pn’, namely ‛Venus’
In the expression: pn Venus
<interactive>:9:4:
<interactive>:11:4:
Couldn't match expected type ‛main::Interactive.Planet’
with actual type ‛Planet’
NB: ‛main::Interactive.Planet’ is defined in ‛:Interactive’
‛Planet’ is defined in ‛:Interactive’
In the first argument of ‛pn’, namely ‛Mars’
In the expression: pn Mars
<interactive>:11:44:
<interactive>:13:44:
Couldn't match expected type ‛Planet’
with actual type ‛main::Interactive.Planet’
NB: ‛Planet’ is defined in ‛:Interactive’
‛main::Interactive.Planet’ is defined in ‛:Interactive’
In the pattern: Earth
In an equation for ‛pn’: pn Earth = "E"
--Testing deriving in the presence of shadowing
-- Very unsatisfactory error messages
data Planet = Mercury | Venus | Earth deriving Eq
let mercury = Mercury
Venus == Earth
......
<interactive>:8:12:
<interactive>:10:12:
Couldn't match expected type ‛main::Interactive.Planet’
with actual type ‛Planet’
NB: ‛main::Interactive.Planet’ is defined in ‛:Interactive’
‛Planet’ is defined in ‛:Interactive’
In the second argument of ‛(==)’, namely ‛Mercury’
In the expression: mercury == Mercury
<interactive>:10:10:
<interactive>:12:10:
Couldn't match expected type ‛Planet’
with actual type ‛main::Interactive.Planet’
NB: ‛Planet’ is defined in ‛:Interactive’
‛main::Interactive.Planet’ is defined in ‛:Interactive’
In the second argument of ‛(==)’, namely ‛Earth’
In the expression: Venus == Earth
mod180.hs:8:5:
Couldn't match expected type ‛T’ with actual type ‛main:Mod180_A.T’
Couldn't match expected type ‛T’
with actual type ‛main:Mod180_A.T’
NB: ‛T’ is defined in ‛Mod180_B’
‛main:Mod180_A.T’ is defined in ‛Mod180_A’
In the expression: x
In an equation for ‛z’: z = x
......@@ -2,5 +2,7 @@
C.hs:6:11:
Couldn't match expected type ‛bug1465-1.0:A.T’
with actual type ‛A.T’
NB: ‛bug1465-1.0:A.T’ is defined in ‛A’ in package ‛bug1465-1.0’
‛A.T’ is defined in ‛A’ in package ‛bug1465-2.0’
In the expression: B2.f
In the expression: [B1.f, B2.f]
......@@ -2,6 +2,8 @@
tcfail182.hs:9:3:
Couldn't match expected type ‛Prelude.Maybe a’
with actual type ‛Maybe t0’
NB: ‛Prelude.Maybe’ is defined in ‛Data.Maybe’ in package ‛base’
‛Maybe’ is defined in ‛Foo’
Relevant bindings include
f :: Prelude.Maybe a -> Int (bound at tcfail182.hs:9:1)
In the pattern: Foo
......
Markdown is supported
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