[fpc-pascal] Multiple active class helpers at same time

Ryan Joseph ryan at thealchemistguild.com
Mon Apr 23 17:18:49 CEST 2018



> On Apr 23, 2018, at 8:22 PM, LacaK <lacak at zoznam.sk> wrote:
> 
> Later in uses clause wins ... as for other cases where in different units are used same names
> But probably problem is deeper , what I am not aware of ;-)

Swift just gives a compiler error if there is a redefinition of method in the current scope. Very simple and works just fine. Why not do what Swift/Objective-C does given this is a proven implementation? At least as a starting point if nothing else.

extension MyObject {
	func foo() {
		
	}
}

extension MyObject {
	func foo() {	// redefinition error
		
	}
}

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list