Bug 2737 – Nonsensical Error Message on Unsafe .idup

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-03-16T12:31:00Z
Last change time
2014-02-14T20:35:50Z
Keywords
diagnostic, patch
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2009-03-16T12:31:09Z
void main() { uint[][] foo = [[1, 2], [3, 4], [5, 6]]; immutable bar = foo.idup; } Compiler error: test.d(3): Error: undefined identifier module test.idup test.d(3): Error: function expected before (), not module test.idup of type void Of course, the compiler should not allow .idup to be applied to foo because, unless a deep copy were made, this would cause unsafe aliasing between mutable and immutable. However, a better error message might be a good thing.
Comment #1 by yebblies — 2011-07-08T19:10:36Z
*** Issue 6252 has been marked as a duplicate of this issue. ***
Comment #2 by yebblies — 2011-07-08T19:14:49Z
The error message is actually in there, it's just hidden by the hacky ufcs is implemented.
Comment #3 by yebblies — 2011-07-08T21:33:45Z
Comment #4 by bugzilla — 2011-10-02T22:35:02Z