www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1344] New: Can't implicitly convert literal 0 to typedef of ulong

reply d-bugmail puremagic.com writes:

           Summary: Can't implicitly convert literal 0 to typedef of ulong
           Product: D
           Version: 1.018
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: webmaster villagersonline.com

The following will not compile:
  typedef uint  u32;
  typedef ulong u64;
  void main() {
    uint  a = 0;
    ulong b = 0;
    u32   c = 0;
    u64   d = 0;

It fails with the following error:
  foo.d(7): Error: cannot implicitly convert expression (0) of type int to u64

Notice that it works just find with typedefs of uint.

Jul 17 2007
parent d-bugmail puremagic.com writes:

thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
            Summary|Can't implicitly convert    |Can't implicitly convert
                   |literal 0 to typedef of     |literal 0 to typedef of
                   |ulong                       |ulong

------- Comment #1 from thomas-dloop kuehne.cn  2007-07-23 14:55 -------
Added to DStress as

Jul 23 2007