[fpc-pascal] Scoped enums and inferred types

Ryan Joseph ryan at thealchemistguild.com
Wed Feb 21 08:08:57 CET 2018

> On Feb 21, 2018, at 2:01 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> The compiler does not know the type of the parameter, because overload selection occurs only after all parameters have been parsed. So during parsing the compiler would not know from which enum type to select the enum value. Not to mention unsolvable overloads if there would be two enums with the same value and the same name of the routine. 

So it’s a limitation of overloading? I mentioned I saw the idea from Swift (https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Enumerations.html) but I don’t know if they have overloaded functions. That’s too bad, it would be a nice feature. Thanks.

	Ryan Joseph

More information about the fpc-pascal mailing list