On 30/10/2010, at 1:17 AM, john skaller wrote:
> 
> No, I don't know which bit is failing yet, but it has narrowed it down to 
> something
> trivial (TGFT!)


Well now .. I have found the bug. It is here:

let full_string_of_entry_kind bsym_table {base_sym=i; spec_vs=vs; sub_ts=ts} =
  let bsym = 
      try Flx_bsym_table.find bsym_table i 
      with Not_found -> failwith ("full_string_of_entry_kind: Help, can't find 
index " ^ string_of_int
      i ^ " in bysm table")
  in
  string_of_bbdcl bsym_table (Flx_bsym.bbdcl bsym) i ^
  "\n  defined at " ^ Flx_srcref.short_string_of_src (Flx_bsym.sr bsym) ^ "\n  
with view" ^
  " vs=" ^ catmap "," (fun (s,_)->s) vs ^
  " ts=" ^ catmap "," (sbt bsym_table) ts

I think this is Erick's fault :)

What's happening is that this routine is used to print the candidates for a 
failed
overload resolution. Unfortunately, the routine is trying to print information
from the *bound* symbol table.

Overloading is done entirely using information from the *unbound* symbol
table. Not all the functions which are overload candidates need be bound yet,
in fact, in the case of a recursive function it is impossible for it to be 
bound:

fun f(x:int)=> match x with | 1 => 1 | f (x - 1) endmatch;

Here you can't know the bound type of f when you're trying to
resolve the f in f (x - 1), because f of (int) is one of the candidates,
and its return type depends on .. its return type.

for this reason, recursively binding the candidates can't work,
so overloading, rather painfully, has to start with *unbound*
functions and just bind the parameter types on the fly.. this
is a pity because the results of this hard work are thrown away.

In any case the problem is simple: the function has to use the unbound
symbol table to print the entry_kind.

--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to