[Issue 1851] New: missing opCall? when cast away const struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 18 15:23:23 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1851

           Summary: missing opCall? when cast away const struct
           Product: D
           Version: 2.010
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: someanon at yahoo.com


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

==================================


-- 



More information about the Digitalmars-d-bugs mailing list