D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10157 - Vector ops with different types
Summary: Vector ops with different types
Status: REOPENED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-23 15:34 UTC by bearophile_hugs
Modified: 2024-12-13 18:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-05-23 15:34:00 UTC
Is code like this meant to work? It's useful code:


void main() {
    int[2] data = [10, 20];
    double[2] result;
    result[] = data[] * 0.5;
}



DMD 2.063beta5 gives:

test.d(4): Error: incompatible types for ((data[]) * (0.5)): 'int[]' and 'double'
Comment 1 Martin Nowak 2017-08-17 11:37:37 UTC
https://github.com/dlang/dmd/pull/4218
Comment 2 anonymous4 2017-08-21 13:59:15 UTC
void f()
{
	ubyte[] a;
	char[] b;
	a[]=b[];
}
Error: cannot implicitly convert expression `b[]` of type `char[]` to `ubyte[]`
Comment 3 anonymous4 2017-08-21 14:00:16 UTC
Hmm... vector ops are array ops?
Comment 4 dlangBugzillaToGithub 2024-12-13 18:07:01 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18585

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB