[fpc-devel] Implicit function specialization precedence
Ryan Joseph
genericptr at gmail.com
Sat May 15 18:49:25 CEST 2021
> On May 15, 2021, at 10:27 AM, Ryan Joseph <genericptr at gmail.com> wrote:
>
> Looking at this again today and I have yet another question to confirm. I create one of the types using ctypesym.create but the others were just references from the system unit. We only want to change owner of the symbol I create, right? Not the system unit ones? If not changing owner maybe we need to add some ref count or something? just confirming to make sure.
Also it looks like ChangeOwnerAndName isn't making the compiler happy.
The dynamic array creates an unnamed typesym like this. (def is the array def for [1,2,3])
newtype:=ctypesym.create(def.typename,def);
newtype.owner:=def.owner;
And specialized like this:
generic procedure DoThis<T>(p1: T);
begin
end;
begin
DoThis([1,2,3]);
end;
Then during assembling I get these errors.
Assembling (pipe) /Users/ryanjoseph/Developer/Projects/FPC/macro_test/output/timpfuncspez0.s
<stdin>:40:50: error: unexpected token in directive
.globl _P$TIMPFUNCSPEZ19_$$_DOTHIS$1$CRCC2373297${Array Of Const/Constant Open} Array of ShortInt
^
<stdin>:41:60: error: unexpected token in directive
.private_extern _P$TIMPFUNCSPEZ19_$$_DOTHIS$1$CRCC2373297${Array Of Const/Constant Open} Array of ShortInt
^
<stdin>:42:44: error: unknown token in expression
_P$TIMPFUNCSPEZ19_$$_DOTHIS$1$CRCC2373297${Array Of Const/Constant Open} Array of ShortInt:
^
<stdin>:117:50: error: invalid register name
call _P$TIMPFUNCSPEZ19_$$_DOTHIS$1$CRCC2373297${Array Of Const/Constant Open} Array of ShortInt
^~~~~
<stdin>:117:50: error: Expected an op-mask register at this point
call _P$TIMPFUNCSPEZ19_$$_DOTHIS$1$CRCC2373297${Array Of Const/Constant Open} Array of ShortInt
^
<stdin>:283:50: error: unexpected token in '.quad' directive
.quad _P$TIMPFUNCSPEZ19_$$_DOTHIS$1$CRCC2373297${Array Of Const/Constant Open} Array of ShortInt
^
error: There were 1 errors compiling module, stopping
error: Compilation aborted
Regards,
Ryan Joseph
More information about the fpc-devel
mailing list