Bug 1851 – missing opCall? when cast away const struct
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-02-18T17:23:00Z
Last change time
2015-06-09T01:14:30Z
Assigned to
bugzilla
Creator
someanon
Comments
Comment #0 by someanon — 2008-02-18T17:23:22Z
missing opCall? when cast away const struct
==================================
$ cat conststruct.d
struct S {
int i;
}
int main() {
S s;
const(S) cs = s;
S s1 = cs;
S s2 = cast(S)cs;
return 0;
}
==================================
$ dmd.exe conststruct.d
conststruct.d(9): Error: no property 'opCall' for type 'S'
conststruct.d(9): Error: function expected before (), not 1 of type int
conststruct.d(9): Error: cannot implicitly convert expression (1(cs)) of type in
t to S
conststruct.d(10): Error: no property 'opCall' for type 'S'
conststruct.d(10): Error: function expected before (), not 1 of type int
conststruct.d(10): Error: no property 'opCall' for type 'S'
conststruct.d(10): Error: function expected before (), not 1 of type int
conststruct.d(10): Error: cannot implicitly convert expression (1(1(cs))) of typ
e int to S
==================================