Bugs item #2051258, was opened at 2008-08-14 13:13
Message generated for change (Comment added) made by mr-meltdown
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2051258&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: Core
Group: MonetDB5 CVS Head
>Status: Open
Resolution: Accepted
Priority: 8
Private: No
Submitted By: Fabian (mr-meltdown)
Assigned to: Martin Kersten (mlkersten)
Summary: M5:inspect.getType returns wrong type in :any typed function
Initial Comment:
# observed 13-08-2008: inspect.getType works fine local, but not in a
# function on an argument with type :any
function user.typetest(o:any);
t := inspect.getType(o);
io.print(t);
end user.typetest;
p := "string";
t := inspect.getType(p);
# here it is still a "str"
io.print(t);
# but now it is a "any", should be "str"
user.typetest(p);
Added as tests/BugReports/Tests/gettype_in_function
----------------------------------------------------------------------
>Comment By: Fabian (mr-meltdown)
Date: 2008-08-20 12:25
Message:
Logged In: YES
user_id=963970
Originator: YES
I'm getting frustrated by this.
function myfunc(o:any);
t := inspect.getType(o);
barrier isbat := str.startsWith(t, "bat");
len := aggr.count(o);
exit isbat;
end myfunc;
works fine for an invocation with a bat, however it fails horribly when
invoked with e.g. an int:
!TypeException:user.myfunc[5]:'aggr.count' undefined in: len:any :=
aggr.count(o:int)
!MALException:user.myfunc[0]:Error in cloned function
reflection (a runtime thing) is mixed up with a static analysis thing
here, it seems.
Additionally, see the next bug for a workaround which doesn't work either.
----------------------------------------------------------------------
Comment By: Martin Kersten (mlkersten)
Date: 2008-08-20 11:04
Message:
Logged In: YES
user_id=490798
Originator: NO
Extended the facilities to retrieve the types
and solved a problem in the cloneFunction.
Additional inspection routines are added upon need.
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2008-08-19 15:05
Message:
Logged In: YES
user_id=963970
Originator: YES
Ultimate fun!:
function user.doit(o:any):void;
t := inspect.getType(o);
io.print(t);
end user.doit;
s := "my string";
user.doit(s);
b := bat.new(:str, :int);
t := inspect.getType(b);
io.print(t);
user.doit(b);
user.doit(s);
returns:
[ "str" ]
[ "bat[:str,:int]" ]
[ "any" ]
[ "any" ]
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2008-08-16 23:53
Message:
Logged In: YES
user_id=963970
Originator: YES
isn't that a good argument to disallow :any as type in function arguments
(in their declaration)?
----------------------------------------------------------------------
Comment By: Martin Kersten (mlkersten)
Date: 2008-08-15 08:18
Message:
Logged In: YES
user_id=490798
Originator: NO
In cloning all any arguments should be passed on.
Using :any as the equivalent for :any_0
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2008-08-14 13:52
Message:
Logged In: YES
user_id=963970
Originator: YES
this bug blocks further development on remote module
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2051258&group_id=56967
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs