fxm wrote:It is not the only case:
- This works:
Code: Select all
type Dictionary
dim as Integer I
declare operator let( byref as Dictionary )
end type
type RegisterDictionary extends Dictionary
end type
- but no longer that:
Code: Select all
type Dictionary
dim as Integer I = 1
declare operator let( byref as Dictionary )
end type
type RegisterDictionary extends Dictionary
end type
Both examples work perfectly fine here (1.06.0). When extending Object, it also works:
Code: Select all
type Dictionary extends Object
dim as Integer I
declare operator let( byref as Dictionary )
end type
type RegisterDictionary extends Dictionary
end type
This also works as expected (which is how the Dictionary class is laid out
by design):
Code: Select all
type Foo extends Object
public:
declare constructor()
declare sub invokeFoo()
protected:
declare operator let( byref as foo )
end type
constructor foo()
? "Foo constructed"
end constructor
type Bar extends Foo
declare constructor()
protected:
declare operator let( byref as bar )
end type
constructor bar()
? "Bar constructed"
end constructor
dim as bar b = bar()
dim as bar a = bar()
a = b
sancho3 wrote:Obviously that operator is not defined. I did not thoroughly test to see if it has no logic errors, but it does seem to print out the example properly.
Of course it's not defined, and it's under the
protected: section for a reason (to avoid shallow copying of the class).
Try this: instead of including 'fb-dictionary.bi', include 'fb-dictionary-src.bi'. This will force the compiler to use the source code version. What results do you get? I also don't have it in my fbc installation, so it exists only in it's own folder. It's unthinkable we get different results, downloading it from the same source...