Summary: template functions doesn't specialize types of arguments
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

DMD 2.205 on Windows

See this code.

import std.stdio: writefln;
void main( ){
    int a = 1;
    funcA( [a] );
    funcA!( typeof( [a] ))( [a] );
void funcA( T )( T t ){
    writefln( "funcA, T" );
void funcA( T: T[] )( T[] t ){
    writefln( "funcA, T: T[]" );

It is compiled with no errors.

funcA, T
funcA, T: T[]

This means, 'funcA( [a] );' is not equal to 'funcA!( typeof( [a] ))( [a] );'
Perhaps it is not a bug, but is not good spec.

Thank you for your reading.


Reply via email to