Am 03.12.2018 um 14:01 schrieb Ryan Joseph:
On Dec 3, 2018, at 2:45 PM, Ryan Joseph <r...@thealchemistguild.com> wrote:
I just looked it over and I was wrong about the dummy, it’s just a flag. If the
generic doesn’t cover existing functions then that messes up some assumptions I
made so I need re-think the design now.
I believe I managed to solve the problem and now non-generic procedures take
precedence. I guess it’s possible that you could opt out of an implicit
specialization now but declaring and overload which the specific type you were
interested in. This is probably a good fallback to have so it’s good it’s like
this now.
Good. I also confirmed this behavior with Delphi:
=== code begin ===
program GenTest;
type
TSomeRecord = record
Value: Integer;
class procedure Test(aArg: String); overload; static;
class procedure Test<T>(aArg: T); overload; static;
class procedure Test(aArg: LongInt); overload; static;
end;
class procedure TSomeRecord.Test(aArg: String);
begin
Writeln('String');
end;
class procedure TSomeRecord.Test<T>(aArg: T);
begin
Writeln('T');
end;
class procedure TSomeRecord.Test(aArg: LongInt);
begin
Writeln('LongInt');
end;
begin
TSomeRecord.Test('Hello World');
TSomeRecord.Test(42);
TSomeRecord.Test(True);
end.
=== code end ===
This will output:
=== output begin ===
String
LongInt
T
=== output end ===
Regards,
Sven
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal