Bugs item #1898518, was opened at 2008-02-21 09:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1898518&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PF/compiler
Group: Pathfinder 0.22
Status: Open
Resolution: None
Priority: 2
Private: No
Submitted By: Maurice van Keulen (mvankeulen)
Assigned to: Jan Rittinger (tsheyar)
Summary: PF pf:attribute error for function parameter without type

Initial Comment:
Given the query

declare function getData($d) { $d//[EMAIL PROTECTED]"1"] };
let $d := <b><c><data num="1">211098</data></c></b>
return <result>{getData($d)}</result>

MPS-version gives the error message

!type error: no variant of function pf:attribute accepts the given argument 
type(s): item*; string; string; string; string; string
!type error: maybe you meant: !type error: pf:attribute (node*, string, string, 
string, string, string) as node* !type error: illegal arguments for function 
pf:attribute !# halted in typecheck.brg (fun_not_found), line 1317

Algebra-version gives the error message "fatal error: Sorry, I cannot translate 
the test for type `node*'"

The problem lies in the fact that in this query, the parameter $d has no 
specified type, while in the body we refer to an attribute. Is we write

declare function getData($d as element()) { $d//[EMAIL PROTECTED]"1"] };
let $d := <b><c><data num="1">211098</data></c></b>
return <result>{getData($d)}</result>

The query compiles and runs fine.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1898518&group_id=56967

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to