English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Type inference problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-01 (07:58)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] Type inference problem

I can't figure out what's wrong with my code =(

It's on a paste site, so will only last about 24 hours or so.

jonathan@moonbeam:~/dst/stdlib$ ocamlc VFS.ml
File "VFS.ml", line 106, characters 3-6:
This expression has type int but is here used with type unit

It -has- to return int ;-) But I have no idea where the type
constraint is coming from that wants it to return unit. Change it to
return unit, and where it's used complains it doesn't return type int
(so that constraint is correct).