March 05, 2011 [Issue 5702] New: Out parameter with default value as null compiling unit test fails. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5702 Summary: Out parameter with default value as null compiling unit test fails. Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: doob@me.com --- Comment #0 from Jacob Carlborg <doob@me.com> 2011-03-05 03:53:46 PST --- The following code fails to compile: void isEmail (out void* v = null) {} unittest { isEmail; } With the error message: test.d(1): Error: null is not an lvalue This only happens when I compile with -unittest. The parameter has to be an out parameter, a default parameter and the default value has to be null. The type of the parameter doesn't matter as long as "null" is a valid value for the type. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 05, 2011 [Issue 5702] Out parameter with default value as null compiling unit test fails. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=5702 --- Comment #1 from Jacob Carlborg <doob@me.com> 2011-03-05 03:56:43 PST --- If the parameter is "ref" the same error occurs. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation