[Issue 9153] New: Type inference for array of delegates should not break based on order
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Dec 13 10:23:52 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9153
Summary: Type inference for array of delegates should not break
based on order
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: hsteoh at quickfur.ath.cx
--- Comment #0 from hsteoh at quickfur.ath.cx 2012-12-13 10:23:50 PST ---
import std.stdio;
version=Broken;
void main() {
version(Broken) {
auto tbl = [
(string x) { writeln(x); },
(string x) { x ~= 'a'; },
];
} else {
auto tbl = [
(string x) { x ~= 'a'; },
(string x) { writeln(x); },
];
}
}
This code used to compile in dmd 2.058.
Commenting out "version=Broken" fixes the problem. It seems that type inference
isn't being done correctly for the delegates in the array, depending on what
order they appear in.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list