[fpc-pascal] with in classes/records

Ryan Joseph ryan at thealchemistguild.com
Fri Sep 14 10:50:09 CEST 2018


How should this syntax work? TWrapper needs to allow assignments of TWrapper for constructors but it also should accept assignments of THelperA for the default write property.

Is that a problem or should TWrapper be able to assign both? It looks strange so I thought I would ask.

==========================================

type
	THelperA = class
	end;

type
	TWrapper = class
		objA: THelperA;
		property helperA: THelperA read objA write objA; default;
	end;

var
	wrapper: TWrapper;
begin
	wrapper := TWrapper.Create;
	wrapper := THelperA.Create;
end.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list