Bug 16538 – Parameter head-const-ness shouldn't matter but does

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-09-25T10:13:37Z
Last change time
2022-11-10T14:35:46Z
Assigned to
No Owner
Creator
Eyal

Comments

Comment #0 by eyal — 2016-09-25T10:13:37Z
const(int) retConst1(); int retConst2(); auto retConst = [&retConst1, &retConst2]; // Compiles! const(int*) retConstPtr1(); const(int)* retConstPtr2(); auto retConstPtr = [&retConstPtr1, &retConstPtr2]; // Compiles! void constArray1(const(int)[1]); void constArray2(const(int[1])); auto constArray = [&constArray1, &constArray2]; // Compiles! const(int)[] retConstSlice1(); const(int[]) retConstSlice2(); auto retConstSlice = [&retConstSlice1, &retConstSlice2]; // Compiles! void constSlice1(const(int)[]); void constSlice2(const(int[])); auto constSlice = [&constSlice1, &constSlice2]; // Errors: Incompatible types! void ptrToConst1(const(int)*); void ptrToConst2(const(int*)); auto ptrToConst = [&ptrToConst1, &ptrToConst2]; // Errors: Incompatible types!
Comment #1 by bugzilla — 2017-05-13T13:00:03Z
Comment #2 by bugzilla — 2017-06-10T20:45:45Z