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

Key: BOO-809
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Avishay Lavie
Reporter: Rodrigo B. de Oliveira
Votes: 0
Watchers: 0
Operations

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

Compiler error when overriding virtua generator method

Created: 12/Mar/07 04:02 PM   Updated: 04/May/07 04:53 AM
Component/s: None
Affects Version/s: 0.7.6
Fix Version/s: 0.7.7

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide
class sgroup:
pass

class state:
public type as sgroup

virtual def GetTypes():
yield type

class state1(state):

public type1 as sgroup

def GetTypes():
yield type1

Error: The return type of a generator must be either
'System.Collections.IEnumerable' or 'object'. (BCE0101)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 12/Mar/07 04:03 PM
The workaround is to explicilty declare the return type of the virtual method as System.Collections.IEnumerable.

Avishay Lavie - 04/May/07 04:53 AM
Fixed in 2470: generators with unknown return types are now assumed to return IEnumerable or IEnumerable of YieldType, instead of the specific compiler-generated type. This allows overriding methods to specify the same return type or no return type (it will be correctly inferred).