[Issue 1913] New: Template error message reports correct line # but wrong file

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 12 08:18:11 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1913

           Summary: Template error message reports correct line # but wrong
                    file
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: webmaster at villagersonline.com


The code below actually has two problems with the error messages produced.

This bug is to report the fact that the second error message reports the wrong
file name (although it reports the right line number).

dmd 2.012, Linux

BEGIN MODULE "a.d"
  import b;

  import std.stdio;

  template typeof_each(T,TPL...)
  {
    static if(TPL.length == 0)
      alias Tuple!(typeof(T)) typeof_each;
    else
      alias Tuple!(typeof(T), typeof_each!(TPL)) typeof_each;
  }

  template typeid_each(T,TPL...)
  {
    static if(TPL.length == 0)
      alias Tuple!(typeid(T)) typeid_each;
    else
      alias Tuple!(typeid(T), typeid_each!(TPL)) typeid_each;
  }

  void foo(ARGS_TPL...)(ARGS_TPL args)
  {
    writefln("", typeid_each!(typeof_each!(ARGS_TPL)));
  }

  void bar()
  {
    foo(',' , ',');
  }

BEGIN MODULE "b.d"
  template Tuple(TPL...)
  {
    alias TPL Tuple;
  }

END CODE

COMPILER OUTPUT
  Error: expression & _D10TypeInfo_a6__initZ is not a valid template value
argument
  b.d(16): template instance b.Tuple!(& _D10TypeInfo_a6__initZ) error
instantiating


-- 



More information about the Digitalmars-d-bugs mailing list