You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title:
Component: dmd
Severity:
Code number:
Keywords:
Outcome:
Is done: no
See also:
I am not sure this is a but, it seems like one:
void main() {
bool test;
string s1 = test ? "" : null; // OK
dstring s2 = test ? ""d : null; // OK
dstring s3 = test ? "" : ""; // OK
dstring s4 = test ? "" : null; // error
dstring[] a = test ? [""d] : null; // OK
dstring[] b = test ? [""] : null; // error
}
dmd 2.065alpha gives:
temp.d(6): Error: cannot implicitly convert expression (test ? "" : null) of type string to immutable(dchar)[]
temp.d(8): Error: cannot implicitly convert expression (test ? [""] : null) of type string[] to immutable(dchar)[][]
The text was updated successfully, but these errors were encountered:
bearophile_hugs reported this on 2013-12-12T10:09:07Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=11732
CC List
Description
Title: Component: dmd Severity: Code number: Keywords: Outcome: Is done: no See also: I am not sure this is a but, it seems like one: void main() { bool test; string s1 = test ? "" : null; // OK dstring s2 = test ? ""d : null; // OK dstring s3 = test ? "" : ""; // OK dstring s4 = test ? "" : null; // error dstring[] a = test ? [""d] : null; // OK dstring[] b = test ? [""] : null; // error } dmd 2.065alpha gives: temp.d(6): Error: cannot implicitly convert expression (test ? "" : null) of type string to immutable(dchar)[] temp.d(8): Error: cannot implicitly convert expression (test ? [""] : null) of type string[] to immutable(dchar)[][]The text was updated successfully, but these errors were encountered: