Last active
December 5, 2016 15:27
-
-
Save ortuagustin/3b14d51881b922cdc500f214dc85e36a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IFoo = interface | |
['{4061C455-B122-48D6-940F-9C1B2FD4A689}'] | |
end; | |
IDoesntWorkFactory = interface | |
['{E9A093ED-C429-46C3-82DD-D5D32EB9120F}'] | |
function Create(const Blabla: string): IFoo; overload; | |
function Create(const Blabla: Integer): IFoo; overload; | |
end; | |
IWorkingFactory = interface | |
['{E32C2F49-F6E4-4D7F-B1DF-787C3CC55A39}'] | |
function Create(const Blabla: string): IFoo; | |
end; | |
TWorkingFactoryImpl = class(TInterfacedObject, IWorkingFactory) | |
strict private | |
function IWorkingFactory.Create = FooCreate; | |
function FooCreate(const Blabla: string): IFoo; | |
end; | |
TDoesntWorkFactoryImpl = class(TInterfacedObject, IDoesntWorkFactory) | |
strict private | |
function IDoesntWorkFactory.Create = FooCreate; | |
function IDoesntWorkFactory.Create = FooCreate; // identifier redeclared | |
function FooCreate(const Blabla: string): IFoo; overload; | |
function FooCreate(const Blabla: Integer): IFoo; overload; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work aswel:
"Not so ideal" method name 'Create' isn't the problem either