Bug 6523 – Vector slice assign of a struct with opAssign

Status
REOPENED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-08-17T11:15:47Z
Last change time
2024-12-13T17:56:08Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: dmd#18363 →

Comments

Comment #0 by bearophile_hugs — 2011-08-17T11:15:47Z
import std.bigint: BigInt; void main() { BigInt[1] array; array[0] = 1; // OK array[] = BigInt(1); // OK array[] = 1; // line 6, error } DMD 2.055beta gives: test.d(6): Error: cannot implicitly convert expression (1) of type int to BigInt[] I think this is the reduced version: struct Foo { int x; void opAssign(int x) {} } void main() { Foo[1] array; array[0] = 1; // OK array[] = Foo(1); // OK array[] = 1; // error } opAssign doesn't get called.
Comment #1 by ibuclaw — 2018-10-10T23:00:19Z
Fixed by https://github.com/dlang/dmd/pull/6969 *** This issue has been marked as a duplicate of issue 17380 ***
Comment #2 by ibuclaw — 2018-10-10T23:01:24Z
Oops, wrong bug.
Comment #3 by robert.schadek — 2024-12-13T17:56:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18363 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB