From: John Skaller <skaller@maxtal.com.au>
To: caml-list@inria.fr (OCAML)
Subject: Diagnostic bug?
Date: Thu, 22 Jul 1999 16:51:37 +1000 [thread overview]
Message-ID: <3.0.6.32.19990722165137.00976500@mail.triode.net.au> (raw)
In-Reply-To: <199907181757.TAA31587@miss.wu-wien.ac.at>
The following code indicates an incorrect error diagnostic:
type t = T;;
let rec g (x:int) =
(let (aT:t) = f x in ())
and f x : unit = ();;
Line 5 characters 17-19:
This expression has type unit but is here used with type t.
The function f is explicitly declared with return type unit,
and clearly returns the unit value: there is no error
in f, and certainly the () is _not_ being used 'here'
with type t.
The error may be considered to be in the call of f,
in the function g, or it may be considered to be
in the explicit declaration of the return type of f,
which clashes with the infered return type,
or even in the whole of f,
but it cannot be in the body of f: f is internally
consistent.
In my actual code, I got an error
in a 5000 character expression, and it took three
days to figure out the error wasn't in that expression
at all.
I can guess how the problem arises in the inference
algorithm, but now I can't figure out a policy for tracking
down type errors (since they can no longer be trusted).
I found previously that adding explicit types helped
isolate errors, but in this case it didn't.
-------------------------------------------------------
John Skaller email: skaller@maxtal.com.au
http://www.maxtal.com.au/~skaller
phone: 61-2-96600850
snail: 10/1 Toxteth Rd, Glebe NSW 2037, Australia
next prev parent reply other threads:[~1999-07-27 1:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-18 18:57 optimization and purity Markus Mottl
1999-07-22 6:51 ` John Skaller [this message]
1999-07-27 15:34 ` Diagnostic bug? Hendrik Tews
1999-07-30 14:55 ` John Skaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3.0.6.32.19990722165137.00976500@mail.triode.net.au \
--to=skaller@maxtal.com.au \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox