Consider two abstract classes alpha and beta:
[<AbstractClass>]
type alpha () =
abstract member foo: beta->beta
[<AbstractClass>]
and beta () =
abstract member bar: alpha
If I try to compile that I am getting an error message, in the line indicated by * * *:
error FS0010: Unexpected keyword 'and' in interaction
And if I write:
[<AbstractClass>]
type alpha () =
abstract member foo: beta->beta
and beta () =
abstract member bar: alpha
then I get:
error FS0365: No implementation was given for 'abstract member beta.bar : alpha'
and a hint that I should add the AbstractClass attribute
So how do I declare cyclically defined abstract classes?
source
share