History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-308
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Rodrigo B. de Oliveira
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

duck typing - assignment to indexed property

Created: 27/Apr/05 03:48 PM   Updated: 03/Jun/06 10:43 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.7.7

Time Tracking:
Not Specified

File Attachments: 1. File df-slice-patch.diff (4 kb)

Issue Links:
Duplicate
 
Related
 


 Description  « Hide
a as duck = [1, 2, 3]
a[1] = -1
assert a == [1, -1, 3]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
steve donovan - 29/Jun/05 07:34 AM
Here is a related problem with casting an array to a duck. We don't even get read access! (BTW, this occurs also if we do the retrieval outside the interactive context)

>>> arr = (1,2,3) as duck
(1, 2, 3)
>>> arr[1]
System.MissingMethodException: Method System.Int32[].ToString not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Bind
er binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at Boo.Lang.Runtime.RuntimeServices.GetSlice(Object target, String name, Object[] args)
at Input2Module.Main(String[] argv)

steve d.


Snaury - 23/May/06 07:47 AM
Possible patch for the problem

Snaury - 23/May/06 07:48 AM
I'm not sure if I did everything correctly and didn't forget anything, however I spent some time on figuring this bug and created a fix. Works for me (for now), hope it will help the others! Also fixes BOO-662.

Rodrigo B. de Oliveira - 03/Jun/06 10:43 AM
Patch applied. Thanks!