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: Closed
Resolution: Out of Date
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-11-14 23:40

Message:
2009/11/14 - stmane:
        function_parameter_without_type.SF-1898518.stable.err,1.2.8.1
        function_parameter_without_type.SF-1898518.stable.out,1.2.8.1

approved error message of first version of the query
after Peter's "will not be fixed" verdict;
cf.,
ID: 1898518 "PF pf:attribute error for function parameter without type"
https://sourceforge.net/tracker/?func=detail&aid=1898518&group_id=56967&atid=482468

Thus, we keep on testing the second version of the query.


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

Comment By: Peter Boncz (boncz)
Date: 2009-04-07 10:24

Message:
will not be fixed

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

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to