TypeFunction example creatiing a conversion matrix

Stefan Koch uplink.coder at gmail.com
Fri Oct 2 15:36:46 UTC 2020


On Friday, 2 October 2020 at 15:11:18 UTC, Adam D. Ruppe wrote:
>
> type function with 1,000 unique instances:
>
>  Error: function test.makeConvMatrix(alias[] types...) is not 
> callable using argument types (i18, byte, ubyte, short, ushort, 
> int, uint, long, ulong)
>   cannot pass argument i18 of type i18 to parameter alias[] 
> types...
> [snip etc same thing for all 1000 cases]
>
>
> Lovely. But I just grabbed your git branch so some in-progress 
> work is to be expected to be incomplete...
>
> What about a template?
>
> test.d-mixin-42(42):        cannot pass argument test!18 of 
> type test!18 to parameter alias[] types...

Indeed. A am currently fixing this bug.
The problem is that structs and classes are not considered types 
... they are symbols.
Generally dmd doesn't like it if you pass types to functions and 
I have to circumvent the resistance ;)


More information about the Digitalmars-d mailing list