On Sun, 2007-07-22 at 20:40 +1000, Rhythmic Fistman wrote:
> The following programme only compiles if either I lift the _ctor_
> declaration out of the proc f or if I write var ap = _ctor_apoot p.
> Is this a bug or is this a lookup rule that I've asked about in
> different guise before?
> 
> #import <flx.flxh>
> type poot = "int";
> type apoot = "int*";
> 
> var p: poot;
> 
> proc f {
>       fun _ctor_apoot: poot -> apoot = "&$1";
>       var ap = apoot p;
> }

Well, perhaps it is a bug, but currently, a _ctor_* fuction
for an abstract type must be defined in the same scope
as the abstract type.

There is duplicated code in the compiler here.
If an OverloadKindError is thrown by overload resolution on name,
lookup_name_with_sig' retries with _ctor_name.

However that routine calls lookup_name_in_table_dirs_with_sig,
and if that gets an type, it also retries with _ctor_name,
if that fails it throws an error .. but not an OverloadKindError.

The effect is that if lookup_name_in_table_dirs_with_sig
finds a type, it retries .. but as the name of the functions
suggests ONLY in the current symbol table = scope .. so the
_ctor must be in the same scope as the type.

I tried fiddling the code and got other errors .. :)

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to