[fpc-pascal] Re: Problem with virtual constructors

leledumbo leledumbo_cool at yahoo.co.id
Wed Jun 1 19:19:44 CEST 2011

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
2nd solution: try using constref instead of const (I hope constref has the
same semantics as var for classes, where the assigned object must be exactly
the instance of expected class, descendants not allowed)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Problem-with-virtual-constructors-tp4445729p4445832.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

More information about the fpc-pascal mailing list