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
BOO-1013and/orBOO-1008