D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17720 - Wrong code using vector extensions with different types
Summary: Wrong code using vector extensions with different types
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: Iain Buclaw
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2017-08-04 23:41 UTC by Iain Buclaw
Modified: 2020-07-31 09:54 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2017-08-04 23:41:42 UTC
This is code is accepted by the compiler, but should be rejected, to be consistent with static and dynamic array ops.

---
float4 v1;
int4 v2 = [1,2,3,4];
int4 v3 = [5,6,7,8];

v1 = v2 + v3;

// Prints: [8.40779e-45, 1.12104e-44, 1.4013e-44, 1.68156e-44]
writeln(v1.array);
---
Comment 1 Walter Bright 2017-08-08 02:04:45 UTC
https://github.com/dlang/dmd/pull/7065
Comment 2 Dlang Bot 2020-07-10 20:51:49 UTC
@ibuclaw updated dlang/dmd pull request #7065 "fix Issue 17720 - Wrong code using vector extensions with different types" fixing this issue:

- fix Issue 17720 - Wrong code using vector extensions with different types

https://github.com/dlang/dmd/pull/7065
Comment 3 Dlang Bot 2020-07-31 09:54:18 UTC
dlang/dmd pull request #7065 "fix Issue 17720 - Wrong code using vector extensions with different types" was merged into master:

- 0aeef222a3ce271f3e6637df3ab17a983bd45689 by Iain Buclaw:
  fix Issue 17720 - Wrong code using vector extensions with different types

https://github.com/dlang/dmd/pull/7065