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

Key: BOO-625
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Cedric Vivier
Reporter: Rodrigo B. de Oliveira
Votes: 0
Watchers: 1
Operations

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

Internal compiler error when trying to override non virtual method with an explicit interface implementation

Created: 28/Nov/05 05:49 AM   Updated: 16/May/08 09:22 AM
Component/s: None
Affects Version/s: 0.7.5
Fix Version/s: 0.8.2

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide
I was porting some C# code and got this error:
BCE0011: An error occurred during the execution of the step
'Boo.Lang.Compiler.Steps.EmitAssembly': 'Declaration referenced in a
method implementation can not be a final method. Type: MyCollection.
Assembly: run, Version=0.0.0.0.'.

I distilled the problem down to 4 lines:

import System
import System.Collections
class MyCollection(CollectionBase):
def GetEnumerator() as IEnumerator:
return null

I tried adding "IEnumerable." to the def:
def IEnumerable.GetEnumerator() as IEnumerator:
which gave:
problem05.boo(4,9): BCE0090: Derived method
'MyCollection.GetEnumerator' can not reduce the accessiblity of
'System.Collections.CollectionBase.GetEnumerator' from 'public' to
'private'.

I added "public" to the def:
public def IEnumerable.GetEnumerator() as IEnumerator:
which gave:
problem05.boo(4,16): BCE0116: Explicit member implementation for
'IEnumerable.GetEnumerator' must not declare any modifiers.

I then peeked at Set.boo from the source and saw that it inherited
(ICollection, IEnumerable). When I changed MyCollection to do the same
(and took out CollectionBase) the compilation errors went away (other
than missing abstract methods which I added and then successfully
compiled).

Has any one derived from CollectionBase in boo?
Is this a bug in the compiler?

-Chuck



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Cedric Vivier - 16/May/08 09:22 AM
I guess this has been fixed along with BOO-1013 and/or BOO-1008