Re: [fpc-pascal] Re: Problem with virtual constructors

2011-06-01 Thread Jorge Aldo G. de F. Junior
Cobines solution worked ! not tested constref. 2011/6/1 Jorge Aldo G. de F. Junior : > 2011/6/1 leledumbo : >> Yep, this situation would confuse the compiler as it's possible to assign >> descendant class instance to a class. >> 1st solution: rename one of the constructor, don't need to use >> vi

Re: [fpc-pascal] Re: Problem with virtual constructors

2011-06-01 Thread Jorge Aldo G. de F. Junior
2011/6/1 leledumbo : > Yep, this situation would confuse the compiler as it's possible to assign > descendant class instance to a class. > 1st solution: rename one of the constructor, don't need to use > virtual/override Its a class factory, i cannot have multiple constructors, so i need virtual c

[fpc-pascal] Re: Problem with virtual constructors

2011-06-01 Thread leledumbo
Yep, this situation would confuse the compiler as it's possible to assign descendant class instance to a class. 1st solution: rename one of the constructor, don't need to use virtual/override 2nd solution: try using constref instead of const (I hope constref has the same semantics as var for classe