[Issue 24241] New: Uncaught Default argument error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 13 11:11:32 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24241
Issue ID: 24241
Summary: Uncaught Default argument error
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: aliloko at gmail.com
Created attachment 1899
--> https://issues.dlang.org/attachment.cgi?id=1899&action=edit
source file
Consider the following D program:
------------------- main.d --------------
// Here `d` should have a default argument value too.
// Will DMD catch it?
ubyte lookup_decoding(char c = '/', bool d)
{
return (c + d) & 255;
}
void main(string[] args)
{
lookup_decoding(1, true);
}
------------------------------------------
This build OK with DMD 2.104.0
This doesn't build with DMD 2.100.0
Making it very easy to use default argument incorectly.
--
More information about the Digitalmars-d-bugs
mailing list