Bugs item #1898518, was opened at 2008-02-21 09:41
Message generated for change (Comment added) made by stmane
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: (zombie: Pathfinder 0.22)
Status: Open
Resolution: None
Priority: 2
Private: No
Submitted By: Maurice van Keulen (mvankeulen)
Assigned to: Peter Boncz (boncz)
Summary: PF pf:attribute error for function parameter without type
Initial Comment:
Given the query
declare function getData($d) { $d//da...@num="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//da...@num="1"] };
let $d := <b><c><data num="1">211098</data></c></b>
return <result>{getData($d)}</result>
The query compiles and runs fine.
----------------------------------------------------------------------
>Comment By: Stefan Manegold (stmane)
Date: 2009-02-17 13:45
Message:
added test in
pathfinder/tests/BugTracker/Tests/function_parameter_without_type.SF-1898518.*
behaves as reported:
- works fine with ALG
- triggers error with MPS
----------------------------------------------------------------------
Comment By: Jan Rittinger (tsheyar)
Date: 2008-02-21 10:04
Message:
Logged In: YES
user_id=993208
Originator: NO
Maurice,
MPS gives you the error because Peters heuristic magic that transforms the
path order always expects node* -- a bug in my opinion. The algebra variant
on the other side misses the implementation for the runtime typeswitch and
thus fails with a not-so-informative error message.
Perhaps Peter has an idea to solve this for MPS - maybe an additional
typeswitch that ensures that pf:attribute is only called for nodes.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1898518&group_id=56967
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs