www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Array of associative array.

reply "Auto cannot infer type from initializer" <agustin.l.alvarez hotmail.com> writes:
public static CompilerTable = [
      ////////////////////////////////////////////////////////////
      /// \brief DMD
      ////////////////////////////////////////////////////////////
      ["-c"               : "-c",
       "-debug"           : "-debug",
       "-g"               : "-g",
       "-gc"              : "-gc",
       "-I"               : "-I",
       "-inline"          : "-inline",
       "-L"               : "-L",
       "-lib"             : "-lib",
       "-noboundscheck"   : "-noboundscheck",
       "-O"               : "-O",
       "-o-"              : "-o-",
       "-odobjdir"        : "-odobjdir",
       "-offilename"      : "-offilename",
       "-profile"         : "-profile",
       "-release"         : "-release",
       "-unittest"        : "-unittest",
       "-w"               : "-w",
       "-wi"              : "-wi"],

      ////////////////////////////////////////////////////////////
      /// \brief LDC
      ////////////////////////////////////////////////////////////
      ["-c"               : "-c",
       "-debug"           : "-debug",
       "-g"               : "-g",
       "-gc"              : "-gc",
       "-I"               : "-I",
       "-inline"          : "-inline",
       "-L"               : "-L",
       "-lib"             : "-lib",
       "-noboundscheck"   : "-noboundscheck",
       "-O"               : "-O",
       "-o-"              : "-o-",
       "-odobjdir"        : "-odobjdir",
       "-offilename"      : "-offilename",
       "-profile"         : "-profile",
       "-release"         : "-release",
       "-unittest"        : "-unittest",
       "-w"               : "-w",
       "-wi"              : "-wi"],

      ////////////////////////////////////////////////////////////
      /// \brief GDC
      ////////////////////////////////////////////////////////////
      ["-c"               : "-c",
       "-debug"           : "-fdebug",
       "-g"               : "-g",
       "-gc"              : "-g",
       "-I"               : "-I",
       "-inline"          : "-finline-functions",
       "-L"               : "-Wl",
       "-lib"             : "",
       "-noboundscheck"   : "-noboundscheck",
       "-O"               : "-O3",
       "-o-"              : "-fsyntax-only",
       "-odobjdir"        : "-od",
       "-offilename"      : "-o",
       "-profile"         : "-profile",
       "-release"         : "-release",
       "-unittest"        : "-unittest",
       "-w"               : "-Wall",
       "-wi"              : "-Wextra"]
];

Error: variable org.ghrum.installer.option.CompilerTable cannot
infer type from initializer
Oct 28 2013
parent reply "Auto cannot infer type from initializer" <agustin.l.alvarez hotmail.com> writes:
On Monday, 28 October 2013 at 21:26:41 UTC, Auto cannot infer
type from initializer wrote:
 public static CompilerTable = [
      
 ////////////////////////////////////////////////////////////
      /// \brief DMD
      
 ////////////////////////////////////////////////////////////
      ["-c"               : "-c",
       "-debug"           : "-debug",
       "-g"               : "-g",
       "-gc"              : "-gc",
       "-I"               : "-I",
       "-inline"          : "-inline",
       "-L"               : "-L",
       "-lib"             : "-lib",
       "-noboundscheck"   : "-noboundscheck",
       "-O"               : "-O",
       "-o-"              : "-o-",
       "-odobjdir"        : "-odobjdir",
       "-offilename"      : "-offilename",
       "-profile"         : "-profile",
       "-release"         : "-release",
       "-unittest"        : "-unittest",
       "-w"               : "-w",
       "-wi"              : "-wi"],

      
 ////////////////////////////////////////////////////////////
      /// \brief LDC
      
 ////////////////////////////////////////////////////////////
      ["-c"               : "-c",
       "-debug"           : "-debug",
       "-g"               : "-g",
       "-gc"              : "-gc",
       "-I"               : "-I",
       "-inline"          : "-inline",
       "-L"               : "-L",
       "-lib"             : "-lib",
       "-noboundscheck"   : "-noboundscheck",
       "-O"               : "-O",
       "-o-"              : "-o-",
       "-odobjdir"        : "-odobjdir",
       "-offilename"      : "-offilename",
       "-profile"         : "-profile",
       "-release"         : "-release",
       "-unittest"        : "-unittest",
       "-w"               : "-w",
       "-wi"              : "-wi"],

      
 ////////////////////////////////////////////////////////////
      /// \brief GDC
      
 ////////////////////////////////////////////////////////////
      ["-c"               : "-c",
       "-debug"           : "-fdebug",
       "-g"               : "-g",
       "-gc"              : "-g",
       "-I"               : "-I",
       "-inline"          : "-finline-functions",
       "-L"               : "-Wl",
       "-lib"             : "",
       "-noboundscheck"   : "-noboundscheck",
       "-O"               : "-O3",
       "-o-"              : "-fsyntax-only",
       "-odobjdir"        : "-od",
       "-offilename"      : "-o",
       "-profile"         : "-profile",
       "-release"         : "-release",
       "-unittest"        : "-unittest",
       "-w"               : "-Wall",
       "-wi"              : "-Wextra"]
 ];

 Error: variable org.ghrum.installer.option.CompilerTable cannot
 infer type from initializer
The declaration is public static auto CompilerTable = [ ... ]
Oct 28 2013
parent reply "Wolftein" <agustin.l.alvarez hotmail.com> writes:
On Monday, 28 October 2013 at 21:27:46 UTC, Auto cannot infer 
type from initializer wrote:
 On Monday, 28 October 2013 at 21:26:41 UTC, Auto cannot infer
 type from initializer wrote:
 public static CompilerTable = [
     
 ////////////////////////////////////////////////////////////
     /// \brief DMD
     
 ////////////////////////////////////////////////////////////
     ["-c"               : "-c",
      "-debug"           : "-debug",
      "-g"               : "-g",
      "-gc"              : "-gc",
      "-I"               : "-I",
      "-inline"          : "-inline",
      "-L"               : "-L",
      "-lib"             : "-lib",
      "-noboundscheck"   : "-noboundscheck",
      "-O"               : "-O",
      "-o-"              : "-o-",
      "-odobjdir"        : "-odobjdir",
      "-offilename"      : "-offilename",
      "-profile"         : "-profile",
      "-release"         : "-release",
      "-unittest"        : "-unittest",
      "-w"               : "-w",
      "-wi"              : "-wi"],

     
 ////////////////////////////////////////////////////////////
     /// \brief LDC
     
 ////////////////////////////////////////////////////////////
     ["-c"               : "-c",
      "-debug"           : "-debug",
      "-g"               : "-g",
      "-gc"              : "-gc",
      "-I"               : "-I",
      "-inline"          : "-inline",
      "-L"               : "-L",
      "-lib"             : "-lib",
      "-noboundscheck"   : "-noboundscheck",
      "-O"               : "-O",
      "-o-"              : "-o-",
      "-odobjdir"        : "-odobjdir",
      "-offilename"      : "-offilename",
      "-profile"         : "-profile",
      "-release"         : "-release",
      "-unittest"        : "-unittest",
      "-w"               : "-w",
      "-wi"              : "-wi"],

     
 ////////////////////////////////////////////////////////////
     /// \brief GDC
     
 ////////////////////////////////////////////////////////////
     ["-c"               : "-c",
      "-debug"           : "-fdebug",
      "-g"               : "-g",
      "-gc"              : "-g",
      "-I"               : "-I",
      "-inline"          : "-finline-functions",
      "-L"               : "-Wl",
      "-lib"             : "",
      "-noboundscheck"   : "-noboundscheck",
      "-O"               : "-O3",
      "-o-"              : "-fsyntax-only",
      "-odobjdir"        : "-od",
      "-offilename"      : "-o",
      "-profile"         : "-profile",
      "-release"         : "-release",
      "-unittest"        : "-unittest",
      "-w"               : "-Wall",
      "-wi"              : "-Wextra"]
 ];

 Error: variable org.ghrum.installer.option.CompilerTable cannot
 infer type from initializer
The declaration is public static auto CompilerTable = [ ... ]
Had to use string[string][] instead of auto.
Oct 28 2013
parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 10/28/2013 02:39 PM, Wolftein wrote:

 Error: variable org.ghrum.installer.option.CompilerTable cannot
 infer type from initializer
The declaration is public static auto CompilerTable = [ ... ]
Had to use string[string][] instead of auto.
Looks like a compiler bug to me. Reduced: void foo(T)(T) { pragma(msg, T.stringof); } void main() { // Works and prints string[string][] pragma(msg, typeof([ [ "a" : "a"] ]).stringof); // Works and prints string[string][] foo([ [ "a" : "a"] ]); // However, this fails auto a = [ [ "a" : "a"] ]; } Is there a reason why the last line cannot be compiled? Ali
Oct 28 2013
parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 10/28/13, Ali =C7ehreli <acehreli yahoo.com> wrote:
 Looks like a compiler bug to me. Reduced:
 Is there a reason why the last line cannot be compiled?
Could be one of these: http://d.puremagic.com/issues/show_bug.cgi?id=3D9295 http://d.puremagic.com/issues/show_bug.cgi?id=3D9520 There's a bunch of these array literal bugs.
Oct 28 2013