www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14430] New: Null parameter is detected as non-null.


          Issue ID: 14430
           Summary: Null parameter is detected as non-null.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: 14crgg+ekargo2d7qijk sharklasers.com


I defined a class with a single method in it. Method has 6 parameters. Other
than first parameter, all others has default value. 3rd, 4th, and 5th
parameters are string and their default value is "null".

I create an instance of that class, and call that method 2 times with only
first parameter.


Parameters those have "null" value by default should be "null" always.


In the first call, it works correctly. In the second and later calls, assert
doesn't pass, and it says those parameters are not null.


Tested on both "DMD64 D Compiler v2.066 and v2.070 on Archlinux" and "DMD64 D
Compiler v2.070 on Ubuntu 14.04". Results are same.

rdmd test.d

One person reported it works correctly on LDC and rdmd test.d on Archlinux. But
says that with "dmd -O", and "dmd -release", it works wrong as well.

This problem can be generated repeatedly.

Apr 09 2015