Error: func(const(A) a) is not callable using argument types (const(A)

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 30 04:22:29 PDT 2017


http://forum.dlang.org/post/xpmpakmusudanwuzzezl@forum.dlang.org
https://issues.dlang.org/show_bug.cgi?id=9631

On Tue, May 30, 2017 at 1:07 PM, Biotronic via Digitalmars-d-learn <
digitalmars-d-learn at puremagic.com> wrote:

> On Tuesday, 30 May 2017 at 10:46:12 UTC, Andrew Edwards wrote:
>
>> On Tuesday, 30 May 2017 at 10:37:58 UTC, Biotronic wrote:
>>
>>> On Tuesday, 30 May 2017 at 10:31:24 UTC, Daniel Kozak wrote:
>>>
>>>> import std.traits : fqn = fullyQualifiedName;
>>>>
>>>
>>> Darnit. I just googled the template and got a result talking about
>>> fqn!T. So yeah - this code:
>>>
>>> import std.traits;
>>>
>>> pragma(msg, fullyQualifiedName!ImVec2);
>>> pragma(msg, fullyQualifiedName!(typeof(CalcTextSize(label.ptr, null,
>>> true))));
>>>
>>> --
>>>   Biotronic
>>>
>>
>> This is exactly the cause. Output is follows:
>>
>>     internal.ImVec2
>>     types.ImVec2
>>
>> I'm leveraging types as I try to do my own port of the lib so
>> CalcTextSize is returning an instance of ImVec2 as defined types and I'm
>> trying to assign to one I have declared in internal.
>>
>> Thanks.
>>
>
> Pleasure. :)
>
> I don't know why you have two different ImVec2s, but you may have good
> reasons to. If they need to be separate, you'll need to write a conversion
> function between the two for the cases where you have one and want the
> other. This could be the constructor or opAssign, or a standalone function
> if you want to be more explicit about it.
>
> I'd argue that error message could be improved upon, btw.
>
> --
>   Simen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20170530/cffa1d14/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list