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

Key: BOO-600
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Arron Washington
Votes: 0
Watchers: 0
Operations

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

op_Implicit not being called for duck typed something or other's.

Created: 09/Nov/05 11:31 AM   Updated: 03/Mar/06 07:58 PM
Component/s: Compiler
Affects Version/s: 0.7
Fix Version/s: 0.7.6

Time Tracking:
Not Specified


 Description  « Hide
I believe that both of the assertions should pass, and "returning implicit" should be called twice.

Only happens once, instead.

**Code:

"""
returning implicit
returning implicit
"""
class test(IQuackFu):
def QuackSet(name as string, obj):
pass
def QuackGet(name as string):
return
def QuackInvoke(name as string, *args as (object)):
print 'entered invoke'
static def op_Implicit(arg as test) as bool:
print 'returning implicit'
return false
first = test()
assert not first
second as duck = test()
assert not second #assertion has FAILED; op_Implicit wasn't called, or went through QuackInvoke

**Output:

returning implicit



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Doug H - 09/Nov/05 01:26 PM
You can change runtimeservices.ToBool to try op_Implicit (use GetMethods instead of InvokeMember or GetMethod since in the future if op_Implicit support is added there can be multiple op_Implicits that only differ by return type). There are other alternative fixes too.

Arron Washington - 03/Mar/06 07:34 PM
Do we wanna fix this or not?

Doug H - 03/Mar/06 07:58 PM
This was fixed with BOO-644.